κυβερνήτης · the helmsman
↖ every letter is a closed-loop system: swipe or click to disturb it
Control theory in the browser. How do you make a machine do what you want?
Every machine that holds a temperature, balances on two wheels or lands on a barge is running a feedback loop: measure, compare, correct, dozens of times a second. These demos build that idea up in four steps. You can't even hold a car at a steady speed → PID. You can't balance a broomstick → state space & LQR. You can't land a rocket → everything at once, in the wind, on dwindling fuel. And the twist: in the real world you don't even know where you are → the Kalman filter. Try each one by hand first. Then watch the controller do it better.
I spent a chunk of my Mech Eng PhD around control systems and taught this material to undergraduates. These are the demos I wish I'd had in the lecture theatre: the intuition, with the maths one hover away.
01 · The Present, the Past, the Future
Hold a car at a target speed, by hand and then with the controller that runs most of the industrial world. Tune Kp, Ki, Kd live; meet steady-state error, overshoot and integrator windup on a hill.
Drive →02 · State Space
Balance an inverted pendulum on a cart: by hand (good luck), with PID on the angle alone (watch the cart run away), then with LQR: four gains from a Riccati equation solved live in your browser. Drag the flag and it balances and drives.
Balance →03 · The Showpiece
A thrust-vectored rocket, gusty wind and a fuel tank that empties as you burn. Fly it by hand (you'll crash), then compare a cascade of PID loops, LQR and a bang-bang suicide burn: the cheapest landing with the thinnest nerves.
Light the engine →04 · The Twist
Control assumes you know the state. You don't, because sensors lie. Guess a hidden boat's position from its scattered fixes, then watch the filter beat both you and its own sensor, with the uncertainty ellipse breathing, honest even during a GPS outage.
Find the boat →