Preliminary Communication
This article belongs to the Special Issue No. 1, 2026 on Security 4.0 – Cybersecurity and Digital Resilience of Information Systems (CYRES 2026)
Ž. Jovanović, K. Kuk, and E. Mekić, “State-Machine Oscillations and Anomaly Detection in PX4 Offboard Mode Using Timed Automata Observers,” International Journal of Innovative Solutions in Engineering, no. S1, pp. 110–125, Oct. 2026, doi: 10.47960/3029-3200.2026.S1.110.
pages 110-125
Download a citation file:
Preview and download a citation file in BibTex format that can be imported by citation management software, including Mendeley, EndNote, ProCite, RefWorks, and Reference Manager.
Abstract
Drones, as unmanned aerial vehicles (UAVs), operate through a predefined set of flight states. In this work, the PX4 autopilot is modeled as a state machine designed with drone safety as a primary consideration. Individual states and the corresponding transition conditions are defined to describe the behavior of the autopilot during flight. An experiment is conducted to investigate the influence of setpoint commands received from an external source on the PX4 state machine. Particular attention is given to scenarios in which oscillations between states occur, representing anomalous behavior that may lead to instability in drone operation. Communication is established among the PX4 autopilot, a ground control station (GCS), and a Python script executed on a computer within the same local network. The command format follows the MAVLink 2.0 communication protocol. The Python script provides external control of the UAV while operating in Offboard mode. The PX4 parameter COM_OF_LOSS_T specifies the timeout interval after which the autopilot triggers a failsafe action if a new setpoint message is not received within the defined period. The most significant behavior is observed when the delay between two consecutive setpoint messages is approximately 50 ms longer than the timeout specified by COM_OF_LOSS_T. Under these conditions, the UAV repeatedly transitions between its current operational state and the failsafe state, thereby producing oscillatory behavior in the PX4 state machine. The activated failsafe mechanism consequently forces the UAV to initiate a landing procedure.
Keywords
UAV, State Machine, Offboard Mode, COM_OF_LOSS_T, MAVLink
ijise ID
33
Publication Date
In Press
References
- T. Vas, K. Károly, S. Zsembery, and G. Horváth, “Comprehensive Study of Military and Civil Drone Applications: Assessing Key Areas of Significance and Future Prospects,” RepTudKoz, vol. 35, no. 3, pp. 149–170, 2023, doi: 10.32560/rk.2023.3.10.
- N. Aliane, “A Survey of Open-Source UAV Autopilots,” Electronics, vol. 13, no. 23, p. 4785, Dec. 2024, doi: 10.3390/electronics13234785.
- “Offboard Mode (Generic/All Frames) | PX4 Guide (v1.16).” Accessed: Aug. 11, 2026. [Online]. Available: https://docs.px4.io/v1.16/en/flight_modes/offboard
- A. Koubaa, A. Allouch, M. Alajlan, Y. Javed, A. Belghith, and M. Khalgui, “Micro Air Vehicle Link (MAVlink) in a Nutshell: A Survey,” IEEE Access, vol. 7, pp. 87658–87680, 2019, doi: 10.1109/ACCESS.2019.2924410.
- F. Taha AL-Dhief et al., “Performance Comparison between TCP and UDP Protocols in Different Simulation Scenarios,” IJET, vol. 7, no. 4.36, pp. 172–176, Dec. 2018, doi: 10.14419/ijet.v7i4.36.23739.
- “Parameter Reference | PX4 Guide (main).” Accessed: Aug. 11, 2026. [Online]. Available: https://docs.px4.io/main/en/advanced_config/parameter_reference#COM_OF_LOSS_T
- A Program Generator for Object-Based Implementation of Communication Protocol Software.” Accessed: Aug. 11, 2026. [Online]. Available: https://www.researchgate.net/publication/2823657_A_Program_Generator_for_Object-Based_Implementation_of_Communication_Protocol_Software
- R. Ah and D. L. Dill, “A theory of timed automata*,” 1990.
- “Flight Modes (Multicopter) | PX4 Guide (main).” Accessed: Sep. 12, 2026. [Online]. Available: https://docs.px4.io/main/en/flight_modes_mc/
- “Arm, Disarm, Prearm Configuration | PX4 Guide (main).” Accessed: Aug. 12, 2026. [Online]. Available: https://docs.px4.io/main/en/advanced_config/prearm_arm_disarm
- A. Allouch, O. Cheikhrouhou, A. Koubaa, M. Khalgui, and T. Abbes, “MAVSec: Securing the MAVLink Protocol for Ardupilot/PX4 Unmanned Aerial Systems,” in 2019 15th International Wireless Communications & Mobile Computing Conference (IWCMC), Tangier, Morocco: IEEE, Jun. 2019, pp. 621–628. doi: 10.1109/IWCMC.2019.8766667.
- M. A. Hamza, M. Mohsin, M. Khalil, and S. M. Kazam Abbas Kazmi, “MAVLink Protocol: A Survey of Security Threats and Countermeasures,” in 2024 4th International Conference on Digital Futures and Transformative Technologies (ICoDT2), Islamabad, Pakistan: IEEE, Oct. 2024, pp. 1–8. doi: 10.1109/ICoDT262145.2024.10740195.
- F. Du, J. Ge, W. Wang, Y. Zou, S.-Y. Chang, and W. Fan, “Exploiting the Vulnerabilities in MAVLink Protocol for UAV Hijacking,” in 2024 17th International Conference on Security of Information and Networks (SIN), Sydney, Australia: IEEE, Dec. 2024, pp. 1–8. doi: 10.1109/SIN63213.2024.10871546.
- “SITL Simulator (Software in the Loop) – Dev documentation.” Accessed: Aug. 14, 2026. [Online]. Available: https://ardupilot.org/dev/docs/sitl-simulator-software-in-the-loop.html
- “Mission Planner Home – Mission Planner documentation.” Accessed: Aug. 11, 2026. [Online]. Available: https://ardupilot.org/planner/
- “MAVProxy – MAVProxy documentation.” Accessed: Aug. 11, 2026. [Online]. Available: https://ardupilot.org/mavproxy/
- “Simulation | PX4 Guide (main).” Accessed: Aug. 11, 2026. [Online]. Available: https://docs.px4.io/main/en/simulation/#sitl-simulation-environment
- “QGroundControl – Drone Control – Ground Control Station for Small Air – Land – Water Autonomous Unmanned Systems.” Accessed: Aug. 12, 2026. [Online]. Available: https://qgroundcontrol.com/
- “MAVLINK Common Message Set (common.xml) | MAVLink Guide.” Accessed: Aug. 11, 2026. [Online]. Available: https://mavlink.io/en/messages/common.html
- “Using Pymavlink Libraries (mavgen) | MAVLink Guide.” Accessed: Aug. 14, 2026. [Online]. Available: https://mavlink.io/en/mavgen_python/
- H. S. Purba, R. A. Sukmawati, A. Yono, and M. H. Adini, “Evaluating the Feasibility of Ubuntu-Based Software for Learning in the Computer Education Program at ULM,” in Proceedings of the 7th International Conference on Education and Social Sciences (ICESS 2025), vol. 1016, B. Z. Melani, S. Hadisaputra, S. Farmasari, L. R. T. Savalas, Z. Zhang, N. Jiang, and M. N. A. B. Mohamed, Eds., Paris: Atlantis Press SARL, 2026, pp. 155–170. doi: 10.2991/978-2-38476-579-9_13.
- R. Karamagi, S. A.-A. J. C. S. E. Surv, and undefined 2020, “Implementation of Inter-Networking with Host Internet in Oracle® VirtualBox Guest Virtual Machines,” researchgate.net, vol. 8, no. 2, p. 10, 2020.
- S. Bin Uzayr, Mastering Visual Studio Code: A Beginner’s Guide, 1st ed. Boca Raton: CRC Press, 2022. doi: 10.1201/9781003311973.
- M. Ben-Ari and F. Mondada, “Finite State Machines,” in Elements of Robotics, Cham: Springer International Publishing, 2018, pp. 55–61. doi: 10.1007/978-3-319-62533-1_4.
- “Parameter Reference | PX4 Guide (main).” Accessed: Aug. 14, 2026. [Online]. Available: https://docs.px4.io/main/en/advanced_config/parameter_reference#COM_DISARM_PRFLT
- “Parameter Reference | PX4 Guide (main).” Accessed: Aug. 14, 2026. [Online]. Available: https://docs.px4.io/main/en/advanced_config/parameter_reference#COM_DISARM_LAND
- “GitHub – PX4/PX4-Autopilot: PX4 Autopilot Software · GitHub.” Accessed: Aug. 12, 2026. [Online]. Available: https://github.com/PX4/PX4-Autopilot
- “QGroundControl Guide | QGC Guide (v5.0).” Accessed: Aug. 11, 2026. [Online]. Available: https://docs.qgroundcontrol.com/Stable_V5.0/en/qgc-user-guide/
- “Flight Review.” Accessed: Aug. 12, 2026. [Online]. Available: https://review.px4.io/