We need more info.
Is it a race? Does it have to move quickly?
How fast at the end of the tape does it have to stop?
One method would be to use two photocells close to the black tape perhaps on a spring loaded mechanism assuming a nice flat tile surface. :smile:
Keep both left and right motors engaged equally for equal light output from each sensor.
That would be a voltage or current reading using 5V power into the photocell resistance.
Use a PIC microcontroller and 2 inputs for data, one output control for each servo, digital out or stepped voltage output to the motor drive circuit.
When one sensor picks up more light than the other slow the proper motor down to compensate for being off course.
The photocells should be equally spaced over the tape for midpoint in the light range of the cells.
The algorithm should be simple to do out on paper and implement with the PIC micro-controller.
You might get it to run fast enough to actually work. :biggrin:
Stopping could be accomplished when both cells detect full light output at the same time.
Under normal movement wandering left or right a bit one cell will become lighter moving off the tape, and one darker going onto the tape.
That would be a good safety algorithm to use initially as well, especially if it gets off course.
I wouldn't be going for speed here. :wink: