In this project we were trying to make a robot that could follow a black line using 7 down facing photoresistors. We calibrated the photoresistors by getting the average values of each photoresistor while it is on a black surface and mapping that value to 0. We then did the same thing with the photoresistors on a white surface. This way, we could tell where in relation to the photoresistors the 1 inch wide black line was. We then used this information of how far off center the black line was and fed it into our PId controller as the error. We used 4 potentiometers to set the multiplication constants of the S (speed), P (proportion), I (integral), and D (derivative). The result of the calculation was fed into the motor controller as voltages so that the motors could change their speed and keep the robot central to the black line.
Here is the photoresistor wiring diagram:
Here is the potentiometer wiring diagram:
Here is the chassis CAD model:
Here is the printed chassis:
Here is the assembled robot:
Here is the robot following a line:
sarpuser/The-TRACKtor
The TRACKtor is a robot that uses 7 down facing photoresistors to follow a black line on a white surface. It uses a PID controller to adjust the speed of the two motors on either side. The robot is also able to follow dotted lines.
C++