Six instruments, one trustworthy picture.
Every element is drawn in OpenGL ES 3 from a single per-frame state snapshot — a crisp, low-latency display that stays readable in direct sunlight.
Attitude first.
How the attitude is computed.
No single sensor gives a trustworthy attitude. The gyroscope is fast but drifts; the accelerometer and magnetometer are stable on average but noisy and disturbed by manoeuvre. Every estimator below resolves the same conflict — trust the gyro over short intervals, correct it toward gravity and magnetic north over long ones — and they differ only in how they strike that balance.
Gravity from the accelerometer drives the update — with GPS-derived acceleration removed first, so a sustained turn isn't mistaken for a tilt. The payoff: clean, true bank angles under load. This is the default estimator.
Splits the signal by frequency: the gyro supplies the fast motion, accel and mag the slow reference. The correction is the rotation error between measured and estimated gravity/north, fed back through a proportional and an integral gain — and the integral term also learns and cancels gyro bias. Cheap, robust and predictable — the simple, dependable fallback.
Frames orientation as an optimisation: the gyro gives the rate, while a single gradient-descent step nudges the estimate toward the orientation that best matches measured gravity and north — at one tunable rate, β. Smooth and responsive for very little compute.
When the IMU already publishes its own fused quaternion, this mode passes it straight to the display — a useful reference, and the right choice when you trust the sensor's on-board fusion over the phone's.
Fly it, sim it, or replay it.
| BLE Waveshare 10-DOF | external IMU — primary |
|---|---|
| Internal sensors | phone accel / gyro / mag / baro |
| X-Plane UDP | simulator feed |
| FlySys TCP | TCP gateway |
| Replay | recorded CSV from Documents/PFD/ |
| Demo | synthetic motion — no hardware |
Three independent calibrations.
Magnetometer
Hard- and soft-iron fit so heading stays honest near metal and avionics.
Accelerometer
A guided 6-face procedure recovers per-axis offset and scale, applied before the filters.
Gyro offset
A short static "Align" window zeroes gyro bias the moment you power up on the ground.