Sunday, April 12, 2009

Experience - Line Tracking

The sum of knowledge gained from the few past classes is of great use as we got the chance to experiment with the light sensor as well as learn the behavior and configurations of the light sensor.
In order to learn about the light sensor, we were told to conduct an experiment using the sensor. The experiment is as follows: Robots must be programmed to follow a black line (on a white surface), "using" the light sensor - Line Tracking.
My partner and I first attached the light sensor to the front of the robot; however, we found out that placing the light sensor at the back of the robot, closer to the two wheels, is better because the light sensor will create smaller swing turns, minimizing the chance of the robot going off course during the experiment; additionally, it helps the robot to follow the line at a greater speed. Now on to programming, in order for the the robot to proceed along the black line, we programmed it to make right and left swing turns depending on whether the sensor reads a light value that is less or greater than the threshold set (the threshold is the average of both light and dark readings - test on NXT).


Program:

No comments:

Post a Comment