Training Control Systems PID Controllers
4 / 5

PID Controllers

30 min Control Systems

PID Controllers

The PID controller — Proportional + Integral + Derivative — is the workhorse of industrial control. Tens of millions of loops run some form of PID. Its strength is its simplicity and the intuitive role of each term:

Proportional ($K_p e$) reacts to the current error — the bigger the error, the stronger the push. Too much $K_p$ causes overshoot and ringing.
Integral ($K_i \int e\,dt$) removes steady-state error by accumulating past error. It introduces a pole at the origin and can cause overshoot if tuned aggressively.
Derivative ($K_d \dot e$) anticipates future error by reacting to the rate of change. It adds damping but amplifies high-frequency noise.

We write the PID transfer function, discuss Ziegler–Nichols tuning, and work an example of tuning a first-order process.

PID Transfer Function

$$C(s) = K_p + \frac{K_i}{s} + K_d\,s = \frac{K_d s^2 + K_p s + K_i}{s}$$

Ziegler–Nichols (Ultimate Gain Method)

Raise $K_p$ with $K_i = K_d = 0$ until the loop just starts to oscillate. Record ultimate gain $K_u$ and ultimate period $T_u$. Then:

  • P-only: $K_p = 0.5 K_u$
  • PI: $K_p = 0.45 K_u, \; T_i = T_u/1.2$
  • PID: $K_p = 0.6 K_u, \; T_i = T_u/2, \; T_d = T_u/8$

Note: $K_i = K_p/T_i$, $K_d = K_p T_d$.

Example 1 — PI on a first-order plant

Plant $G_p = 2/(5s+1)$. With $K_p = 3, K_i = 1$, find the closed-loop characteristic polynomial.

$C(s) = 3 + 1/s = (3s+1)/s$. Loop gain $L = C G_p = (3s+1)\cdot 2/[s(5s+1)] = (6s+2)/[s(5s+1)]$.

$1 + L = 0 \Rightarrow s(5s+1) + 6s + 2 = 0 \Rightarrow 5s^2 + 7s + 2 = 0$.

Roots: $s = (-7 \pm \sqrt{49 - 40})/10 = (-7 \pm 3)/10 = -0.4, -1.0$. Stable over-damped.

Example 2 — Zero steady-state error

Show that a PI controller drives the steady-state tracking error to zero for a constant reference.

Steady-state error for unit step: $e_{\infty} = \lim_{s\to 0} s \cdot \dfrac{1/s}{1 + C(s) G_p(s)} = \dfrac{1}{1 + \lim_{s\to 0} C(s) G_p(s)}$.

With $C(s) = K_p + K_i/s$, $\lim_{s\to 0} C = \infty$, so $e_\infty = 0$. The integral term guarantees zero offset.

Example 3 — Ziegler–Nichols PID

Tests show $K_u = 4$ and $T_u = 0.8$ s. Compute $K_p, K_i, K_d$ for PID tuning.

$K_p = 0.6 \cdot 4 = 2.4$. $T_i = 0.8/2 = 0.4$, so $K_i = K_p/T_i = 2.4/0.4 = 6.0$.

$T_d = 0.8/8 = 0.1$, so $K_d = K_p T_d = 2.4 \cdot 0.1 = 0.24$.

Interactive Demo: PID Tuner (Ziegler–Nichols)
K_p =2.40
K_i =6.00
K_d =0.24
Preset:PID

Practice Problems

1. State the three PID terms and what each does.
2. Why does adding integral action eliminate steady-state error?
3. Why does $K_d$ amplify noise?
4. From $K_u=10$, $T_u=0.5$ s, compute Z–N PI gains.
5. What is derivative kick and how is it mitigated?
6. Give one real application of PID outside process control.
Show Answer Key

1. P: scales current error; I: integrates past error; D: reacts to rate of change (anticipation).

2. The integrator adds a pole at the origin, giving infinite DC gain; feedback forces $e\to 0$.

3. Noise has high $d/dt$; differentiator gain rises with frequency, magnifying fluctuations.

4. $K_p = 0.45\cdot 10 = 4.5$; $T_i = 0.5/1.2 \approx 0.417$, so $K_i = 4.5/0.417 \approx 10.8$.

5. A large step in setpoint produces a huge derivative spike; use derivative-on-measurement rather than on error.

6. Cruise control, drone flight stabilization, disk-drive head positioning, thermostat tuning.