← antimony labs

controls

Control theory is how you make a real, sluggish, noisy thing track a set-point you actually want. Measure → compare → push → repeat. This page starts where most courses start — a damped second-order plant and a PID controller — but lets you turn the knobs first and read the math second.

PID step response

Plant G(s) = 1 / (s² + 0.4 s + 1). Controller u = Kp e + Ki ∫e dt + Kd ė. Setpoint steps from 0 → 1 at t = 0.

rise time
overshoot
settling (±2%)
steady-state err
what to try
  • Pure proportional (Ki=Kd=0): bump Kp. Faster, but watch the steady-state offset linger.
  • Add integral: offset disappears, but the overshoot grows and settling time blows up.
  • Add derivative: overshoot calms down — D acts on the rate of change, so it brakes before you hit the wall.
  • Ziegler-Nichols ballpark: Kp≈3.0, Ki≈1.5, Kd≈0.7.

where this is going

Ten short lessons, each with a sandbox like the one above. Built in order.

  1. 01Feedback. Why measure-and-correct beats open-loop, even when your model is wrong.
  2. 02PID. The three knobs that go further than they deserve. live above ↑
  3. 03Transfer functions. What a system is, written in s.
  4. 04Poles & zeros. Where stability lives. Move a pole, watch the response change.
  5. 05Bode plots. Gain and phase at every frequency, on log paper.
  6. 06Nyquist. The contour that tells you when the loop will sing.
  7. 07Root locus. How the poles slide as you turn up the gain.
  8. 08State-space. Vectors instead of polynomials. ẋ = Ax + Bu.
  9. 09Controllability & observability. Can you steer it? Can you see it?
  10. 10Observers. Estimating the state you can't measure — Luenberger, then Kalman.

Then three applied: motor speed, inverted pendulum, quadrotor altitude.