I’ve been building a robot that follows a black line on a white surface for a line following competition. One of its challenges is that the robot should also tackle line breaks.
My robot utilizes the Arduino Uno, a Pololu QTR-8RC, a TB6612FNG motor driver and 30:1 HP micrometal gearmotors.
My code uses a PD algorithm, and I’ve been able to tune my robot to follow an arena including right angles at around 400 rpm.
The line is 2.5 cm thick and both sensors 4 and 5 of the array are located above the line in a zero error condition (the error is calculated by subtracting 3500 from the value obtained using the ‘readLine’ method of the QTRSensors library).
I was trying to write code that makes it handle line breaks according to the following logic:
If no sensors are on the line and the absolute value of the error is 3500 then continue straight (because when the robot arrives on white, the error is either 3500 or -3500).
However, I noticed during turns that the robot overshoots a bit and the loop for a line break starts executing.
I would like to know how I can solve this problem.
I would also appreciate advice on how to tune my robot to speeds around 800 rpm.
An early response would be appreciated.