You can read about P, I and D forever — tuning only clicks when you feel the loop fight back. This is a live closed-loop: a real first-order process with deadtime, controlled by a PID you tune with three sliders. Step the setpoint, kick it with a disturbance, and watch overshoot, settling and steady-state error move as you turn each knob. Break it on purpose, then make it beautiful.
The controller looks at error = setpoint − process value, and sums three responses. Each has one job — and one failure mode if you overdo it.
🟦 P — Proportional (Kp): push in proportion to the present error. More Kp = faster & stronger, but too much = oscillation. P alone leaves a permanent offset.
🟩 I — Integral (Ki): accumulate past error until it's gone — this is what kills the offset. Too much = sluggish overshoot and windup.
🟨 D — Derivative (Kd): react to the rate of change — anticipate and damp. Calms overshoot, but amplifies noise, so it's used sparingly (often zero).
➕ Output = Kp·e + Ki·∫e + Kd·(de/dt), clamped to 0–100%. The art is balancing the three so the process reaches setpoint fast, flat and stable.
The grey line is your setpoint; the orange line is the process value chasing it; the faint blue is the controller output. Drag the knobs and watch the response redraw live. Try a preset, then hit Step setpoint or Disturbance to test it.
Don't twiddle randomly. The classic manual recipe gets you 90% there in minutes:
📐 Ziegler–Nichols formalises step 1: find the ultimate gain Ku (where it oscillates) and period Tu, then for a classic PID set Kp = 0.6·Ku, Ki = 1.2·Ku/Tu, Kd = 0.075·Ku·Tu. It's aggressive — a great starting point, rarely the final answer.
📈 Integral windup
When the output saturates (100%), the integral keeps piling up — so when you finally reach setpoint it massively overshoots. Fix: clamp the integral (anti-windup) when the output is maxed.
⚡ Derivative kick
A step change in setpoint makes de/dt spike, slamming the output. Fix: compute D on the process value, not the error ("derivative on measurement").
📻 Noise amplification
D multiplies high-frequency noise into a jittery output that wears valves. Fix: filter the input or keep Kd small/zero on noisy signals.