Model and Data-Driven Combination: A Fault Diagnosis and Localization Method for Unknown Fault Size of Quadrotor UAV Actuator Based on Extended State Observer and Deep Forest

The rotor is an essential actuator of quadrotor UAV, and is prone to failure due to high speed rotation and environmental disturbances. It is difficult to diagnose rotor faults and identify the fault localization simultaneously. In this paper, we propose a fault diagnosis and localization scheme based on the Extended State Observer (ESO) and Deep Forest (DF). This scheme can accurately complete the fault diagnosis and localization for the quadrotor UAV actuator without knowing the fault size by combining the model-based and the data-driven methods. First, we obtain the angular acceleration residual signal of the quadrotor UAV by using ESO. The residual signal is the difference between the observed state of ESO and the true fault state. Then, we design the residual feature analysis method by considering the position distribution of the quadrotor UAV actuator. This method can embed the actuator fault localization information into the fault data by simultaneously considering pitch and roll of the quadrotor UAV. Finally, we complete the fault diagnosis and localization of the quadrotor UAV actuator by processing the fault data by using DF. This scheme has the advantages of straightforward observer modeling, strong generalization ability, adaptability to small sample data, and few hyperparameters. Our simulation results indicate that the accuracy of the proposed scheme reaches more than 99% for the unknown size of the quadrotor UAV actuator fault.


Introduction
In recent years, quadrotor Unmanned Aerial Vehicle (UAV) has gradually become an important part of people's lives [1].The quadrotor UAV has the advantages of simple operation, vertical take-off and landing, and good flexibility [2].It is widely used in video shooting, agricultural cultivation, logistics transportation, and other fields [3].With the research on the reliability of quadrotor UAV, the fault diagnosis of quadrotor UAV actuator has also become one of the research hotspots [4].The actuator of quadrotor UAV is usually in the working state of high speed rotation [5].Due to frequent task execution and environmental interference, these actuators usually experience various failures leading to efficiency reduction, circuit, and mechanical damage [6].Accurately finding the actuator fault localization and determining the fault type can greatly improve the reliability techniques of quadrotor UAV [7].Therefore, it is necessary to study the fault diagnosis for the quadrotor UAV actuator [8].
The fault diagnosis methods for the quadrotor UAV actuator are mainly categorized into model-based and data-driven methods [9].Ren et al. [10] completed the fault diagnosis of quadrotor UAV actuator by designing the Robust H-Infinity Observer.Gao et al. [11] combined Extended Kalman Filter and adaptive estimation method to diagnose actuator fault types.The above model-based methods require accurate mathematical modeling of the quadrotor UAV and the actuator [12].Model-based methods are also difficult to effectively achieve accurate modeling of interference and various errors.With the development of machine learning technique, data-driven methods are widely used in fault diagnosis [13].Park et al. [14] applied the neural network method to the actuator fault diagnosis of a quadrotor UAV under unknown control signals.In this method, the network with hundreds of layers increases the computation amount and the design process is complicated.Fu et al. [9] combined convolutional neural networks and long short-term memory networks to establish the fault localization model of UAV actuator.Although this method completed the fault localization of the actuator, it did not consider the fault diagnosis of different types of actuator faults.The data-driven method can achieve high fault diagnosis accuracy without relying on the model, but it is prone to overfitting and cannot effectively deal with the fault diagnosis under the condition of system state change.
Actuator fault type diagnosis and fault localization identification are very important for quadrotor UAV actuator fault diagnosis, but they are usually carried out separately.In this paper, we propose a fault diagnosis and localization scheme for a quadrotor UAV actuator based on ESO-DF under the condition of unknown fault size.In this scheme, model-based and data-driven methods are combined to realize fault type diagnosis and fault localization identification simultaneously.The Extended State Observer (ESO) is an observer in Active Disturbance Rejection Control (ADRC) [15].ESO can track the motion state of the system quickly and accurately with a small number of parameters [16].Li et al. [17] has achieved good results by applying ESO to autonomous underwater vehicle actuator fault diagnosis.DF is an ensemble learning method based on decision tree proposed by Zhou et al. [18].This method has the advantages of less hyperparameters, less computation, and small sample size.Qin et al. [19] applied DF to realize the fault diagnosis of rolling bearing.For the fault diagnosis of quadrotor UAV, Ai et al. [20] applied DF to the fault diagnosis of quadrotor UAV for the first time, which verifies the effectiveness of DF in fault diagnosis.
In order to better extract the fault features of quadrotor UAV actuators, we have made corresponding improvements to ESO [21].We extract the angular acceleration of pitch and roll through the improved ESO to extract fault features.In addition, in order to confirm the location of the actuator failure, we designed an actuator residual feature analysis method combined with the location distribution of the quadrotor UAV actuator [22].Through this method, we can embed the fault location information of the actuator into the residual fault data.Finally, we completed the fault type diagnosis and fault localization identification of the quadrotor UAV actuator by using the DF method.
The contributions of this paper are summarized as follows: 1.
We have improved the ESO combined with the characteristics of the quadrotor UAV actuator failure.We obtain the angular acceleration containing the fault characteristics of the quadrotor UAV actuator through ESO.

2.
Aiming at the problem of fault location identification of quadrotor UAV actuators, we designed an analysis method of actuator fault residual characteristics.By combining the angular acceleration information of pitch and roll, the method embeds the fault location information of the actuator into the fault data.

3.
Aiming at the problem that the judgment of the fault type and the fault location cannot be obtained at the same time, we designed an actuator fault diagnosis and localization scheme based on ESO-DF.By combining the model-based method and the data-driven method, the scheme fully extracts fault features and achieves high-accuracy fault diagnosis and localization results.
The remainder of this paper is organized as follows.The problem definition and basic theory are introduced in Section 2. In Section 3, the proposed method is introduced.In Section 4, the setup of the simulation experiments is presented and the results of the experiments are analyzed.Finally, conclusion is given in Section 5.

Mathematical Model of Quadrotor UAV
In the simulation experiment of this paper, we have the following three assumptions on the mathematical model of the quadrotor UAV:

•
The quadrotor UAV is a rigid body.

•
The mass of the quadrotor UAV is uniformly distributed and the center of mass overlaps with the geometric center.

•
The four actuators of the quadrotor UAV are evenly distributed on the fuselage according to the X shape, as shown in Figure 1.The six-degree-of-freedom mathematical model [23] of the quadrotor UAV is shown below: where (x, y, z) represents the coordinates of the center of mass of the vehicle under the earth coordinate system.θ, φ, and ψ are the pitch, roll and yaw angle, respectively.j r refers to the rotational inertia of the rotor.m, g represent the mass and gravitational acceleration of the quadrotor drone, respectively.U 1 represents the lift of a quadrotor UAV.U 2 , U 3 , and U 4 represent the aerodynamic moment.D x , D y , and D z are air resistance coefficients of three axes.J x , J y , and J z refer to the rotational inertia of the body.

Actuator Fault Model
In this paper, the quadrotor UAV actuator faults mainly include speed constant deviation faults and speed gain loss faults [24].

Actuator Speed Constant Deviation Fault
The speed constant deviation fault is usually caused by bias current or bias voltage in the circuit.The fault model is as follows.
where ω(t) represents the rotational speed of the actuator under no-fault conditions.ω f (t) represents the actual rotational speed of the actuator.∆ represents the deviation speed value between the actual value of the actuator rotational speed and the expected value.At t = t f , the actuator has a fault with a speed deviation value of ∆.

Actuator Speed Gain Loss Fault
The speed gain loss fault is usually caused by mechanical damage to the motor or propeller.The fault model is as follows.
where ω(t) represents the rotational speed of the actuator under no-fault conditions.ω f (t) represents the actual rotational speed of the actuator.ρ represents the actuator speed gain loss factor.At t = t f , the actuator has a fault with speed gain loss.

Extended State Observer (ESO)
The purpose of ESO is to solve the core problem of the observation of disturbances in ADRC.It borrows the idea of the state observer in modern control theory, that is, on the basis of observing the state variables a 1 , a 2 . . .a n of the system, all factors that affect the output of the controlled object except the control quantity are called the total disturbance f (x 1 , x 2 , . . .x n ).Then, it expands the total disturbance into a new state variable a n+1 , and uses its special feedback mechanism to establish an expanded state observer to observe the total disturbance.The biggest advantage of ESO is that it does not depend on the model that generates the perturbation.It also does not require a detailed and accurate system model to estimate the model parameter uncertainty and the total disturbance value caused by changes in the external environment.In the final output, the observed disturbances are offset in real time to obtain the estimated the total disturbance by ESO.
The following is an introduction to the ESO design of a second-order system.Equation ( 9) is the ADRC form of a second-order system.
where f (x 1 , x 2 , . . .x n ) is the total disturbance.It contains the internal disturbance generated by the system state variable x 1 , x 2 and the external disturbance ω(t).In order to observe the specific size of f (x 1 , x 2 , . . .x n ), we introduce a new state variable 9) to obtain the expanded second-order system as shown in Equation (10).
For better tracking of the expanded third-order system, the following linear ESO is established for Equation (11): where e 1 is the error between the observed quantity a 1 and the output y of the controlled object.u is the output value of the controller.β 1 , β 2 , and β 3 are related to the bandwidth ω b of the system.when t → ∞, e 1 → 0, in other words, a 1 → x 1 , a 2 → x 2 , a 3 → x 3 .Through the above proof, the observation of the total disturbance can be realized.

Deep Forest
Deep Forest (DF) is an ensemble learning method based on decision tree proposed by Professor Zhihua Zhou in 2017.DF mainly consists of two parts as shown in Figure 2: Multi-Grained Scanning (MGS) and Cascade Forest (CF).After the original input features are expanded by MGS, they are input into CF for classification.The features are filtered through multiple layers in CF, and the final classification category can be obtained.The following describes the specific implementation process of DF based on the three-category classification of sequences whose original input features are 400 dimensions.

Multi-Grained Scanning
MGS is a method of feature expansion.The original features are cut by sliding windows to enhance the classification effect of CF.In Figure 2, MGS cuts the original 400-dimensional input features through 100-dimensional, 200-dimensional, and 300-dimensional sliding windows with a step size of 1 dimension.In total, 301, 201 and 101 features are obtained, respectively.Then, each segment of the obtained features is input into Forest A and Forest B, respectively.Then, feature extraction is performed on each segment of features through Forest A and Forest B, respectively.After each feature passes through Forest A or Forest B, a three-dimensional feature can be obtained.All the features extracted from Forest A and Forest B obtained by each sliding window are connected together.A 100-dimensional sliding window can obtain 301 (number of features) × 2 (Forest A and Forest B) × 3 (3-dimensional features) = 1806 dimensions, as shown in Figure 2. Similarly, a 200-dimensional sliding window and a 300-dimensional sliding window can obtain 1206-dimensional features and 606-dimensional features, respectively.Finally, by concatenating the features obtained by the three sliding windows, the 3618-dimensional features are obtained as the input of CF.
In MGS, Forest A and Forest B are two kinds of decision trees.Decision trees can complete the classification task of input features.The original 400-dimensional input features are transformed into 3618-dimensional features after feature extraction by MGS.This process completes the enhancement of the original features, which is beneficial to the classification process of CF.

Cascade Forest
CF is a module that completes the classification work inside DF, as shown in Figure 2. CF is composed of multiple layers of forest.Each layer of CF consists of multiple forests.For-est is an optional decision tree classification method, and its number in cascaded forests can also be set.The input to the first layer of CF is 3618-dimensional features obtained by MGS.After each feature passes through each forest in each layer, a 3-dimensional feature can be obtained.Since the default number of forests is 4, the features of 3 × 4 = 12 dimensions can be obtained after each layer.In order to enhance the classification ability, the obtained 12-dimensional features are connected with the input of 3618-dimensional features of the cascade forest and then input to the next layer for processing.CF performs a loss calculation on the classification results of each layer.When the classification results obtained by several consecutive layers do not change, the final classification category can be obtained by calculating the average and maximum values of the classification results of the last layer.

The Proposed Scheme
In this section, the overall framework of our proposed ESO-DF scheme is presented first in Section 3.1.Then, two key parts of the proposed ESO-DF scheme are described in Sections 3.2 and 3.3, respectively, namely, the residual acquisition method based on ESO and the designed residual feature analysis method.In addition, Section 3.4 describes the procedure for establishing an actuator fault data set.Finally, the fault diagnosis and localization process of the unknown fault size of the quadrotor UAV actuator based on the proposed ESD-DF scheme is described in detail at the end of this section.

Fault Diagnosis and Localization Scheme Based on ESO-DF
The overall framework of fault diagnosis and localization of the quadrotor UAV actuator based on ESO-DF under the condition of unknown fault size is shown in Figure 3. First, we send maneuver control commands to the quadrotor UAV.The UAV maneuvers according to the control commands.The sensor collects angular acceleration information according to the actual motion state of the UAV.ESO obtains residual data including actuator fault information according to the control torque calculated by the controller and the angular acceleration information collected by the sensor.In order to obtain the actuator fault location information, we designed an actuator residual feature analysis method based on the location distribution of the quadrotor UAV actuator.With this method, the information of the fault location is embedded in the fault data.Finally, a fault data sequence containing fault type and fault location information is obtained.We feed the failure data sequence into the DF for training and testing.Through the above process, we have completed the fault diagnosis and localization of the quadrotor UAV actuator.

Residual Acquisition Method Based on ESO
ESO can accurately track the movement status of the quadrotor UAV according to maneuver control command.ESO can estimate the approximate total disturbance based on the input and output data of the system.The performance of ESO is only related to the estimation accuracy of b 0 and the observer bandwidth [25].In Equation (11), the input of the ESO is the control torque and the angle measured by the sensor after the solution, and the output of the ESO is the angle residual information.In order to obtain the fault information of the actuator, we have improved the ESO combined with the fault characteristics of the actuator.When an actuator fails, its failure characteristics will first be reflected in the lift.When there is an abnormal state of lift, the angular acceleration, not the angle, will change significantly.So we made some improvements to ESO based on this feature so that ESO can output angular acceleration residual information.When a certain actuator fails, the angular acceleration residual information output by the ESO will change significantly.Since the pitch and roll channel of quadrotor UAV are similar, the ESO model of angular acceleration of pitch channel is introduced below.The model is as follows: where β 1 , β 2 , and β 3 are related to the bandwidth ω b of the system.e θ is the residual between the angle observed by the ESO and the angle measured by the sensor.θ is the measured value of the pitch angle acceleration sensor.U 3 is the pitch axis control torque, see Equation (2).
When t → ∞, a 1 → θ, thus e θ → 0. We take the difference between the ȧ2 observed by the ESO based on the control torque and the angular acceleration θ measured by the sensor to obtain e θ .e θ is the residual difference between the angular acceleration observed by ESO and that measured by sensor.From the ESO model of Equation (12), it can be seen that the characteristics of actuator fault under maneuvering conditions can be obtained without introducing additional signals.

Residual Feature Analysis Method
We designed an actuator residual feature analysis method by combining the actuator position distribution of quadrotor UAV.Since the actuators of the quadrotor UAV are X-shaped and evenly distributed around the body, the four actuators will have different effects on pitch and roll when they fail separately; therefore, we embedded fault localization information into the fault data by splicing the angular acceleration of pitch and roll in the time dimension, as shown in Figure 4.

Fault Dataset Establishment
The attitude maneuver of the quadrotor UAV is carried out according to the maneuver control command at t = t d .The actuator fails while performing a maneuver, that is, a fault of random size is injected into the actuator at t = t d .Then, we obtain angular acceleration residual data by using ESO.After that, the residual signal in [t d − ∆t/2, t d + ∆t/2] is intercepted.We obtain fault data by processing the intercepted residual signal using the actuator residual feature analysis method.Finally, we build the actuator failure dataset by repeating the experiments for N times.

Workflow of Actuator Fault Diagnosis and Localization Based on ESO-DF
The workflow of the proposed ESO-DF based actuator fault diagnosis and localization scheme is depicted in Figure 5.

Maneuvering Control Command
Establishment  The entire process can be split into two parts: training and testing.The specific steps are set out below.

1.
Injecting faults into actuators while maneuvering: injecting faults into actuators while the quadrotor UAV is performing attitude maneuvers.

2.
Extracting residual fault signals: According to the control torque and the angular acceleration information measured by the sensor, the ESO outputs the angular acceleration residual sequence containing the actuator fault information, that is, the fault data.

3.
Embedding fault localization information into fault data: we apply residual feature analysis method to embed fault localization information into fault data.The fault data obtained by embedding fault location information are a time series of a certain length.Actuator fault diagnosis and localization: We complete the fault diagnosis and localization of the quadrotor UAV actuator by processing the test fault data using the trained model.

Metrics
The evaluation metrics used in this paper include accuracy, precision, recall, and F 1 score.The F 1 score is the harmonic average of the precision and recall indicators.The calculation of various indicators is below.
The accuracy is one of the important evaluation metrics to measure the fault diagnosis model.The calculation formula is as follows: where n samples is the number of all fault samples.y is the sample true fault type label.ŷ is the predicted fault type label for all samples.I(•) is an indicator function, when y is completely equal to ŷ, the value of I(•) is 1, otherwise the value of I(•) is 0.
For each sample under each fault type, the precision is the ratio of the number of correctly predicted labels to the number of labels predicted to be correct by the classifier.The calculation formula is as follows: where y s is the label data of the real fault type.ŷs is the label data for the predicted fault type.
For each sample under each fault type, the recall is the proportion of the number of correct predicted labels in the total number of correct labels.The calculation formula is as follows: where y s is the label data of the real fault type.ŷs is the label data for the predicted fault type.The F 1 score takes into account the precision and recall rate of the classification model at the same time.It is a harmonic average of the precision rate and recall rate of the model.The calculation formula is as follows:

Simulation Setup and Data Acquisition
In this paper, the maneuver control instructions provided to the quadrotor UAV are shown in Equations ( 17)- (19).The attitude maneuver of the quadrotor UAV is carried out according to Equation (1) to Equation ( 6) and maneuver control instructions.When maneuvering, a fault is injected into the actuator of the quadrotor UAV according to Equations ( 7) and (8), that is, t f = t d .Then, we obtain the residual fault data according to Equation (12).In Equation (12), ω b = 100, b 0 = 13.9237.The mean value of measurement noise of angular acceleration measured by the sensor is 0, and the variance is 0.1 rad/s.
where ψ is the yaw angle, θ is the pitch angle, ϕ is the roll angle.ϕ d is the desired roll angle command for maneuvering at t = t d .
During the experiment, the size of the roll angle maneuver control command ϕ d sent to the quadrotor UAV at t = t d = 2 s is a random number between [0 • , 20 • ].When t f = t d = 2 s, the speed constant deviation fault and the speed gain loss fault are injected into the four actuators, respectively.The size of the speed deviation value ∆ is a random number between [50 n/s, 800 n/s].The angle signal and residual signal of No. 1 actuator with ∆ = 200 n/s fault at ϕ d = 10 • are shown in Figure 6.The size of the speed gain loss factor ρ is a random number between [0.5, 1.0].The angle signal and residual signal of No. 1 actuator with ρ = 0.7 fault at ϕ d = 10 • are shown in Figure 7.Each actuator repeats the experiment to obtain 100 sets of data under no-fault conditions, and repeats the experiment to obtain 400 sets of data under the condition of constant speed deviation fault and speed gain loss fault, for a total of 900 sets of data.Finally, we obtain 3600 sets of training data and test data, respectively.

Actuator Fault Localization Analysis
The actuators of the quadrotor UAV are evenly distributed on the fuselage, as shown in Figure 1.When different actuators fail, the state changes of pitch and roll of the quadrotor UAV are different.It can be seen from Figure 6 that when Actuator 1 has a constant rotational speed deviation fault, the pitch state will increase while the roll state will decrease.As can be seen from Figure 7, when Actuator 1 has a failure of rotational speed gain loss, the state of pitch will decrease and the state of roll will increase.Through simulation experiments, we obtained the state change trends of pitch and roll of different actuators when different faults occurred, as shown in Table 1.
It can be seen from Table 1 that when the same fault occurs in different actuators, the combination of angular acceleration residual changes in pitch and roll is different.Therefore, our designed actuator residual feature analysis method can embed the fault localization information into the fault data.In this paper, we set the parameter ∆t = 1 s of the actuator residual feature analysis method.We obtain the final fault data using a combination of the angular acceleration residuals for pitch and roll using the actuator characterization method; however, when the fault types of the actuators are not unique, different types of faults in different actuators may show the same variation combination of pitch and roll, as shown in Figure 8.The fault data of the constant deviation fault of Actuator 1 and the fault data of the gain loss of Actuator 2 are so similar that it is difficult for the human eye to identify effectively.In order to complete the diagnosis of the fault type of the actuator and the identification of the fault localization at the same time, it is necessary to inject the fault data into the DF model for training and testing.We complete the fault diagnosis and localization of the quadrotor UAV actuator under the condition of unknown fault size by using the DF model to process the fault data.In order to verify the effectiveness of the DF algorithm, we introduce Random Forest (RF) for comparison.The reason we chose RF for comparison is that RF fault diagnosis is widely used and DF is an improved algorithm based on RF.In this paper, the parameters of DF and RF all use default parameters.We completed a final comparative experiment by comparing the two methods and whether ESO was used, as shown in Table 2.The results of the training and testing accuracy of the above four schemes for the fault diagnosis and localization of the quadrotor UAV actuator are shown in Table 3.It can be seen from Table 3 that the accuracy of the DF scheme is higher than that of the RF scheme.
Table 4 shows the accuracy and recall results of four schemes calculated according to Equations ( 14) and ( 15) for fault diagnosis and localization of quadrotor UAVs.The results of the F 1 score calculated by the four schemes according to Equation ( 16) are shown in Figure 9.As can be seen from the figure, the F 1 scores of ESO-DF and ESO-RF are relatively close.However, the F 1 score of ESO-DF has a smaller variation range and is more stable.According to the fault diagnosis results of various indicators above, we verify that the DF scheme is superior to the RF scheme.Because ESO can better extract the fault features of the system, the effects of fault diagnosis and localization are improved after the introduction of ESO.Through our proposed ESO-DF method, the fault type diagnosis and fault localization identification of the quadrotor UAV actuator under the condition of unknown fault size can be completed at the same time.

Conclusions
In this paper, we completed the fault diagnosis and localization of unknown fault size of quadrotor UAV actuator by using the ESO-DF based scheme.The scheme achieves highaccuracy fault diagnosis and localization results by combining model-based method with data-driven method.In addition, we designed a residual characteristic analysis method by considering both pitch and roll.This method is straightforward in design, but it can embed fault localization information into fault data.The simulation results indicate that the fault type and fault localization of the actuator can be provided precisely.By comparing the results of other methods, this scheme has better generalization ability and accuracy.In future work, we will try to conduct experimental verification on a real quadrotor UAV.

3 fFigure 1 .
Figure 1.The body fix reference frame of the quadrotor UAV.The x b axis is set to be parallel to the body and points toward the nose.The y b axis is set to be perpendicular to the body and points to the right.The z b axis is set to be perpendicular to the x b -y b plane and pointing downwards.

Figure 4 .
Figure 4. Actuator fault data feature fusion process.∆t is the sampling length.The pitch angular acceleration residuals e θ and roll angular acceleration residuals e φ of the corresponding time are spliced, that is, the fault data containing unknown fault information is finally obtained.

Figure 5 .
Figure 5. Flow chart of the ESO-DF based actuator fault diagnosis and localization scheme.

NFigure 9 .
Figure 9. Fault diagnosis and fault localization F 1 scores of different schemes.

1 .
The trend of each signal value change when the actuator fails.↑ means the corresponding value increases, ↓ means the corresponding value decreases

Table 2 .
The scheme of actuator fault diagnosis and fault localization.

Table 3 .
Fault diagnosis and fault localization accuracy of different schemes.

Table 4 .
Fault diagnosis and fault localization precision of different schemes.