Magnetic levitation: an unstable plant
The plant falls (or jumps) on its own. What does that demand of the controller, and does it need anything beyond PID?
The situation
A 2 kg armature hangs under an electromagnet at a 15 mm gap. The mechanical view shows why it can't stay there on its own: where the magnet's pull equals the weight, a little further down the pull is weaker and a little closer it is stronger. Linearized, the gap has a pole at +36 rad/s: any error doubles in 20 ms. The amplifier answers in 3 ms, and the controller runs every millisecond.
Try auto-tune on the PID: it refuses. Every tuning rule assumes a stable or integrating plant.
A PID designed by hand
The derivative is what stabilizes it: P alone makes a spring with no damping. Place the closed-loop pair well above 36 rad/s: , ms (filtered), and a slow integral, ms, for the weight it has to carry. With the setpoint weight at its default , every gap change kicks the coil: the armature overshoots by more than its step, 130 %. On the mismatch test it lands on the pad.
Setpoint weighting
Put only 30 % of the setpoint into the P term (; the D term already works on the measurement only). The loop's stability is unchanged; only the setpoint response is. Gap changes now settle in about 0.2 s without overshoot, half a kilogram of extra load dips the gap by 2 %, and the mismatch test passes.
The peak sensitivity is 3.1, high by the usual standards. For an unstable plant there is a lower limit on how robust the loop can be, set by the unstable pole and the delays, and this is near it.
State feedback by pole placement
The model is exactly what an unstable plant needs designed from anyway. Place the dominant pair at rad/s, ; a Kalman filter estimates the falling speed (no differentiating of a noisy gap) and the extra load from the current it takes.
It settles about twice as fast (0.06–0.13 s), with a little more margin (Ms 2.4), and overshoots more on gap changes: up to 9 %, and 26 % on the mismatch test, because the setpoint feedforward assumes the magnet is as strong as it was. Against a PID tuned as hard (see Compare controllers) the speed advantage shrinks to about 15 % less error, and close to the magnet it has less margin, not more.
Verdict
PID is fine here: PD plus a slow integral, designed from the model, with a setpoint weight. State feedback is no clear win on one axis.
What the unstable plant teaches:
- The loop has a minimum speed: it has to be faster than the unstable pole.
- So the hardware sets the limits: the controller cycle, the amplifier, the sensor. Real magnetic bearings run at 10–20 kHz.
- No tuning rule applies: design from the model, by pole placement or on the Bode plot.
- The gain moves with the setpoint (the pole runs from 50 rad/s at 8 mm to 30 at 22 mm), and saturating the amplifier at the wrong moment drops the load. Range, limits and trips matter as much as the tuning.