Flight systemsSensing and estimation on bare metal.
Embedded Rust for flight controllers. Sensor fusion crates, firmware for real boards, the wire format between them and the tools to watch it fly.
Open source firmwareARK FPV · STM32H743 · RTIC 2
The discovery series
Three crates for exploring the sensing half of flight control. The firmware runs bare metal on the ARK FPV flight controller, brings up the IMU, barometer and magnetometer, fuses them into attitude and altitude, and streams the result over USB.
The telemetry crate defines the bytes on that wire once, postcard inside COBS frames, shared by the no_std firmware and the desktop host so neither side hand writes a parser. The scope reads the stream and draws a primary flight display in egui: artificial horizon, altitude and vertical speed tapes. Deliberately not a full flight stack. The fused estimate is the endpoint.
USB CDC byte streamtransport
COBS frame0x00 delimited
postcard bytesno_std serde
Frame { t_ms, msg }Imu · Baro · Mag · Fused
Open source librariescrates.io · no_std
fusion-ahrs and fusion-altitude
fusion-ahrs is a Rust port of xioTechnologies' Fusion library: a complementary filter that combines gyroscope, accelerometer and magnetometer readings into orientation, with gyro offset correction and sensor calibration built in.
fusion-altitude picks up where orientation stops. Barometers drift slowly and are noisy over short spans; integrated acceleration is the reverse. A third order complementary observer fuses the two into altitude, climb rate and a running estimate of accelerometer bias, so a constant bias leaves no steady state altitude error.
r = baro_alt - h
a_c = accel - bias
v += (a_c + k_v*r) * dt
h += (v + k_h*r) * dt
bias -= k_b*r * dt