PID: Three Letters That Run the World
Push proportionally to the error, remember what refuses to close, brake before you arrive. Present, past, future — every factory floor hums with this one line.
Builds on: 3.1 Feedback: Why On/Off Must Wobble
Same idea, other course:Spark: PID on real hardware
P: push like you mean it, proportionally
Replace bang-bang’s two settings with a dial: effort proportional to error, u = Kp·e. Far from the target, push hard; close, ease off. One gain to tune, and the behaviour is already recognisably civilised — mostly. Two failures remain. Set Kp timidly and the system crawls; worse, a steady disturbance (gravity on an arm, a hill under a cart) leaves a permanent steady-state error — P needs some error to output any effort at all, so it settles where push equals pull, short of the target. Set Kp fiercely and you re-invent bang-bang with extra steps: overshoot, oscillation.
I: the grudge. D: the brake
The integral term accumulates error over time — a grudge account. That stubborn last half-degree that P alone would tolerate forever? It builds in the sum until the controller pushes it away. I erases steady-state error. Its dark side: during long errors the grudge overfills (windup) and spends itself as a wild overshoot on arrival.
The derivative term watches the error’s speed. Closing fast on the target? D pushes against the rush — a brake applied before arrival, which is exactly what kills overshoot and calms oscillation. Its dark side: differentiating a noisy sensor amplifies every jitter into effort, so real D terms are always filtered, and often small.
Tuning without tears
The bench recipe, good enough for nearly everything: zero out I and D. Raise Kp until the response oscillates, then back off a third. Add a whisper of D to squash the remaining overshoot. Add just enough I to close the last stubborn gap — and no more. Tune in that order, one knob at a time, watching a plot. You will do exactly this in the lab, and again — under race conditions — in the capstone.
Fancier control exists and Unit 6 gestures at it. But PID needs no model of the world — only the error signal — and that ignorance is a superpower: it works on ovens and quadcopters alike, unchanged. Estimates put PID in the vast majority of all industrial loops. Learn its three temperaments and you can talk to most of the machines on Earth.
⚗️ Lab — The Tuning Bench
A weighted arm commanded to hold an angle — gravity is the steady disturbance. Three gain sliders, a live plot, and readouts for overshoot, settling and the leftover gap.
- P only: raise Kp till it oscillates, back off. Note the arm hangs stubbornly below the target — the steady-state error.
- Add I and watch the last gap close… then set Ki huge and watch windup fling the arm past the mark.
- Add D to calm the arrival. Then follow the full recipe and log your best settling time.
Work it by hand — 0 / 2
No multiple choice here: compute the value and type it. Suffixes like 2.5k or 20m are understood; answers within ±2% count.