Robotics core · topic B6 · 50 hours
Modern control (state space / LQR / MPC)
Multi-input multi-output systems (humanoids, quadrupeds, drones) cannot be PID-tuned into existence — state space is mandatory.
What to learn
- State-space modeling, and the physical meaning of controllability and observability
- LQR: the Q-versus-R trade-off is «how much control effort buys how fast a convergence»
- MPC: receding-horizon optimization, prediction horizon, constraint handling — and why it fits constrained robots naturally
- Where MPC sits in a real stack: usually 50–100 Hz at the planning layer, 1 kHz reserved for the inner loops
The lesson · plain words
Classical control watches one error at a time; modern control supervises all the states together. The core move is two steps: write the system as ẋ = Ax + Bu, then ask «where do the closed-loop poles go».
Do not let the symbols scare you. A just says «how the state evolves on its own»; B says «how the input pushes it». What actually decides the feel is a geometry question: where the poles sit in the complex plane.
State space: a handful of numbers that remember the past
Position control tracks one number, but the spring-mass block's future also depends on its velocity. Pack position and velocity into one vector x — that is the state: everything the past imposes on the future, compressed into a few numbers.
ẋ = Ax + Bu reads: the state evolves by itself through A; the control u pushes it through B. The output y = Cx picks out the part you can measure.
Where the poles sit is how the response looks
Drag the pole pair below: the real part sets speed — more negative, faster decay; the imaginary part sets ringing — bigger, harder shaking; slide the real part past 0 into the right half-plane and the response diverges outright.
«Pole placement» means designing the gain K so the closed-loop poles land where you chose. Sounds great, until the gains turn out absurdly large — the motors give up. That is where LQR comes from.
Interactive figure · drag it and see
LQR: pole placement without hand-tuning
LQR turns «tuning» into a well-posed problem: minimize state deviation² × Q + control effort² × R. It automatically balances «converge fast» against «spend little effort».
In practice you only tune the Q/R ratio (echoing A2's conclusion): Q relatively larger — fast response, power-hungry; R relatively larger — gentle and slow. Absolute magnitudes do not matter; the ratio decides everything.
MPC: look a few steps ahead
LQR only optimizes the present; MPC solves a small optimization every step: total cost over the next N steps, under every constraint (limits, torque caps, obstacles) — execute the first move, re-solve at the next step.
The price is compute: a QP every millisecond. What you buy is the only control framework that handles constraints explicitly — which is why humanoids, quadrupeds, and drone racing all run it.
Three questions — do you really get it?
1. A closed-loop pole with real part greater than 0 means?
- AFaster response
- BThe system diverges — unstable, period
- CLarger steady-state error
Show answer
B. The real part is the decay rate; positive means exponential growth. Any noise gets amplified without bound — a hard boundary.
2. What really decides the feel of an LQR?
- AThe absolute values of Q and R
- BThe sampling period
- CThe ratio of Q to R
Show answer
C. Scale both by the same constant and the solution is unchanged. A big ratio favors state accuracy; a small ratio favors saving effort.
3. MPC's biggest advantage over LQR?
- AIt computes faster
- BIt needs no model
- CIt handles constraints explicitly
Show answer
C. MPC optimizes inside the constraints at every step, respecting limits and caps by construction. The cost: an optimization solve at every step.
Keep going deeper
Links without a marker stay on this site; the rest point to the Chinese edition until its translation batch lands.
How it fails in the field
- LQR perfect in simulation, diverging on hardware because the model never contained the latency
- An MPC prediction horizon shorter than the execution period — that is not prediction
You have learned enough when
The Chinese edition carries the full topic page for Modern control (state space / LQR / MPC), including the complete outline, depth requirements per career track, and further derivations: robotguide.dev/k/B6/.