|
Re: encoders
It sounds as if you have implemented a simple PID control, or at least the proportional part of PID. If you are unfamiliar with this just search for it here on ChiefDelphi. Believe it or not, you aren't too far away from making your drive behave properly. I am guessing you are finding the error between the speed you want and the speed the encoders are showing and applying that error to your motors to make the correction. The problem is you keep overshooting the mark, this is a common problem in all mechanical control systems. You just need to scale down your error so that the response is slower and doesn't overshoot:
correction = error*.4 (for example)
In a true PID control you would scale it down to just enough to prevent oscillation, however this often results in the error never going to 0. That's when you can try adding in the "I" and the "D" part of the control. I will let you find out more about that after you search for "PID"
|