PID Control: Design, Tuning, and Modern Practice

An engineer's path from "three magic numbers" — through lambda tuning, margins, digital implementation, and loop shaping — to the modern PID family.

Contents
  1. Why tuning deserves your attention
  2. A model worth tuning against: the FOPDT approximation
  3. What each term actually does
  4. The classical recipes — and why they overshoot
  5. The modern way: specify the closed loop, derive the gains
  6. Worked example — same plant, five tunings
  7. Advanced practice: what separates a tuner from an engineer
  8. From algebra to code: the digital PID
  9. The master view: loop shaping in the frequency domain
  10. Modern PID variants: more exponents, more knobs
  11. Interactive laboratory
  12. Where this fits in control theory

1. Why tuning deserves your attention

A PID controller is the most deployed algorithm in industrial history — it runs the temperature of your refinery column, the position of your robot joint, the speed of your motor. The algorithm itself is three lines of math; the entire engineering content lives in choosing its three gains. The same controller can make a plant settle crisply in two seconds or oscillate itself to destruction, depending only on those numbers.

Why this matters to you: textbook recipes (Ziegler–Nichols) were designed in 1942 for pneumatic regulators and a "quarter-amplitude decay" aesthetic. Modern practice — IMC/lambda tuning, relay autotuning, frequency-domain margins — lets you specify the closed-loop behavior you want and derive the gains, rather than gambling on a heuristic. That shift, from guessing to specifying, is what "advanced usage" means.

The setting is the standard feedback loop:

setpoint \(r\)
−
error \(e\)
PID
\(C(s)\)
Plant \(G(s)\)
output \(y\)
measurement
disturbance \(d\)
actuation \(u\)
Figure 1. The unity-feedback loop. Tuning means choosing \(C(s)\) so that \(y\) tracks \(r\) and rejects \(d\) quickly, smoothly, and robustly — with bounded effort \(u\).

The PID law, in the "standard" (ISA) form we will use throughout, is

\[ u(t) \;=\; K_c\Bigl(e(t) + \frac{1}{T_i}\int_0^t e(\tau)\,d\tau \;+\; T_d\,\frac{de}{dt}\Bigr) \]

where \(u\) is the actuator command, \(e = r - y\) the tracking error, \(K_c\) the proportional gain, \(T_i\) the integral time (minutes or seconds per repeat), and \(T_d\) the derivative time. Beware: many vendors use the parallel form \(u = K_p e + K_i\!\int\!e + K_d \dot e\); the conversion is \(K_i = K_c/T_i\), \(K_d = K_c T_d\). Mixing up the two forms is the single most common tuning bug in the field.

Takeaway: the algorithm is trivial — all the skill is in picking three numbers that shape the loop's dynamics.

2. A model worth tuning against: the FOPDT approximation

Why introduce a model at all? Because tuning rules are maps from plant characteristics to gains; without a compact description of the plant there is nothing to map from. Remarkably, most sluggish industrial processes (temperature, level, flow through long pipes) are well described by just three numbers: a first-order plus dead time (FOPDT) model,

\[ G(s) \;=\; \frac{K\, e^{-Ls}}{\tau s + 1} \]

where \(K\) is the process gain (how far \(y\) eventually moves per unit of \(u\)), \(\tau\) the time constant (how fast it gets there), and \(L\) the dead time (the pure delay before anything happens — transport, sensing lag, computation).

You obtain \(K,\tau,L\) from one open-loop step test — and the geometry of the response curve is the model:

\(t\)
\(y\)
\(L\)
\(\tau\)
\(\Delta y_\infty = K\,\Delta u\)
Figure 2. Reading a FOPDT model off a step response: dead time \(L\) until the output reacts; draw the tangent at the steepest point — its slope sets the time constant \(\tau\) (time from end of dead time to where the tangent hits the final value); the final rise gives \(K\).

The ratio that governs everything is the normalized dead time

\[ \theta \;=\; \frac{L}{L+\tau} \;\in\; (0,1). \]

Why define \(\theta\)? Dead time is what makes feedback hard: while the plant "ignores" your command, the controller accumulates error and overshoots. When \(\theta\) is small the plant is lag-dominant and aggressive tuning works; as \(\theta \to 1\) the plant is delay-dominant and no PID can be both fast and stable — you must either accept slowness or add dead-time compensation (§7.4). Every sensible tuning rule is, at heart, a statement about \(\theta\).

Takeaway: reduce your plant to \(K,\tau,L\) from one step test; the ratio \(\theta = L/(L+\tau)\) tells you how hard the tuning problem is.

3. What each term actually does

Why decompose? Because tuning is triage: each symptom (offset, oscillation, sluggishness) maps to one term, and you should know which knob to reach for.

\(t\)
\(y\)
setpoint
P only: offset
PI: zero offset, oscillatory
PID: damped by lead
Figure 3. The three personalities on one plant: P is fast but leaves steady-state error; adding I removes the offset at the price of ringing; adding D buys back damping.
Takeaway: P = present, I = past (removes offset, costs phase), D = future (adds damping, hates noise and dead time).

4. The classical recipes — and why they overshoot

4.1 Ziegler–Nichols ultimate-gain method

Why this construction? The stability boundary is the one point of the gain axis you can find experimentally without a model. Ziegler & Nichols' idea: turn off I and D, raise \(K_c\) until the loop oscillates steadily — record the ultimate gain \(K_u\) and the ultimate period \(T_u\) — then back off to fixed fractions of that edge.

\[ K_c = 0.6\,K_u, \qquad T_i = 0.5\,T_u, \qquad T_d = 0.125\,T_u \]

The recipe targets quarter-amplitude decay (each overshoot ¼ of the previous): lively by 1942 standards, nervy by modern ones — typically 40–60% overshoot with poor robustness margins. Treat it as a quick first guess and a diagnostic, not a final answer.

4.2 Reaction-curve rules (Z–N and Cohen–Coon)

If you already have \(K,\tau,L\) from Figure 2, you can skip the stability hunt. The two classical table rules:

Rule\(K_c\)\(T_i\)\(T_d\)Character
Z–N reaction curve\(1.2\,\tau/(KL)\)\(2L\)\(0.5L\)quarter-decay, oscillatory
Cohen–Coon\(\dfrac{\tau}{KL}\Bigl(\tfrac{4}{3}+\tfrac{L}{4\tau}\Bigr)\)\(L\,\dfrac{32+6L/\tau}{13+8L/\tau}\)\(L\,\dfrac{4}{11+2L/\tau}\)better for larger \(\theta\), still ~¼ decay

Why do both overshoot? Both target a fixed damping ratio near \(\zeta \approx 0.2\)–0.3 and place the closed-loop poles aggressively. They answer "make it lively" — a question nobody should be asking of a temperature loop on a 400 °C reactor.

Takeaway: classical rules locate the stability edge and back off by folklore — useful as a baseline, dangerous as a default.

5. The modern way: specify the closed loop, derive the gains

5.1 IMC / lambda tuning — the central idea

Why flip the problem around? Instead of guessing gains and checking the response, choose the response and solve for the gains. The Internal Model Control (IMC) approach asks: "I want my closed loop to behave like a clean first-order system with time constant \(\lambda\)" — the one design knob, called lambda:

\[ T_{\text{desired}}(s) \;=\; \frac{e^{-Ls}}{\lambda s + 1} \]

(the dead time must remain — no controller can make the plant respond before its own delay; wishing it away is exactly what makes naive designs unstable). Now require the actual closed loop \(T = \dfrac{CG}{1+CG}\) to equal this desired form, with \(G = Ke^{-Ls}/(\tau s+1)\), and approximate the delay in the denominator by a first-order Padé, \(e^{-Ls} \approx \frac{1-\tfrac{L}{2}s}{1+\tfrac{L}{2}s}\). Solving for \(C\) and matching it to PI form gives the celebrated SIMC / IMC rules:

\[ \boxed{\;K_c = \frac{1}{K}\,\frac{\tau}{\lambda + L}, \qquad T_i = \min\bigl(\tau,\;4(\lambda+L)\bigr)\;} \]

Every symbol earns its place: gain is proportional to the plant's speed ratio \(\tau/(\lambda+L)\) — you cannot close the loop faster than \(\lambda+L\); the integral time simply cancels the plant's lag \(\tau\) (pole–zero cancellation), capped at \(4(\lambda+L)\) so that slow lags don't make disturbance rejection glacial.

Why is this profound? One knob, \(\lambda\), with a direct physical meaning — desired closed-loop speed — trades performance against robustness and actuator wear monotonically. Common choices:

For a second-order plant with a fast secondary lag \(\tau_2\) (which is when derivative action truly pays), SIMC sets \(T_d = \tau_2\) — the derivative cancels the second lag, just as the integral cancels the first. The pattern: a PID is two lags' worth of plant inversion.

\(t\)
\(y\)
\(\lambda\) small: fast, fragile
\(\lambda = L\): SIMC default
\(\lambda = 3L\): robust, gentle
Figure 4. Lambda is a speed dial with an honesty guarantee: you choose the closed-loop time constant, the formula hands you gains that achieve it, and dead time \(L\) puts a hard floor under how fast you may ask.
Takeaway: stop guessing gains — choose a desired closed-loop time constant \(\lambda \geq L\) and read the gains off \(K_c=\tfrac{1}{K}\tfrac{\tau}{\lambda+L},\; T_i=\min(\tau,4(\lambda+L))\).

5.2 Relay autotuning (Åström–Hägglund) — finding the ultimate point automatically

Why improve on Z–N's manual hunt? Driving a loop to sustained oscillation by hand is slow, risky, and hard to automate. The trick: replace the controller with a relay (an on/off element of amplitude \(d\)). Most processes low-pass-filter the relay's square wave into an almost-sinusoidal limit cycle of amplitude \(a\) — the loop finds its own stability edge, safely bounded by the relay amplitude.

The describing-function argument is one line of intuition: the relay's output fundamental has amplitude \(4d/\pi\); if it passes through the plant and comes back as amplitude \(a\) at the oscillation frequency, then the plant's gain there is \(a/(4d/\pi)\), and the ultimate gain — the controller gain that would produce loop gain 1 at that frequency — is

\[ K_u \;=\; \frac{4d}{\pi a}, \qquad T_u = \text{measured oscillation period}. \]

Feed \(K_u, T_u\) into any ultimate-gain rule — or better, into damped variants like Tyreus–Luyben (\(K_c = K_u/3.2\), \(T_i = 2.2T_u\)) — and you have a one-button autotuner. This is literally what lives inside most commercial "auto-tune" features.

\(t\)
relay output \(u = \pm d\)
process output, amplitude \(a\)
period \(= T_u\)
Figure 5. Relay feedback: the plant filters the square wave into a near-sinusoid. Amplitude ratio gives \(K_u = 4d/(\pi a)\); the period gives \(T_u\) — the whole ultimate point from one safe experiment.
Takeaway: a relay makes the loop oscillate at its own stability edge, handing you \(K_u\) and \(T_u\) from one bounded experiment — the engine of industrial autotuners.

5.3 Frequency-domain view: margins as the acceptance test

Why another viewpoint? Time-domain rules give you gains; margins tell you how much model error those gains survive. Form the loop transfer \(L(s) = C(s)G(s)\). Two numbers, read off where \(|L|\) crosses 1 and where \(\angle L\) crosses \(-180^\circ\):

\[ \text{gain margin } g_m \geq 2\ (6\,\text{dB}), \qquad \text{phase margin } \varphi_m \in [30^\circ,\,60^\circ] \]

are the working engineer's robustness acceptance test. The connection to everything above: Z–N's quarter-decay tuning lands near \(\varphi_m \approx 15^\circ\)–25° (fragile); SIMC with \(\lambda = L\) lands near \(\varphi_m \approx 45^\circ\)–60°. Dead time is a pure phase thief — it contributes \(-\omega L\) radians of lag while changing gain not at all — which is why \(\theta\) from §2 predicts tuning difficulty. A modern tuning workflow ends by checking margins, not by admiring step responses.

Takeaway: whatever rule you use, certify it — phase margin 30–60° and gain margin ≥ 6 dB, or the tuning is not done.

6. Worked example — same plant, five tunings

Take \(G(s) = \dfrac{2e^{-2s}}{10s+1}\) (\(K=2,\ \tau=10,\ L=2\), so \(\theta = 2/12 \approx 0.17\), lag-dominant). For the ultimate-gain methods, solve the phase-crossover condition \(\operatorname{atan}(10\omega_u) + 2\omega_u = \pi\), which yields \(\omega_u \approx 0.844\) rad/s, hence \(T_u = 2\pi/\omega_u \approx 7.4\) s and \(K_u = \sqrt{1+(10\omega_u)^2}/2 \approx 4.25\):

Method\(K_c\)\(T_i\)\(T_d\)Expected behavior
Z–N reaction curve\(1.2\cdot\tfrac{10}{2\cdot2}=3.00\)\(4.0\)\(1.0\)fast, ~50% overshoot, ringing
Cohen–Coon\(\tfrac{10}{4}(1.33{+}0.05)=3.46\)\(2\cdot\tfrac{32+1.2}{13+1.6}=4.55\)\(2\cdot\tfrac{4}{11.4}=0.70\)similar, slightly hotter
Z–N ultimate (from \(K_u{=}4.25,\ T_u{=}7.4\))\(0.6\cdot4.25=2.55\)\(0.5\cdot7.4=3.7\)\(0.125\cdot7.4=0.93\)quarter-decay
Tyreus–Luyben (PI)\(4.25/3.2=1.33\)\(2.2\cdot7.4=16.3\)0calm, well-damped, slower rise
SIMC, \(\lambda = L = 2\)\(\tfrac{1}{2}\cdot\tfrac{10}{4}=1.25\)\(\min(10,16)=10\)0 (PI)~5–10% overshoot, settle \(\approx 4\lambda\)

Why the dramatic difference? The classics fix a damping ratio (aggressive); SIMC and Tyreus–Luyben fix a closed-loop time constant (deliberate). Note the classical gains are ~2.5× larger — bought with robustness margin. Try all five in the simulator below and look at the control effort: aggressiveness is paid for in actuator travel.

Takeaway: for the same plant, "classic" and "modern" tunings differ by a factor of 2–3 in gain — that factor is the robustness you're trading away.

7. Advanced practice: what separates a tuner from an engineer

7.1 Filtered derivative

An ideal differentiator has gain growing like \(\omega\) — a noise amplifier. Every industrial PID implements

\[ D(s) \;=\; K_c\,\frac{T_d\, s}{1 + s\,T_d/N}, \qquad N \in [8,20], \]

i.e. derivative action rolled off above \(N/T_d\) rad/s. Why mention it? Because \(N\) is a hidden fourth tuning knob: too large and noise drives your actuator; too small and you've quietly deleted the derivative you tuned for.

7.2 Anti-windup

When the actuator saturates, the integrator keeps accumulating error it cannot correct — then the output overshoots violently when the error finally flips sign. Fixes: clamping (stop integrating while saturated) or back-calculation (feed the saturation deficit \(u_{\text{sat}}-u\) back into the integrator with time constant \(T_t \approx \sqrt{T_i T_d}\)). Any tuning you do is void if the loop spends its life in saturation.

7.3 Setpoint weighting (2-DOF PID)

Notice the conflict: you tune for disturbance rejection but the same gains also amplify setpoint steps, and the derivative kicks on every step change. The industrial fix is to weight the setpoint differently from the measurement,

\[ u = K_c\bigl(\beta r - y\bigr) + \frac{K_c}{T_i}\!\int e\,dt + K_c T_d\,\frac{d(\gamma r - y)}{dt}, \qquad \beta\in[0,1],\ \gamma = 0, \]

so you can keep aggressive load rejection while making setpoint moves gentle — tuning tracking and regulation separately. This is why "PID" on a datasheet often means five parameters.

7.4 Dead-time compensation (Smith predictor)

When \(\theta \to 1\), no PID tuning survives: the information simply arrives too late. The Smith predictor embeds a fast model: control \(\hat G\) (no delay) directly, and feed back only the model error delayed by \(L\). The controller then tunes as if \(L=0\) — but its performance is bounded entirely by model accuracy; a 20% error in \(L\) can destabilize it. Use it when the delay is real and the model is trustworthy.

7.5 Cascade control

If a fast inner variable exists (valve pressure inside a temperature loop, motor current inside a position loop), close a fast inner PID around it and let a slow outer PID command the inner setpoint. Rule of thumb: the inner loop must be 3–5× faster than the outer, and you tune inside-out. The inner loop absorbs disturbances before the outer variable ever sees them — this is why cascades routinely outperform any single-loop tuning.

7.6 Gain scheduling

PID assumes a linear plant. If \(K, \tau, L\) swing with operating point (pH neutralization, level-dependent tank dynamics, airspeed-dependent aircraft), store a table of gains indexed by the operating variable and interpolate — the loop then preserves its closed-loop character while the plant changes underneath it. Modern twist: drive the schedule not by the operating point but by the measured phase margin, so the loop repairs its own robustness as the plant drifts.

7.7 Feedforward: don't ask feedback to do everything

Why add an open-loop path at all? Feedback only acts after a disturbance has already moved the output — it reacts to damage already done. If the disturbance \(d\) can be measured, a feedforward element \(G_{ff}(s)\) can push the actuator in the counter-direction immediately, ideally with zero error ever appearing. For a FOPDT plant the ideal feedforward is essentially the inverse of the plant's input channel, shaped for realizability,

\[ G_{ff}(s) \;=\; -\frac{G_d(s)}{G_u(s)} \;\approx\; -\frac{K_d}{K}\,\frac{\tau s + 1}{\tau_d s + 1}\,e^{-(L_d-L)s}, \]

where \(G_u\) is the plant's input-to-output transfer and \(G_d\) the disturbance-to-output transfer, with its own gain \(K_d\), time constant \(\tau_d\), and dead time \(L_d\). Why keep feedback anyway? Because the inverse is never exact: unmeasured disturbances, model error, and drift all accumulate. The division of labor: feedforward for the big, measurable, predictable disturbance (a pump starting upstream, a batch entering an oven), tuned one gain and one lead-time at a time; feedback for the residual. Because the feedforward carries the load, the PID can be tuned gentler — which is robustness for free.

\(r\)
−
\(e\)
PID \(C(s)\)
+
\(d\)
Plant \(G(s)\)
\(y\)
measurement
\(G_{ff}(s)\)
feedforward
Figure 6. Feedforward in parallel with feedback: the measured disturbance \(d\) is fed both into the plant and into \(G_{ff}(s)\), which launches the counter-action immediately; the PID only corrects what the model got wrong.
Takeaway: real PID work is mostly these seven refinements — filtering, anti-windup, 2-DOF, Smith, cascade, scheduling, feedforward — applied on top of a lambda-tuned baseline.

8. From algebra to code: the digital PID

Why a whole section on implementation? The clean continuous law of §1 is only ever approximated in silicon: a PLC scans every 100 ms, an ESC at 1 kHz, an ECU at 10 kHz, and between scans the actuator is held still (a zero-order hold). How you discretize changes what the loop actually does — a naive transcription of the ideal law kicks the actuator on every setpoint change, winds up in saturation, and pours noise into the plant through the derivative. Designing the gains is half the job; the code is the other half.

Three implementation decisions matter. (1) The integrator is not an integral. The discrete integrator is the accumulator \(I(n) = I(n-1) + \tfrac{K_c T_s}{T_i}e(n)\) — one line of code, but exactly where windup (§7.2) lives, so it must be coupled to anti-windup. (2) The derivative is a filtered difference, taken on the measurement, not the error. This kills derivative kick on setpoint changes and caps the noise gain. (3) Prefer the velocity (incremental) form. Output the change \(\Delta u\) and let the actuator integrate it: no integrator state to wind up or initialize, and a bump-free handoff when switching manual/auto.

\(r\)
−
\(e\)
\(P:\ \beta K_c e\)
\(I:\ \tfrac{K_c}{T_i}\!\int e\)
\(D:\ \) on \(y\),
filtered
+
\(v = P+I+D\)
sat
\(u\)
ZOH + \(G(s)\)
\(y\)
measurement
"S&H, \(T_s\)"
back-calculation \((v_{sat}-v)/T_t\)
Figure 7. One scan of an industrial PID. The integrator is an accumulator with back-calculation anti-windup (the saturation deficit \(v_{sat}-v\) is fed back into it, dashed); the derivative term is a filtered difference of the measurement; everything is sample-and-hold at \(T_s\).

The velocity form — the most common industrial implementation — is the difference of two successive position-form commands. For a pure (unfiltered) derivative on the error it reads

\[ \Delta u(n) = K_c\Bigl[\bigl(e(n)-e(n-1)\bigr) + \frac{T_s}{T_i}\,e(n) + \frac{T_d}{T_s}\bigl(e(n)-2e(n-1)+e(n-2)\bigr)\Bigr], \qquad u(n) = u(n-1) + \Delta u(n), \]

and in practice you replace the second difference by a filtered one exactly as below. Either form, the position form with the three anti-kick/anti-windup measures is what ships in a PLC library:

// one controller scan, executed every T_s seconds
e    = r - y;                                            // y = current measurement
P    = Kc*(b*r - y);                                    // b = setpoint weight, §7.3 (0..1)
I    = I + (Kc*Ts/Ti)*e;                                // integrator: backward Euler
I    = I + (Ts/Tt)*(vsat - v);                          // back-calculation anti-windup
D    = a*D + Kc*(Td*N/(Td + N*Ts))*(yold - y);          // filtered derivative on y, a = Td/(Td+N*Ts)
v    = P + I + D;                                       // pre-saturation command
vsat = clamp(v, umin, umax);                            // actuator limits
yold = y;   u = vsat;                                   // output to the ZOH

with the tracking time constant \(T_t \approx \sqrt{T_i T_d}\) (or \(T_t = T_i\) for a PI) and the derivative filter rate \(N \in [8,20]\) from §7.1.

How fast must \(T_s\) be? Discretization costs phase: the ZOH alone contributes \(-\omega T_s/2\) radians of lag, which is margin the control law must buy back. Two rules of thumb cover nearly every loop. Take the sample rate \(\omega_s = 2\pi/T_s\) roughly 10–30× the crossover \(\omega_c\): at 10× the ZOH eats ≈ 18° of phase margin, at 30× only ≈ 6° — and remember the derivative lead has to repay that debt. For delay-dominated plants take \(T_s \lesssim L/10\), so the dead time spans at least ten sample steps (and the Smith predictor of §7.4 gets resolution to work with). A too-slow \(T_s\) shows up as ringing and eventually a limit cycle; a too-fast one buys nothing but noise and CPU. The modern workflow: design in continuous time, discretize with a ZOH, then re-check the margins — the lab below lets you feel the degradation live.

Takeaway: implementation is where the ideal PID becomes an industrial PID — filtered derivative on the measurement, an accumulator with back-calculation, and a sample rate 10–30× the crossover.

9. The master view: loop shaping in the frequency domain

Why step back to frequencies? Every tuning rule in §4–§5 is a shortcut to the same underlying object: the complex loop gain \(L(s) = C(s)G(s)\). If you can read \(L(j\omega)\), you can read everything — how fast the loop is (crossover \(\omega_c\)), how robust it is (margins), how well it rejects low-frequency disturbances (sensitivity \(S = 1/(1+L)\)), how much noise it injects (complementary sensitivity \(T = L/(1+L)\)). Tuning then becomes what an experienced engineer actually does: loop shaping — placing the controller's corners so that \(|L|\) crosses 1 at the right frequency, with the right slope.

\[ C(s) = K_c\Bigl(1 + \frac{1}{T_i s} + \frac{T_d s}{1 + T_d s/N}\Bigr), \qquad L(s) = C(s)\,G(s) \]

Read the builder's pieces in Figure 8. Below \(1/T_i\) the integrator lifts \(|L|\) at +20 dB/dec — that lobe is your low-frequency disturbance rejection and the guarantee of zero steady-state error. Between \(1/T_i\) and \(1/\tau\) the loop rides on the proportional gain. Above \(1/T_d\) the filtered derivative adds +20 dB/dec of its own with a phase-lead hump; beyond \(1/\tau\) the plant's roll-off takes over. The frequency where \(|L| = 1\) — the crossover \(\omega_c\) — is your closed-loop bandwidth, and the phase still available there is your robustness.

\(\mathrm{dB}\)
\(\deg\)
\(\omega\)
0.1
1
10
100
\(|C|\)
\(|G|\)
\(|L| = |CG|\)
\(\angle L\)
Figure 8. Loop shaping at a glance for a FOPDT plant (\(K{=}1,\ \tau{=}10,\ L{=}1\)) under a PID (\(K_c{=}1.1,\ T_i{=}4,\ T_d{=}1.2,\ N{=}10\)). Top: magnitudes — the integrator lobe below \(1/T_i\), the derivative ramp above \(1/T_d\), the plant's corner at \(1/\tau\); the loop \(L\) crosses 0 dB at \(\omega_c\). Bottom: phase of \(L\); the margin between \(\angle L\) and \(-180°\) at \(\omega_c\) is the phase margin — here comfortably in the 30–60° target band.

The design recipe falls out of the picture. (1) Choose the crossover \(\omega_c\) from the delay: dead time alone spends \(\omega_c L\) radians, so keep \(\omega_c L \lesssim 0.5\) — the frequency-domain twin of \(\lambda \ge L\). (2) Place the integral corner \(1/T_i\) at roughly \(\omega_c/3\)–\(\omega_c/5\) (or cancel the plant lag outright, SIMC-style, \(T_i = \tau\)). (3) Place the derivative corner \(1/T_d\) near \(\omega_c/3\)–\(\omega_c/2\) with \(N = 8\)–10, so the lead hump peaks at crossover. (4) Set the gain so the loop crosses 0 dB exactly at \(\omega_c\):

\[ K_c \;=\; \frac{1}{\bigl|G(j\omega_c)\bigr|} \cdot \frac{1}{\Bigl|1 + \frac{1}{j\omega_c T_i} + \frac{j\omega_c T_d}{1 + j\omega_c T_d/N}\Bigr|} \]

(5) Read the margins; iterate until \(\varphi_m \in [30°,60°]\) and \(g_m \ge 6\) dB. Margins translate directly to feel: for a second-order-dominant loop the phase margin and damping are one-to-one, \(\zeta \approx \varphi_m/100^\circ\), and overshoot follows \(e^{-\pi\zeta/\sqrt{1-\zeta^2}}\) — so PM ≈ 60° ≙ \(\zeta\) ≈ 0.6 ≙ ≈ 9% overshoot, PM ≈ 45° ≙ ≈ 20%, PM ≈ 30° ≙ ≈ 37%. Tuning is choosing your overshoot, disguised as geometry.

Takeaway: loop shaping is the master recipe — every term is a corner on a Bode plot, \(\omega_c\) is your speed knob, and the margins at the two crossings are the acceptance test.

10. Modern PID variants: more exponents, more knobs

10.1 Fractional-order PID: \(PI^\lambda D^\mu\)

Why fractional exponents? The integer PID is stuck with a fixed phase story: the integrator donates up to −90°, the derivative up to +90°. Two extra exponents build intermediate slopes and, crucially, let you hold the loop phase nearly flat across the crossover band. A loop whose phase is flat at \(\omega_c\) is iso-damping: overshoot stays almost constant while loop gain drifts (a valve wearing, a load moving, a gain-varying plant) — robustness you would otherwise buy with gain scheduling. The law

\[ C(s) = K_p + \frac{K_i}{s^\lambda} + K_d\, s^\mu, \qquad \lambda,\mu \in (0,2), \]

reduces to the ordinary PID at \(\lambda = \mu = 1\). How is it built — and why is an engineer allowed to trust it? There is no exact discrete realization of \(s^\alpha\), so you approximate it over the band that matters with a rational filter; the standard tool is the Oustaloup recursion

\[ s^\alpha \;\approx\; K\prod_{k=-N}^{N}\frac{s+\omega'_k}{s+\omega_k}, \qquad \omega'_k = \omega_l\Bigl(\frac{\omega_h}{\omega_l}\Bigr)^{\frac{k+N+\frac{1-\alpha}{2}}{2N+1}}, \qquad \omega_k = \omega_l\Bigl(\frac{\omega_h}{\omega_l}\Bigr)^{\frac{k+N+\frac{1+\alpha}{2}}{2N+1}}, \]

valid on \((\omega_l,\omega_h)\) — so a "fractional" PID in firmware is really an integer PID dressed in a \(2N{+}1\)-tap IIR filter per fractional term; pick the band to bracket \(\omega_c\) and \(N = 5\)–10. Tuning now has five knobs: choose \(\lambda,\mu\) to satisfy the flat-phase constraint \(\tfrac{d}{d\omega}\angle L\big|_{\omega_c} = 0\) together with the usual margin targets — or simply run a numerical optimizer over the five gains minimizing ISE/ITAE subject to the margins. Where they earn their keep: motion control, fuel cells, flexure stages, temperature rigs whose gain drifts with the operating point and refuses to behave like a constant FOPDT.

\(\angle C\)
\(\omega\)
integer PID: sharp phase hump
fractional \(\lambda,\mu\): flat shelf near \(\omega_c\)
\(\omega_c\)
Figure 9. The phase curves of an integer PID and a fractional \(PI^\lambda D^\mu\) on the same axes. The integer controller's phase swings sharply and peaks (a hump); choosing \(\lambda,\mu\) trades that hump for a wide, flat phase shelf through \(\omega_c\) — the iso-damping property that makes overshoot nearly gain-invariant.

10.2 PID inside the modern toolbox: LQR, \(H_\infty\), MPC

Where does PID sit next to "modern control"? Write the PID as state feedback and the family resemblance appears: the integral term is a state (accumulated error), the derivative is an observer's estimate of \(\dot y\), and \(K_c\) feeds back \(y\) itself. For a second-order plant plus an integrator state, full-state feedback is a PID — so LQR is literally a tuning rule: choose \(Q, R\) (the performance/effort weights) and out come the three gains. Deeper still, every modern method answers the same two questions tuning answers — how fast, how robust — with more machinery: \(H_\infty\) loop shaping optimizes a robustness norm instead of checking a margin; MPC adds constraints, preview, and MIMO coupling, and its offset-free variants keep the integrator that PID made famous. If you can phrase the problem as "three gains and a phase margin", a well-tuned PID is still the cheapest, most transparent, most auditable controller in existence; reach for the bigger guns when constraints or multivariable coupling force you to.

Takeaway: the modern PID family adds knobs — setpoint weights, filter rates, fractional exponents, LQR-shaped gain vectors — but every knob earns its place only by improving the phase/margin story, not by being fashionable.

11. Interactive laboratory

Everything above, live. Set the plant, choose gains (or press a tuning-rule button), and watch the step response and the control effort. New in this build: slide the noise slider to feel how the derivative amplifies measurement noise; raise \(T_s\) to feel discretization degrade the loop; and read the live margins — the §5.3 acceptance test, computed on the continuous loop and updated with every slider move. Notice: how Z–N's speed comes from control violence; how SIMC's \(\lambda\) slider trades speed for smoothness monotonically; how the loop falls apart when you push \(K_c\) near \(K_u\).

blue: output \(y\)  ·  dashed orange: setpoint  ·  green (lower band): control effort \(u\) (scale at left)
Takeaway: tuning is a felt tradeoff — speed, damping, robustness, and actuator effort are four currencies, and you spend one to buy another.

12. Where this fits in control theory

PID is not a primitive trick — it is the tip of a pyramid, and every floor above it is the same ideas wearing more formal clothes. The IMC derivation in §5.1 is one instance of model-based design: plant inversion plus a filter — the same construction that grows into \(H_\infty\) loop shaping when "robustness" becomes a norm to optimize rather than a margin to check (and for a FOPDT the IMC/SIMC choice is, in fact, \(H_2\)-optimal). Ziegler–Nichols' ultimate point is one point of the Nyquist curve; relay autotuning is a describing-function experiment; the Smith predictor is a special case of the general principle that feedback cannot beat information delay; fractional-order PID is a low-order stand-in for the flat-phase robustness that CRONE and \(H_\infty\) achieve by other means; and as §10.2 showed, LQR + observers generalizes PID's "present + past + predicted future" to many states, with MPC inheriting the integrator for offset-free tracking while adding constraints and coupling.

How mature is the field? The core ideas are 1942-era, but the practice keeps modernizing: relay autotuning, lambda/SIMC rules, margins-based certification, digital implementation hygiene, and the fractional-order family are all products of the last four decades, and they are what industrial autotuners and computer-aided tuning (MATLAB pidtune, python-control, FOMCON) ship today. Master PID deeply — the loop, the margins, the code — and every more advanced method becomes a refinement of intuitions you already have. Which is why, eighty years on, an estimated 95% of industrial control loops still run it.

Takeaway: PID tuning, done properly, is introductory control theory wearing work boots.

Further reading