|
Re: Elevator Motion Profiling / PID Ramping
I have two ideas that might help
If you want to stick with plain PID, you could try just increasing the value of kD. If it starts to oscillate a lot, try a low pass filter (moving average over 0.1 seconds or so) on the sensor value. This will help slow the elevator, but it may not be enough.
A second solution is a nested PID controller (sometimes called cascade). Have the output of one PID controller be the input of the other.
Your first PID controller looks at the actual elevator position and the desired elevator position, and outputs a desired lift rate - not motor power.
The second PID controller takes this desired lift rate as an input, looks at the actual lift rate, and adjusts elevator lift motor power.
To tune, you first worry about the second PID controller that takes velocity as an input. To tune, you can set it up so that the operator sets a desired lift rate, and the elevator moves at this rate. Make sure all your units are in terms of velocity for this loop and you should have mainly kI for this loop, and no kP. You may want to also try having a feedforward term here, I believe WPI has this built in.
Next, you tune the second PID controller. This should have lots of kD, which will give you the smooth deceleration and dampening you want.
|