◄ WORLD II · THE FOLDTHE OCHO · blue builds │ the machine │ red breaks

THE PID CONTROLLER

Three gains, no model, and ninety percent of the world's control loops. Multiply the error by Kp, its running sum by Ki, its slope by Kd — add them, feed the plant, watch the loop close. The integral erases the steady offset; the derivative tames the overshoot; push either too hard and the whole thing shakes apart. Down the center: the error goes in, three terms sum, the response comes out. Blue builds it; red breaks it.

source N. Minorsky, Directional Stability of Automatically Steered Bodies, J. Amer. Soc. Naval Engineers 34(2):280–309 (1922), DOI 10.1111/j.1559-3584.1922.tb04958.x — 1922 print, no open scan (AMBER). Rendered, not quoted.

◧ blue team · builds & defends
3

THE MODEL — plant & loop

The plant is a fixed second-order body: G(s) = 1/(s²+2s+1), a double pole at −1 (open-loop A = [[0,1],[−1,−2]]). No model enters the controller — only the error e = r − y.

The control law is three tuned gains:

u = Kp·e + Ki·∫e dt + Kd·de/dt

Closing the loop gives the cubic characteristic s³ + (2+Kd)s² + (1+Kp)s + Ki. Live coefficients for the current gains:

α₂ (s²)α₁ (s¹)α₀ (s⁰)
5

THE LINEAGE — control without a model

PID is the model-free special case of full state feedback: instead of a gain vector on measured states, it feeds back only the output error and two operators on it — one memory (∫), one prediction (d/dt).

Give it the states and a plant and it becomes the-state-space feedback u = −Kx. Strip the model away and three tuned knobs remain — the loop that steers ships (Minorsky's New Mexico), holds thermostats, and levels quadrotors. Each sphere is the next one's premise.

7

THE WITNESS live

The blue team's live check: re-simulate the reference PI loop and confirm its steady-state error is zero, that P-only leaves an offset, and that the derivative sweep damps. If red removes the integral, this badge is where it shows.

▼ the machine ▼
4

DATA IN — the error in ↓

The reference is a unit step: r jumps to 1 at t=0. The output y starts at 0, so the error e = r − y starts at 1 and is what the controller sees — never the plant's internals.

Three things are read off that one error signal each instant:

termreadsgain
Pe nowKp
I∫e (history)Ki
Dde/dt (trend)Kd

Sum the three, send u to the plant — that is the whole machine. It is fed to the engine below.

▼   sum the three terms into u   ▼
0

▣ THE PANEL — the engine LIT

P term
I term
D term

Terms shown are the controller output at the moment of peak error.

Every curve is an RK4 simulation of the closed loop — the steady-state error and overshoot are measured off it, never looked up. Stability is the Routh test on the live cubic.

▼   the loop settles — read the result   ▼
8

DATA OUT — the result out ↓

What the machine proves, live: with Ki>0 the step settles to exactly r — steady-state error 0 (final value within 1e-6). Kill the integral and a fixed offset a/(a+Kp) = 1/(1+Kp) remains. Raising Kd across 0→1.5 drives the overshoot monotonically down; raising Ki past (2+Kd)(1+Kp) tips the loop unstable.

The witness (left) confirms these live; the red team (right) tries to make them lie.

red team · attacks & breaks ◨
1

THE ADVERSARY

WALL PID is blind. With no model it cannot anticipate — only react to error already made. It has no notion of constraints, and pure derivative amplifies measurement noise without bound, so real loops must filter D and clamp the integrator (anti-windup) or it saturates and overshoots wildly.

Three scalar gains cannot place three-plus poles independently, handle dead time, or decouple multivariable plants. For those you need the model PID throws away — the state-space, MPC, robust designs. PID is not the controller; it is the proof that three numbers steer most of the world.

2

THE GRAVEYARD

"More gain is always better control." Cut. Past the Routh boundary (2+Kd)(1+Kp) < Ki the loop diverges — verified in the engine at Ki=40.

"The derivative term always reduces overshoot." Cut. Only up to a point: the fixed controller zero at −Ki/Kp means very large Kd brings overshoot back. The witness sweeps only the monotone region 0→1.5.

"P-only can be tuned to zero error." Kept, corrected. Its offset shrinks with Kp but is a/(a+Kp) > 0 for any finite gain — only ∫ removes it exactly.

6

THE TAMPER — break it

The red team's move: quietly set Ki = 0 — delete the integral action — while still claiming "steady-state error is zero." The blue witness (window 7) is watching.

With the integral gone, the residual proportional offset 1/(1+Kp) is nonzero — so the "error is 0" check fires. The witness re-simulates, finds the offset, and turns red. The attack is real and it is caught.