After another unsuccessful attempt at a robot conga line last week, we decided to work on correcting motor imperfections to drive straight.
First, we tried to program one wheel's motor to reset the shaft to a specified angle.
The bang-bang control version for getting Wheel B to reset to a value of 42 after some arbitrary displacement:
The final proportional control program:
We soon realized that the "coutb=42" if-then-else statement was completely unnecessary and removed it from our subsequent programs.Next, we tried to get Wheel B to follow Wheel A--i.e., when Wheel A was turned, Wheel B rotated exactly the same way, as if the wheels were on the same shaft.
The proportional-control program to get Wheel B to follow Wheel A:
We then tried to apply this new program by turning on both motors and seeing if the car drove straight.
We initially had some success, but we realized that pressing the button to start the car introduced a bit of wiggle, which made the final path imperfect, so we decided to use the ultrasonic sensor to start the car remotely after removing a hand in front of the car.
The final Drive Straight program, including the remote start:
This seemed to work a bit better, but then we were concerned about driving surface imperfections skewing our car's path, so we replaced the original wheel with a ball bearing caster, which was less likely to randomly rotate.
The original front wheel:
The ball bearing caster attached as the front wheel:
Snow White climbs the ramp with the ball bearing caster!






No comments:
Post a Comment