Model: Fmag = k·I²/x² pulls the steel ball up toward the coil; gravity m·g pulls it down. A PID loop reads the gap x and sets the coil current every tick to hold x at the target — this is the classic single-axis maglev-ball control problem.
Interference adds sensor noise and random gusts the controller must reject. Push Kd too low or interference too high and the ball oscillates or drops — that instability is real, not scripted.