I have 3 line trackers in front of my vehicle. 4 wheels, 1 motor for each wheel. It also needs to stop at intersections. It follows black electrical tape on the floor. I do not have it in front of me, so I can not test the code, but I will test, soon. For now, is there anything that you think I should change?
The code may work, but here are some ways you can improve smoothness:
Proportionality: As the robot goes farther away to one side, the robot will correct itself more. This way the robot can make big and small adjustments.
If the line is a straight line, then on average all motors should move the same amount. By VERY SLIGHTLY correct the robot in this way, it can stop the proportionality from reaching a state in which the robot oscillates from dark to light areas, increasing efficiency.
Another way to achieve this same goal is to premptively predict where the robot will go next. If the robots speed in one motor is increasing, slightly correcting the robot to decrease its speed will make it correct slightly better.
Most line followers use a combination of these 3 concepts, and are called PID line followers. Here is a link with more info: Proportional–integral–derivative controller - Wikipedia
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.