RickBot
Introduction Sensors Drive control Application code Possibilities Contact
Line tracking
"Bump" sensors
Line tracing
Sensor circuitry
Expansion possibilities

Tracking a line
Something that is useful but not difficult to implement is a line tracker. This allows the 'bot to follow a line marked out on the floor.

Traditional line trackers have a black line on a white strip, or vice-versa, and a photocell looks down upon the line. A change in the photocell's reading signals that the positioning needs to be adjusted.

Our implementation
The method used in RickBot is much the same priniciple, however we use two photocells which point down either side of the marker line. This allows responses to be easier, as we don't actually need to know in which direction we move in order to correct our velocity. Instead, we can use direct feedback from the left and right sensors to know how to adjust movement.

Diagram of line tracking.

In the diagram above, the blue squares represent the optical sensors. The green circles represent roughly where the sensors 'see'.

A possible extension (which is not currently supported) is the use of a third sensor to detect the end of the track by way of a special marker. Read more about this .

Data signals
Because line track sensing is less critical than bumping into things, the sensors do not generate an interrupt. The state of the sensors must be polled regularly.

 PA4

  Left sensor

 PA5

  Right sensor 

The sensors will connect to the interface board by way of a "flying lead". This is to facilitate operation when the line tracking is not in use - the flying lead may be disconnected and a special feedback lead plugged in which will behave as if the sensors were connected and active, see below.

The diagram of how this connects to the main board (Amélie) may be found in Sensor Circuitry .

Line colouring
The standard line is a black strip with white edges. This can be three pieces of coloured sticky tape side-by-side or - given that many non-carpeted floor surfaces are a light colour - it could be just lines of black electrical tape on the floor.
This means, in normal use, both sensors are "ON" when following a line, and one will switch "OFF" to indicate crossing the central black marker.

There may be cases where you would prefer dark/white/dark sensing. You could run the RickBot outdoors with a white stripe on a dark tarmac surface. In this case, the sensors would normally be "OFF". There is an option to invert the tracker response before working out what to do with it, so no hardware modifications are required.

Disabling the tracking
In normal use, the line tracker sensing provides fine-tuning of the drive systems, to ensure that RickBot doesn't stray from the line it is following. This could have undesirable side-effects when there is no line to follow, as variations in floor texture and colour could cause all manner of odd side effects. For example, imagine trying to track a line across a kitchen floor laid out with those horrible white/black tiles in a design sort-of Gingham. :-)
There is an option to disable the line tracking. An alternative could be to unplug the sensors and plug in a special plug where the two inputs are connected to +5V by way of a signal diode. 

© 2006 Rick Murray