This article investigates causes of flight instability occasionally observed in Unmanned Aerial Vehicles (UAVs). The issue manifests as unexpected oscillations that can lead to emergency landings. The analysis focuses on delays in the Extended Kalman Filter (EKF) algorithm used to estimate the drone’s altitude, position, and velocity. The authors propose moving the magnetic field estimation calculations to a separate, lower-priority thread so as to not cause delays in the main EKF loop.
The UAV firmware is based on the FreeRTOS real-time operating system. With the help of Percepio Tracealyzer, any anomalies can be detected.