Work in progress This site is under construction — content, figures and specifications are provisional.
6 — Testing

Recorded, then proven.

An attitude display is only as good as its evidence. Every session writes two synchronised logs — the raw sensors and the computed display — the foundation for post-mission diagnostics, calibration, sensor characterisation and exact replay. On top of that, the system is checked three ways: by hand, against recorded flights, and in the aircraft.

Flight recording§1 — Two synchronised logs.

Every session — live, simulator or replay — is recorded to a companion pair of CSV files in Documents/PFS/ that share one timestamp: the display log (what the pilot saw) and the sensor log (the raw data and the exact setup behind it). Together they let any flight be re-opened, re-analysed and re-processed long after landing.

Fig.01 — One session, two logsDISPLAY & SENSOR
EVERY SESSION live, sim, replay DISPLAY_*.csv attitude, tapes, view settings, rotation matrix SENSOR_*.csv raw sensors, initial conditions, setup, diagnostics
A pair with the same timestamp — DISPLAY_…csv and SENSOR_…csv — so the two are always aligned in time.
The raw log§2 — Sensors & initial conditions.

The sensor log is more than a stream of samples — it captures the complete initial state, so a session can be reconstructed exactly: the calibrations in force, the alignment, the learned biases and every relevant setting. Raw means uncorrected — magnetometer in raw µT, gyro and accel before calibration — precisely as the sensor produced them.

Inertialaccelerometer & gyroscope (raw, body frame, configurable up to 250 Hz)
Magnetometerraw µT (uncalibrated)
Barometricpressure (hPa) & Inertial Measurement Unit (IMU) temperature (°C)
GPSlat, lon, ground speed, track, altitude
Quaternionsensor on-board fusion via Bluetooth Low Energy (BLE)
Batteryvoltage (ESP32)

Written once at the start as initial conditions — what a replay needs to reproduce the live state:

SettingsQNH, units, aircraft, filter, IMU mounting, mag declination, vibration cutoffs, GPS-aid
Aligngravity correction, gyro offset, initial quaternion
Magnetometer calellipsoid (sensor 3D) & installation (2D)
Accelerometer cal6-face scale & bias
Gyro biaspersisted online estimate
Diagnosticsfilter-gate activity, vibration RMS (root-mean-square) & recommended cutoff
Post-mission analysis§3 — What raw data unlocks.

Raw data turns every flight into a dataset you can interrogate on the ground. Three things it makes possible:

01

Diagnostics

Replay a flight and read the filter's gate activity, sample by sample — see exactly which check blocked a correction, and when.

02

Calibration — σ

A static recording yields the per-axis noise std-dev (σ) that sets each sensor's weight — the measurement covariance R — in the estimator.

03

Characterisation

Allan variance and PSD reveal the noise structure: random walk, bias instability, and the vibration peaks that set the filter cutoff.

Fig.02 — Sensor characterisationAllan variance, PSD
ALLAN DEVIATION σ(τ) short-term noise (−½) bias instability long-term drift (+½) τ: averaging time (log) POWER SPECTRAL DENSITY noise floor vibration peak frequency (Hz, log)
The Allan curve separates short-term random walk from long-term bias instability; the PSD exposes the vibration peaks that the 2-pole filter is tuned to reject. Both come straight from a raw log.

The test itself is simple: lay the IMU still on the bench (or spin it at a constant rate on a turntable) and record for a few minutes. A still log isolates noise and drift; a constant-rate log adds scale-factor and linearity. From that one recording the sensor is qualified:

Noise level (σ)How jumpy the readings are while the sensor sits perfectly still. A quieter sensor (small σ) is trusted more by the filter.
Short-term noiseThe random flicker from one sample to the next — the downward slope of the Allan curve (slope −½, white noise). It sets how fast a gyro-only estimate drifts away.
Bias instabilityThe best the sensor can do: past a point, averaging for longer stops helping. It's the bottom of the Allan curve (the minimum) — the single most telling quality number.
Long-term driftHow far the zero point wanders over minutes — the upward slope of the Allan curve (slope +½, rate random walk). It says how often the attitude needs re-aligning.
Noise floorThe steady background hiss across all frequencies on the PSD — a second, independent check on the noise level.
Vibration peaksThe spikes on the PSD, where the engine and airframe shake the sensor — these set the frequency the vibration filter must cut.

In short: a still recording tells you how good the sensor is and how much to trust it. Those numbers — measured from the unit in hand, not copied from a datasheet — are what set the filter's weights and its vibration cutoff, and let two sensors be compared head to head.

Gyro — random walk (measured)0.32–0.33 °/√h per axis (Allan −½ fit, IEEE Std 952; 204 min raw log at 250 Hz)
Gyro — bias instability (measured)6.3–6.4 °/h (converged interior Allan minimum / 0.664; stable within ±2% as the record grew from 115 to 204 min)
Accel — output noise (measured)σ ≈ 0.002 m/s² at rest — below one quantisation step, exposing the IMU firmware's internal low-pass

First bench characterisation of the production unit, from raw logs via the exact recipe above. What is characterised is the sensor as the filter consumes it — the BLE output stream — which is precisely what the measurement covariances need.

Fig.03 — Measured: gyro Allan variance & PSDbench, 204 min @ 250 Hz
Measured gyro characterisation: per-axis root Allan variance with −½ fits, interior minima and a +½ region, gyro PSD with the 2N² white-noise floor, and the accelerometer PSD from the same session with the 73.24 Hz vibration line aligning across all panels
The real thing, from one raw log: per-axis Allan curves (−½ white-noise fit, interior minimum → B, +½ rate-random-walk), the PSD with its 2N² floor, and the vibration line at 73.24 Hz appearing identically in the gyro and accelerometer spectra — the excitation, not the sensor. The excited axis (Y) is annotated and reported as bounds only.
Replay & regression§4 — Tune, diagnose, compare.

Because both logs exist, a flight can be replayed two ways. Feed the raw log back through the processing and it re-runs the full pipeline — so a new algorithm can be measured against the previous solution on real data, on the desktop, before it ever flies. Or replay the display log to reproduce exactly what the pilot saw — frame for frame.

And because a recorded log replays deterministically — the same samples in, the same result out, every time — it doubles as a tuning and diagnostics bench. The raw sensor data is re-injected synthetically into the live pipeline, so one flight can be run again and again while sweeping the filter's parameters — the σ weights, the vibration cutoffs, the gains — until the output converges, with no aircraft and no waiting for weather. The same loop isolates a fault: feed in the exact data that misbehaved and step through it until the cause is found.

Fig.04 — Replay two waysre-run, reproduce
SENSOR_*.csv raw log NEW PROCESSING candidate algorithm PREVIOUS SOLUTION known-good baseline COMPARE diff → regressions DISPLAY_*.csv display log EXACT REPLAY bit-for-bit, no re-run
Raw → re-run a new processing and diff it against the previous solution. Display → reproduce the exact picture (the rotation matrix r0..r10 is stored directly, so there's no lossy euler round-trip).
RAW

Re-run

The raw log drives the identical live pipeline — so live and replay agree by construction, and a new filter is tested on real flights.

TUNE

Tune & diagnose

Replay one flight repeatedly while sweeping σ, cutoffs and gains — deterministic, so tuning converges and a fault can be stepped through to its cause.

DIFF

Compare

A candidate solution is diffed against the previous one over a library of real data — regressions are caught on the ground.

By hand§5 — On the bench.

Move the IMU by hand and watch the horizon, heading and tapes respond immediately and in the right sense — pitch up, bank left, turn through a heading. Demo mode supplies synthetic motion, so the full display can be exercised with no hardware connected at all.

Needsthe device (IMU optional)
Checkssense & response of each instrument
Modeslive IMU, internal sensors, demo
In flight§6 — In the aircraft.

The display is flown in a real aircraft (a Robin DR400) and compared against references it doesn't itself use — bank derived from GPS ground track and speed, and altitude from the barometric reference — so attitude is checked against independent physics, not against itself.

PlatformRobin DR400/180
Bank referenceGPS ground-track & speed
Altitude referencebarometric
Goaltrue bank in sustained turns