Fault Diagnosis Algorithm Based on Adjustable Nonlinear PI State Observer and Its Application in UAV Fault Diagnosis

: Aiming at the problem of fault diagnosis in continuous time systems, a kind of fault diagnosis algorithm based on adaptive nonlinear proportional integral (PI) observer, which can realize the effective fault identiﬁcation, is studied in this paper. Firstly, the stability and stability conditions of fault diagnosis method based on the PI observer are analyzed, and the upper bound of the fault estimation error is given. Secondly, the fault diagnosis algorithm based on adjustable nonlinear PI observer is designed and constructed, it is analyzed and we proved that the upper bound of fault estimation under this algorithm is better than that of the traditional method. Finally, the L-1011 unmanned aerial vehicle (UAV) is taken as the experimental object for numerical simulation, and the fault diagnosis method based on adaptive observer factor achieves faster response speed and more accurate fault identiﬁcation results.


Introduction
In the field of industrial control, it is often necessary to estimate the system state on-line and control it according to the estimated state, however, the existence of faults will make the control more difficult. Usually, fault detection, isolation and estimation are three major tasks of fault diagnosis. Compared with fault detection and isolation, fault estimation is more difficult and more significant. Because fault estimation is often the key link of fault-tolerant control and fault regulation system, the quality of fault estimation directly affects the control accuracy and the control performance of the whole system. At present, researchers have done a lot of research on fault diagnosis methods, including data-based fault diagnosis algorithm and model-based fault diagnosis algorithm [1].

1.
Fault diagnosis algorithm based on data The data-based fault diagnosis algorithm mainly uses statistical methods to obtain the characteristics of the data, and constructs the detection threshold through statistics to diagnose the fault. Furthermore, some intelligent algorithms, such as support vector machine (SVM), K-nearest neighbor (KNN) and so on, are also used in fault diagnosis [2,3]. However, most of the data-based fault diagnosis methods are used for fault detection and identification, and it is difficult to estimate the fault amplitude.

2.
Model based fault diagnosis algorithm The model-based fault diagnosis algorithm usually needs to accurately model the diagnosis object [4], and obtain the system state by comparing the reference model output with the actual output, so as to judge whether there is a fault in the system [5].
Although this method has high accuracy and reliability, it often takes a lot of energy to accurately model the diagnosis object.
Due to the unmanned aerial vehicle (UAV) control system requires high reliability, it needs more accurate fault diagnosis algorithm [6]. The data-based fault diagnosis algorithm is not suitable for UAV control system because of its low accuracy and inability to estimate fault effectively [7]. On the contrary, a large number of scholars have conducted indepth research on UAV control system and established perfect mathematical and physical models [8]. Therefore, the model-based fault diagnosis algorithm can provide highly reliable fault diagnosis results for UAV control system. A large number of scholars have studied the model-based UAV fault diagnosis method.
The proportional integral (PI) control algorithm is the most widely used control algorithm. It mainly considers the historical information, current information and future information of dynamic system output error to construct state observer to realize the state and fault monitoring. In References [9,10], the method of fault detection observer was first proposed. Its basic idea is to detect the fault of linear system by designing fault detection observer. In Reference [11], a set of structured residuals is proposed, in which each residuals is only sensitive to some faults but not to others. In Reference [12], the observer based method is deeply studied, and an improved PI observer based on adaptive gain scheduling method and its design method are proposed. In addition, in References [13,14], the parameter estimation problem of PI observer was considered, and the optimal planning algorithm for determining the optimal parameters was designed. In the simulation, the overshoot of fault estimation process was obviously reduced, and the robustness of PI control system was effectively improved. In References [15][16][17], a fault estimation method based on PI observer and considering imprecise scheduling parameters is proposed for a class of nonlinear systems described by linear variable parameter mathematical model.
Most UAV fault diagnosis algorithms are based on PI control algorithm. In References [18,19], a widely applicable fault estimation observer was designed by the optimization technology for the UAV system with an actuator fault and sensor fault. However, due to the existence of constraints, the upper bound of fault estimation error was related to the parameters. In References [20,21], an active fault-tolerant control algorithm based on the interpolation gain scheduling PI was proposed for the actuator fault of the UAV. It was verified on the UAV experimental platform. The test results showed that the active fault-tolerant control algorithm based on the interpolation gain scheduling PI can effectively improve the fault-tolerant performance of UAV, compared with the simple PID controller. In References [22,23], the robust linear variable parameter observer is applied to the rotating subsystem to detect actuator fault of the UAV. Numerical experiments show the effectiveness of the method. In Reference [24], the problem of distributed fault detection and isolation is studied, and a local fault diagnosis algorithm is designed for each unit of UAV through the linear model. This algorithm is effective in most of common fault situations.
In past research, the linear algorithm of state estimation was widely used. Although this method has advantages in hardware implementation, there is a contradiction between the tracking time and the tracking effect in the performance. In this regard, a nonlinear state estimation algorithm can effectively improve the tracking effect and fundamentally solve the contradiction between the tracking time and the tracking effect.
In this paper, fault diagnosis algorithms based on the nonlinear observer is used to improve the effect of the additive single sensor fault estimation. The adaptive parameter updating algorithm is given, which effectively improves the fault estimation effect. This paper is organized as follows. In the Section 2, the system model and the fault diagnosis algorithm based on the PI state observer are introduced. In the Section 3, the fault estimation of the nonlinear state observer is analyzed. In the Section 4, combined with the UAV system, the simulation verification is carried out, and the fault estimation effect is expected.

System Model and PI State Observer
Most control systems are highly complex and nonlinear, and they always have the following form The usual method is to linearize the system near the working point x(t 0 ), u(t 0 ) of the system. So that, the linear system is as follows . ( For this reason, the general linear continuous time system is considered where x is the state vector, u is the input vector, y is the output vector, A, B, C, F α , F s are the known matrices of the appropriate dimensions, f is the unknown fault vector and w, v are the noise vectors. Remark: It is a reasonable assumption that the unknown fault vector f in Equation (3) is common in the state equation and the output equation. Because the origin of the fault should be the same, but it has different forms in the state and output, and its different forms are reflected in F α and F s .
In the simple case, without the system noise and observation noise, the PI state observer of system is constructed as follows wherex is the estimated state,f is the estimated fault,ŷ(t) is the estimated output, and K p , K i , G are the observer gain matrices to be designed.
The error system, consisting of the state estimation error e x =x − x and the fault estimation error e f =f − f , is investigated In order to organize it into the matrix form, define Equation (5) can be rewritten as followṡ where The following theorem, in Reference [14], gives the condition of bounded error. Theorem 1. For the error system Equation (6), the positive definite symmetric matrix P 1 and the parameter γ > 0 can be chosen, so that the inequality holds. Then, the error system equation Equation (6) is bounded, and the bound satisfies where Proof. Consider the Lyapunov function V = ε T P 1 ε, thenV is as followṡ Using condition Equation (7), it is obvious that Thus, the Theorem 1 is proven.
When there are the system noise and the observation noise w(t), v(t), the state observer (4) is considered, then the error system is easily obtained as follows In order to organize it into the matrix form, define Equation (9) can be rewritten as followṡ where The Lyapunov function V = ε T P 1 ε and the performance tracking index J = τ 0 ε T ε − γφ T φ dt are also examined, and it is easy to know that when the linear inequality A T e P 1 + P 1 A e + I + P 1 B T e P 1 P 1 B e −λ 2 I < 0 holds, the error system equation Equation (10) is bounded. The bound satisfies

Nonlinear State Observer
In the previous section, we analyzed the PI state observer of the linear time invariant system, and considered its stability and stability conditions. In this section, based on the comparison theorem, a class of nonlinear state observers with better stability is constructed. Consider the following forms of the observers [25][26][27] wherex is the estimated state, K p is the observer gain matrix,f is the estimated fault, y is the estimated output and p is the nonlinear observer adjustment parameter. Besides, the R(ŷ(t), y(t), p) has the following form where denotes multiplication by elements.
The error system equation is investigated For a good state observer, the following two conditions must be satisfied:

1.
When the error between the estimated state and the system state is large, the state observer can achieve fast tracking; 2.
When the error between the estimated state and the system state is small, the state observer can achieve stable tracking.
Therefore, it is necessary to design the nonlinear observer factors under different estimation errors.
In order to realize the above two advantages, we can consider the case of large error first. While the (ŷ(t) − y(t)) is large, p < 1 can be chosen, so that R(ŷ(t), y(t), p) < p(ŷ(t) − y(t)) .
Further, it can be easy to get that According to the comparison theorem, when the condition in Equation (7) is true, from Equation (8), we can obtain the bound that satisfies Remark: Equation (15) only holds when (ŷ(t) − y(t)) is large. When (ŷ(t) − y(t)) is small, choosing p < 1 may lead to the amplification of the estimation error, and p > 1 should be considered.
At this point, it is proved that if the original PI observer in Equation (12) is stable, the nonlinear observer in Equation (13) can improve the observation effect by selecting appropriate parameter.
Furthermore, it is a universal method, and a more general nonlinear observer can be considered Similarly, if h e y is chosen appropriately for any t > 0, it is easy to get a result for Equation (16). The convergence rate of the state observer with Equation (16) is better than that of the PI state observer with Equation (4).

Numerical Simulation
The UAV system is taken as the research object. In Reference [28], based on the detailed modeling of UAV attitude, the classic PI control algorithm is used to control the UAV longitudinal flight attitude. It is proved that the PI control algorithm can make the system track the desired signal better. On the basis of this model, the problem of the sensor fault estimation in UAV system is studied. The attitude model of the UAV is shown in Figure 1. Accroding to References [29][30][31], the UAV model can be linearized and the system model can be described by Equation (3). The system state is where x 1 , x 2 , x 3 , x 4 are bank angle, roll rate, yaw rate and sideslip angle, respectively. Its control variable is where δ r , δ a are rudder deflection and aileron deflection, respectively. The matrices A, B, C, F α , F s of the linear continuous time system Equation (3) Reference [32] shows that, there are two typical failure modes of UAV sensor mechanism: 1.
Step fault. There is a fixed error between the measured output of the sensor and the actual value of the measured parameter. It is mainly caused by bias current or bias voltage. 2.
Periodic fault. The error caused by the superposition of the measured output value of the sensor with the signal of a certain frequency. It mainly includes power signal interference and so on.
These two kinds of faults are the main factors that cause UAV to deviate from the course, so we carried out simulation experiments on these two kinds of faults.
The UAV system works normally in 0 s∼25 s, a step fault with the amplitude 0.15 occurs in 25 s∼50 s, a periodic fault with the amplitude 0.25 occurs in 50 s∼75 s, and then the fault ends.
The system output is shown in Figure 2. The state observer Equation (4) is adopted, and the fault estimation results are as follows.
It can be seen from Figure 3 that the state observer Equation (4) can track the real fault, but its tracking effect is not ideal. There is a certain deviation from the real fault, and the tracking of the sine function fault has hysteresis.  Consider the nonlinear state observer Equation (13), which has the same gain matrix The fault estimation results are obtained by selecting parameter p = {0.6, 0.8, 1.0, 1.2, 1.4}, respectively. Then, the results are shown in Figure 4.
Obviously, when the difference between the estimated fault and the actual fault is large, the smaller parameter p has a faster response speed, but when the difference becomes small, the larger parameter p has more stable estimation effect. For this reason, according to Equation (15), the adaptive parameter estimation is adopted, which has the faster and more stable tracking effect at the same time.
From Figure 5, we can know that the nonlinear observer with the adaptive parameters combines the stability of the large parameters and the rapidity of the small parameters, which can realize a more reasonable system state estimation. Compared with the PI observer Equation (4), its adjustment time is reduced from 1.8 s to 0.8 s, its estimation error for the step fault is reduced from 0.047 to 0.023, and its estimation residual for the periodic fault is reduced from 0.01 to 0.007. Thus it is significantly better than that of the PI observer Equation (4  When Gaussian noise with mean value of 0 and variance of 0.05 is added to the system state, the system fault can still be effectively estimated, and the result is shown in Figure 6.
Further, Figure 6 shows that the fault diagnosis algorithm based on adaptive nonlinear PI observer can still achieve better fault estimation effect in the case of system error. Compared with the fault diagnosis algorithm based on linear PI observer, the estimation error is significantly reduced, and the fault estimation result is more robust than that of the fault diagnosis algorithm based on nonlinear PI observer with fixed factor.

Conclusions
In this paper, a class of state observers for the linear continuous time systems is discussed, the stability of the state observers, as well as the stability conditions are analyzed and the upper bound of the system error estimation is given. Based on the improvement of the PI state observer, the stability and the stability conditions of the nonlinear state observer are also analyzed, and it is proved that the system state estimation of the nonlinear state observer is better than that of the PI state observer.
In the simulation, the UAV was taken as the simulation object, and the fault estimation effects of the PI state observer and the nonlinear state observer with different parameters were investigated. From the results of the fault estimation, with a large parameter, the fault estimation results are more stable, but the offset between the estimated fault and the real fault is larger. With a small parameter, the estimated faults are closer to the real fault, but there is a large vibration. On this basis, the adaptive parameter selection was investigated. The fault estimation results have smaller offset, faster response speed and smaller vibration amplitude. To sum up, the nonlinear state observer can achieve better track of the system state, and overcome the contradiction between the response and offset in the traditional PI state observer. At the same time, the algorithm can be used to improve other state observers, which can achieve better expansibility.
Although our method has achieved good results in the linear model, there are still some problems to be further studied. Firstly, how to apply this method to the fault diagnosis of nonlinear system and whether it can achieve better fault diagnosis results. Secondly, for the nonlinear system, how to design the corresponding nonlinear observer to improve the effect of fault diagnosis.