Designing and tuning PID controllers using systematic methods, understanding the physical interpretation of each control action, and addressing practical implementation challenges.
u(t) = K_p · e(t) + K_i · ∫e(t) dt + K_d · de(t)/dt
Where e(t) = r(t) - y(t) (error = reference - output)
Transfer function (ideal PID):
C(s) = K_p + K_i/s + K_d·s = (K_d s² + K_p s + K_i) / s
Parallel form parameters: K_p, K_i = K_p/T_i, K_d = K_p·T_d
Responds to current error. Reduces error but cannot eliminate steady-state error (offset) in Type 0 systems. Increasing Kp speeds response but increases overshoot and can destabilize.
Responds to accumulated past error. Eliminates steady-state offset by adding an integrator (raises system type by 1). Can cause slow response and windup. Reduces phase margin.
Responds to rate of change of error (predictive). Reduces overshoot and improves transient response. Amplifies high-frequency noise — always use with a low-pass filter in practice.
Apply a step change to the plant input in open loop. Measure the S-shaped response curve. Fit a first-order plus dead-time (FOPDT) model: gain K, time constant T, dead time L.
Model: G(s) = K·e^(-Ls) / (Ts + 1)
Extract from step response: K = Δy/Δu, L = apparent dead time, T = time constant
Z-N Tuning:
P only: K_p = T/(K·L)
PI: K_p = 0.9T/(K·L), T_i = L/0.3
PID: K_p = 1.2T/(K·L), T_i = 2L, T_d = 0.5L
Increase Kp in proportional-only mode until sustained oscillations begin. Record the ultimate gain Ku and ultimate period Tu.
PID tuning:
K_p = 0.6 · K_u
T_i = T_u / 2
T_d = T_u / 8
When the actuator saturates (e.g., motor at max speed), the error persists and the integral term continues to grow (winds up). When the error finally reverses, the large integral must be "unwound" before the controller can respond, causing large overshoot. Anti-windup strategies:
Ideal derivative D(s) = Kd·s has infinite gain at high frequency, amplifying sensor noise. A practical derivative uses a first-order filter: D(s) = Kd·s / (1 + s·Tf) where Tf = Td/N and N = 5 to 20.
K_p = 1.2T/(K·L) = 1.2×8/(2.5×1.5) = 9.6/3.75 = 2.56
T_i = 2L = 2×1.5 = 3.0 s → K_i = K_p/T_i = 2.56/3.0 = 0.853 s&sup-¹
T_d = 0.5L = 0.5×1.5 = 0.75 s → K_d = K_p×T_d = 2.56×0.75 = 1.92 s
K_p = 2.56, K_i = 0.853 s&sup-¹, K_d = 1.92 s
Adding integral action (PI controller) eliminates steady-state offset by integrating the accumulated error until it reaches zero. The integral action raises the system type by 1, ensuring zero error for step reference inputs.
Add integral action (PI controller). Side effect: integrator windup must be managed with anti-windup logic; phase margin will decrease, potentially increasing overshoot.