Reverse Line Tracking

I have been thinking about this for a few days and i have to say it is getting on my nerves. I am trying to figure out how to use the line trackers BUT here is the catch. I have the line trackers (3) mounted on the back of the robot (about 1 inch behind the axis of rotation but centered) I am unable to mount them anywhere else and i only have 3 line trackers. the issue i have is that i want to track the line while driving forward. This is proving to be a very difficult task (as far as i can see) because when you start to veer off course you can’t just turn until the center line tracker is on the line because you will then be turned farther off of the line. Worst case scenario for me is that i need to drive the line backwards most of the way then turn 180 at the last second and then drive forward (set all drive motors to 255) for the last foot or two but this method will only work for short distances because i can not expect to be perfectly on the line from the beginning i can only expect to be within a few degrees.

Do you guys have any ideas for using the line trackers behind the axis or rotation but still drive forward?

Feel free to ask questions if you have them.


Sending a PM to Vamfun comes to mind immediately. He can probably lead you through developing a nice general purpose implementation of what you need.

On the other hand, you can probably write down sequences of sensor outputs that correspond to all of the trajectories you care about, and then use those to develop heuristics that work well enough.

The result of writing down the patterns is likely to be that you will find out that instead of using the sensors’ instantaneous outputs you will have to look at the sensor outputs over a second or two, and use the history to decide what the robot’s relationship to the line is.

For example
On, Off, Off
followed by
Off, On, Off
followed by
Off, Off, On
can be converted into
100 010 100
and that can be converted into
100010100 in binary
and that can be converted into
114 in hex
and that can be converted into
276 in base 10
and when your robot detects a 276 pattern, you will know a lot more about what to do than you would if you just used the latest reading of Off, Off, On.

That’s my hunch…

Can’t you just use one sensor, and then put that one sensor on any part of your robot?
Essentially the robot would be following the “edge” of the line, and I don’t think that would throw off your robot that much because the movement are oscillated back and forth over a period of time.

There is another method, but it would require at least 4 light sensors and a bit more logic.

Let me know if the above works.

It is feasible with one sensor.

It is better in some (but not all) senses if you can use more.

There is a certain amount of inescapable complexity involved in using a pattern of lines to get a machine from point A to point B.

You can deal with this complexity in different ways
*]more/fewer sensors,
*]more/less information stored in the software,
*]more/less travel time,
*]exerting more/less precise control over the machine’s motions,
but you can’t make it disappear.

That’s what makes tracking a line satisfying/fun (and sometimes profitable).