An electromagnet hangs a train from a steel rail with a gap of a few millimetres. Click the top half of the picture to kick the module and watch the control loop hold it.
The science
Attractive levitation (EMS). A C-shaped electromagnet pulls up on a steel rail with F = mu0 N^2 A I^2 / (4 g^2). The force falls with the square of the gap, so equilibrium I0 = g0 sqrt(m g / k) is unstable: a smaller gap pulls harder, a larger gap lets go (Earnshaw).
Linearisation. Around equilibrium dF = Ki dI - Ks dg with Ki = 2F0/I0 and Ks = 2F0/g0. Without control the gap error grows as cosh(sqrt(2 g / g0) t), about 44 per second for 10 mm.
Feedback. A PD law I = I0 + kp (g - g0) + kd dg/dt gives m dg'' + Ki kd dg' + (Ki kp - Ks) dg = 0. It is stable only if kp exceeds the critical value Ks/Ki; then omega = sqrt((Ki kp - Ks)/m) and zeta sets the damping. A permanent extra load sags the gap by dm g/(Ki kp - Ks) because there is no integral term.
Electrodynamic levitation (EDS). Superconducting magnets over a conducting track give lift F/(1+(vc/v)^2) and drag F (vc/v)/(1+(vc/v)^2) (Reitz model): no lift at rest, lift equals drag at the characteristic speed vc.
Speed profile. Thrust is min(Fmax, P/v) against aerodynamic drag 0.5 rho CdA v^2, so the top speed is (2P/(rho CdA))^(1/3). Lowering the air density (evacuated tube) raises it sharply.
Simplifications. Single module, vertical motion only, ideal current source (no coil inductance or amplifier lag), constant Fmax of 250 kN, no guideway irregularities. Gap is drawn x9 and time is slowed so the oscillation can be seen. Educational, not an engineering design tool.