Lab
1. Link your servo motor to a PWM pin. Alternate through the 180' limit of a servo motor.
2. Connect a pot to an analog in pin. Map pot value to angle position of the servo motor.
3. Moving forward robot. The servo motor was placed on top of a popsicle table construction. An L-shape propeller was attached to a spock of the servo gear on an axis, giving it clearance to move and return without backward motion.
Homework
Supplies: 1 Servo motor, ~6 popsicles, 1 linear pot, arduino.
The following arduino code maps a linear pot to the speed of a forward step. I empiracally found a threshold for the servo pulse for a forward cycle of motion (about 400ms). I then switched between the degrees for a cycle of motion. This threshold became the upper bound for speed. By mapping the linear pot value to go from that upperbound, I was able to control the speed of movement.
Code: SpeedyRobot.txt
Lab and HW Images: SpeedyRobot.jpg
- Login to post comments