PID controller


Revision as of 15:57, 11 April 2013 by Gabe Spradlin (Talk | contribs) (See Also)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
PID controller
Green carrot left.gif
SISO Pole Placement
Green carrot.jpg
In order to prevent spam, users must register before they can edit or create articles.

1 Introduction to PID Control

A Proportional-Integral-Derivative controller (PID controller) is a generic controller widely used in industrial control systems. The PID control equation involves three separate parameters; the Proportional, the Integral and Derivative terms. The Proportional term responds instaneously to the current error (providing instaneous response). The Integral term responds to the accumulation of errors (providing a slow response that drives the steady-state error towards 0). And the Derivative term responds to the rate at which the error is changing (providing some anticipatory response). Their respective weighting determines the controls response.

A block diagram of a PID controller

1.1 Proportional Action[1]

Proportional action provides an instantaneous response to the control error. This is useful for improving the response of a stable system but cannot control an unstable system by itself. Additionally, the gain is the same for all frequencies leaving the system with a nonzero steady-state error.

1.2 Integral Action[2]

Integral action drives the steady-state error towards 0 but slows the response since the error must accumulate before a significant response is output from the controler. Since an integrator introduces a system pole at the origin, an integrator can be detrimental to loop stability. Only controllers with integrators can wind-up where, through actuator saturation, the loop is unable to comply with the control command and the error builds until the situation is corrected.

1.3 Derivative Action[3]

Derivative action acts on the derivative or rate of change of the control error. This provides a fast response, as opposed to the integral action, but cannot accomodate constant errors (i.e. the derivative of a constant, nonzero error is 0). Derivatives have a phase of +90 degrees leading to an anticipatory or predictive repsonse. However, derivative control will produce large control signals in response to high frequency control errors such as set point changes (step command) and measurement noise.

In order to use derivative control the transfer functions must be proper. This often requires a pole to added to the controller (this pole is not present in the equations below).

2 PID Control

Proportional-Integral-Derivative or PID control combines proportional control, integral control, and derivative control in parallel.

LaTeX: C_{PID}\left(s\right)=K_P\left(k+\frac{k_{i}}{s}+k_{d}s\right) PID[4]


LaTeX: K_P is the PID control gain,
LaTeX: k is a constant included for more flexibility,
LaTeX: k_{i} is the integral gain, and
LaTeX: k_{d} is the derivative gain.

From this generic form we can do the following:

set LaTeX: T_{d}=0 and Eqn. PID becomes equal to Eqn. PI
set LaTeX: k_{i}=0 and Eqn. PID becomes equal to Eqn. PD
set LaTeX: k=0 and Eqn. PID becomes an integral-derivative controller
set LaTeX: k=0, k_{i}=0 and Eqn. PID becomes equal to Eqn. D
set LaTeX: k=0, T_{d}=0 and Eqn. PID becomes equal to Eqn. I

2.1 Alternative forms of PID Control

Standard form similar to Eqn. PID except that a pole has been added to the derivative action to ensure a proper transfer function.

LaTeX: C_{PID}\left(s\right)=K_P\left(1+\frac{1}{T_{r}s}+\frac{T_{d}s}{\tau_{D}s+1}\right) PID Alt 1[5]

Note: Typically LaTeX: 0.1T_{d}\le\tau_{D}\le0.2T_{d}

Series Form

LaTeX: C_{PID}\left(s\right)=K_s\left(1+\frac{I_s}{s}\right)\left(1+\frac{D_{s}s}{\gamma_{s}D_{s}s+1}\right) PID Alt 2 - Series Form[6]

Parallel Form

LaTeX: C_{PID}\left(s\right)=K_p+\frac{I_p}{s}+\frac{D_{p}s}{\gamma_{p}D_{p}s+1} PID Alt 3 - Parallel Form[7]

3 Example: PID Control design using Pole Placement

Let's assume a 2nd order system of with the following form

LaTeX: H(s)=K\frac{\omega_n^2}{s^2+2\zeta\omega_n s+\omega_n^2} \mbox{ for } 0 \le \zeta \le 1 Generic 2nd Order System

LaTeX: K is the system gain
LaTeX: \omega_n is the system's natural frequency
LaTeX: \zeta is the system's damping ratio.

Let's assume we have a PID controller of form

LaTeX: C_{PID}\left(s\right)=K_P\left(k+\frac{k_{i}}{s}+k_{d}s\right) PID[8]

Roll LaTeX: K_p inside the parentheses and add a factor to denominator of the integrator

LaTeX: C_{PID}\left(s\right)=k+\frac{k_{i}}{\alpha s}+k_{d}s

Do a little algebra...

LaTeX: C_{PID}\left(s\right)=\frac{k\alpha s+k_{i}+k_{d}\alpha s^2}{\alpha s}

Finally, rearrange

LaTeX: C_{PID}\left(s\right)=\frac{k_{d}\alpha s^2+k\alpha s+k_{i}}{\alpha s}

The characteristic equation of this system is

LaTeX: \Phi_{CL}=\left(s^2+2\zeta\omega_{n}s+\omega_{n}^2\right)\alpha s+\omega_{n}^2\left(k_{d}\alpha s^2+k\alpha s+k_{i}\right)

LaTeX: \Phi_{CL}=\alpha s^3+\left(2\zeta\omega_{n}\alpha+k_{d}\alpha\omega_{n}^2\right)s^2+\left(\omega_{n}^2+k\alpha\omega_{n}^2\right)s+\omega_{n}^2k_{i}

From the order of LaTeX: \Phi_{CL} we know we need 3 stable closed loop poles so the form of the desired characteristic equation is

LaTeX: \beta s^3+\gamma s^2+\chi s+\nu


Table 1: Pole Placement Results

LaTeX: s^3

LaTeX: \beta=\alpha

LaTeX: s^2

LaTeX: \gamma=\left(2\zeta\omega_{n}\alpha+k_{d}\alpha\omega_{n}^2\right)

LaTeX: s^1

LaTeX: \chi=\left(\omega_{n}^2+k\alpha\omega_{n}^2\right)

LaTeX: s^0

LaTeX: \nu=\omega_{n}^2k_{i}

Once the desired closed loop poles are determined then LaTeX: \beta, \gamma, \chi, and LaTeX: \nu can be determined. Algebra does the rest.

In the [Helicopter Hover Example|hovering helicopter example] the desired closed loop poles are determined by deciding what a reasonable overshoot and rise time would be. This allowed for the determination of a desired LaTeX: \zeta and LaTeX: \omega_n. From those a standard 2nd order system was formed. Since 3 poles were required, just as in this case, a 3rd pole was placed at an arbitrarily high frequency. The desired chracteristic equation from that became

LaTeX: \left(s+a\right)\left(s^2+2\zeta_{desired}\omega_{desired}s+\omega_{desired}^2\right)


  • LaTeX: a=10\omega_{desired} is our arbitrarily high 3rd pole.

The addition of the pole at LaTeX: -a required that a prefilter be included to reduce overshoot. That prefilter was

LaTeX: W\left(s\right)=\frac{a}{\left(s+a\right)}

4 Empirical Tuning[9]

For open loop stable plants the following procedure may be used (these steps are quotes, I've added links and changed the table number only)

  1. Set the plant under proportional control, with a very small gain.
  2. Increase the gain until the loop starts oscillating. Note that linear oscillation is required and that it should be detected at the controller output.
  3. Record the controller critical gain LaTeX: K_p=K_c and the oscillation period of the controller output, LaTeX: P_c.
  4. Adjust the controller parameters according Table 2; there is some controversy regarding the PID parameterization for which the Z-N method was developed, but the version described here is, to the best knowledge of the authors, applicable to the parameterization of (6.2.4).
Table 2: Ziegler-Nichols tuning, using the oscillation method
LaTeX: K_P LaTeX: T_r LaTeX: T_d

LaTeX: P

LaTeX: 0.50K_c




LaTeX: 0.45K_c

LaTeX: \frac{P_c}{1.2}



LaTeX: 0.60K_c

LaTeX: 0.5P_c

LaTeX: \frac{P_c}{8}

LaTeX: C_{PID}\left(s\right)=K_P\left(1+\frac{1}{T_{r}s}+\frac{T_{d}s}{\tau_{D}s+1}\right) Eqn. 6.2.4[10]

Note: Typically LaTeX: 0.1T_{d}\le\tau_{D}\le0.2T_{d}

The parameters in Table 2 come from Zieglers and Nichols whose goal was to acquire an underdamped response to a step input for plants of the form

LaTeX: G_0\left(s\right)=\frac{K_{0}e^{-s\tau_{0}}}{\nu_{0}s+1}

5 See Also

6 References

Goodwin, G. C., Graebe, S. F., and Salgado, M. E. 2000 Control System Design. 1st. Prentice Hall PTR. ISBN 0139586539
Franklin, G. F., Emami-Naeini, A., and Powell, J. D. 1993 Feedback Control of Dynamic Systems. 3rd. Addison-Wesley Longman Publishing Co., Inc. ISBN 0201527472

6.1 Notes

  1. Goodwin et all, pg. 160
  2. Goodwin et all, pg. 161
  3. Goodwin et all, pg. 161
  4. Franklin et all, pg. 185, Eqn. 4.31
  5. Goodwin et all, pg. 160, Eqn. 6.2.4
  6. Goodwin et all, pg. 160, Eqn. 6.2.5
  7. Goodwin et all, pg. 160, Eqn. 6.2.6
  8. Franklin et all, pg. 185, Eqn. 4.31
  9. Goodwin et all, pp. 162-166
  10. Goodwin et all, pg. 160, Eqn. 6.2.4