Design and Implementation of a Real-Time Quadrotor Flight Controller on STM32 Using an Error-State Kalman Filter and Quaternion-Based Control
This document presents the design and implementation of a quadrotor unmanned aerial vehicle (UAV) flight controller (FC), developed from scratch using the STM32F405 microcontroller unit (MCU). To achieve reliable flight stabilization and state estimation in a resource-constrained environment, the system includes the implementation of an Error-State Kalman Filter (ESKF), which fuses IMU, magnetometer, barometer, and GNSS signals to estimate the precise state. A quaternion-based attitude control is used to avoid singularities during maneuvers. Additionally, position and velocity Proportional control is integrated as a cascaded architecture. To satisfy real-time requirements, a real-time operating system (RTOS) is used. FreeRTOS manages task scheduling guaranteeing a 1kHz control loop, while the Dshot600 protocol is used for accurate motor speed control. Furthermore, the adopted modular software architecture facilitates further system upgrades and maintenance. The results demonstrate that the advanced estimation and control algorithm can be executed on low-power, resource-constrained embedded hardware, enabling low-cost but high-performance flight control solutions for small quadrotor UAV systems.
Authors
- Junho Lee
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2025-12-19
- DOI
- https://doi.org/10.5281/zenodo.17988702
- Primary Topic
- Adaptive Control of Nonlinear Systems
- Type
- article
- Field-Weighted Citation Impact
- 0.00