Thursday, December 11, 2014

These videos show how our nutcracker works.

It generally works but has a few issues. First, our ramp is not steep enough so the walnuts have to be manually pushed down into the nutcracker. In addition, the weight is not heavy enough to crack the nut.

Below is our slide which is designed to feed the nuts into the nutcracker. It is a printed part.

Everyone was at our group meeting this week. The meeting lasted around 3 hours.

/*note: The servo tends to vibrate when at the
extreme positions of 0 and 180 degrees*/

#include<Wire.h>  //motor libraries
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_PWMServoDriver.h"

#include<Servo.h>  //servo library
Servo serv;  //defines "serv" object
Adafruit_MotorShield motor = Adafruit_MotorShield();  //defines motor object

int servpin=9;  //defines servo pin
int buttonpin=2; //defines button pin
Adafruit_DCMotor *myMotor = motor.getMotor(1);  //attaches motor to motor pins 1

int gate_seconds=5;  //defines the gate delay
int gate_mseconds=gate_seconds*1000;

int drop_seconds=2;  //defines the drop delay
int drop_mseconds=drop_seconds*1000;

int lift_seconds=4;  //defines the lift delay
int lift_mseconds=lift_seconds*1000;

void setup()
{
  motor.begin();
  
  serv.attach(servpin);  //attaches serv to servpin
  
 pinMode(buttonpin,INPUT_PULLUP);  //initializes button pin
}

void loop()
{
  
  myMotor->run(RELEASE);  //sets motor to initially be still
  serv.write(33);  //states the initial position of the servo
  
  int button=digitalRead(buttonpin);  //defines the button input variable
  
  if (button==LOW)
  {
  serv.write(160);  //opens the gate
  delay(gate_mseconds);  //holds the gate open
  serv.write(33);  //closes the gate
  
  myMotor->setSpeed(150);  //drops weight
  myMotor->run(FORWARD);
  delay(drop_mseconds);
  
  myMotor->setSpeed(150);  //lifts weight
  myMotor->run(BACKWARD);
  delay(lift_mseconds);  

  myMotor->run(RELEASE);    //holds weight stationary
  }
}

This is an updated code for our nutcracker. We needed to update our code because we needed to use a shield in order for our motor to work. The motor did not work because it requires 12 volts. We burnt out our arduinos and had to replace them by borrowing one from Daniel Sullivan. We also borrowed the shield from him.

We acquired a dumbbell and cut it into an appropriate shape for our nutcracker. We cut the dumbbell with a hacksaw. The dumbbell was too wide so we cut off one of the ends of the dumbbell and cut off a portion of the other end.

This video is a motion study 

Wednesday, December 3, 2014

In today's meeting all members were in attendance. Benjie spent many hours on building the device on his own time. Each member spent 2 hours at the meeting.

/*note: The servo tends to vibrate when at the
extreme positions of 0 and 180 degrees*/

#include<Servo.h>
Servo serv;  //defines "serv" object

int gate_seconds=5;  //defines the gate delay variable
int gate_mseconds=gate_seconds*1000;


int drop_seconds=2;  //defines the drop delay variable
int drop_mseconds=drop_seconds*1000;

int servpin=3;  //defines servo pin
int motormain=11;  //defines motor pins
int motor1=9;
int motor2=5;
int buttonpin=2; //defines button pin

void setup()
{
  serv.attach(servpin);  //attaches servo to servpin
  
 pinMode(buttonpin,INPUT_PULLUP);  //initializes button pin
 pinMode(motormain,OUTPUT);  //initializes motor pins
 pinMode(motor1,OUTPUT);
 pinMode(motor2,OUTPUT);
}

void loop()
{
  digitalWrite(motormain,LOW);  //holds the weight stationary
  digitalWrite(motor1,LOW);
  digitalWrite(motor2,LOW);
  serv.write(3);  //states the initial position of the servo
  
  int button=digitalRead(buttonpin);  //defines the button input variable
  if (button==LOW)
  {
  serv.write(176);  //opens the gate
  delay(gate_mseconds);  //holds the gate open
  serv.write(3);  //closes the gate
  
  digitalWrite(motormain,HIGH);  //drops the weight
  digitalWrite(motor1,HIGH);
  digitalWrite(motor2,LOW);
  delay(drop_mseconds);
  
  digitalWrite(motormain,HIGH);  //lifts the weight
  digitalWrite(motor1,LOW);
  digitalWrite(motor2,HIGH);
  delay(2*drop_mseconds);  

  digitalWrite(motormain,LOW);  //holds the weight stationary
  digitalWrite(motor1,LOW);
  digitalWrite(motor2,LOW);
  }
}

This is a incomplete draft of our code to run the servo and the motor. 
SIDE
 FRONT
 TOP

These are pictures of our nutcracker. The nutcracker has more parts that need to be attached. This is the overall structure of the nutcracker. These blue parts make up the structure of the nutcracker.
 This is a revised version of the base plate. The base plate was revised because the laser cutter could not cut part ways through the material.
 This is a revised version of the front bracket. The new version of the front bracket replaced the rear bracket in the old assembly, so now we are using 2 front brackets. The front bracket was revised to add the jigsaw effect to make it easier to assemble.
 This is the same motor part from the previous version.

 These two parts are a separate revised assembly for the servo. The revised version is a more detailed representation of our servo.
 This is a revised version of our side shield. The side shield was revised to fit the front brackets jigsaw effect to make it easier to assemble.
This is the same slide part from the previous version.

This is the full assembly of our nutcracker.