|
Re: Motor Ramp Up/Ramp Down Function
So despite this being a rather old thread, I'll add an important comment for any future readers of this thread.
Using the I term in a PID controller is a monumentally stupid way to do this. I will now explain why this is, and why the results were not what your inuition lead you to expect. Integral control is slow. You've noted this yourself, but failled to appreciate the consequences. As the error remains and is integrated, you build up a rather large number to add to your command. Unfortunately, this number is still there when the error reaches zero, it won't go away until the system errs on the other side for a while. Of course then it starts adding up in the other direction... So, mostly, you should never depend on integral control to get you most of the way to where you want to go, just use a small amount of it to take care of any errors that are left from your P term. In fact, though, increasing your I term like you did would simply increase the input from your I term by a heck of a lot. That is, it would make your robot accelerate a whole lot after a small delay.
If you were set on using the PID control for this, you'd actually just want to increase your D gain. The D term adds damping and slows down the response of the system, which is presumably what you're looking for.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.
Lone Star Regional Troubleshooter
|