← Back to Projects

Embedded Controls · Bare-Metal STM32 · Sensor Fusion

SteadiFly — Three-Axis Flight Stabilizer

A bare-metal STM32 stabilizer that reads an IMU, estimates aircraft attitude through a Kalman filter, and drives control surfaces to counteract disturbances and hold level flight.

Course EE 329 — Microcontroller-Based Systems Design, Prof. John Penvenne
Role Production, control development, testing, and hardware integration
Platform STM32 Nucleo, MPU6050, SG90 servos
STM32 Bare-Metal C MPU6050 Kalman Filter I2C UART PWM Servo Drive MATLAB

The build, by the numbers.

324 mm Airframe length (324 × 96 × 50.3 mm)
1361 g All-up weight
>18 h Battery life
1 kHz IMU sample rate over I2C, 16-bit resolution

Built to be flown at.

The SteadiFly airframe from above: a white foam fuselage marked with the SteadiFly logo, cardboard wings and tailplane with black edging, blue micro servos at the control surfaces, and a battery pack strapped on top.
The completed airframe, with servos mounted at the control surfaces and the battery pack on the spine.
The SteadiFly during assembly, showing the internal electronics and wiring before the airframe was closed up.
During the build.

A cyclic loop on bare metal.

No RTOS and no HAL — the control system runs as a continuous cyclic loop handling initialization, sensor acquisition, filtering, control computation, and actuator output in sequence.

The MPU6050 supplies three-axis gyroscope and accelerometer data over I2C at 1 kHz. That feeds a Kalman filter which estimates pitch, roll, and yaw; the estimates are smoothed for display and logged over UART at 115200 baud, where PuTTY and MATLAB were used to inspect the data during tuning. Independent control paths then drive the servos on each control surface to oppose the measured disturbance.

Flowchart of the SteadiFly firmware showing initialization followed by a repeating loop of sensor read, filter, control computation, and servo output.
Firmware flow — initialization, then the cyclic control loop.
Wiring diagram showing the Nucleo board connected to the MPU6050 over I2C, five servos on PWM outputs, the UART serial link, and the power supply rails.
System wiring — Nucleo, IMU, servos, serial link, and power.

Holding level.

The stabilizer responding to disturbance. Silent — the audio track has been removed.

Control surfaces driven by the Kalman-filtered attitude estimate as the airframe is tilted.

Report and source.

The EE 329 report covers the behaviour specification, system specifications, software architecture, wiring, and test results. The archive contains the bare-metal STM32 project as submitted.