A custom flight controller built from scratch on an STM32F401 (Blackpill), written in C using STM32CubeIDE. This is a hobby project I have been building alongside my computer engineering studies at Åbo Akademi, and it is still actively in progress, currently running on a breadboard prototype.
The goal is a working fixed-wing autopilot: something that can take RC input, fuse sensor data, hold an attitude, and eventually fly a stabilized loiter or hold altitude on its own. So far it includes:
Quaternion-based cascaded attitude controller: outer loop converts attitude error into a desired body rate, inner loop converts rate error into torque, and a mixer maps torque commands to servo PWM outputs. No gimbal lock, no small-angle Euler approximations breaking down at high pitch. BNO055 IMU for attitude sensing, feeding the quaternion pipeline. FlySky iBUS RC input decoded via DMA, so the CPU is not blocked waiting on UART bytes. Flight state machine with signal-loss detection and automatic parachute deployment if the link drops. BMP390 barometer driver, written directly against the datasheet: full double-precision compensation math, baseline altitude averaging with outlier rejection, and a proportional altitude-hold throttle controller. SiK telemetry radio support (Holybro V3) with a simple custom binary packet format and a Python ground station script for logging and monitoring.
I wanted to actually understand the control theory rather than just wiring up a library, so the attitude controller is hand-derived: quaternion error, small-angle linearization, cascaded P control, and a configurable mixer matrix so it can be reconfigured for different control surface layouts (currently a simple aileron/elevator setup, but the mixer supports more).
The project currently runs on a super loop rather than an RTOS. The current processor, an STM32F401CCU6, is not capable enough for a well-working RTOS setup, and the current functionality works well enough on a super loop. I have looked at an RTOS, mainly FreeRTOS, but that is something for the future.
I want to be upfront about this: the flight state machine is written by me. The attitude controller (quaternion error, cascaded control, mixer) was written mostly with AI assistance (roughly 70%), based on the control theory I worked out myself, but I refined and adapted it.
Where I did use AI (mainly Claude) was in the peripheral drivers: the BMP390 register-level driver and the SiK radio packet handling. Datasheet-heavy, boilerplate-adjacent code where AI is genuinely useful for getting the byte-packing and register sequences right quickly, but I still had to understand what it was doing well enough to debug it, which I did (a good example: a compensation math bug where raw ADC values were fine but the calibration coefficient scaling was producing wrong temperature and pressure outputs).
I'm a computer engineering student at Åbo Akademi with a hands-on background: PCB design in EasyEDA Professional, 3D modelling in Fusion 360, soldering (through-hole and SMD) on my own designs. This project is where I apply that alongside actual embedded software and control theory, rather than just building hardware.
Actively developed, breadboard prototype stage. Next steps: flight surface tuning on the bench, then the first test flight.
The next steps are: Finish testing on the different failsafe modes and cases. Start planning the perfboard design and layout (power supply, etc.). Test out the BNO055's ability to handle the vibrations and flight conditions. Implement GPS functionality