You are on page 1of 3

Grid Following

Line tracking is a very popular notion in robotics since it gives an easy to implement navigation
scheme. Line sensors just involve an array of sender/receiver pairs using light
(usually IR) that shall be reflected by the line but not by the eventually opaque background hence
making the receiving sensors to be able to detect the line. The simplest looking solution can be a
set of two sensors being able to detect whether the bot is at the left or right of the line and
perform the required maneuver. But you would notice that the robot will keep brutally turning
right and left, never being able to smoothly follow the line.
Thus some points worth noticing (also clear from the diagram) are:
1. Try to make use of as many sensors as practically possible in the array(more
information, more precision).
2. Keep the sensors as close as possible (thus improving the least detectable deviation) but
the pairs should not interfere.
3. Keep the center of steering as far away from the sensor as possible to amplify the
deviation detected by the sensor.

Hardware

Sender and receiver pairs: Usually IR LEDs and IR photodiodes are used since they are cheap
and easy to implement. (Refer http://www.ikalogic.com/ir_prox_sensors.php for detailed
information on IR sensors.)

The output of the sensors can be manifested in two ways:


1. By directly feeding the output to ADC pins of the microcontroller you are using and
manipulate the readings by the code itself.
2. By using a properly calibrated comparator IC to give logic high or low based on the
output of the receiver and a certain threshold.

Software

Now that the sensors are working and providing a correct reading of the line underneath it, you
need to develop some algorithms to make use of the readings.

Navigation through lines and intersections

Things to take care of:

1. Number and Placement of Sensors:


Each Sensor may detect the presence of a white patch underneath it. Hence, it is obvious that to
sense both edges of the line, and horizontal intersections on both sides, atleast 3 sensors are
needed. The number of sensors is a design factor completely open to the choice of the builder
keeping in mind only the application.It is not applicable in general that more the number of
sensors, the better your machine.

One also has to be careful, in the distance between the centres, look at the following 8 sensor
bots.:

In the first situation, the spacing between the cells is not very critical, but if the robot
accidentally makes a 10° turn away from the line (second situation), you will notice that only the
cell number 6 detect the line, which is the only indication that the controller will have about that
10° error. This means that, most probably, an error smaller than 10° wont even be noticed.

But in the third situation, the cells are closely collated together, and you can notice that with the
same 10° deviation from the line, the sensor's cells 6 and 7 detected the line, leaving some other
possible states in between the perfectly centered position and the 10° deviation. In other words,
the closer are the cells from each others, the more will be the resolution of the sensor.

We strongly recommend that a newcomer try out his comfort level with 3 sensors before
trying to better it. A simpler circuit that works is always much better than a complex one
that refuses to debug.
2. Strategy for detecting intersections:
A simple and quick strategy may be to use a bot with 3 sensors in a straight line. If all 3 sensors
detect light, your bot is perpendicular to a line. This may be used to counting the number of grid
lines passed by, and hence keep a track of your coordinate.

As before, you can take your precision higher by using more sensors. Here's an example of the
scenario with 8 sensors.

The inputs read from these sensors are then given to the Microcontroller. This is where your
main code will reside.

You might also like