Implementing Quaternion-Based Nonlinear Control for Quadrotors in the PX4 Autopilot Framework

2025-1-9
Yücel, Utku
Designing custom controllers for UAVs requires fast, reliable, and repeatable testing methods. This study addresses this need with a way to implement custom controllers directly within PX4, retaining community-powered safe and reliable features. PX4, an open-source autopilot platform, provides a modular architecture that allows implementation of custom control algorithms. In this study, integration of novel control algorithms into the PX4 autopilot system by two different methods is demonstrated: by using the UAV Toolbox Support Package for PX4 Autopilots, and by modifying the open-source code directly. The process is exemplified by implementing a previously developed Quaternion-Based Nonlinear Controller and an LQT (Linear Quadratic Tracking) Velocity Controller. By taking advantage of the open-source nature and modular design of PX4, the manuscript will present an effective method to implement novel controller approaches on platforms for real-world testing.The workflow involving Simulink Toolbox begins by implementing the custom controller in Simulink environment and using the toolbox to embed the design into PX4 software. The workflow continues with Software-In-The-Loop (SITL) testing. The second workflow begins with setting up the PX4 development environment, followed by creating a custom flight mode that activates the desired controller that is implemented as a module inside the software. The custom controller is then tested and verified using SITL simulations. The latter of the two workflows is selected for the real-world application which involves building a quadrotor that uses PX4 autopilot and has the modified software that includes the custom controller. Finally, the quadrotor is tested to validate simulation findings. The flight tests validate the findings of the SITL in terms of viability of the selected workflow.
Citation Formats
U. Yücel, “Implementing Quaternion-Based Nonlinear Control for Quadrotors in the PX4 Autopilot Framework,” M.S. - Master of Science, Middle East Technical University, 2025.