Magnetic levitation
Holding a steel nut suspended in mid-air in an electromagnetic field — a plant with no stable resting point in either direction.
The problem
Magnetic attraction grows as the gap closes and weakens as it opens, so the open-loop system has no stable resting point: drift up and the object falls, drift down and it slams into the magnet. The force is nonlinear in both current and gap, which means the model you design against is only valid in a narrow band around one operating point.
Approach
The plant was modelled analytically from the electromagnetism rather than fitted blind, then the remaining parameters identified on the rig and the whole thing linearised about the working gap. The controller is a lead compensator — phase lead where the loop needs it to stay stable at crossover — with a high-frequency filtering pole so that sensor noise from the photodiode and phototransistor pair does not end up driving the coil.
What it does
The nut sits in mid-air at the design gap and stays there. Disturb it and the current corrects within the band the linearisation is good for. Push it far outside that band and the model stops applying — which is itself the lesson the rig teaches.
Specification
- Actuation
- Electromagnet
- Sensing
- Photodiode and phototransistor pair
- Modelling
- MATLAB, Simulink, analytic electromagnetism
- Controller
- Lead controller with a high-frequency filtering pole
- Target
- National Instruments myRIO
On the bench









