The science
An electromagnetic-suspension (EMS) maglev car hangs below a steel rail and is pulled up by electromagnets. The pull is F = K (i/g)² (coil current i, air gap g), so a bigger gap means a weaker pull: the equilibrium is unstable and only active control keeps the car levitating.
- Equilibrium:
F = m g gives i0 = g0 √(m g / K); with the constants used here, 20 A at a 10 mm gap and 1000 kg per magnet.
- Linearised plant:
m δg'' = ks δg − ki δi with ks = 2mg/g0 and ki = 2mg/i0. Without control δg grows like cosh(ωt), ω = √(2g/g0) ≈ 44/s (doubling in about 25 ms).
- Controller:
i = i0 + Kp e + Kd e' + Ki ∫e through an amplifier with lag τ. Stability needs at least Kp > ks/ki = i0/g0 = 2 A/mm; the closed-loop characteristic polynomial mτs&sup4; + m s³ + (kiKd − ksτ)s² + (kiKp − ks)s + kiKi = 0 is solved live and its roots are drawn (red zone = unstable).
- The integral term lets the car recover its set-point after a payload step; rail irregularities act as an acceleration disturbance at
f = v/λ (λ = 6 m here).
Honest simplifications: one magnet module (vertical motion only), no pitch/roll or lateral guidance, ideal gap sensor with exact derivative, current-limited amplifier modelled as a first-order lag, constant leakage-free magnetic circuit (no saturation or eddy currents), and the 3D page's superconducting-style field arcs are only decorative. The 2D page is the control-theory view.