← All projectsGitHub
Digital twins & sim-to-real

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.

11 tests

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

Figure produced by research/compass-twin: hard_iron
compass-twin/experiments/hard_iron.svg, written by the project's own experiment code.

Paper, code and results

More in Digital twins & sim-to-real

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.