|
Re: Autonomous using encoders
the best algorithm is PID(search these forums). If you want something simpler then just P:
*Subtract the left side encoder count from the right side. I you get a negative value then you are
veering to the left. Positive means you are going to the right
*multiply this number by some constant.
*Add the result to the left wheel. subtract it from the right wheel. Make sure nothing overflows.
This is not the best algorithm but it helps. One year, we found that for whatever reason one side of our robot was slightly more powerful than the other. We simply multiplied the more powerful side by a constant and it almost completely eliminated the problem without any feedback at all.
__________________
1139 Alumni
|