Research · completed
Sim-to-Real: Data-Driven Inverse Actuator Model
Simulators usually treat an actuator as a perfect torque source: command i_q and you get
τ = N · Kt · i_q at the output. Real actuators don’t behave like that. Friction, load-dependent
losses and drive limits all take a share, and the gap is part of why controllers trained in
simulation stumble on hardware.
This project builds the inverse map. You give it the torque you want at the output and the operating state (speed, optionally temperature), and it returns the motor command that makes the real actuator deliver that torque.
The model
The main model is physics-structured, not a black box. It sums three parts:
- Ideal term
τ / N, the starting point. - Trainable friction physics. Steady-state LuGre/Stribeck friction plus load-dependent Coulomb friction, fitted separately for each direction and dissipative by construction.
- A small, bounded MLP residual that learns whatever the physics misses.
The output increases monotonically with the requested torque, is clamped to the drive’s limits, and rejects non-finite inputs, so it is safe to put in a control loop.
Everything motor-specific lives in a single YAML config: column mapping, units, signs, gear ratio, motor constants, command type (torque or current) and limits. Adding a new actuator means writing a new config, with no code changes. The pipeline has 187 tests.
Results on real data
I evaluated it on a VT8020 motor with a 5.4:1 reduction, using dyno data from all four quadrants (motoring and back-driven, both directions). Scoring used a held-out test split that was run exactly once.

- 6× better than the ideal model: 0.88% vs 5.28% RMS error, as a percentage of rated output torque.
- Better than every analytic friction model (Coulomb/viscous, LuGre/Stribeck, per-quadrant) and the physics-loss neural net.
- Ties a plain inverse MLP and a Hwangbo-style forward network inverted numerically. On this data the physics structure doesn’t improve accuracy. What it does buy is robustness: the most stable results across seeds, smooth behaviour near zero speed (0 sign flips vs 8 for the unstructured nets), and no commands beyond the drive’s limits.
What I learned
- Motor-only data can’t identify gearbox losses. Every “output torque” here assumes an ideal gearbox. The most useful next measurement is a torque sensor after the gearbox.
- Transfer to a new motor is hard. Fine-tuning from one motor to another did worse than training from scratch. With little data on a new motor, a classical friction model beats the network by more than 10×.
- Honest baselines matter. A plain MLP is a strong baseline. Without it, the hybrid would have looked much better than it is.