2. Dynamic Modeling of the Quadcopter
For this application, it is essential to understand the modeling of the quadcopter. Its mathematical model can be obtained using the Newton-Euler formulation, but the whole procedure will not be presented here for simplicity [
31]. The quadcopter is shown in
Figure 1, which includes the inertial coordinate system (
X,
Y,
Z) fixed to the Earth, and the body coordinate system (
Xb,
Yb,
Zb), which moves according to the aircraft’s orientation.
The forces (f1, f2, f3, f4) and the torques (, , , ) generated by each propeller vary according to the angular velocity (Ω1, Ω2, Ω3, Ω4) of each motor and are related to the body-fixed coordinate system. To balance the counter-torque present in the motors, which is responsible for generating the yaw torque () and consequently the rotation of the quadcopter around the Zb axis, one pair of motors rotates clockwise while the other pair rotates counterclockwise.
The pitch torque
, responsible for rotation around the
Yb axis, results from the difference between the forces (
f1,
f4) and (
f2,
f3), allowing the quadcopter to move along the
Xb axis. As for the roll torque (
), the difference lies between the forces (
f1,
f2) and (
f3,
f4) which enables rotating around the
Xb axis and a corresponding movement along the
Yb axis according to (1). The parameter
l represents the distance between the quadcopter’s center of mass and each motor.
where
b is the thrust coefficient,
l is the distance from the center of mass to the respective motor,
d is the drag coefficient, and
is the control allocation matrix.
It is observed in (1) that all motors contribute to the torque around each axis of the aircraft. This is due to the quadcopter’s cross or X configuration, where no motor is aligned with a coordinate axis. The thrust force uz is equivalent to the sum of the forces generated by each propeller and is directed along Zb axis. Each of these forces equals the product of the thrust coefficient and the square of the respective motor’s angular velocity.
The quadcopter’s linear positions in space (x, y, z) are defined in the inertial coordinate system, as are its angular positions, which are associated with three Euler angles (ϕ, θ, and ψ—roll, pitch, and yaw, respectively), with the following limits: (–π/2 < ϕ < π/2), (–π/2 < θ < π/2), and (–π < ψ < π).
The dynamics of the quadcopter can be described by the Newton-Euler formulation, by initially considering that the aircraft’s structure is rigid, yielding (2).
where
accounts for linear accelerations in the inertial coordinate system along the
x,
y, and
z axes, respectively;
g is the acceleration due to gravity;
m is the mass;
represent the cosine operator applied to
ϕ,
θ, and
ψ, respectively;
represent the sine operator applied to
ϕ,
θ, and
ψ, respectively.
Thus, translational movement is described, where the linear accelerations in the inertial coordinate system are given as a function of the weight and the thrust force generated by the propellers. It is possible to describe the dynamic model of the quadcopter according to (3).
where (
p,
q,
r) is the angular velocity in the body-fixed reference frame, while
are the corresponding angular accelerations;
Ixx,
Iyy, and
Izz are the moments of inertia about the
x,
y, and
z axes, respectively.
Thus, the angular accelerations in the body-fixed coordinate system are described as functions of three torques: the torque associated with the Coriolis effect, the torque associated with the gyroscopic effect, and the torque produced by the propellers, respectively. To determine the angular accelerations in the inertial coordinate system, the Euler matrix is used, leading to (4), which describes the dynamic model of the quadcopter associated with the rotational system.
where
is the angular acceleration in the inertial coordinate system and
the corresponding vector;
represent the tangent operator applied to
ϕ,
θ, and
ψ, respectively;
is the variation of the roll angle;
Wn is the Euler matrix;
is the angular velocity vector in the body-fixed reference frame defined according to (3); and
is the corresponding angular acceleration. Thus, it is possible to define the nonlinear model of the quadcopter from (1), (2), and (4).
In this work, both the position control of the quadcopter and one of the filter approaches in the FDD structure relies on the system’s linear model. To obtain this model, hovering is considered as the operating point. Therefore,
,
, and
are equal to zero, the angular velocities are the same for all motors, and
uz is approximately equal to the quadcopter’s weight force. Additionally, to account for translational movement in the
x and
y directions, small roll and pitch angles are assumed, so that
and
are approximately equal to
θ and
Φ, respectively, while
and are equal to 1, respectively. This allows for deriving the quadcopter’s linear model, defined by (5).
3. Controller and FTC System Design
A simple proportional-integral-derivative (PID) controller can be used to ensure that the quadcopter is in the desired position since this is a single input, single output (SISO) system [
32]. Due to the decoupling between the linear model equations, a separate controller is required for each variable. In this work, a parallel PID controller with a derivative mode for measurement is adopted. The design method based on pole allocation is employed, as it calculates the parameter values by comparing the desired and actual system conditions. The gains are obtained directly from equations associated with the closed-loop transfer function and the initial configuration of the quadcopter’s control loop is shown in
Figure 2.
Without an FTC and FDD architecture, the PID controller would be responsible for generating a control signal to counterbalance the losses caused by faults, with its performance depending on its response speed to the effects of the faults. Due to unexpected faults in the quadcopter’s propellers or motors, the actuators may exhibit undesirable behavior, raising concerns about reliability and safety. Faults associated with UAV actuators include high operating temperatures, heavy workloads on the motors, aging and wear of components (such as propellers and bearings), and electrical failures in the motor driver (short-circuit, open circuit, component aging, among others) [
3].
In this work, actuator faults are considered, encompassing issues in all components from the propellers to the motors, represented by motor efficiency loss. The control signal is generated based on information from the sensors. Thus, the faulty control signal
can be expressed in (6) as a function of the fault-free control signal
and the efficiency loss factor
of the
i-th motor [
24].
where
represents the maximum allowable value of
for the system to remain controllable. If the quadcopter operates correctly, then
δi = 0. A value of
δi > 0 indicates the presence of faults in the
i-th actuator. Thus, it is possible to determine the control signal in the presence of faults from (7).
where
is the fault-free control signal matrix.
According to [
33], environmental characteristics of the system and data that characterize sensor faults often include offset, noise, outliers, spikes, and freezing. Therefore, in this study, sensor faults will be considered as measurement faults. This behavior is described by the signal
in (8), where
is the generalized representation of a given faulty measurement signal
y.
3.1. Definitions for the Kalman Filter Algorithm
The initial system goal is to attenuate the measurement noise rather than estimate it. Outliers and spikes cause instantaneous variations with significant magnitude and correspond to a stage prior to fault estimations by the KF, which is an algorithm extensively used in various fields such as control, signal processing, and optimization. Due to its simple implementation, it has become popular in fault detection and diagnosis in stochastic processes, where the states are considered Gaussian random variables subject to zero-mean white noise [
34]. This property allows for the definition of statistical characteristics for these variables, which will be described below as they are common parameters across all filter approaches.
Therefore, the following vectors are defined: the state vector of the quadcopter model (
∈ ℝ
n), the system input signal vector (
∈ ℝ
r), the measurement vector (
∈ ℝ
m), the actuator fault vector (
∈ ℝ
p), and the sensor fault vector (
∈ ℝ
q) according to (9).
Thus, one can obtain the nonlinear and linear discrete models of the system corresponding to (10) and (11), respectively.
where
and
are the state vectors at the discrete time instants
k and
k + 1, respectively;
Ts is the sampling time;
is the process noise vector;
is the measurement noise vector;
is the measurement vector at discrete time instant
k;
,
, and
Fk are matrices defined in (12), with
I corresponding to the identity matrix; and
A,
B,
C,
E, and
F are matrices obtained from the linear model of the quadrotor, sensors, and actuators fault according to (7) and (8).
To enable the KF to estimate faults in both actuators and sensors, these signals must be included in the state vector of the model, resulting in an augmented state space. In a previous work [
35], the authors used a hybrid FDD system combining observers and neural networks for fault estimation. The system proved effective in estimating multiple faults, including simultaneous occurrences and nonlinear behaviors. Consequently, the following representations of the quadcopter are obtained in both linear and nonlinear augmented state spaces, with (13)–(19) incorporated into the model.
where:
A linear time-invariant system is considered observable if any initial state can be determined from the control input and the measurable output at any time greater than zero [
36]. Observability can influence the KF’s ability to estimate states. For linear systems, observability is determined using the observability matrix
O, as shown in (20), assuming the aircraft is fault-free. The system is observable if the rank of this matrix equals the number of states.
It is observed that a loss of rank will occur in this case, rendering the system unobservable. Therefore, it is necessary to reduce the number of faults to be estimated. Faults in the actuators, being directly related to the control system, will remain unchanged. However, variables related to faults in linear and angular position measurements will be excluded from the sensor fault scenario. Thus, the new vector for sensor faults is defined by (21).
Wind disturbances are considered to avoid false alarms in fault estimations. These disturbances affect the quadcopter by altering the system states according to their magnitude and direction. However, due to observability issues and the priority of estimating faults in actuators and sensors, these variables could not be included in the extended model of the filter.
3.2. KF Approaches
The filter algorithm is divided into two stages: prediction, which calculates the estimated value based on the system model, that is, the a priori value, denoted by the subscript k∣k−1; and update, where the a priori value is refined by the filter gain and measurements to yield the a posteriori value, denoted by k∣k.
This work considers three KF approaches: linear, EKF, and UKF. Additionally, the three-stage KF (TsKF), three-stage EKF (TsEKF), TsUKF, ATsKF, adaptive three-stage EKF (ATsEKF), and adaptive three-stage UKF (ATsUKF) are assessed, totaling nine solutions. Except for the adaptive structure of the ATsUKF, the KF approaches were implemented according to guidelines provided in the studies mentioned in
Table 2.
One issue with the KF is the presence of model nonlinearities, which lead to different behaviors of the states compared to the linear model, especially in the presence of unknown dynamics, such as faults [
25]. To mitigate these harmful effects, the EKF uses the nonlinear model in the prediction step and performs linearizations of the model based on the current values of each state at each sampling period during the update step [
37]. However, these linearizations can introduce errors in the update process. For this reason, the UKF is used to address this issue by propagating sigma points through the nonlinear system model [
36].
The drawback of using more complex KF structures, such as the EKF and UKF, and especially system models with an expanded state space to include actuator and sensor faults, is the considerable increase in computational burden. One way to minimize it consists of dividing the estimations into three stages, creating three subfilters, each related to the states of the quadcopter’s flight dynamics, actuator faults, and sensor faults. The subfilters are divided by applying the U-V transformation to the covariance matrix, state vector, and gain vector of the respective filter [
25,
38]. After each subfilter estimates its states, there is a correction step, characterized by incorporating the sensor fault estimations into the actuator fault estimations and then integrating these into the estimations of the quadcopter’s flight states.
It is known that actuator and sensor faults have unknown dynamics, and for this reason, there will be a deterioration in the filter’s performance during the estimation process. To solve this problem, there are adaptive versions that adjust the filter parameters based on estimations over time. In this work, the adaptive approach implemented in the TsUKF filter described in [
25] is based on the forgetting factor
λ for weighting the covariance matrix
defined in (22) during the prediction step at time instant
k. The matrix
corresponds to the covariance matrix for calculating the filter gain and other variables.
The forgetting factor
λ can be determined from (23) and (24).
where
vk is the innovation,
M is the window that defines the number of samples for calculating the covariance
, and
is the covariance of the innovation calculated analytically, which corresponds to the term whose inverse is calculated in the filter gain equation.
The innovation covariance matrix is used in (23) because the filter will be optimal in the context of the mean squared error if the model is accurate and both matrices are equal [
24]. Furthermore, the ability to calculate
in real-time makes such matrices attractive. However, due to the presence of model errors and the unknown nature of certain statistical properties of the signals, these values may differ, representing a degradation of the optimal value of the filter gain. Therefore, it can be noted in (23) that if the values of the analytically calculated matrix are less than those of the other matrix,
λ will be greater than one, consequently increasing the values of the covariance matrix and the filter gain. The higher the gain, the greater the relevance of the innovation in updating the estimations compared to the prediction. In the context of model uncertainties, this allows for an adjustment in the convergence of the filter’s covariance matrix based on the most current values obtained from the system, reducing estimation errors. Thus, the forgetting factor is used to mitigate potential undesirable effects of old information generated by model issues.
Additionally, the presence of “1” in (23) prevents the covariance matrix from being smaller than that obtained by the filter analytically, as this would produce the opposite effect to what was previously discussed, degrading the estimation performance. It is important to note that for three-stage filters, each sub-filter will have its innovation, and thus each element must calculate its respective forgetting factor.
3.3. FTC Structure
FTC systems are designed to mitigate or neutralize the effects of faults in the control loop to ensure good performance and stability of the process. The FTC method introduced in this work relies on estimations from the FDD method, functioning similarly to feedforward control, as described by (25).
where
is the control signal vector generated by the PID and converted into a signal suitable for the motors at time
k,
is the vector of actuator faults estimated by the FDD system,
is the matrix related to the angular velocities of the motors, and
is the final control signal transmitted to the quadcopter’s actuators.
By using the representation of actuator faults as described in (6) and converting the signals to another suitable signal for the motors, it is possible to obtain (26).
where
is the control signal with the presence of actuator faults. As discussed earlier, due to these faults, this control signal will not have the same value generated by the PID controller without the FTC system, which would lead to a degradation of the drone’s flight. However, substituting (25) in (26) yields a control signal that compensates for the effects of actuator faults in the system, eliminating this problem through the FTC, corresponding to (27). It is observed that the smaller the error between the actual value of the fault and the estimated value, the better the compensation will be.
For sensor faults, a control loop based solely on PID controllers would be unable to distinguish between accurate measurements and those distorted by faults. Consequently, such a system would consistently misposition the quadcopter. By using FDD and FTC systems, the feedback in the PID controllers occurs using only the values of the flight dynamics states, which are decoupled from the sensor faults by the Kalman filter. Therefore, this approach allows for avoiding the undesirable problem discussed earlier. The complete system, involving FDD, FTC, the PID controller, and the quadcopter, is shown in
Figure 3.
4. Results and Discussion
In this work, the Parrot Minidrone, provided by the MathWorks Simulink Team since 2017, is used as the quadcopter model for implementing FDD and FTC systems. This aircraft is equipped with an ultrasonic sensor, accelerometer, gyroscope, air pressure sensor, and front camera, which together enable the measurement of its linear and angular positions and velocities in both coordinate systems, either directly or indirectly via numerical integrations and transformation matrices.
To assess the filtering performance, the integral absolute error (IAE) metric was applied to the actual and estimated values, and these results were normalized for better comparison of performance.
Table 3 shows the calculated PID controller gains for the controlled variable, where
OS stands for the maximum overshoot;
Ts,5% is the settling time for a tolerance band of 5%;
Kp,
Ki, and
Kd are the proportional gain, integral gain, and derivative gain, respectively. The sampling time is 5 ms and lower settling times were chosen for the roll and pitch angles compared to the other angles due to the cascade structure with the
x and
y position controllers. Conversely,
Table 4 presents the parameters for all the KF approaches used in the simulations.
The noise covariance matrices, particularly those associated with faults, were manually adjusted to ensure satisfactory convergence speed, reduce overshoot in estimations, and attenuate measurement noise. These three factors are directly associated with the performance of the FTC method in mitigating the effects of faults on the system, which can be degraded by delays in detecting the actual fault value or by the incorrect insertion of information into the control signal. The measurement noise covariance matrix was obtained along with other quadcopter parameters.
The results from the implementation of the FDD and FTC methods on the quadcopter were obtained through simulations in Simulink. For analysis, the integral absolute error (IAE) metric was employed for the actual and estimated values, with all values normalized. The simulations considered two flight trajectories: an initial ascending movement followed by a rectangular movement in the XY plane while maintaining a constant vertical position. The complete movement of the quadcopter is performed in 35 s.
One of the advantages of using FDD methods based on the Kalman filter is the ability to estimate faults in actuators and sensors with nonlinear behaviors and multiple occurrences. To address this scenario, faults were introduced into each of these quadcopter elements according to
Table 5. The magnitude is based on the percentage of the nominal value of the variable affected by the respective fault. For actuator faults, the value was determined based on the parameter
δmax, which corresponds to the maximum allowable fault value that ensures system stability. The sensor faults were introduced into the system as a step change to represent offset. Separate simulations will be conducted for scenarios involving lockups. So, the offset was chosen to account for various measurement situations.
4.1. Scenario 1: ATsUKF
Figure 4 compares two adaptive structures by weighting the innovation covariance matrix: one across all three sub-filters (structure 1) and the other only in the sensor fault sub-filter (structure 2). Structure 1 exhibited some sensitivity to variations in the time interval
M and a deterioration in estimations compared to structure 2.
It is observed that using the forgetting factor in all three sub-filters results in a deterioration in estimation compared to using it in just one sub-filter. Additionally, structure 2 is more sensitive to variations in the time interval determined by M. In turn, structure 1 proved to be almost insensitive to this variation. This behavior is also observed in the ATsKF and ATsEKF filters. The explanation for this behavior lies in the averages of the innovations of the state and actuator fault sub-filters, which will not be zero in the presence of a second signal in the system. This occurs due to the correction of estimates at the end of the algorithm. Consequently, large values of M will affect the covariance calculation if the innovation exhibits non-stationary and persistent behaviors over time, such as sinusoidal and intermittent signals, while small values of M will be sensitive to sudden variations in the signal.
4.2. Scenario 2: Performance of Different FDD Approaches
This analysis focuses on the FDD system’s ability to estimate all faults simultaneously, highlighting its accuracy and the isolation of estimations. This latter factor is associated with the system’s ability to diagnose a fault without significant and persistent interference from other faults.
Table 6 summarizes the filtering performance in this scenario using the normalized IAE value for each variable.
The adaptive approach improved estimation accuracy by up to 30%. Due to the number of filters and the simulation time interval, which makes it challenging to observe performance differences over a short period, only the faults estimated by the ATsUKF are illustrated in
Figure 5 and
Figure 6.
Figure 6 shows that one estimated actuator fault is characterized by peaks generated by the variation of another fault, with a duration of less than approximately 0.5 s. The magnitude of these peaks is directly associated with the convergence speed of the estimation. The filter can estimate faults through innovation, which depends on the measurement signals, and these are related to the states of the aircraft dynamics. According to the equations representing the quadcopter model, all actuator faults affect a state variable. Therefore, transients are a consequence of the interval required by the filter to correctly determine the fault’s location. Since these signals influence the control signal in the FTC architecture, they can induce undesirable behavior in the quadcopter, which may be partially interpreted as measurement problems.
By comparing the performance of linear (KF) and nonlinear (EKF and UKF) filters, it is observed that both exhibited similar behavior in estimating the states of the quadcopter. However, the nonlinear versions achieved a maximum reduction of 7% in the IAE of actuator faults and a maximum reduction of 48% in the IAE of sensor faults.
EKF and UKF showed similar performance with a maximum difference of 1%, except for some faults, where the difference reached 4% and 11%, with the UKF having the worst performance. The three-stage version performs linearization based on faults, and the propagation of sigma points is limited to the quadcopter’s dynamic states. It is observed that TsUFK shows improved estimations compared to the UKF and similar results to the EKF, reducing all differences to less than 0.5%. This demonstrates that, for the nonlinear dynamics considered and the movement of the quadcopter, the second moment of the Taylor series does not have a significant effect on the precision of the mean and covariance, and does not necessarily benefit estimation in cases involving faults with unknown models.
As for the adaptive filters, there was an increase in accuracy of 22% to 30% for and 7% to 13% for when compared to the same types of filters without the adaptive structure. For the other variables, the maximum improvement was 7%, with an average of around 2%.
4.3. Scenario 3: Performance of the FTC Architecture
The third scenario relies on the ATsUKF, highlighting the advantage of using an FDD method to anticipate faults and reduce the controller’s effort in mitigating the effects of these signals on the system. The results for the
x,
y, and
z positions are shown in
Figure 7.
The main goal of the FTC is to mitigate the effects of faults in the process and ensure stability.
Figure 7 shows that, without this structure, the system becomes unstable at a certain instant, with oscillations around the fault-free system response. The PID controller alone responds to faults, but since it relies solely on the feedback error, the angular velocities, and the linear velocities, its response is slower compared to systems based on filters like FDD. This is because FDD systems use a model of the aircraft’s behavior considering different types of faults.
Figure 8 compares the signals generated by the PID controllers in systems with and without FTC. It shows that all fault attenuation actions are managed by the FDD system, while the short-term variations in the PID controller of the FTC system are related to estimation transients. Additionally, without FTC, the measurement noise was reduced using a KF that only considers the quadcopter model.
Figure 9 shows the quadcopter’s displacement in the XY plane. It demonstrates that the system with FTC achieved oscillations with a maximum value of less than 2%, partly due to reduced interference from transients in fault estimation for velocity measurements in the
x and
y directions, as previously discussed.
4.4. Scenario 4: Performance of the FDD and FTC Architectures with Lock-Up Faults
The fourth scenario comprises lock-up faults, where the measurement signal remains constant at the last value before the fault occurs for some time, demonstrating the efficiency of the FDD structure.
Figure 10 shows the behavior of different systems under these conditions. The fault was introduced in the
y-axis velocity measurement at 14 s, maintaining the measurement value fixed at −0.6 m/s until 24 s into the simulation, at which point the real values reappeared. All other faults were removed from the system to observe the isolated behavior of the lock-up fault.
The system without FTC became unstable 4.0 s after the onset of the lock-up fault. In this case, controllers are more vulnerable compared to faults in actuators and offset behaviors in measurements. The disturbance caused by the lock-up fault leads the integral mode to continuously act increasingly since the measurement is locked at a value, making the feedback error constant and non-zero. This results in process instability if the measurement does not return to its normal operating value.
Figure 11 shows the estimation of this fault by the KF, corresponding to the difference between the lock-up value and the actual target variable value. The FDD system can distinguish between the real signal, which is sent to the controller, and the faulty signal caused by the lock-up, preventing the same issues in the controller as seen in systems without this structure, thereby maintaining aircraft stability.
4.5. Scenario 5: Performance of the FDD and FTC Architectures with Disturbances
The fifth scenario consists of assessing the influence of external disturbances, specifically wind, on the fault estimation process. Winds alter the system’s state values based on their direction and magnitude. This behavior can be described by proper equations as presented in [
39], which uses the Beaufort scale to determine wind speed according to the environment.
Thus, the impact of these disturbances is analyzed since they were not considered in the quadcopter model. The simulation represents this external signal in a generalized manner as a constant non-null value for some time.
Figure 12 shows the system’s response to the following disturbances: forces applied in the
x,
y, and
z directions at 15 s, 21 s, and 27 s, respectively, with a constant value
uz = 10% and a duration of 2s. The FTC system’s response to disturbances has deteriorated compared to the system without FTC because false alarms are generated by fault estimations in the sensors and actuators.
According to
Figure 13, these false alarms inject erroneous signals into the control loop. Consequently, they force the controller—the only component capable of mitigating disturbances—to act in a way that reduces the effects of wind along with those generated by the filter. For the system without FTC, the PID only addresses the wind effects.
It is also important to note that winds are not fixed disturbances, as they vary with various environmental factors. Thus, false alarms are similar to transients that cancel out after a while. For this reason, depending on the duration, magnitude, and direction of the wind (given that the disturbance in the z direction had a considerably smaller effect compared to x and y), the FTC system may not experience significant performance degradation.
5. Conclusions
The combined use of FDD and FTC has improved the reliability and safety factors of the aircraft in terms of stability and flight performance in fault situations, compared to systems without FTC. From the results obtained, by comparing different FDD structures based on the KF and the performance of fault-tolerant controllers, the following issues were observed:
- -
transients in estimations generate disturbances in the control loop;
- -
adaptive approaches enhance estimation accuracy;
- -
nonlinear filters perform better than linear ones;
- -
FTC systems effectively maintain quadcopter stability in the presence of faults;
- -
FDD and FTC methods present some drawbacks when dealing with external disturbances.
FDD structures were able to accurately estimate the considered faults. In the case of model-based FDD methods, the efficiency is directly influenced by the amount of information available about the process. Transients in estimation represent false fault alarms, and in FTC systems, these can introduce disturbances in the control loop, affecting the quadcopter’s performance when wind-related disturbances exist. However, the effectiveness of the FTC system in maintaining stability during actuator and measurement faults, particularly those with lock-up behavior, was confirmed. Additionally, it is important to consider the fault signal frequency when designing Kalman filters due to their convergence speed. The adaptive approach positively contributed to selecting an estimator that significantly reduces measurement noise while providing the desired estimation speed.
Future work includes applying FDD and FTC methods to real UAVs. If testing with defective components is not feasible due to difficulty in obtaining faults experimentally, there may be a possibility of simulating these faults computationally. Another area of interest is studying the performance of FDD and FTC systems under different flight conditions, including larger variations in roll, pitch, and yaw angles, to assess the impact of nonlinearities. Exploring other control strategies, such as model predictive controllers and robust controllers, is also possible.