Goal: to calibrate driving forwards, turning left, and turning right.
Driving straight forwards: the first time we tested the code for the robot to drive straight, it more or less turned left. To correct for the veering to the left, we changed the motor power percents to correct the misalignment of the wheels. After managed to get the robot to drive straight, our next task was to correctly calibrate the distance traveled using the igwans. Because the robot doesn’t stop immediately after driving forwards, we must correct any input to the drive forwards method by reducing it slightly, accounting for any inertia that causes the robot to continue moving forwards even after the stop command had been given.
Our strategy was to command the robot to drive forwards 10 inches, and then measure the true distance traveled, allowing us to obtain a correction factor we could integrate into our code. Using this correction factor, we were able to travel to within 0.25 inches of any targeted distance.
Turning left/right: Our strategy for turning left or right was to move one wheel forward while moving another wheel backwards, allowing the robot to turn within a relatively small radius. To adjust the correct encoder count for a full 90 degree turn, the robot was tested with varying counts until a full 90 degrees had been reached. Our final encoder count was determined to be 280.
I also got to see the robot complete the first performance test today. I can’t explain my excitement. It worked.