Magnetic levitation

A 2 kg steel mass hanging under an electromagnet with nothing touching it: one axis of a magnetic bearing. It is unstable without control, so the loop can't be slow, and the magnet's pull changes with the gap, so the gain moves with the setpoint.

Plant Dynamics at Nominal Point

FOPDT dynamics & controllability regime
Open on the bench🧩 Build in Block Studio
Dead time θ0.0025 snothing happens for this long after the valve moves
Time constant τ0.0292 sthen 63 % of the way in this long
Gain K1.01% of span the PV moves per % of valve
Lag-dominant (θ/τ < 0.2) — Easy for PIDelay share: 7.9% (θ/τ = 0.086)
0% Pure lag (fast PI)50% Balanced100% Pure delay (needs Smith / MPC)
Linearized model at 15 mm:
G(s)≈1.01 e−0.0025s0.0292s+1G(s) \approx \frac{1.01\,e^{-0.0025s}}{0.0292s + 1}
Verdict: PID is the answer

PID works, once the setpoint weight is right. PD plus a slow integral (Kc 4, Td 20 ms, Ti 150 ms) with b = 0.3 moves the gap in about 0.2 s without overshoot and holds half a kilogram of extra load to a 2 % dip. With b = 1 the same PID overshoots 130 % on a 3 mm step, and on the mismatch test drops the armature on the pad.

State feedback with an observer settles a little faster on most tests and has about 15 % less error. It has the same margin at the design point (Ms 2.4) and less close to the magnet (7.5 against 4.1 at 8 mm), and it overshoots more on gap changes (up to 9 %, and 26 % on the mismatch test). It is not a clear win. What this plant teaches is not "use state feedback" but what instability demands: a minimum speed, derivative action, fast hardware, and a gain that changes across the range.

Loading the comparison…