Nonlinear MPC with Motor Failure Identification and Recovery for Safe and Aggressive Multicopter Flight

by   Dimos Tzoumanikas, et al.
Imperial College London

Safe and precise reference tracking is a crucial characteristic of MAVs that have to operate under the influence of external disturbances in cluttered environments. In this paper, we present a NMPC that exploits the fully physics based non-linear dynamics of the system. We furthermore show how the moment and thrust control inputs can be transformed into feasible actuator commands. In order to guarantee safe operation despite potential loss of a motor under which we show our system keeps operating safely, we developed an EKF based motor failure identification algorithm. We verify the effectiveness of the developed pipeline in flight experiments with and without motor failures.



page 1


Fail-safe Flight of a Fully-Actuated Quadcopter in a Single Motor Failure

In this paper, we introduce a new quadcopter fail-safe flight solution t...

Fail-Safe Controller Architectures for Quadcopter with Motor Failures

A fail-safe algorithm in case of motor failure was developed, simulated,...

Investigating Flight Envelope Variation Predictability of Impaired Aircraft using Least-Squares Regression Analysis

Aircraft failures alter the aircraft dynamics and cause maneuvering flig...

Autonomous Quadrotor Flight despite Rotor Failure with Onboard Vision Sensors: Frames vs. Events

Fault-tolerant control is crucial for safety-critical systems, such as q...

Data Set Description: Identifying the Physics Behind an Electric Motor – Data-Driven Learning of the Electrical Behavior (Part II)

A data set was recorded to evaluate different methods for extracting mat...

Identification of Motor Parameters on Coupled Joints

The estimation of the motor torque and friction parameters are crucial f...

Detecting Identification Failure in Moment Condition Models

This paper develops an approach to detect identification failures in a l...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

I Introduction

During the past years, the use of MAVs in applications such as environmental monitoring, aerial filming, surveillance and search and rescue has dramatically increased. However, most commonly used control algorithms lack the necessary robustness needed for the critical applications stated above and they often struggle when aggressive maneuvers are required. To some extent, these problems can be eliminated when the Micro Aerial Vehicle (MAV) model is taken into account in the control design. Model based control approaches such as Model Predictive Controller (MPC

) have become more popular in robotics thanks to increasing computational capabilities and improved algorithmic efficiency. The design and implementation of such algorithms on real robots has become significantly easier due to the open source availability of optimisation and control toolboxes such as

[Houska2011a, adrlCT:SIMPAR, mattingley2012cvxgen]. At the same time, robust performance under mechanical failures (such as motor failures), can only be achieved when the failure can be correctly identified and appropriately handled by the control design. In our paper we address the problem of aggressive, precise and fault tolerant MAV navigation. Our contributions are as follows:

  • The design of a quaternion based non-linear model predictive controller with body torques and collective thrust as the control inputs.

  • The design of a new control allocation algorithm that maps the desired control inputs into feasible thrust commands for each motor. We consider the general case where the motors can generate both positive and negative thrust. Our algorithm takes into account the different motor coefficients for normal and inverted rotation eliminating the need for symmetrical propellers. We show how this can be applied in a motor failure scenario.

  • The design of an EKF which monitors the health of each individual actuator (motor/propeller) which we use for fast identification of an actuator failure.

  • Seamless integration of the failure detection scheme with NMPC and allocation under actuator failure: in particular, our hexacopter platform maintains full controllability (position and yaw) after the loss of one actuator.

Fig. 1: Our MAV experiencing a propeller loss. The fault is identified online and the MAV can still control its position and orientation.

I-a Related Work

Regarding MPC in MAVs, the most common approach is that of a cascade connection between a position and an attitude controller. In the simplest form, a linear model can be used for the translational dynamics, resulting in an optimisation problem whose solution can be solved online [tzoumanikas:JFR, sa:FSR2018] or pre-computed in the form of lookup tables [darivianakis:ICRA2014, papachristos:JIRS]. The use of a non-linear model for the translational dynamics such as the one presented in [Kamel:IFAC2017] presents performance improvements especially when tracking of aggressive trajectories is required. The approach of the cascaded position-attitude controllers has become popular due to its ease of use, since most of the available platforms come with a pre-tuned attitude controller. However, it relies on the assumption that the attitude dynamics can be controlled independently, requiring bandwidth separation between the successive loops, i.e. slow control of attitude. The aforementioned works furthermore use Euler angles for the vehicle orientation which prohibits the operation close to gimbal lock. Analogously to the position-attitude approach the authors of [Falanga:IRO2018] and [Foehn:ICRA2018] propose a quaternion based position controller which uses the angular rates as control inputs. These were assumed to be tracked perfectly by a separate angular rate controller.

The benefits of using the true non-linear model of the MAV has been successfully illustrated in [Kamel:CCA2015] where an attitude NMPC was employed to stabilise a hexacopter with a motor failure. Additionally, the authors of [Neunert:ICRA2016] proposed an Sequential Linear Quadratic (SLQ) MPC algorithm able to run onboard an MAV and capable of following full state trajectory commands. Similarly, in [Crousaz:ICRA2015] simulation results of an SLQ controller stabilizing a quadrotor with slung load and a quadrotor with motor failure were presented.

For the control allocation – that is, the mapping of the control inputs to actuator commands – the most commonly used method employs the pseudo-inverse of the allocation matrix (e.g. [Achtelik:IROS2013, Lee:CDC2010]

). In this case the actuator commands can be obtained through a simple matrix by vector multiplication. However, the main drawback is the fact that it can produce actuator commands that are not feasible. Control allocation techniques that respect the actuator limits, such as the ones presented in

[Faessler:RAL2017, Brescianini:ITCST], result in better trajectory tracking. This is partially due to the prioritisation of the roll/pitch moments and collective thrust over the yaw moment which does not directly contribute to position tracking. Another interesting approach is the one presented in [Brescianini:Mechatronics], where the minimum energy solution is obtained by solving an optimisation problem. The authors exploit the structure of the allocation matrix nullspace in order to transform the original optimisation problem into a computationally cheaper one. Their method can be used on platforms equipped with bidirectional capable motors but requires the use of symmetrical propellers. When non symmetric propellers are used, the resulting allocation matrix is not constant but depends on the direction of rotation of each motor.

As far as fault identification and fault tolerant control are concerned, the authors of [mueller:icra] were among the first to show stable position control (despite losing yaw control) with a quadrotor despite the loss of a single or two opposing propellers. The authors of [schneider:fault_tolerant]

stabilised a hexacopter experiencing a motor failure. However, unlike us, they used an unconventional hexacopter motor layout which enables orientation control despite the loss of up to two motors. None of the above methods includes online fault estimation. This is done in

[saied:icra] where the residuals between the measured and predicted orientation and angular rate are used as criteria for detecting motor failures. Another example is the work presented in [saied:ifac], where faults are identified based on the measured motor speed and electrical current. Compared to these approaches, our method achieves up to three times faster fault detection without relying on additional sensors apart from the onboard Inertia Measurement Unit (IMU).

Ii Notation and Definitions

Vectors are denoted as e.g. , when required with coordinate frame representation as . A rotation matrix changes the coordinates of a vector from to as . We use quaternions analogously i.e. . We further denote the position of a point relative to the origin of as . The motion of the MAV, with body frame (x: forward, y: left, z: upward), is referenced relative to the World-frame (z-axis upward).

Iii System Overview

The software pipeline presented in this paper consists of the following different blocks: (i) the NMPC which receives full state trajectory estimates and commands and outputs body torques and collective thrust as the control inputs; (ii) the Control allocation block which transforms the control inputs to actuator commands and finally (iii) the failure detection algorithm which estimates the health status of each motor and notifies the control allocation block in the case of a failure. An overview of the system is given in Figure 2.

Fig. 2: Overview of the various software components that run onboard the MAV. The control loop runs at 100Hz while the failure detection EKF at 400Hz.

Iv Model Based Control

Iv-a Mav Dynamics

The Newton-Euler equations are used to model the MAV dynamics. We ignore less significant phenomena such as the effect of the aerodynamic friction and the gyroscopic moments due to the rotation of the propellers (but our model could be extended accordingly with ease). The MAV dynamics can then be written in the following form:



stands for the skew symmetric operator,

for the gravitational acceleration, for the MAV mass, and

for the inertia tensor. The thrust vector

acting on the MAV Centre of Mass (CoM) solely depends on the collective thrust generated by the motors. This together with the moments are considered as the control input . The control state , consists of the MAV position, orientation, linear and angular velocities respectively. The motor dynamics are considered significantly faster than the MAV body dynamics and are thus neglected. The generated thrust and moments from the motor are given by:


Unlike approaches such as [Faessler:RAL2017] where the relationship between the motor command and the achieved motor thrust was approximated as a quadratic polynomial, we first estimated the motor and moment coefficients defined in (2) and we later identified the relationship between the motor command and the achieved angular velocity. Figure 3 shows the results obtained from the experimental identification of the thrust and moment coefficients and using a load cell. Since we use non symmetrical propellers which are optimised for rotation in one direction, we identified two sets of coefficients and one for normal rotation and another one for inverted. Regarding the motor command to angular velocity relationship, we experimentally determined the dependency on input battery voltage which does not remain constant during flight. The identification results are illustrated in Figure 4. The obtained quadratic polynomials for different voltage levels were stored in lookup tables and were used online depending on the measured battery voltage 111An easier and more accurate way of handling this problem is by using motors which are equipped with encoders and perform closed loop angular velocity control using the encoder information. However, the commercially available hardware, see is mainly designed for small racing drones and not ones like ours which carries significant payload..

Fig. 3: Experimental identification of the thrust and moment coefficients using a load cell. Each dot corresponds to the mean of 100 measurements and the solid lines correspond to the fitted model as defined in (2). The use of non symmetrical propellers results in different curves for normal and inverted rotation. The least-squares fit error for the thrust and moment model for normal motor rotation is N and Nm respectively. The same quantities for inverted rotation are N and Nm.
Fig. 4: Experimental identification of the relationship between the normalised PWM command and the achieved angular velocity. Dots correspond to averaged measurements and solid lines to the fitted quadratic polynomials. Different colours correspond to different voltage levels applied on the ESCs (here only plotting 12 different cases for visualization purposes).

Iv-B Nonlinear Mpc (Nmpc)

For the control formulation, we define the following time-varying error functions for the position, linear and angular velocity, orientation and control input respectively:


Apart from the orientation error which is obtained through quaternion multiplication, the rest corresponds to the Euclidean difference between the actual and desired (here denoted with the superscript ) quantity.

We compute the optimal control input sequence online by solving the following optimisation problem:

s.t. : (4b)

where is the number of time steps, a known initial state, the discrete-time version of the MAV dynamics given in (1) and , lower and upper bounds for the inputs . We use quadratic costs for the final and intermediate terms defined as:

with gain matrices of appropriate dimensions which are considered tuning parameters. In our implementation we use a 10 ms discretisation step and a constant time horizon = 2.0 s. For the online computation of the optimal input we use the CT toolbox [adrlCT:SIMPAR] and the Gauss-Newton Multiple Shooting (GNMS) algorithm (outlined in [Giftthaler:CoRR2017]

) which result in an average computation time of 5.2 ms with standard deviation of 0.6 ms. At each GNMS iteration dynamically feasible state and input increments

, around the state and input trajectories , are computed. We obtain the dynamics of the minimal state perturbation around the state by introducing the local quaternion perturbation with . The dynamics for the rotation vector are given by: , while the rotation matrix can be approximated as: . After each iteration the state trajectory is updated as: .

Iv-C Control allocation

As stated earlier, the control allocation problem involves mapping the control inputs to feasible actuator commands . We tackle this by solving the following Quadratic Program (QP):

s.t. : (6b)

where is the number of motors. The allocation matrix , which we will present later, depends on the MAV geometry and its motor coefficients, whereas correspond to the minimum and maximum attainable thrust. In order to prioritise the roll/pitch moments and the collective thrust over the yaw moment, we use the weighting matrix . The scalar is used such that solutions with smaller norm are preferred. When a feasible control input is commanded, solution of (6) coincides with the one obtained by using the pseudo-inverse of , namely .

Since we are interested in solving the control allocation problem for the general case where the motors can produce both positive and negative thrust, we introduce the vector with

. We thus use the binary variables

to indicate whether the motor is spinning in its intended normal direction–corresponding to positive thrust ()–or otherwise in the inverse ().

The original optimisation problem (6) is transformed to:

s.t. : (7b)

where the superscript or in , , , has been used to indicate normal and inverted rotation respectively. The vector which encodes the direction of rotation is now an optimization variable and the allocation matrix is a function of . For the case of the hexacopter used in our experiments, takes the following form: , where stands for the MAV arm length, , , and denote the normal and inverted moment coefficients identified in Section IV-A.

The resulting optimisation is a mixed integer programming problem. However, since the possible values of are finite (72 in the case of a hexacopter), we can solve a single QP for each single value of . The global optimum of the optimisation problem defined in (7) corresponds to the solution of the QP with the minimum cost. From a practical perspective solving 72 QPs instead of a single one does not affect significantly the overall control computation time as this is dominated by the computation of the optimal input as described in the previous section. This is owing to the small number of optimisation variables in a single QP tailored to the solver, CVXGEN [mattingley2012cvxgen]. In our implementation, solving 72 QPs, storing the results in a vector and finally sorting it in ascending order consistently takes less than 0.4 ms. We acknowledge, however, that our method is more resource demanding compared to methods using the pseudoinverse which can be easily implemented on a microcontroller.

It was experimentally found that reverting the direction of rotation during flight is particularly impractical. This is because the motor dynamics are significantly slower when a direction change is commanded. As our control model does not capture this behaviour, we can prevent unnecessary direction change commands by augmenting the optimisation (7) similarly to [Brescianini:Mechatronics] with the constraint, where is the set of rotor thrusts that does not require a per motor direction change when this has already happened during the past time interval . The solution satisfying this constraint can be found with a single iteration over the vector of 72 possibilities. The threshold can be iteratively decreased until a good (e.g. ) solution is found.

V Fault Identification

Our goal is to online estimate whether one or more motors have failed (consequently limiting maximum thrust and moments). To do so, we introduce the health variable for each individual motor and assume that the effective force generated from the motor is , where is the logistic function shown in Figure 5 and corresponds to the respective motor thrust. Intuitively, we expect that for a healthy motor and for a stopped one. We implemented an EKF that estimates the set of health variables online (and thus the motor thrust ) for each individual motor. The effective body torques and collective thrust are now given by:


where is the allocation matrix defined in (IV-C), which depends on the moment coefficients and the motor direction of rotation.

Fig. 5: The logistic function used for the EKF. Notice, that it is appropriately scaled such that has finite value.

In our EKF, we use the following prediction and observation models:


The noises , , and

are Gaussian white noise processes with densities

, , and , respectively; the measurement is assumed to be corrupted by and . Furthermore, stands for the per-motor reference thrust as given by the control allocation and for the time constant characterising the first order motor thrust dynamics. The measurements and required for the EKF update are obtained using the onboard IMU. For we use the bias corrected gyro measurements and for measured collective thrust we use with denoting the known mass of the MAV and the accelerometer measurement along the z axis. Notice that our observation model for the collective thrust does not account for the term which appears in the Body frame expressed linear acceleration dynamics. The values for the noise parameters and model constants are given in Table I.

TABLE I: EKF Parameters

In order to avoid false positives due to e.g. inaccurate model, we use the estimated value of and its estimated uncertainty. We thus consider a motor failed when (with denoting the health state standard deviation obtained as a marginal from the state covariance matrix). When the above inequality is true we update the control allocation algorithm by setting for the failed motor and enabling the bidirectional mode for the opposite.

Vi Experiments

We showcase the capabilities of our algorithms in two different scenarios, namely response to step commands and autonomous detection and recovery after a motor failure. For the experiments presented we used a custom-built hexacopter using off-the-shelf components. It consists of a 550 mm wide frame, a Pixhawk flight controller flashed with a modified version of the PX4 firmware and an Intel NUC-7567U onboard computer. We used 960KV motors coupled with the carbon reinforced Aeronaut CAMcarbon propellers and the DYS ARIA bidirectional capable ESCs. A Vicon motion capture system was responsible for providing external position and orientation measurements while all the other components run onboard the MAV.

Vi-a Aggressive step commands

In order to verify the tracking capabilities of the designed NMPC, Figure 6 shows the MAV response for a 2  step in x and z and a 180 step in yaw. The NMPC generated dynamically feasible trajectories which can steer the MAV in any orientation and achieve large linear accelerations (given the physical limitations of the platform) without overshooting. We conducted the same experiment twice using low and high orientation gains and observed that, in the latter case, the NMPC reduces the yaw error faster by simultaneously performing a half flip in roll and pitch.

Fig. 6: Our MAV executing a 2  step in x and z and a 180 step in yaw with low (left) and high (right) orientation gains. Peak acceleration exceeds 15 while peak orientation exceeds 120 in pitch.

Vi-B Fault detection and recovery

We tested the failure detection and autonomous recovery in two different scenarios where one motor was switched off (i) while hovering and another (ii) while the MAV was following setpoint commands. The results regarding the position and yaw tracking along with the online estimated health status of each motor, are shown in Figures 7 and 8. The injected motor failure was correctly identified with a maximum delay of . In both scenarios, the MAV was able to recover with a maximum height loss of . Position and yaw references were still tractable however the 5-motor asymmetric configuration resulted in slower tracking response. Regarding the health status variables of the functioning motors, these always remain close to 1. It can be seen that, in the setpoint experiment, there exist some short-in-duration deviations from 1. These spikes correspond to time instants when large angular accelerations were executed. We consider the main reason for this behaviour to be the mismatch between the EKF prediction model (which does not take into account less significant phenomena, such as gyroscopic moments) and the real one. In any case the estimated upper bound was always greater than 0.8 and thus unable to trigger a false positive.

Fig. 7: Top row: Three different experiments with autonomous fault identification and recovery during hover. In all the experiments the failure was identified and the fail-safe was triggered within 0.18 after the manual deactivation of Motor 1. The MAV was able to recover with a maximum height loss of 0.40 . Bottom row: The online estimates of the health status and their corresponding confidence bounds and the absolute yaw error for the first experiment. Notice how the upper bound estimate for Motor 1 drops below the 0.5 threshold after the motor deactivation at t = 23.68. Once the fail-safe is triggered at t = 23.85, control of yaw (bottom right) is maintained and the error converges to zero.
Fig. 8: Top row: Three different experiments with autonomous fault identification and recovery while following setpoint commands. In all the experiments the failure was identified and the fail-safe was triggered within 0.18 after the manual deactivation of Motor 3. The MAV was able to recover with a maximum height loss of 0.60 . Bottom row: The online estimates of the health status and their corresponding confidence bounds and the absolute yaw error for the first experiment. The upper bound estimate for Motor 3 drops below the 0.5 threshold after the motor deactivation at t = 26.80 . Once the fail-safe is triggered at t = 26.96 , control of yaw (bottom right) is maintained and the error converges to zero.

Vii Conclusion and Future Work

This paper presented a series of algorithms that can be used for aggressive and fault tolerant multicopter navigation. We experimentally verified their performance using a hexacopter although the same approach can be implemented on any other multirotor with minor modifications. Control performance can be further improved by using a more accurate system model, as the current one does not take into account effects such as the motor dynamics, rotor drag and gyroscopic moments. The fault detection EKF can seamlessly be implemented as an algorithmic update on any MAV as it only requires inertial measurements. It can be accordingly extended with speed or current measurements in order to prevent false positives due to large external disturbances. The disadvantage of our approach is that it requires carefully identifying physical parameters such as the motor coefficients and the inertia tensor. By online estimating these as shown in [Burri:JFR2018], we can make the controller adaptive to model changes and eliminate the need for tedious accurate offline identification.