Controllers from PID to QP-MPC

Interactive simulators tracing the evolution of feedback control — all applied to the same DC motor servo.

"Four generations of engineers looked at the same motor and came up with four radically different answers. Not because the motor changed, but because what they had available changed."

PID → LQR / LQI → QP-MPC → Nonlinear MPC
🎙️
Classical · SISO

PID Explorer

Start here. Tune Kp, Kd, Ki on a 2nd-order plant and watch the pole-zero map update in real time. Build intuition for what each term does before moving to real motors.

ζeff ωn,eff poles × zeros ∘ 7 presets
🗜️
Real Physics · DC Motor

Servo Motor PID

Apply PID to a brushed DC motor with real parameters — R, L, Kt, J, B. Voltage saturation, anti-windup, and disturbance torque injection show where classical control meets physics.

3rd-order motor ±Vmax saturation τdist stiff ODE guard 7 presets
📉
Compensator · Bode · Loop Shaping

Lead / Lag Compensator Explorer

Design lead and lag compensators interactively on a 2nd-order plant. Tune α, β, K and watch the Bode plot and step response update in real time. See phase margin at the 0 dB crossover with guide lines.

lead & lag sliders dual-axis Bode PM & GM readout step response TF display
🌀
Root Locus · Pole Placement · Gain Design

Root Locus Explorer

Click to place poles and zeros, then drag K to see the closed-loop poles trace the root locus. Watch branches emerge, break away, and cross the imaginary axis. The missing link between “turn the gain” and “the poles move like this.”

click-to-place p/z K slider 0→∞ branch tracing step response 5 presets
🔍
PRBS · Least Squares · Model Fitting

System Identification Explorer

A plant hides behind a black box. Excite it with a PRBS, collect I/O data, fit an ARX model via least squares, and validate on held-out data. The missing first chapter: where A, B, C, D actually come from.

4 hidden plants PRBS excitation least-squares fit train/val split step response compare
🎯
State Feedback · Eigenvalue Design

Pole Placement Explorer

Choose K to place the eigenvalues of A−BK exactly where you want them. Drag poles on the s-plane, tune k₁ and k₂, and watch the closed-loop response obey the eigenvalues you chose. The bridge from “what are eigenvalues?” to “I design with them.”

s-plane pole map click-to-place poles k₁, k₂ sliders A−BK readout 7 presets
🧮
Optimal · MIMO

LQR Explorer

Tune cost weights Q & R instead of gains. The CARE solver returns the mathematically optimal state-feedback matrix K. Overlay PID to see how classical tuning compares to optimal control.

LQI (4-state) CARE solver PID overlay kθ feedforward 6 presets
👁️
Luenberger · Kalman · Output Feedback

Observer Explorer

LQR gives u = −Kx, but you only measure position. Design a Luenberger observer to estimate hidden states (ω, i), add noise, and watch the separation principle in action — the missing half of every real controller.

Luenberger observer pole placement noise injection separation principle 5 presets
🧩
Constrained · Receding Horizon

QP-MPC Explorer

Hard constraints enter the optimization. A QP solver finds the best control sequence that respects ±Vmax and ±Imax. Parallel LQR simulation proves the constrained optimum is structurally different from simply saturating LQR.

online QP solver prediction horizon LQR comparison V & I limits N=3–30
📈
Transfer Function · Intuition

Zero-Effect Explorer

Deep-dive on zeros: why derivative action speeds things up, why RHP zeros impose hard bandwidth limits, and how multiple zeros compound. The transfer-function view that explains why the controllers above behave the way they do.

LHP & RHP zeros up to 3 zeros combined trace 7 presets
📡
Sensor · Bandwidth Limit · Positive Feedback

Sensor Bandwidth Explorer

What happens when your sensor is bandlimited? The feedback path H(s) ≠ 1 introduces a hidden positive feedback loop. Slide Kp up or ωs down and watch the red trace diverge while the blue trace stays stable — the sensor sets a hard ceiling.

ideal vs real sensor step response pole migration PM & BW readout stability status
🧬
ADRC · ESO · Disturbance Rejection

ADRC vs PID Explorer

Active Disturbance Rejection Control — three knobs replace dozens of PID parameters. An Extended State Observer estimates and cancels the total disturbance in real time. Compare step response, disturbance rejection, and parameter-shift robustness side-by-side.

ωc, ωo, b0 tuning ESO f̂(t) estimate disturbance types param shift test ISE & peak|u|
Deep Dives
🧩
Framework · Nine Problems

Core Problems in Controller Design

Every controller, from PID to nonlinear MPC, is an answer to the same nine fundamental problems — measurement, inertia, constraints, uncertainty, disturbances, nonlinearity, stability, computation, and trade-offs. The framework that explains why the field evolved the way it did.

9 problem taxonomy Luenberger & Kalman H∞ & robustness evolutionary arc table separation principle
📐
Fundamentals · ODE

Poles, Zeros & Differential Equations

Every transfer function is a differential equation in disguise. Learn why a pole at −σ + jω means oscillation at ω rad/s with decay e−σt, and how zeros determine which modes the input excites.

ODE ↔ TF mapping homogeneous modes zero residues root locus via ODE
🧮
Fundamentals · Modal Analysis

Eigenvalues & Eigenvectors in Control

Why does modern control theory orbit around Ax=λx? From geometric intuition through pole placement, LQR, Kalman filters, and the separation principle — the 31-section deep dive that connects linear algebra to every controller you will ever design.

eigenvalue ↔ pole proof modal coordinates z PBH test diagonalization pole placement & LQR
⚡
PD · Properness · Practice

Why Pure PD Is Unimplementable

Theory says pure PD can't exist — improper transfer function, infinite HF gain. Yet your MCU code runs fine without a dedicated LPF. The answer: your hardware already contains four implicit low-pass filters.

causality & properness noise amplification filtered derivative implicit LPFs when it fails
🎛️
IP · Set-Point Filter · 2-DOF

The IP Controller

Kill overshoot without touching disturbance rejection. Move the proportional term from the error to the feedback path, and the closed-loop zero disappears. Equivalent to a first-order low-pass filter on the reference — and the algebra is exact.

proportional kick filter equivalence 2-DOF architecture bumpless transfer three lines of C
📉
Compensator · Bode · Loop Shaping

Lead and Lag Compensators

Shape the Bode plot directly instead of tuning error responses. Place poles and zeros to add phase margin (lead) or boost low-frequency gain (lag) — the systematic design method that dominated control before LQR. Lead ≈ PD, lag ≈ PI, lead-lag ≈ PID.

lead & lag TF phase bump formula design procedure Tustin discretisation PID connection
💧
Bode · Limits · Trade-offs

The Waterbed Effect

Bode's sensitivity integral says you can't cheat physics: reduce error at one frequency and it must increase elsewhere. The single most important theoretical result for understanding why every controller is a compromise.

Bode integral proof waterbed metaphor RHP poles/zeros design implications PID/LQR/MPC
⏱️
s → z · Tustin · Aliasing

Digital Control & Sampling

All real controllers run in discrete time. What changes when you go from s to z: aliasing, the ZOH, Tustin discretisation, and why a pole at s=−100 becomes z≈0.9, not z=0.

ZOH & aliasing z-transform mapping Euler / Tustin / ZOH w'-transform implementation guide
🧶
Nested Loops · Motor Drives · Bandwidth

Cascaded Control Loops

Real motor drives don't use one PID — they use three nested loops: current (fastest), velocity, and position (slowest). Why cascade works, how to tune each layer, and why this is the standard industrial architecture.

current/vel/pos cascade bandwidth separation anti-windup per layer inner-loop approximation vs full-state LQR
📡
ARX · PRBS · Least Squares

System Identification

Every controller needs a model. Where does A, B, C, D come from? From data. ARX, ARMAX, OE structures, PRBS design, least-squares fitting, and the validation tests that keep you honest.

ARX/ARMAX/OE normal equations PRBS rules of thumb cross-validation d2c conversion
🧮
Luenberger · Kalman · Duality

Observer Design

You never measure the full state. The Luenberger observer runs your model in parallel and corrects it with measurements. Kalman filters make it optimal. The separation principle lets you design K and L independently.

Luenberger structure pole placement 2–5× Kalman optimality duality theorem separation principle
📡
Sensor · Bandwidth · Geq(s)

Sensor Bandwidth: The Hard Ceiling

Every controller assumes it sees the truth. A bandlimited sensor introduces a hidden positive feedback loop: Geq(s)=GC/(1+GC·(H−1)). Phase margin is the first casualty; the equivalent forward gain diverges as GC→1 above ωs. If you can't measure it, you can't control it.

Geq derivation positive feedback phase margin ceiling practical limits table 5 mitigations
🛡️
Saturation · Clamping · Back-Calculation

Anti-Windup

Every actuator saturates. When your integrator keeps accumulating while the output is clipped, it winds up — and dumps it all when saturation ends. Clamping, back-calculation, and why MPC doesn't need any of this.

windup mechanics clamping & conditional back-calculation observer-based AW MPC vs AW
📅
Nonlinear · Interpolation · LPV

Gain Scheduling

Your plant is nonlinear but you only know how to design linear controllers. Design at multiple operating points, interpolate the gains — and hope. The practical method that ships in every aircraft flight control system.

scheduling variables grid-point design hidden coupling trap bumpless transfer LPV upgrade path
🧬
ADRC · ESO · Han · Model-Free

ADRC: The Controller That Doesn't Need a Model

Jingqing Han's radical idea: don't model the plant, estimate the gap between the plant and an integrator. The Extended State Observer lumps all unknowns into f(t) and cancels them. Three knobs replace PID's dozen. In the voice of Richard Feynman.

ESO derivation bandwidth tuning PID → ADRC limit PMSM & F-16 apps 20-line C impl
🧬
ADRC · ESO · 中文

自抗扰控制:不需要模型的控制器 (中文)

韩京清的激进思想:不去建模对象,而去估计对象与积分器之间的差距。 扩张状态观测器把一切未知量塞进 f(t) 并抵消它。三个旋钮取代 PID 的十几个。 以理查德·费曼的口吻写就。

ESO 推导 带宽整定 PID → ADRC 极限 PMSM 与 F-16 应用 20 行 C 实现
🎯
MRAC · Lyapunov · MIT Rule · Adaptation

MRC: The Controller That Changes Itself to Match a Dream

Model Reference Control forces the plant to impersonate a better plant. MIT rule, Lyapunov-based adaptation, direct vs indirect MRAC, the persistency-of-excitation problem, and why ADRC won the servo market. In the voice of Richard Feynman.

MIT rule derivation Lyapunov MRAC proof direct vs indirect ADRC duality proof PE & Rohrs example
∞
H∞ · Uncertainty · Mixed Sensitivity

H-Infinity Robust Control

Your model is wrong. LQR optimises for the nominal plant; H∞ designs for the worst-case plant in an uncertainty set. Shape S, T, and KS with frequency weights — and get guaranteed robustness margins.

uncertainty sets S/T/KS shaping weighting functions DGKF solution order reduction
🧠
Bellman · Riccati

Bellman to LQR

How a 1950s idea about "optimal remaining paths" leads directly to the Riccati equation. Dynamic programming, the value function ansatz, and why LQR stays quadratic at every step — with a worked 1D example.

Bellman principle Riccati recurrence CARE / DARE worked 1D example
⚖️
CARE · DARE · Time Domain

CARE vs DARE

Two algebraic Riccati equations, one idea. Why discrete and continuous LQR produce different equations, when to use each, and how the Δt → 0 limit connects them. In practice: use DARE — all real controllers run on digital hardware.

DARE CARE gain comparison Δt → 0 limit practice guidance
🧬
Youla · Convexity · Meta

Youla Parameterization

One knob, all controllers. Pick any stable Q(s) and you get a stabilizing controller. PID, LQR, H∞, MPC — they're all points in the same convex set, selected by different objectives. The result that turned control design from art into engineering.

IMC warm-up coprime factorization affine in Q convex optimization bumpless transfer
📈
Optimization · Condensing

From LP to QP to LQR

LP finds the cheapest way. QP prefers small moves. LQR finds the best sequence for a dynamic system. MPC connects them by condensing LQR into a QP at every time step — the computational engine of modern control.

simplex & interior point condensing QP-MPC bridge robot IK via QP
🎯
Tracking · LQR + MPC

Trajectory Tracking with LQR & MPC

Regulation asks "push to zero." Tracking asks "follow this moving target." The feedback gain doesn't change at all — just add a feedforward term that translates the reference into control space.

feedforward design error coordinates reference trajectory LQR & MPC tracking
🌀
Nonlinear · Advanced

Beyond Linearity: Nonlinear MPC

What happens when x_{k+1} = f(x_k, u_k) instead of A x_k + B u_k. DDP, SQP, and the tools that replace Riccati equations when dynamics go nonlinear — a tour of what breaks and how the field has responded.

DDP / iLQR SQP non-convex cost real-time iteration
🎙️
Audio · Feedback · Bruno Putzeys

Why Audio Amp Design Speaks a Different Language

An audio power amplifier IS a feedback control system. So why do the textbooks, measurements, and tribal disputes look nothing like control theory? The 1970s feedback wars, the THD vs phase margin divide, and what each tribe can learn from the other — in the voice of Bruno Putzeys.

feedback wars (Otala/TIM) jargon translation table S(s) = THD reduction factor class D = switching control damping factor myth
🎙️
音响 · 反馈 · Bruno Putzeys

为什么音响功放设计与控制理论说着不同的语言

一台音响功放就是一套反馈控制系统。为什么教科书、测量方法和部落争端看起来和控制理论完全不同?1970 年代的反馈战争、THD vs 相位裕度的测量鸿沟,以及两个部落能从对方学到什么——以 Bruno Putzeys 的口吻写成。

反馈战争 (Otala/TIM) 术语对照表 S(s) = 失真降低因子 D 类 = 开关控制 阻尼系数的迷思
🎧 Podcast
50 min · English

The Century of Feedback

A deep-dive podcast tracing the 250-year evolution of feedback control — from James Watt's flyballs through Maxwell, the PID pioneers, the Space Race LQR revolution, to SpaceX rocket-landing QP-MPC. Stories of the inventors, their spark ideas, and the historical forces that drove each generation's answer.

Watt & Maxwell Sperry & Minorsky Ziegler & Nichols Bellman & Pontryagin Kalman & Apollo Richalet & Cutler Mayne & QP-MPC
🎧 播客
50 分钟 · 中文

反馈的世纪:控制理论演化史

追溯反馈控制二百五十年的演化史——从瓦特的飞球到SpaceX的火箭着陆。 每位发明家的故事,每个思想的火花,串联成一个完整的工程史诗。中文版。

瓦特 & 麦克斯韦 斯佩里 & 米诺尔斯基 齐格勒 & 尼科尔斯 贝尔曼 & 庞特里亚金 卡尔曼 & 阿波罗 理查莱 & 卡特勒 梅恩 & QP-MPC