|
Re: How to get robot to drive straigth using shaft encoders
The best way I know of driving straight with encoders to ensure that the wheels not only maintain in sync, but if they get out of sync , the robot returns back to it's original line is:
During an equal period take the difference between the encoder counts
Integrate this difference.
The result of the integration should be used to offset the commanded wheel commands. See the pseudo code below:
current_difference = left_count - right_count
integrated_error = integrated_error + current_difference
Left_Drive = Commanded_Left_Drive + integrated_error
Right_Drive = Commanded_Left_Drive - integrated_error
Let me know if I should make it clearer
|