Research
Magflow: Differentiable Simulation of Industrial-Grade 6D Magnetic Levitation
Magflow's GPU-differentiable 6D magnetic levitation simulator lets engineers train neural controllers without the hand-crafted force models that shrink industrial workspaces.
- arXiv
- 2611.23050 · accepted · ROBOTICS AND AUTOMATION LETTERS
- Published
- 2026-11-17
- Authors
- Philipp Hartmann, Jannick Stranghöner, Klaus Neumann
In plain words
Industrial 6D MagLev systems work only because hardware and software are co-designed: mover and stator geometries are jointly shaped so that the electromagnetic force reduces to a short analytical "harmonic commutation" formula that a CPU can evaluate inside a 250 µs control cycle.
AI summary
Overview
Research area: Robotics — magnetic levitation (MagLev) control, differentiable physics simulation, and learning-based control for industrial mechatronics.
Technical level: Advanced. The paper assumes familiarity with electromagnetic force modeling (Lorentz force integrals, Biot–Savart law, Halbach arrays), Lie-group rigid-body integration, backpropagation through time, and hard real-time embedded control.
Scope: The paper introduces Magflow, a differentiable GPU-parallel simulator of 6D magnetic levitation, and uses it to train — purely from simulated physics — a neural controller that transfers zero-shot to a Beckhoff XPlanar industrial MagLev platform running at 4 kHz.
What This Paper Is About
Industrial 6D MagLev systems work only because hardware and software are co-designed: mover and stator geometries are jointly shaped so that the electromagnetic force reduces to a short analytical "harmonic commutation" formula that a CPU can evaluate inside a 250 µs control cycle. That shortcut imposes artificial limits — yaw is typically restricted to about ±5°, and only mover topologies anticipated during co-design are supported. The authors replace the shortcut with direct physics: they build a fully differentiable simulator that computes the actual coil–magnet interactions with gradients, and train a neural network controller end-to-end through closed-loop rollouts of that simulator, then deploy it unchanged on real hardware.
Key Contributions
-
Magflow, a differentiable 6D MagLev simulator. Implemented entirely in JAX, it compiles the electromagnetic physics, the neural controller, and the full closed-loop rollout into a single GPU computational graph, enabling backpropagation through time across many parallel simulated worlds. The authors state it is the first simulator to differentiate through coil–mover–Hall-sensor electromagnetic interactions at kilohertz rates.
-
The first neural controller for an industrial-grade 6D MagLev system learned purely from simulated physics, with no commutation model and no expert controller to imitate. It transfers zero-shot to the real XPlanar hardware while meeting the 4 kHz real-time constraint (worst-case inference latency 242 µs against a 250 µs budget).
-
Behavior beyond the engineered envelope. The learned controller extends the yaw range of the industrial system beyond its engineered limit, and levitates a plain bar magnet — a topology with no harmonic commutation model and hence no existing engineered controller on this platform — in full 6D, including continuous 360° rotation about a horizontal axis.
-
A full training pipeline covering action encoding, reference encoding invariant to mover symmetry, a multi-term tracking/safety/smoothness objective, and domain randomization over mover, sensing, and actuation parameters.
Main Findings
-
Simulation matches measurement where the analytical model does not. Along a cut at mover-local y = 40 mm, z = −1 mm, the measured field components are matched by Magflow, whereas the first-harmonic commutation model deviates systematically (Fig. 3).
-
The harmonic model decays sharply with yaw. Under the derived sinc-based correction, lift of the aligned units is 98% of nominal at ψ = 5°, 55% at 30°, and 25% at 45% — explaining why engineered systems constrain yaw.
-
Zero-shot sim-to-real transfer at 4 kHz. The Magflow-trained controller π_MF runs on hardware within the 250 µs cycle without hardware acceleration, on one CPU core of a C6030 (Intel i9-9900K) in kernel mode.
-
Tracking accuracy on the motion-capture benchmark (Table I, RMS). π_MF: 0.34 mm (x), 0.30 mm (y), 0.14 mm (z), 0.24° roll, 0.25° pitch, 0.26° yaw. The proprietary controller π_PC: 0.09, 0.07, 0.06 mm and 0.10°, 0.07°, 0.05°. The behavior-cloned baseline π_BC: 0.15, 0.14, 0.09 mm and 0.12°, 0.11°, 0.10°. The Magflow-trained controller is therefore less accurate on this tracking metric than the incumbent engineered and imitation-learned controllers.
-
Simulation aligns with hardware for the learned controller. π_MF in simulation: 0.31, 0.24, 0.15 mm and 0.19°, 0.21°, 0.22°, close to its hardware numbers; π_BC in simulation: 0.16, 0.18, 0.08 mm and 0.10°, 0.10°, 0.24°.
-
New behaviors demonstrated (Fig. 4). Full 360° yaw rotation of the APM4330 away from the tile center, where the imitation baseline π_BC directly loses control; stable levitation and 360° yaw tracking of a plain bar magnet with a controller retrained in Magflow; and continuous 360° rotation of the bar magnet about a horizontal axis, which the authors state has not been shown for a single permanent magnet on a planar MagLev system.
-
Sensitivity-matrix approximation is cheap. Holding the current-to-wrench matrix A_t fixed over four control cycles speeds training 3.5× at relative force and torque errors of 0.5% and 0.8%.
-
Coil discretization tolerance. Representing PCB coils with four layers, five parallel thin wires per track, and 3 mm segments changes the wrench by about 1% relative to 20 wires and 1 mm segments; the number of layers matters more than the number of wires.
Methodology in Plain English
The team first characterizes the real system: a 240 × 240 mm active tile with 24 stator units, 50 triaxial Hall sensors giving 150 raw field readings per cycle, and 72 actuator commands per step, all inside a 250 µs tick. They then write down the physics honestly rather than approximately. Each of the mover's magnets is a uniformly magnetized cuboid whose field has a closed-form solution (Akoun–Yonnet); each stator conductor is a short straight segment whose field follows the Biot–Savart law. Because the coil field is linear in current, the field at the sensors becomes a fixed 150 × 72 sensitivity matrix, and the force/torque becomes a 6 × 72 matrix times the current vector. Motion is integrated with semi-implicit Euler at 250 µs, with rotation updated on the SO(3) manifold and simple tile-contact handling.
Everything is written in JAX so that the whole loop — physics, sensor sampling, neural network, dynamics update — becomes one differentiable graph that runs many simulated worlds in parallel on a GPU. Gradients flow backward through 500-step windows, so the controller is optimized directly for the closed-loop task rather than for one-step force prediction. The controller is a 4-layer GRU with 256 units per layer, taking 150 sensor readings plus an 8-dimensional reference and outputting 48 Clarke-frame current values that map bijectively onto the hardware's field-oriented control triplets. Yaw is encoded as (cos nψ, sin nψ) with n = 4 for the APM4330 and n = 2 for the bar magnet, matching each mover's rotational symmetry.
The loss balances pose tracking in millimeters and degrees against safety terms: a barrier keeping the mover above 0.5 mm, a current cap at 33 A, a penalty for exceeding the power budget (140 W continuous, 240 W short-term), leakage current penalties for uncovered coils, and smoothness penalties on commanded currents and realized wrench. Domain randomization over magnet remanence, magnet placement, mass, inertia, center of mass, sensor placement and noise, per-coil gain, and current lag provides the robustness needed for the sim-to-real gap. Training uses 16 randomized worlds (half step-tracking, half smooth random 6D trajectories), a curriculum that grows the horizon from 100 steps by 1.25× once 80% of worlds survive, and takes five days on an NVIDIA A40 at roughly 3 ms per step including the backward pass.
Why This Matters
Research impact. The paper argues that co-design is not a physical necessity for 6D MagLev control, but a consequence of keeping the actuation model real-time tractable. Moving the approximation out of the control loop and into offline training inverts the usual pipeline: instead of chaining pose estimation, commutation, feedback control, and calibration modules each built on geometry-specific assumptions, a single learned map is optimized against the true physics. This is a template for other domains where hard real-time constraints force crude analytical models.
Real-world applications:
- Semiconductor manufacturing, where frictionless, wear-free 6D transport and micrometer positioning matter.
- Pharmaceutical filling and aseptic processing, where contact-free handling reduces contamination risk.
- Electronics assembly and flexible product routing on planar motor grids.
- Lab automation and vacuum-compatible transport, where mechanical bearings and lubrication are undesirable.
Industry relevance. Industrial MagLev vendors currently constrain workspaces and supported mover shapes to what their commutation model can handle. A physics-trained controller that works on a topology with no engineered solution, and that can rotate continuously through 360°, points toward looser mechanical constraints and faster commissioning of new mover designs — while still respecting the platform's existing 4 kHz real-time and power budgets.
Future Directions
-
Closing the accuracy gap. The learned controller's RMS tracking error on the motion-capture benchmark (0.34/0.30/0.14 mm) exceeds the proprietary controller's (0.09/0.07/0.06 mm); how to recover micrometer-grade precision while retaining the extended operating envelope is left open.
-
Scaling beyond a single tile and single mover. The study uses one tile and one mover; multi-tile travel, multi-mover coordination, and handover between tiles are not demonstrated.
-
Broader topology and geometry transfer. Only the APM4330 and a plain bar magnet are examined; whether one trained policy generalizes across mover geometries, or must be retrained per topology as done here, is not resolved.
-
Reducing the offline cost. Training takes five days on an A40 with the wrench matrix recomputed every four cycles; cheaper physics approximations, better batching, or learned surrogates could widen access. The paper also leaves open how much of the domain-randomization range is actually necessary for transfer.
Target Audience
Robotics and control researchers working on magnetic levitation, planar motors, and learning-based control of unstable high-rate systems; practitioners of differentiable simulation and sim-to-real transfer; and industrial engineers in semiconductor, pharmaceutical, and electronics manufacturing who need to know whether learned control can escape the constraints imposed by hand-derived actuation models. Readers without a background in electromagnetic modeling or gradient-based policy optimization will find the physics and training sections dense, though the motivation and results are accessible.
Authors’ 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…
The full abstract on arXivRelated papers
- ROS2SmolVLA: Enabling Small Vision-Language-Action Models for Integration into Industrial-Grade Lightweight Robots 2026-08-24 · cs.RO · Key terms of the title in common
- HolidayFactory 1.0: Simulating, Generating, and Evaluating Industrial Robot Tasks 2026-11-09 · cs.RO · Key terms of the title in common
- $\nabla$Mimic: Ultra-Efficient Humanoid Control with Differentiable Simulation 2026-10-30 · cs.RO · Key terms of the title in common
- Learning Visuomotor Quadrotor Flight Through Dynamic Narrow Gaps via Differentiable Simulation 2026-10-27 · cs.RO · Key terms of the title in common
- CQDC-Warp: GPU-Accelerated Differentiable Quasi-Dynamic Simulation for Contact-Rich Manipulation 2026-10-15 · cs.RO · Key terms of the title in common