|
Re: Line Tracking, Tips, Suggestions, Pictures
I have never gotten this to work perfectly, but you may want to look into it...
take the difference of the right and left sensors, calculate the difference, and use that to accelerate one side, and decelerate the other side.
example:
difference = right_sensor - left_sensor;
difference = difference / 6;//this value adjusts how hard your robot corrects.
right_motor = 140 + difference;
left_motor = 140 - difference;
if you can get this working, it acts sorta like a PID loop in that it should correct harder the farther away from the line it is.
Hope this helps, and good luck!
__________________
Don't see the world as it is and ask why; see the world as it could be and ask, why not? - unknown author
|