Exploration 2: Line Following & Shaft Encoding

Robots use advanced sensing capabilities to accomplish many tasks, and combining input from many sensors allows robots to complete tasks repeatedly and reliably.  Strategies like line following and shaft encoding are often needed for precise positioning of the robot.  The purpose of this exploration was to become familiar with line following and shaft encoding.

The first part of the experiment required writing a program that used three optosensors to follow a straight line and a curved line.  Different speeds were tested to see how they affected the robot’s ability to follow the line.  The next part of the exploration was shaft encoding where a program was modified to have the robot drive forward 6 inches at 25, 40, and 60 percent power.  The program was then modified again to have the robot make left and right turns and then have the robot alternate between going forward and turning.

For the line following, the group was eventually successful in following both the straight and curved lines, however increasing the speed to sixty percent caused the robot to not stay on the curved line. The spacing between optosensors was important because putting them close together meant the robot could easily get off the line, but putting them too far apart could result in shifting back and forth over the line. Some advantages of the three optosensors when compared to one optosensor was the robot had more states and there was a wider area where the robot was getting optosensor input from. Some disadvantages included more complex programming and higher expense. The group plans to use the three optosensor line following method for the robot to place the wrench in the garage because this task needs to be very precise and doesn’t require the robot to be at a high speed. For shaft encoding, there was a difference of about 2 counts and 18 counts between the experimental and theoretical counts for the left and right motors respectively. The inaccuracies between both the experimental and theoretical counts and the right and left motor counts could have resulted from slipping with the IGWAN motors or slight differences in the encoders. If the difference between the right and left motors is not accounted for in the program, the robot will not drive straight. The group will most likely use the Vex encoder (a Break Beam Shaft Encoder) because it has 8 transitions per revolution compared to the 6 transitions per revolution of the IGWAN thus giving the VEX encoder better resolution.

In this exploration, the group learned that optosensors can be used to follow lines when picking up and disposing the wrench and shaft encoding can be used to determine the distance the robot travels. Using the Vex encoders and using a correction factor between the right and left motors can reduce the error when using shaft encoding.