Quote:
Originally Posted by de_
Is this possible within the current PID classes ? Any suggestions ?
|
This is a very good place to use the PID controller, and the PID classes should be able to do that nicely.
You'll want to start with P, add some D to help prevent overshoot, and then add some I to help it get to the correct height if it isn't there from the P and D.
You will find that just passing your goal position to the PID controller will cause it to go to the goal by applying full power when traveling long distances. Sometimes this is the desired result, and as will probably be the case with our bot this year, this is not what we would like. To fix this, you want to pass a nice movement profile to the controller, and have it follow that path rather than feed it the raw goal. I like to have a final goal, and a local goal. I set the final goal to where we want the arm to go to, and then limit the velocity of the local goal by only changing it by up to some constant each time step. This smooths the motion out considerably. You can go one step further by limiting the acceleration of the goal as well, but that starts to complicate the math for little extra gain.