Saturday, December 13, 2014

Highlighted in red shows the changes that we made to the code.  The changes helped to allow the catapult to shoot completely before returning back to its original position.  Before this change, if the button was let go before the arm was finished shooting it would stop in the middle of its path and go back.  This change will avoid this from happening and make the prototype much more user friendly.  We were unable to get the part 3D printed for the catapult arm due to it being a part that was not compatible or able to be 3D printed for some reason.  The pieces for the box should have been laser cut to create a much more exact prototype.  The design was an overall success and we are happy with the final result.  The project could have been improved by the use of a motor instead of the servo since the motor would have given the "ammo" a much higher velocity and worked better.
Arduino Code
Parts Files

#include <Servo.h> 
const int buttonPin = 5;
const int ledPin1 = 2;
const int ledPin2 = 3;
const int ledPin3 = 4; 
Servo myservo; 
int pos = 0;
int buttonState = 0;

void setup() 
{ 
  myservo.attach(9);
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(ledPin3, OUTPUT);
  pinMode(buttonPin, INPUT_PULLUP);
} 
void loop() 
{ 
  buttonState = digitalRead(buttonPin);
if (buttonState == LOW) {     
    delay (15);
    digitalWrite(ledPin1, HIGH);
    delay (500);
    digitalWrite(ledPin2, HIGH);
    delay (500);
    digitalWrite(ledPin3, HIGH);
    delay (500);
    myservo.write(120);
    delay (250);   
  } 
  else {
    delay (250);
    digitalWrite(ledPin1, LOW); 
   digitalWrite(ledPin2, LOW);
   digitalWrite(ledPin3, LOW);
  delay (100);
    myservo.write(0);
    delay (15);
  }
}

Wednesday, December 10, 2014

      This is our final prototype.  The servo is taped into the cardboardbox and then glued to the catapult arm.  The arm itself is supposed to be made of 3D printed plastic material but there have been a lot of delays in getting this part fabricated, so this is our prototype as it stands.  The code involves using a button to control the firing of the catapult.  When the button is held down, a succesion of 3 LEDs are lit to act as a countdown.  The servo is then told to run and the arm goes about 120 degrees.  When the button is let go, the LEDs and the servo return to their normal states and wait for the button to be pressed again.

Here is the code used for the arduino.

#include <Servo.h> 
const int buttonPin = 5;
const int ledPin1 = 2;
const int ledPin2 = 3;
const int ledPin3 = 4; 
Servo myservo; 
int pos = 0;
int buttonState = 0;

void setup() 
{ 
  myservo.attach(9);
  pinMode(ledPin1, OUTPUT);
  pinMode(ledPin2, OUTPUT);
  pinMode(ledPin3, OUTPUT);
  pinMode(buttonPin, INPUT_PULLUP);
} 
void loop() 
{ 
  buttonState = digitalRead(buttonPin);
if (buttonState == LOW) {     
    delay (15);
    digitalWrite(ledPin1, HIGH);
    delay (500);
    digitalWrite(ledPin2, HIGH);
    delay (500);
    digitalWrite(ledPin3, HIGH);
    delay (500);
    myservo.write(120);
    delay (1);   
  } 
  else {
    delay (5);
    digitalWrite(ledPin1, LOW); 
   digitalWrite(ledPin2, LOW);
   digitalWrite(ledPin3, LOW);
  delay (100);
    myservo.write(0);
    delay (15);
  }
}

Here is a working prototype of our project:

Tuesday, December 9, 2014

Prototyping

      Today we worked on creating a physical model of the project.  Reusing a decorative Louis Vuitton box we cut and glued various pieces into the boxes we needed.  The motor sits nicely on the shelf in the middle of the assembly.  It will be held down using tape so that it does not spin around or fall off of its mount.  The arm itself is a prototype made of the same cardboard, we are planning on using one that is 3D printed if time will allow.  One box on the arm is bigger than the other because this is the one used for "throwing" so it has a small cavity for placing the ammo.






Tuesday, November 25, 2014

Update

Today we worked on designing the design of the project.  We brainstormed and made a few sketches on paper.  We kept the design small to minimize the catapult arm weight and to reduce size in general.  We also decided against making the catapult "turnable" or adjustable.  The design would have called for attaching a servo to the bottom of the project and it was decided that it would be difficult to attach the servo without it being weak at the attachment point.  The sketches were then transformed into Solidworks files.  The decision was also made to use the catapult arm as the 3D Printed piece since it needs to be light, strong and exact in order to work properly and all three of these properties are met by using plastic.  We also decided today that the servo will not be fast enough to "throw" objects, therefore we will need to use a DC motor and a motor shield.  The design also includes 3 leds and a button which will be pressed when ready to fire.  The leds will "count off", lighting up the first, second and third ones in order before it fires.





Tuesday, November 18, 2014

Today we took a look at planning some pieces of the catapult and how it will fit together.  We decided to use the actual shooting arm as the 3D printed piece and glue that directly to the motor.  The rest of the assembly will most likely be constructed using cardboard and poster board.

Wednesday, November 5, 2014

Hello World

We are Team 15.  On the left is Jun, and on the right is Adrian Federico.  We are both students at UMass Lowell working on an arduino based team project.  We will use this blog to post updates on our project and display our work for others to learn from and share.  We landed on the idea of building a catapult using the arduino as the controller.  The catapult will be controlled most likely using a button which will turn on a servo or motor which will turn the lever arm.  Depending on difficulty the catapult can be fitted to a stand with a second servo allowing the catapult to be aimed remotely.



These are a couple of videos that helped to inspire our ideas.