User login

Powered by Drupal, an open source content management system

Theory and Practice of Tangible User Interfaces

Assignment 8: Servo Motors (Single Servo Robot Fun)

Submitted by michael_lee on Sat, 10/18/2008 - 02:16

Assignment: Servo Motor: Actuation Assignment 2

Collaborators:

Description

For this lab, I worked to create a mobile "robot" using a single servo motor. I went with an insect-like idea. I tried several iterations of this using many different parts. I originally had four legs (two stationary legs and two legs attached to the servo) but it was very unstable and tended to fall over at the servo's extremes. For my final design, I attached two sets of legs (four total) to the servo, and had one stationary pair of legs. It worked to a certain degree, but wasn't satisfactory (it didn't always move forward) so I decided to add more traction. To to this, I made some "skis" or "feet" for the legs. The servo legs shared longer skis, while the stationary legs got small skis. This still didn't provide enough traction for smooth surfaces, so I cut up some rubber bands, tied them, and attached them to the skis, making them look more like shoes.

Using the pot to control the "robot," you can control the robot to turn and go forward. It's not very smooth or particularly pretty, but works.

 

Components Used

  • x1 servo motor
  • x2 balsa wood (12.5cm x 1cm) [skis]
  • x2 large paperclips [legs]
  • x1 large clip [legs]
  • Tape
  • Pipe cleaners [antennae]
  • Wires
  • 1 Arduino NG board

Images

Here it is. "RobaMushi", complete with antennae and shoes/skis.

 

The skis with rubber bands actually ended up looking like shoes.

 

Here's a shot of the underside of the skis to show how it's on their. They're fit tightly around the balsa wood and provide the much needed traction. My original idea of scoring the bottom of the balsa wood with a knife didn't add much traction so I opted for rubber.

 

Here are some still shots of the RobaMushi in action. The "rear" legs attached the the servo remain still while the top portion of the servo moves, which in turn moves the front legs back and forth. This causes the robot to move crawl forward.

 

Project Code


int servoPin = 7;
int potPin = 0;

int pulseWidth = 0;
long lastPulse = 0;
int refreshTime = 20;
int val;

int minPulse = 500;

void setup() {
pinMode(servoPin, OUTPUT);
pulseWidth = minPulse;
Serial.begin(9600);
Serial.println("RobaMushi, ready to crawl!");
}

void loop() {
val = analogRead(potPin);

if (val > 0 && val <= 999 )
{
pulseWidth = val*2 + minPulse;

}
updateServo();
}

void updateServo() {
if (millis() - lastPulse >= refreshTime)
{
digitalWrite(servoPin, HIGH);
delayMicroseconds(pulseWidth);
digitalWrite(servoPin, LOW);
lastPulse = millis();
}
}