Module IV·Article II·~5 min read

PID Control and Regulator Synthesis

Linear Control and Stability

Turn this article into a podcast

Pick voices, format, length — AI generates the audio

PID regulator is the most widespread industrial controller: according to various estimates, more than 90% of control loops in industry use PID or its variations. It is simple, requires minimal knowledge of the object model, and when properly tuned provides acceptable quality for most tasks. Understanding PID and its synthesis methods is a basic skill for an automation engineer.

Structure of the PID Regulator

Equation: u(t) = K_P·e(t) + K_I·∫₀^t e(τ) dτ + K_D·de(t)/dt,

where e(t) = r(t) − y(t) is the tracking error (the difference between the setpoint r and the actual output y), and K_P, K_I, K_D are the regulator coefficients.

Three components — three “characters”:

  • Proportional (P). u_P = K_P·e. The greater the deviation, the stronger the response. Reduces the steady-state error, but does not eliminate it completely (there remains a “static error” at all times). Large K_P → fast response, but possible overshoot and loss of stability.

  • Integral (I). u_I = K_I·∫e dτ. “Remembers” accumulated error → eliminates the static error (even if e is small but constant, the integral accumulates until u reaches the required level). Risk of integral windup: when there is a constraint on u (for example, u ≤ u_max), the integral may grow uncontrollably, giving a large burst during unloading.

  • Derivative (D). u_D = K_D·ė. Reacts to the rate of change of error → reduces overshoot, adds “damping”. Sensitive to measurement noise (the derivative of noise is huge). Often a filtered derivative is used: u_D = K_D·s/(τ_f·s + 1)·e.

PID Synthesis: Empirical Methods

Ziegler-Nichols Method (1942), variant 1 — step response.

  1. Apply u(t) = 1 (step), record y(t).
  2. From the plot estimate L (dead time — time until the reaction starts) and T (time constant — time to reach 63% of steady-state value).
  3. Set: K_P = 1.2·T/L, T_I = 2·L (T_I = K_P/K_I), T_D = 0.5·L (T_D = K_D/K_P).

Ziegler-Nichols Method, variant 2 — ultimate cycle.

  1. Set K_I = K_D = 0, increase K_P until the system enters undamped oscillations.
  2. Remember K_cr (critical gain) and T_cr (period of oscillations).
  3. For PID: K_P = 0.6·K_cr, T_I = 0.5·T_cr, T_D = 0.125·T_cr.

The method gives “rough” tuning with overshoot 10–25%. For better quality, Cohen-Coon, IMC (Internal Model Control), λ-tuning are used.

Transfer Functions

Laplace transform turns differential equations into algebraic ones. For an LTI system:

Y(s) = G(s)·U(s), G(s) = C·(s·I − A)⁻¹·B + D — transfer function.

For a double integrator G(s) = 1/s². For a first-order aperiodic element G(s) = K/(τ·s + 1).

PID in s-domain: G_PID(s) = K_P + K_I/s + K_D·s = (K_D·s² + K_P·s + K_I)/s.

Synthesis in Frequency Domain

Goal: ensure stable closed loop with specified margins:

  • Phase Margin (PM) ≥ 45° — allowable phase variation before loss of stability.
  • Gain Margin (GM) ≥ 6 dB (factor 2) — allowable gain variation.
  • Bandwidth — frequency at which |G_closed| = −3 dB.

Bode diagram: Graphs of |G(jω)| and arg G(jω). Allow visual identification of stability margins and determination of how to change K_P, K_I, K_D.

In MATLAB/Python, packages Control Toolbox, python-control automate the process: pid(K_P, K_I, K_D), bode(G), margin(G), pidTuner.

Numerical Example: PID for G(s) = 1/(s·(s+1)·(s+5))

A third-order integrating-type object.

Ultimate cycle method. Select K_P at which the system is on the stability boundary. Substituting s = jω into the characteristic equation 1 + K_cr/(jω·(jω+1)·(jω+5)) = 0: ω_cr = √5 ≈ 2.236, K_cr = 30.

Ziegler-Nichols: K_P = 0.6·30 = 18, T_I = 0.5·(2π/ω_cr) = 1.405 → K_I = K_P/T_I ≈ 12.81. T_D = 0.125·(2π/ω_cr) = 0.351 → K_D = K_P·T_D ≈ 6.32.

Simulation (Python control): to step r(t) = 1 — settling time ~3 s, overshoot ~25%, static error 0. Further manual tuning (reducing K_D, increasing T_I) yields overshoot of 10%.

Anti-windup and Practical Tricks

Clamping: when u saturates (u > u_max), stop integrating e. Back-calculation: correct the integral by (u_satur − u_calculated)/T_t. Bumpless transfer: when switching between manual and automatic modes, initialize the integral so that u does not “jump”.

Real Applications

  • Industrial Automation. Temperature controllers in furnaces (steel melting, ceramics firing), pressure (compressors, pumps), level (tanks, boilers) — almost always PID. Tuning strategy: “80% of tasks solved by PI, 15% — PID, 5% require MPC or adaptive control.”
  • Consumer Electronics. Thermostats for refrigerators, irons, multicookers — simplified PI. Modern boilers (Vaillant, Buderus) — PID with adaptive tuning.
  • Aerospace. Internal loops of airplane autopilot (pitch, roll, yaw control) — cascade PID. External loops (trajectory, altitude) — more complex regulators on top of PID.
  • Robotics. Control of each manipulator joint — PID (often with a feedforward term for gravity compensation). Level: 1 PID per joint, 5–7 joints per arm — total of 5–7 parallel PIDs.

Assignment. Control object: G(s) = 1/(s·(s+1)·(s+5)). (a) In Python (python-control or scipy) build Bode diagram. (b) Use ultimate cycle method to find K_cr, ω_cr. Tune PID using Ziegler-Nichols. (c) Simulate step response to r(t) = 1. Estimate: settling time (5%), overshoot, static error. (d) Manually adjust K_P, K_I, K_D to achieve overshoot < 10% with minimal settling time. (e) Compare with MATLAB pidTuner or your analogue — which parameters does the automatic tuner select?

§ Act · what next