PID controllers / autopilot stability
Posted: 26 Oct 2006, 20:19
I was thinking of posting this a while ago, but since an issue to do with autopilot stability was brought up in another thread, I thought it might be useful to make a short post on Proportional Integral & Derivative (PID) controllers. I cant claim to be an expert in this area or that what I have put here is 100% accurate, but hopefully it might help some people to sort autopilot niggles. A PID controller is a very common form of control device containing three terms; proportional, integral and derivative. As part of a closed loop (feedback) control system, these terms each have a "gain" which determines how they effect the control system. If the gain is zero, it is equivalent to that term being missing from the controller. In the real world, they could be implemented by various circuits built around a 741 Operational Amplifier (Op-Amp) chip.

On the x axis of all four graphs is time, t=0 being when the desired level (this could be an altitude, heading speed etc in the case of the autopilot) is selected. On the y axis is the variable to be set, the "desired level" being what has been asked of it, e.g. 20,000ft on an autopilot. The proportional term is the basic term of the controller. If used alone it will never quite achieve the desired level, but will have a steady state error. The addition of the integral term eliminates the steady state error but may introduce an overshoot/ undershoot of the desired level. An integral term can be used alone to bring the variable to its desired level slowly but with no overshoot. The introduction of the derivative term in a PI controller can help to alleviate overshoot and undershoot and bring the variable to its desired level quicker.

If the gains are set incorrectly then an instability may occur. Possible undesirable situations include the failure of the control to acquire the desired level at all, a steady oscillation about the desired level or worst off, oscillating divergence.
To reduce the time taken for the desired level to be achieved, try increasing the Proportional gain.
To reduce the time taken for the desired level to be achieved when it is already close to it, try increasing the integral gain.
To reduce the time taken for the variable to settle out to its desired level, try increasing the derivative gain.
To alleviate a large overshoot of the desired level, try reducing the proportional and integral gains.
If an instability occurs, try reducing all gains and start over!
Obviously there are other factors that influence the whole control system and so there are no magic combinations of gains that will work for all systems!

On the x axis of all four graphs is time, t=0 being when the desired level (this could be an altitude, heading speed etc in the case of the autopilot) is selected. On the y axis is the variable to be set, the "desired level" being what has been asked of it, e.g. 20,000ft on an autopilot. The proportional term is the basic term of the controller. If used alone it will never quite achieve the desired level, but will have a steady state error. The addition of the integral term eliminates the steady state error but may introduce an overshoot/ undershoot of the desired level. An integral term can be used alone to bring the variable to its desired level slowly but with no overshoot. The introduction of the derivative term in a PI controller can help to alleviate overshoot and undershoot and bring the variable to its desired level quicker.

If the gains are set incorrectly then an instability may occur. Possible undesirable situations include the failure of the control to acquire the desired level at all, a steady oscillation about the desired level or worst off, oscillating divergence.
To reduce the time taken for the desired level to be achieved, try increasing the Proportional gain.
To reduce the time taken for the desired level to be achieved when it is already close to it, try increasing the integral gain.
To reduce the time taken for the variable to settle out to its desired level, try increasing the derivative gain.
To alleviate a large overshoot of the desired level, try reducing the proportional and integral gains.
If an instability occurs, try reducing all gains and start over!
Obviously there are other factors that influence the whole control system and so there are no magic combinations of gains that will work for all systems!