1. Introduction
Unmanned aerial vehicles (UAVs) have been used in many fields, such as photographing, monitoring traffic congestion, survellience, and multi-cameras coverage etc [
1,
2,
3]. The missions for UAVs are becoming more and more challenging. An important problem in a UAV control system is to monitor the sensor or rotor changes when they are working. Much work has been done in this area. It has been shown that the use of an analytic model can allow early detection by measuring available variables. For example, in [
4], the authors develop an incipient fault diagnosis method for a class of induction motors against stator/rotor winding faults; in [
5], the authors present a incipient fault detection filter based on the generalised correntropy criterion; in [
6], the authors propose a diagnosis method for broken rotor by using the analytic equations related to current signals; in [
7], the authors present a fault detection method for a class of linear discrete time-varying systems. On the other hand, for UAV applications, it is important not only to detect sensor faults such as GPS, and inertial measurement units (IMU), but also to accommodate the faults (this is the so-called fault tolerant control). This topic has attracted increasing attention [
8,
9]. In this paper, IMU sensor fault is considered. The problem can be defined as a fault tolerant control that can accommodate IMU sensor faults, maintaining an acceptable performance. In [
10], the authors presented a data-driven sensor fault diagnosis method. In [
11], the authors also use data-driven method for detecting UAV faults. In [
12], the authors propose a classifier for detecting UAV sensor fault. In [
13], the authors use artificial intelligence (AI) method to learn the samples and estimate roll rate after the gyroscope has a fault. In [
14], the authors develop an Euler angle estimator for improving the result of [
13].
In this paper, we propose a fault-tolerant control to handle IMU sensor fault for quadrotor. The main idea is to build an angular rate estimator for the IMU sensor fault detection, which is also used for the IMU recovery. It should be noticed that the IMU fault affects not only angular rate but also the Euler angles. Our paper considers both when designing the estimator. First, the observability analysis is used for selecting the variables for building the angular rate estimator from the sixteen states of the quadrotor studied. Second, the proposed estimator is composed of a long short-term memory (LSTM) neural network trained from the collected data. Third, an Euler angle estimator is designed for improving the angular rate estimation. Finally, a fault diagnosis and IMU recovery mechanism is proposed. The proposed method extends the result of [
14] to more fields: (1) the variable selection of the proposed neural network observer is analyzed; (2) the convergence analysis of the proposed scheme is discussed; (3) the modified estimator of Euler angle is given. The contributions of the present paper include:
4. AI-Based FTC against IMU Sensor Fault
As shown in the quadrotor model, the attitude state includes Euler angles and angular rates. These attitude states can be measured by IMU which contains accelerometer and gyroscope. Sometimes a gyroscope may have faults. This implies that the angular rates may not be available for the rate closed control loop. In this case, the drone may be out of control, causing the drone crash, even if the accelerometer is still available. Of course, in general, the compass is also available (this implies that is known). Thus, we intend to estimate the angular rates by observing other states such as the position (x, y, z), Euler angles as well as the control inputs. The designed estimator will be used for IMU fault detection as well as IMU recovery.
We will first discuss the analysis of the observability in order to design the estimator.
4.1. Selecting Variables
In a quadrotor model, we have the sixteen states including the positions, velocities, Euler angles, angular rates and four PWM signals. How many variables used for designing estimator angular rates is challenging. One way is to analyze nonlinear model. In [
14], we have given the detailed model which is nonlinear. We can use nonlinear observability analysis to decide which variables will be used for the estimator design. The following theorem will be used in our analysis.
Theorem 1. [15] Letwhere x is the manifold of dimension n. Let G be the set of all finite linear combinations formed with the Lie derivatives of with respect to f and constant u. Let dG denote the set of the gradients of the elements of G. The system is weakly (locally) observable if the system satisfies the controllability rank condition at , i.e., dG contains n linearly independent vectors. We focus on the attitude equations and have the following model.
The angular rate controls
and
can be further allocated by the following equations
where
represents the spinning speed of the
ith motor,
and
are the arm length along x and y axes, respectively, and
and
are the thrust and torque constants, respectively.
Furthermore, we assume that the Euler angles have small changes. This implies that
. Rearranging the attitude equations, we have
where
The linear combinations with the Lie derivatives are given by
where
is a constant, and
are the control input constants.
The set of the gradients of G is given by
Check the rank of dG. It is observed that rank(dG)=6. This means that the system is locally observable at the hover state and is verified near hovering state. This property will be lost away from that point.
Furthermore, we consider a full description of quadrotor as
where
represents the position
, and
If considering the measured variables (velocities) to be [], we check if the system is observable. Still, we check the rank of dG and it is not 9, but 7. Thus, it is concluded that in this situation, the system is not observable.
Based on the analysis above, we select ten variables related to the estimator design as shown in
Table 1.
4.2. Neural Network Angular Rate Estimator
For handling gyroscope fault, we will consider to use AI techniques to build a nonlinear mapping function between input and output by learning sample data sets. One of existing AI methods is the LSTM neural network which is powerful in dealing with time series problems. The advantage of LSTM is that the current unit can get the information of all the units before this unit, but the disadvantage is that the information of the units after this unit cannot be obtained. For our application, it is to model sequential data and the LSTM is suitable for our modelling.
It should be noticed that the flight is a time dynamical behavior. Thus, the built LSTM model can be used for estimating or predicting the next state. The variables used in the network are attitude information–roll, pitch and yaw and their corresponding three angular rates. To consider the control action, each PWM signal (it is represented by propeller speed) is also considered. As shown by the observability computation, these ten variables will be used for the LSTM modelling.
For building the LSTM network, the following input and output vectors are used
where
represents the input of the LSTM model at time
t,
including Euler angles and angular rates, represents the LSTM output which is used for observing roll, pitch and yaw rates, and
D represents the data size. In practices,
D will be determined by observing the training performance.
As shown in
Figure 3, in our application, the LSTM network consists of three parts: input, LSTM and output layers.
By the training, the angular rates can be estimated by using the LSTM network as show below
where
,
and
represents the LSTM network. The input and output of the model are shown in
Figure 4.
Before the LSTM training, the data should be normalized for the purpose of the calculation stability. After that, the trained prediction model is used to denormalize the prediction result, so as to compare and analyze the error with the actual value. After the prediction sample data are constructed, the LSTM model can be established for training and prediction according to the following steps.
Step 1. Select a flight or simulation data, and construct training samples and prediction samples.
Step 2. Data preprocessing, normalize training samples and prediction samples.
Step 3. Input the training samples into the LSTM, change the number of hidden layer nodes of the LSTM, and determine the network structure by minimizing the error between the output result and the real sample.
Step 4. Input the prediction sample into the trained network, get the trajectory prediction result, and perform denormalization.
Step 5. compare with other algorithms and analyze the prediction effect. Therefore, the flow chart of the LSTM-based trajectory prediction model algorithm is shown in
Figure 5.
The loss function uses the root mean square error (RMSE) function which is given by
where
is the LSTM output, and
is the output of the sample.
It is observed that the angular rate information can be obtained by
where
For analysis purpose, we re-arrange the equation as
where
. It should be noticed that this can also be written as
Thus, we have the error equation
where
,
and
. A reasonable assumption is that the output of the actual system is bounded. It should be noticed that the neural network output
is bounded. Thus,
is also bounded.
It can be seen that the proposed LSTM network is a nonlinear observer-like estimator by using the observed vector . Such a design can enhance the performance of the estimator. The convergence analysis of the proposed estimator can be given below.
Define a Lyapunov function
Thus, we have
where we have used the inequality
,
Q can be obtained from the following equation
with
denoted as the minimum eigenvalue of
Q. It should be noticed that
if
. This implies that it is uniformly ultimate bounded according to [
16].
It can be observed from the above that the LSTM neural network is a key part in the proposed estimator. It can be trained by learning the samples collected from the drone.
4.3. Euler Angle Estimator
In a quadrotor, the gyroscope sensor not only affects the angular rate measurement, but also Euler angle reading. This implies that when the gyroscope is in faulty state, it also affects the Euler angle reading. Since we assume that the compass works well, the yaw angle is still fine. We will estimate the Euler angles when the gyroscope fault occurs.
For Euler angle estimation, we use the following translational motion equations.
where
,
and
.
Taking normalization of two sides, we have
It should be noticed that
where
Thus, we hve
From our calculation, it can be seen that the vector
does not have the mass
m and thrust
. This simplifies our computation. Thus, we have the following equations
The estimated Euler angle should be calibrated by using the measured acceleration readings . The working principle of using acceleration to estimate Euler angle is as follows.
We can obtain the acceleration information
and the gravity vector
. During the hovering state, by ignoring the effect of yaw, we have
The following calibration is used for estimating angles
where
is a factor which is a filter-like one. This factor is determined by training. The estimation of Euler angle is obtained.
4.4. Imu Fault Detection and Recovery Decision Mechanism
From the obtained LSTM neural network, we can obtain the estimated LSTM network error, that is
, where
y is the sample data, and
is the network output. Based on the statistic information, we can obtain a threshold given by
where
represents the mean of the statistic information,
represents the standard deviation of the statistic information, and
is determined by users. The fault diagnosis mechanism regarding IMU sensor is given by
If the LSTM neural network estimated , IMU has faults in angular rate;
otherwise, IMU has no fault occurrence. In this situation, the actual angular rate measurement is used.
Once the angular rate fault in IMU sensor is detected, the recovery should be made by using the proposed estimator.
Figure 6 shows the angular rate estimator. The entire fault-tolerant control against sensor fault with diagnosis and recovery scheme is shown in
Figure 7, where the fault diagnosis determines the switching between the sensor reading and recovery.
5. Simulation Experiments
The proposed AI-based FTC can be verified by our simulation. During the simulation, the IMU sensor is assumed to have a fault at a certain time and the recovery is triggered to maintain the drone control. The simulation studies below use the computer ThinkPad X390 which has the 8th Gen Intel Core processors. MATLAB and its Deep Learning Toolbox are used in the simulation. The toolbox is a framework developed by the MathWorks used in the development of deep neural networks, including the LSTM network.
The rate gyro fault is considered. The proposed LSTM estimator can predict Euler angle and angular rate by using the previous states. The structure of the proposed LSTM network is composed of 10 inputs, 288 hidden units, and 6 outputs. For the LSTM learning, we use the random number to generate the four rotor control signals which are fed into the quadrotor model of [
14] to receive the six output states (three Euler angles and three angular rates). In total, 59,960 sample data are collected. These data are divided into two groups: training set and test set. The training set has 50,981 samples, while the test set has 8979 samples. For time series
, the delayed term
D is 20. During the LSTM learning, it takes 158 epochs (about 592 min) satisfying the RMSE performance requirement. The convergence process is shown in
Figure 8. For the training set,
Figure 9 shows the estimates of Euler angles, while
Figure 10 shows the estimates of angular rates (we zoom in the figure, having a better insight into the data). For the test set,
Figure 11 shows the estimates of Euler angle, while
Figure 12 shows the estimates of angular rate (we zoom in the figure, having a better insight into the data). It can be seen that the estimated values from the LSTM network closely match the sample data. This implies that the LSTM network can be used for estimating angular rate. Furthermore, the nonlinear estimator is designed by using (23) and (24), where the matrix
L is selected as
As our discussion before, when having IMU fault, Euler angle estimator is necessary for calibration. The calibration rules are shown in Equations (40) and (41), where the factor . The estimated Euler angles are input to the LSTM network.
In the simulation, it is assumed that a fault at IMU (roll rate) occurs at time = 25 s, where the bias fault is introduced (the bias offset is 1.2 rad/s). The random noise with amplitude = 0.00025 rad/s is added in the simulation.
Figure 13 shows the position (xyz) result, while
Figure 14 shows the 2D (xy) result. It should be noticed that the tracking performance along x, y, z axes is good, even the IMU sensor fault occurrence. For the fault diagnosis, we use
Figure 15 to demonstrate it, where the threshold is chosen as 1.01 rad/s. It can be seen that the sensor fault is detected immediately once it happens. Thus, both Euler angle and LSTM estimators are used. The roll rate signal is recovered by using the proposed scheme. For Euler angle estimation, the result is shown in
Figure 16. It can be seen that the difference between both the estimated and actual angles is small. For the roll and pitch rate estimation, the result is shown in
Figure 17. From the figure, it is found that the outputs of the LSTM network are close to the actual ones without fault occurrence. We also tested the control without considering gyroscope fault estimator when the bias fault happens. In this case, we do not use any gyroscope sensor handling.
Figure 18 shows the control performance of the position along x,y,z axes, while
Figure 19 shows the 2D position profile along x,y axes. It is observed that the control performance is poor without considering gyroscope sensor handling. From the figures, it is shown that the position along y-axis is out of control. This also proves that a FTC technology has to incorporate sensor fault processing unit such that the system can continue to be operated safely.
We consider another fault type—multiplication fault. In the simulation, it is assumed that the fault at IMU (roll rate) occurs at time = 25 s, where the roll rate multiplies by 2.8. For this kind of fault,
Figure 20 shows the position (xyz) result, while
Figure 21 shows the 2D (xy) result. It should be noticed that the tracking performance along x, y, z axes is still good, even with the fault occurrence. For the fault diagnosis, we use
Figure 22 to demonstrate it, where the threshold is chosen as 1.01 rad/s. It can be seen that the sensor fault is detected immediately once it happens. Thus, both Euler angle and LSTM estimators are used. The roll rate signal is recovered by using the proposed scheme. For Euler angle estimation, the result is shown in
Figure 23. It can be seen that the difference between both the estimated and actual angles is small. For the roll and pitch rate estimation, the result is shown in
Figure 24. From the figure, it can be seen that the estimated angular rates are close to the actual ones. We also tested the control without considering the sensor estimator. In this case, we do not use any gyroscope sensor handling. Unfortunately, the attitude control is out of control at time = 27.28 s.
Figure 25 shows the control result of Euler angle, where the maximum amplitudes of the roll, pitch and yaw angles are 79.25 rad (4557.3 deg), 33.02 rad (1891.9 deg) and
rad (3.442
deg), respectively.
Figure 26 shows the control result of angular rate. Obviously, a breakdown is observed from the angular rate control.
The proposed LSTM estimator of the angular rate requires to learn sequence data: Euler angle, angular rate and all rotor control signals. As discussed in the previous section, the LSTM is a complex unit which uses a model based on short-term memory processes to build longer-term memory. Two study cases have shown that Euler angle and angular rate can be estimated correctly. Even if during the drone control process, the IMU fault occurs, the designed scheme still can diagnose the fault and recover the sensor information. The drawback of the proposed scheme is that during the whole recovery process, the other sensors such as accelerometer and compass must be healthy.
Comments: In [
13], the authors use the LSTM for the IMU fault diagnosis and recovery. However, the authors assume that Euler angles are available. This is not realistic because the Euler angle measurement is a fusion of gyroscope with accelerometer. This implies that Euler angle measurement is not reliable in this situation. The proposed method solves this issue by adding the Euler angle estimator.