Description
Shreyas and I decided to work together on this assignment. We decided early on that using two servo motors would not be the optimal solution. Instead, we experimented with creating a piston like mechanical setup to get the crawler to work. Our reasoning was that the piston would help us convert the rotational motion of the servo motor into linear motion. However, we realized that it was pretty hard to construct a piston like setup since it would involve creating grooves and wedges in the wood and we didn't have the right tools for that. So we moved onto exploring other ways of achieving the same result.
Eventually we settled on this weird joint like system that emerged from the server and could be used as leverage to move forward. We also created a base using the lid from the class kit and constructed it in a way that would make it push the contraption forward. We iterated a lot on this design to get it to move forward in the most fluid manner possible. Eventually we had to add a hopping mechanism for stability and pins to help reduce tumbling on the carpet. Our only issue with the final design was that after a certain distance it began to turn because the motor was weighting it on one side.
Our main goal was to ensure that the crawler moved forward as fast as possible and hence we made sure we kept the entire setup light. This is why we did not include a battery pack onto the body or add any sort of design element in terms of trying to make it look pretty since that would detract from the fluidity of the mechanical design.
Code
We realized that a key component of this design is the code. We used the Sweep base code from the Servo motor library and modified it to get the best possible range of movement of the motor. Just like we iterated on the mechanical construction, we also iterated on the code to get the best delay and angle range. This helped us further optimize the speed of the crawler.
// Sweep
// by BARRAGAN <http://barraganstudio.com>
// This example code is in the public domain.
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created
int pos = 20; // variable to store the servo position
void setup()
{
myservo.attach(7); // attaches the servo on pin 9 to the servo object
}
void loop()
{
for(pos = 40; pos < 140; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(5); // waits 15ms for the servo to reach the position
}
for(pos = 40; pos>=140; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(5); // waits 15ms for the servo to reach the position
}
}
Components
1x Arduino
1x Breadboard
1x Macbook Pro
A lot of wood pieces
Tons of tape, pushclips, some binder clips and other odds and ends
Many wires
1x Class kit lid
Video
https://www.facebook.com/photo.php?v=10153398590450065¬if_t=video_processed
- Login to post comments