A twin with an ideal magnetometer returns the true heading: how large is the hard-iron and soft-iron error, what does it do to a compass-held path, and how much of a turn does a swing calibration need?
research/compass-twin
A twin with an ideal magnetometer hides hard/soft-iron heading error: exact peaks asin(β/B) and asin(|1−r|/(1+r)), a compass-held square misses by exactly 2Lβ/B, and swing calibration error grows ×12 at a 90° arc. Stylised.
What it found
A hard-iron offset β (relative to the field B) gives a peak heading error of exactly asin(β/B) (11.5° at 0.20, 53.1° at 0.80); soft-iron axis scaling r gives asin(|1−r|/(1+r)) (6.4° at r = 0.8), unchanged by removing the offset. A compass-held 100 m square misses its start by 2Lβ/B (2, 6, 20, 60 m at 0.01–0.3) for every offset direction tried, while the ideal twin closes to 10−14 m; a straight leg stays within 1 m cross-track for only 10–50 m at β/B = 0.02–0.10. A circle-fit swing calibration over a full turn has offset error ≈ 2σ/√n (0.0040 at n = 100), growing ×1.8 at 180°, ×12 at 90° and ×45 at 60° of turn (median heading residual 0.18° → 2.2° → 10.7°). Stylised: level 2-D sensor, simulated data, no gyro fusion, no ellipse fit; the 2Lβ/B closure law is verified numerically, not proved beyond first order.
A figure from its own output
Paper, code and results
More in Digital twins & sim-to-real
- A gyro twin calibrated on white noise hides the bias random walk: how wrong are its heading error, re-alignment interval and dead-reckoning budget, and does a single-point Allan fit help?A gyro twin calibrated on white noise hides the bias random walk: heading variance ratio exactly
1+(t/t*)²(2.33 at 100 s, 134 at 1000 s), the twin's re-alignment interval is 24× too long (10 000 s vs 416 s), a single-point Allan fit is right at one horizon only, and dead-reckoning range is over-stated 1.25–1.74×. Stylised. - A zero-wind twin of a UAV out-and-back leg: does a tailwind repay the headwind, and what does a twin calibrated on one leg say about the return?Zero-wind twin of a UAV out-and-back leg: wind does not cancel (real/twin energy
1/(1−(w/v)²)), the best airspeed moves tov²=w²+√(w⁴+1), and a one-leg-calibrated twin is off by exactly±w/vwith the sign of the leg flown. - A constant-gain twin of a motor holding a load certifies every load: what does thermal derating do to the real hold?A constant-gain twin of a motor holding a load certifies every load: magnet derating makes holding a positive thermal feedback with a fold at
λ=4/27(real temperature 1.33–2.25× the twin's near it, no hold above it, runaway in≈4π/(9√ε)thermal time constants), short tests cannot see it, the twin overstates holdable torque 1.1–1.6×, and refitting a constant gain does not remove the fold. - What does a twin whose sensor reads at any distance get wrong about a loop with a range-limited lidar or radar?A twin whose sensor reads at any distance vs a range-limited one: exact step-count law (49 vs 4021 steps from 1000R), PI overshoot neither bound nor lower bound (4.1× at 1000R), exact scale invariance, and the gain fitted from logs of a given extent.
- One long twin run or many replications when every run starts in the wrong state?One long twin run or many replications under a start-up transient: exact AR(1) MSE and t-interval coverage (single run minimises MSE; replication costs 1.07×–2.2×; 92% coverage at MSE-optimal deletion for short replications), batch means not worse, preliminary M/M/1 coverage 6–84%.
- How biased is a short digital-twin run that starts from a default state?Cold-start bias of short twin runs: exact AR(1) bias/variance/warm-up deletion, M/M/1 empty-start bias constant
ρ/(1−ρ)³, negligible at valid-interval lengths but −5.6 of 9 at 50 jobs; MSER-5 did not help.
All 164 Digital twins & sim-to-real projects →
Other research topics
Proper scoring & elicitation28Effort & peer prediction9Verification games & slashing19Detection & tolerances14Markets as routers13Prediction-market design9Paying contributors8Decentralised training systems23Digital twins & sim-to-real164LLM chip design loops40Robot manufacturing loops53Ambient AI assistant46Self-replicating manufacturing34Simulation-first design64Engineered clothing45Task-specific AI accelerators40Algorithmic chip-design loops42Open-source purpose-built robots44The software-engineering loop43Adversarial human imitation41Open-source residential construction41Autonomous multi-angle capture34Sensing, imaging and 3D31Energy supply and dense energy storage39Robot societies among people31Agentic co-design of low-cost robots27Laundry-hanging robots25Machine learning on qualitative data23Robots on the building site27Civilizations & group psychology1History & human sciences1
Produced with AI assistance (Claude). Results are from the code in this repository and are simulated or stylised unless the abstract says otherwise; nothing here implies affiliation with or endorsement by any lab, researcher or company cited. MIT licensed.