This repository contains the source code used for the research results in [1]. The publication is about passive fault-tolerant control of quadrotors subjected to a complete rotor failure. Passive means that the error does not have to be detected. The controller presented here is based on the methods of Incremental Nonlinear Dynamic Inversion (INDI) and Control Allocation (CA) with prioritization of roll and pitch attitude over yaw. This code can be used to reproduce the figures from [1], on the one hand, and to investigate other rotor failures in simulation, on the other. For further information see [1].
[1] Beyer, Y., Steen, M., & Hecker, P. (2023). Incremental Passive Fault-Tolerant Control for Quadrotors Subjected to a Complete Rotor Failure. Journal of Guidance, Control, and Dynamics, Advance online publication. https://doi.org/10.2514/1.G007475
-
MATLAB:
- You need MATLAB/Simulink 2018b or later (older versions may work but they are not supported).
- You also need the following MATLAB toolboxes:
- Curve Fitting Toolbox (purpose: propeller map interpolation; if you don't have it, you can replace the propeller map interpolation with the simple propeller model in Ref. [1])
- Simulink Coder, MATLAB Coder (purpose: only for code generation for flight tests; if you don't have it, you can still run the simulations)
-
This repository:
Clone this project including the submodules LADAC and LADAC-Example-Data:git clone --recursive https://github.com/iff-gsc/passive-ftc-quadrotor.git
-
FlightGear (optional; for visualization):
You should install FlightGear for visualization. Tested versions are FlightGear 3.4.0 and FlightGear 2019.1.1 but others should also work.
- Open and run init_Minnie_Loiter_FTC located in scripts in MATLAB (if it is not on the MATLAB path already, click Change Folder or Add to Path).
- The Simulink model QuadcopterSimModel_Loiter_FTC located in models should appear after step 1. Run this model.
- Run FlightGear visualization by executing runfg_IRIS.sh (Linux) or runfg_IRIS.bat (Windows) located in the FlightGear folder.
By default the quadrotor will be initialized in hover and start to fly a square after 5 seconds. The front right motor fails after 6 seconds.
- Customize simulation:
- You can initialize the simulation (quadrotor model and controller) by running init_Minnie_Loiter_FTC in the scripts folder.
- You can change the parameters
failure_...
in order to create different failure scenarios.
- You can create the figures from [1] by running the
plot_...
files located in the scripts folder. - You can implement the Simulink flight controller in ArduPilot in order to perform flight tests.
- Run init_Arducopter_Minnie_FTC located in the scripts folder. This will initialize and open the Simulink model ArduCopter_MinnieLoiterFtc.
- Click on the
Build Model
button in the menu of the Simulink model in order to generate C++ code. - Continue with the instructions in the Readme located in modules/ladac/utilities/interfaces_external_programs/ArduPilot_custom_controller.
- After successful implementation of the C++ code in ArduPilot you may want to perform SITL simulations before the flight test. Therefore, use the initialization script init_quadcopter_Minnie_ArduPilot_SITL and follow the instructions in the Readme located in modules/ladac/utilities/interfaces_external_programs/ArduPilot_SITL. For the quadrotor Minnie you should load the ArduPilot parameters Minnie.parm.