Data-Driven Kalman Filtering in Nonlinear Systems with Actuator and Sensor Fault Diagnosis Based on Lyapunov Stability

: This study proposes a data-driven adaptive ﬁltering method for the fault diagnosis (DDAF-FD) of discrete-time nonlinear systems and provides a simultaneous online estimation of actuator and sensor faults. First, dynamic linearization was adopted to transform the nonlinear system into a quasi-linear model, which facilitated accurate modeling of the nonlinear system. Second, a data-driven adaptive fault diagnosis method was designed under the framework of data-driven ﬁltering and the recursive least-squares algorithm using system I/O data only, and accurate real-time estimation of two fault factors was achieved. In addition, the simulation results demonstrate the effectiveness of the proposed method. The stability was veriﬁed via the Lyapunov method.


Introduction
Continuous industrial development has contributed toa gradual increase in the complexity and cost of systems as well as growing demands in terms of the safety and reliability of industrial operations. Various potential abnormalities and faults must be discovered and identified in time to minimize the potential dangers of system performance degradation. Any fault in industrial systems, such as aerospace systems [1], power electronics [2], or nuclear power plants [3], can result in catastrophic damage to life and property. Therefore, fault diagnosis has high research value and is also of practical significance. Model-based fault diagnosis was proposed by Beard in 1971 [4]. Mehra and Peschon proposed a general method for fault detection and diagnosis of linear dynamic systems using residuals similar to the observer structure generated by the Kalman filter [5]. In recent decades, researchers have devoted considerable effort to fault diagnosis and achieved various results, including a detailed overview of the development of fault diagnosis and fault-tolerant control in recent years [6][7][8].
Faults are usually categorized into actuator faults, sensor faults, and object faults. Fault diagnosis includes three tasks: fault detection, fault isolation, and fault identification. Various types of fault diagnosis methods have been proposed, such as model-based methods [9], signal-based methods [10], and data-driven methods [11]. In one study, researchers proposed data-driven filtering for discrete linear time-invariant systems [12]; they used only the measured I/O data and Markov parameters, and employed a low-pass filter to produce an asymptotically unbiased estimation of the system state for the performance of fault diagnosis. A novel discrete-time estimator that can realize simultaneous estimations of the system's state and actuator/sensor faults for linear systems of vehicle lateral dynamics was proposed in [13]. A fault detection and estimation method for robot actuators and sensors was proposed in [14]. It comprised a model-based fault detection and isolation scheme suitable for robot actuators and sensors; without adding redundant joint sensors, multiple faults in the robot actuator and sensor were detected, estimated, and isolated. An adaptive system fault/state estimation algorithm for linear time-varying systems was proposed in [15] by combining the Kalman filtering algorithm with the recursive leastsquares algorithm. The effects of different forgetting factors on state estimation have been discussed in previous studies. The aforementioned studies focused on the fault diagnosis of linear systems with known models.
Model-based fault diagnosis methods require accurate system models. However, the growing complexity of actual engineering systems, as well as problems such as parameter uncertainties and unknown disturbances, reduce the likelihood of obtaining accurate mathematical descriptions of actual systems, which adversely affects fault diagnosis. Datadriven methods do not require accurate models of objects and use only I/O data to detect system faults. Therefore, data-driven fault diagnosis methods offer unique advantages for dealing with complex nonlinear systems. Kalman filtering technology has been widely used in fault diagnosis. Researchers have proposed many algorithms for the fault diagnosis of nonlinear systems, such as extend Kalman filtering (EKF) and unscented Kalman filtering (UKF) [16][17][18][19].
In [16], an actuator fault diagnosis method was proposed for nonlinear systems, which is based on the use of extended Kalman filter (EKF) to update the actuator fault estimation iteratively. However, this approach is dependent on known nonlinear dynamic models. A method based on EKF and a multi-model adaptive estimation was proposed in [17] for continuous nonlinear systems of small UAVs to realize fault detection and diagnosis of the actuators. Combined EKF with neural fuzzy networks, an adaptive estimation method is given based on EKF and multiple models [18]. A fault detection and separation method for a three-phase permanent magnet synchronous motor on the basis of a generalized UKF was proposed in [19]. This method can manage the non-linear characteristics of the system effectively, and it also offers good real-time performance, stable operation and high fault diagnosis accuracy.
The approximation of nonlinearity will inevitably result in information loss. Dynamic linearization (DL) [20,21] technology can be used to linearize discrete time nonlinear systems, and the data model can be established by using only the I/O data through the pseudo-partial-derivative identification method. In [22], local compact dynamic linearization (LOCAL-CFDL) was proposed to transform the original nonlinear non-affine system into an affine structure composed of unknown residual nonlinear time-varying terms and affine of linear parameter terms on the control input.
In this paper, a data-driven dynamic linearization (DL) approach is used to achieve the equivalent linearization of nonlinear systems and effectively retain the dynamic characteristics of the original nonlinear system. To meet the requirements of engineering practice, this study focuses on the effective use of the I/O data measured by the system to obtain fault diagnosis in nonlinear systems. Compared with the EKF method in [16], which needs the model parameters of nonlinear systems and only diagnoses actuator faults, the method based on DL only uses system I/O data and does not need a system model.
Considering the fault diagnosis problem of discrete nonlinear systems subject to simultaneous actuator and sensor faults, we propose a data-driven adaptive filtering fault diagnosis (DDAF-FD) method. By combining data-driven filtering technology with the recursive least squares algorithm, the joint estimation of states, system parameters, and fault factors is obtained. The contributions of this paper are summarized as follows: (1) By using the dynamic linearization (DL) technique, nonlinear systems were converted into equivalent quasi-linear models, and the difficulty of modeling nonlinear systems was solved. Next, a data-driven system parameter identification method was studied via the approximation data model by using only the I/O measurement data instead of including any information on the dynamics or structure of the controlled system.
(2) The DDAF-FD scheme proposed in this paper solves the problem of actuator and sensor simultaneous fault and achieves the real-time online estimation of actuator and The rest of this paper is organized as follows: Section 2 introduces the dynamic linearization technology based on I/O data and establishes an equivalent linear model for nonlinear systems. Section 3 presents the data-driven adaptive filtering algorithm, which achieves the joint estimation of actuator and sensor fault factors. Section 4 discusses the stability analysis using the Lyapunov method. Section 5 verifies the effectiveness of the proposed approach via numerical simulation. Section 6 summarizes this paper.

Dynamic Linearization
A discrete-time single-input single-output (SISO) nonlinear system with measurement noise can be expressed as follows: where k = 1, · · · , N represents each discrete time, u(k) ∈ and y(k) ∈ denote the input and output of the system at time k, respectively, n y , n u ∈ Z + are two unknown positive integers, f (·) : n y +n u +2 → is an unknown nonlinear function, and w(k) ∼ (0, S) represents white Gaussian noise. Next, two hypotheses are presented for the system (1). (1) is taken for a smooth nonlinear function. For all the control inputs and control outputs, the partial derivatives are continuous, and the control input length L is a positive constant.

Assumption 2.
The system (1) is the Lipchitz system in a broad sense. ∀k 1 = k 2 , k 1 , k 2 ≥ 0 and H L y ,L u (k 1 ) = H L y ,L u (k 2 ), where y(k i + 1) = f (y(k i ), · · · y(k i − n y ), u(k i ), · · · , u(k i − n u )),i = 1, 2, and κ is a positive constant. Further, L y , L u are the length constants for controlling the output linearization and input linearization, respectively.

Lemma 1. [23]
If system (1) satisfies Assumptions 1 and 2, we define . When ∆H L y ,L u (k) = 0, there must be a time-varying parameter vector Φ f ,L y ,L u (k) ∈ Ly +Lu that transforms system (1) into the following full-format dynamic linearization model: The nonlinear function relation of input and output is contained in the time-varying parameter vector

Lemma 2. [24]
The dynamic linearization model provided by (3) can be transformed into a linear time-varying system of order n + 2: The selection of L y and L u is based on the complexity of the system, the values of the two parameters become larger while more complexity of the system.
that is: Thus, the linear time-varying system provided by system (1) can be transformed into the following state space expression: where Therefore, a general SISO discrete nonlinear system with measurement noise can be transformed into an equivalent quasi-linear time-varying system (8).

System Identification
To adaptively identify the system matrix A(k) and input matrix B(k) of the quasilinear time-varying system given by system (8), this study introduces the DDF-PI algorithm for parameter identification.
The following equation can be obtained from Equation (4): X(k) ∈ 2n+2 represents the unknown parameter vector that satisfies Ω(k) ∈ 2n+2 represents the known I/O data vector that satisfies For the given unknown time-invariant vector (13) and measurement vector (14), the following DDF-PI algorithm can be used for parameter identification.
Through the DDF-PI algorithm provided by Equations (15)- (17),Â(k) andB(k) can be easily obtained from the unknown parameter estimation vector. Thus, the parameters in system (8) can be identified using the DDF-PI algorithm.

State-Parameter Joint Estimation
System (8) can be rewritten as When simultaneous actuator and sensor faults occur, the system input u(k) deviates from the expected value, and the measured value y(k) also deviates from the expected value. Φ a (k)θ 1 (k) represents the actuator fault, and Φ b (k)θ 2 (k) represents the sensor fault, where 0 ≤ θ 1 < 1, 0 ≤ θ 2 < 1, θ 1 represents the actuator fault factor, and θ 2 represents the sensor fault factor. When the actuator and sensor include faults (such as gain loss), the fault factors vary from 0 to 1. Here, y(k) is the output value of the system with Equation (18) can be rewritten as The proposed DDAF-FD algorithm is divided into three parts according to the recursive sequence stated below: The recursion provided by Equations (20)- (23) is a part of Kalman filtering, which calculates the covariance matrix P(k + 1) and state estimation gain matrix K E (k + 1), and prepares for the next part to calculate the auxiliary variables G(k + 1), O(k + 1), H(k + 1), and S(k + 1) as well as the parameter estimation gain matrix Λ(k + 1).
Inspired by the recursive least-squares estimation with the exponential forgetting factor, the recursion provided by Equations (24)-(28) calculates the parameter estimation gain matrix Λ(k + 1) and auxiliary variables G(k + 1) to prepare for the next fault parameter estimation and state estimation, where λ ∈ (0, 1).
The recursive update given by Equations (29)-(31) is an adaptive Kalman filter, wherê x(k),f(k) are updated at each time k, the residual y(k) is calculated, the fault parameter estimation is updated according to Equation (30), and the state estimation is updated according to Equation (31).

Stability Analysis
In this section, the Lyapunov method [26] is used to prove the convergence of the proposed DDAF-FD algorithm, i.e., when k → ∞ , the estimation error of the state and the fault factor tend to zero. The following hypotheses are presented:
The above assumptions are a previous study [15]. Assuming that there is a matrix Λ(k) that satisfies Equations (26)-(28), under the condition of Assumption 6, for the initial condition S(0) = I( > 0) the matrix S(k) is strictly positive definite. Theorem 1. Based on the above assumptions, for the dynamically linearized system (19), the adaptive filtering method (20)-(31) can be applied to achieve the effective estimation of state and fault factors, and the state and fault estimation errors converge to zero.
Proof of Theorem 1. The state and fault parameter estimation errors are defined as The following equation is introduced: Equations (19), (34) and (35) are substituted into Equation (29) to obtain the following equation: From Equations (19), (31), (34), (35) and (37), we can obtain The following equation is obtained from Equations (30), (35) and (37): By substituting Equation (38) into Equation (36), we can obtain In Equation (40), the term {· · · } is zero and Equation (40) can be written as Since w(k), v(k) are uncorrelated zero-mean white Gaussian noise terms, the mathematical expectation of Equation (41) can be obtained as follows: where E{· · · } is the mathematical expectation. According to Assumption 4, for any initial value E{ξ(0)}, E{ξ(k)} → 0 . By substituting Equation (36) into Equation (39), we can obtain The candidate Lyapunov function is expressed as Since H(k), N(k) are both positive definite matrices, the following equation can be obtained: It can be seen that V(k) tends to 0 exponentially. As M(k) is strictly positive definite, E f(k) tends to 0 exponentially. From Equation (36), we can obtain Therefore, it can be proven that E{ x(k)}, E f(k) tend to 0 exponentially, and the proposed DDAF-FD algorithm is convergent. Thus, the proof is complete.

Numerical Simulations
Consider a discrete nonlinear system in which the state equation of the system contains the cubic term of the state.
where w(k) ∼ (0, Π), Π = 0.1; v(k) ∼ (0, R), R = 0.05. The simulation setting ranges from k = 0 to k = 100. The actuator fault factor parameter θ 1 changes from 0 to 0.4 at k = 10. The sensor fault factor parameter θ 2 changes from 0 to 0.35 at k = 10. For the simulation of this model, second-order dynamic linearization is , C = 0 1 . Figure 1 reflects the effectiveness of the DDF-PI algorithm. The system identification output has a very small deviation from the ideal output. Hence, the proposed system identification algorithm (DDF-PI) is sufficiently accurate.  Figure 1 reflects the effectiveness of the DDF-PI algorithm. The system identification output has a very small deviation from the ideal output. Hence, the proposed system identification algorithm (DDF-PI) is sufficiently accurate.   Figure 2 shows the process of identifying the parameters of the DDF-PI algorithm. As can be observed, the four system parameters eventually stabilized. metry 2021, 13, 2047 Figure 2 shows the process of identifying the parameters of the DDF-PI alg As can be observed, the four system parameters eventually stabilized.
where, x(k) andx(k) respectively represent the actual state and estimated state of the system. The mean absolute error pairs of DDAF-FD, UKF and EKF methods are shown in Table 1. where, () xk and ˆ() xk respectively represent the actual state and estimated state of the system. The mean absolute error pairs of DDAF-FD, UKF and EKF methods are shown in Table 1.    According to the average absolute error in Table 1, the proposed DDAF-FD algorithm is superior to the UKF and EKF algorithms in terms of state estimation for a system with faults. The DDAF-FD algorithm can also perform fault estimation. Figures 5 and 6 show that the parameter estimation performance of the DDAF-FD  According to the average absolute error in Table 1, the proposed DDAF-FD algorithm is superior to the UKF and EKF algorithms in terms of state estimation for a system with faults. The DDAF-FD algorithm can also perform fault estimation. Figures 5 and 6 show that the parameter estimation performance of the DDAF-FD algorithm depends on the forgetting factor Λ. The DDAF-FD algorithm can estimate steady faults, and it can be clearly observed that when the system fails, the proposed DDAF-FD algorithm can effectively track the fault factor. As the forgetting factor decreases, the estimated convergence speed increases. Thus, the smaller the forgetting factor, the greater the sensitivity of the algorithm to system faults. According to the average absolute error in Table 1, the proposed DDAF-FD algorithm is superior to the UKF and EKF algorithms in terms of state estimation for a system with faults. The DDAF-FD algorithm can also perform fault estimation. Figures 5 and 6 show that the parameter estimation performance of the DDAF-FD algorithm depends on the forgetting factor  . The DDAF-FD algorithm can estimate steady faults, and it can be clearly observed that when the system fails, the proposed DDAF-FD algorithm can effectively track the fault factor. As the forgetting factor decreases, the estimated convergence speed increases. Thus, the smaller the forgetting factor, the greater the sensitivity of the algorithm to system faults.    A time-varying fault is introduced:  Figure 7 shows that the DDAF-FD method can estimate time-varying faults. In a tion, it can achieve simultaneous online estimation of actuator and sensor faults.   Figure 8 shows that when there are time-varying faults in the system, and when a fault changes abruptly, the fault estimation value also changes abruptly; however, the fault estimation error curve rapidly approaches zero, which implies that the DDAF-FD method can adaptively estimate time-varying faults. This proves the effectiveness of the proposed DDAF-FD algorithm.
ymmetry 2021, 13, 2047 13 Figure 8 shows that when there are time-varying faults in the system, and w fault changes abruptly, the fault estimation value also changes abruptly; howeve fault estimation error curve rapidly approaches zero, which implies that the DDA method can adaptively estimate time-varying faults. This proves the effectiveness proposed DDAF-FD algorithm.

Conclusions
In this paper, a data-driven method was adopted to effectively combine syste rameter identification and state estimation by using only system I/O data without

Conclusions
In this paper, a data-driven method was adopted to effectively combine system parameter identification and state estimation by using only system I/O data without a system model, and a data-driven adaptive filtering method is proposed for the actuator and sensor fault diagnosis of a class of SISO nonlinear discrete systems. The simultaneous online estimation of actuator and sensor fault factors is achieved. Both the theoretical analysis via Lyapunov theory and the numerical simulation validate the effectiveness and accuracy of the proposed method. At present, there are few studies on data-driven fault diagnosis for nonlinear systems, which will be further studied in the future.