← Paper Digest

Magflow: Differentiable Simulation of Industrial-Grade 6D Magnetic Levitation

Philipp Hartmann, Jannick Stranghöner, Klaus Neumann

November 2026

TL;DR A differentiable, GPU-parallel electromagnetic simulator trains a neural controller for an industrial 6D maglev system, and the controller transfers zero-shot to the hardware at 4 kHz. It turns the mover through full yaw rotations beyond the engineered limit and levitates a plain bar magnet that no hand-built controller supports, at about 0.3 mm RMS position error against under 0.1 mm for the factory controller.

What they do

Industrial 6D maglev stays real-time through co-design: magnets and coils are shaped so that a first-harmonic “commutation” model maps a desired wrench to coil currents. That model holds only near zero yaw and for co-designed movers. Magflow instead simulates the full electromagnetics offline and trains a neural controller in it. The controller then runs unmodified on a Beckhoff XPlanar tile.

How it works

  • Simulator. Written in JAX, it models cuboid magnet fields in closed form, Biot-Savart fields of 3 mm coil segments, Lorentz forces, rigid-body dynamics and the 50 three-axis Hall sensors. All of this compiles together with the controller into one GPU graph.
  • Controller. A 4-layer GRU maps 150 raw Hall readings and a reference pose to currents for 24 stator units. Worst-case inference takes 242 µs, inside the 250 µs cycle.
  • Training. Truncated backpropagation through time at 4 kHz, with random external wrenches and domain randomization over magnets, sensors and coils. The loss adds height, current and power limits to tracking. Each controller trains for five days on one A40.

Results

  • Magflow’s field matches measurements under the mover; the first-harmonic model deviates systematically.
  • Zero-shot, the controller rotates the mover through full yaw while tracking a circle of 15 mm radius. A behavior-cloned controller loses control immediately.
  • Retrained for a 100×30×10 mm bar magnet, it levitates the magnet in 6D and rotates it continuously about a horizontal axis.
  • On a Vicon-measured 60 s trajectory, RMS position error is 0.34/0.30/0.14 mm (x/y/z), against 0.09/0.07/0.06 mm for the proprietary controller. Simulated and real errors agree within 0.06 mm. It hovers with a 1.3 kg payload.

Limitations

It is less precise than the proprietary controller, which the authors attribute to the network, not the simulator. Tests use one tile and one mover. The simulator treats coils as thin wires and magnets as ideal cuboids and ignores ferromagnetic material. The rotating bar occasionally touches the tile.

Figures

From Figure 1: Magflow fuses the electromagnetic physics and the neural controller into one GPU computational graph. ...
From Figure 1: Magflow fuses the electromagnetic physics and the neural controller into one GPU computational graph. Backpropagation through time trains the controller purely from physics, and it then runs zero-shot on the real hardware at 4 kHz.
From Figure 4: Hardware runs of controllers trained in Magflow and deployed zero-shot (blue), with Magflow rollouts o...
From Figure 4: Hardware runs of controllers trained in Magflow and deployed zero-shot (blue), with Magflow rollouts on the same references (green, brown). Left: full yaw rotation of the standard mover, where the behavior-cloned baseline (orange) loses control at once. Middle: a plain bar magnet levitated through full yaw. Right: continuous rotation of the bar magnet about a horizontal axis.
From Figure 5: The neural controller hovers the mover stably under a tested payload of 1.3 kg.
From Figure 5: The neural controller hovers the mover stably under a tested payload of 1.3 kg.
Abstract

Magnetic levitation with six-degrees-of-freedom enables frictionless transport and micrometer-scale positioning in principle, but low-level control is inherently challenging due to its complex and unstable dynamics. Industrial systems typically rely on deep hardware-software co-design, where mover and stator geometries are jointly designed to enable a compact, hand-crafted approximation of the electromagnetic force computation, thereby keeping control computationally tractable at kilohertz rates. However, this approach imposes overly conservative constraints on the operating workspace and the range of supported mover topologies. Instead of reducing the underlying physics to a hand-crafted approximation, we compute the physics directly. We introduce Magflow, a fully differentiable, GPU-parallel simulator for 6D magnetic levitation. It is used to train the first neural controller for an industrial-grade 6D magnetic levitation system that is learned purely from simulated physics. We show that the learned neural controller transfers zero-shot from simulation to real hardware while satisfying hard real-time constraints at 4 kHz. The learned controller achieves qualitatively new behaviors and even levitates a mover topology for which no hand-crafted solution exists. These results demonstrate that co-design is not a physical necessity for 6D magnetic levitation control. More broadly, control learning from simulated physics can find solutions beyond the reach of control engineering in demanding industrial domains. Source code and demonstration videos are publicly available at https://sites.google.com/view/magflow.

Summaries are written automatically from each paper's text. Figures and videos come from the paper and its project page; all credit goes to the authors.