Unsupervised data-driven approach for fault diagnostic of spacecraft gyroscope Unsupervised Data-Driven Approach for Fault Diagnostic of Spacecraft Gyroscope

In spacecraft attitude control, maintaining an accurate estimate of the attitude readings is very important. Due to the aging factors of sensors like gyroscopes, drift or bias from the correct rate values make the attitude pointing less accurate. This paper proposes a data-driven approach for drift diagnosis in spacecraft attitude sensors. The basic idea relies on observing the Euclidean distance evolution of residuals. Therefore, any deviation from normal behavior is typically related to a sensor fault. Also, the Euclidean distance evolution is statistically analyzed to enhance the detection robustness and avoid inaccurate diagnoses. Various drift speeds are injected (as faults) into the satellite attitude control simulator. The obtained results are compared with other methods to show the superiority of our scheme in terms of missed alarm rate and incorrect detection rate. In addition, our approach does not require prior knowledge about the attitude sensor's faults.


INTRODUCTION
Fault detection, isolation, and recovery (FDIR) is a critical subsystem in spacecraft software. Using FDIR generally helps avoid catastrophic consequences in case of abnormal behavior. For a wide range of commercial and military space missions, it is crucial to have performant attitude control for both inertial and geocentric pointing (Markley & Crassidis, 2014). The attitude and orbit control system (AOCS) is designed to respond to these needs. AOCS consists of a combination of attitude sensors, actuators, and control scheme. The latter adopts classical methods such as PID controllers (Luzi, Biannic, Peaucelle & Mignot, 2012) or, alternatively, robust/advanced techniques such as sliding mode or reinforcement learning (Henna, Toubakh, Kafi & Sayed-mouchaweh, 2020).
The model reasoning technique is an alternative solution to overcome the shortcomings of model-based approaches. In these methods, historical data is collected/used to learn system behavior. An optimal solution is built afterward to describe the link between observations and system state/output. This solution enables the designer to elaborate on all the potential normal/faulty behaviors. Many papers in the literature address the AOCS fault diagnosis based on model reasoning approaches, such as neural networks (Lee, Lim, Cho & Kim, 2020;Liu, Pan, Wang & He, 2019;Sun, Hicham HENNA et al. This is an open-access article distributed under the terms of the Creative Commons Attribution 3.0 United States License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited. However, these approaches suffer from several limits (Henna et al. 2020) because they require prior knowledge about failure dynamics. This prior knowledge is hard to obtain when the system evolves in strong dynamics and nonstationary environments (e.g. the spacecraft). Therefore, we propose an unsupervised data-driven approach to monitor and diagnose the gyroscope faults without prior knowledge about sensors' failure dynamics.

Unsupervised Data-Driven Approach for Fault Diagnostic of Spacecraft Gyroscope
The paper is organized as follows. In section 2, we formulate the problem of AOCS fault diagnosis and self-adaptive classification. The proposed approach is presented in Section 3. Section 4 details the obtained results and compares them to other machine learning approaches. Some conclusions and future perspectives are given in the last section.

PROBLEM FORMULATION
AOCS fault diagnosis is essential to avoid space mission interruption. FDI is followed generally by system reconfiguration like the hard reset of non-responding components or frozen sensors. To preserve the state of health, however, a transition to the safe mode (i.e., shutting down the payload subsystem and some AOCS parts) is necessary to guarantee the spacecraft's health until further analysis is performed by the system experts (Henna et al. 2020).
Taburo lu (2019) gave a survey on spacecraft anomaly detection and fault diagnosis methods, among which we can cite: 1. Data preprocessing and feature extraction for data preparation. 2. Machine learning and data-mining for fault detection. 3. Statistical and knowledge based methods that also used for anomaly detection. Generally, space mission control relies on decision-making strategies at two levels: (1) expert/operator-based decisions at the ground control center and (2) autonomous FDIR at the onboard software level. Having a robust FDI subsystem helps optimize decision-making at both levels.
Widely used techniques that deal with fault diagnostics for industrial systems are model-based such as state estimation and observer-based methods. Alternatively, this work focuses on data-based self-adaptive systems. Sabatucci, Seidita, and Cossentino (2017) stated that a self-adaptive system could modify its behavior in response to environmental changes. However, self-adaptation should guarantee an acceptable level of performance and avoid instability issues.
Several metrics are used to evaluate the fault diagnostic performance such as false alarm rate (FAR) and missed alarm rate (MAR). In an efficient FDI, both FAR and MAR must be minimized. The detection speed is also an indicator that reflects how fast the algorithm can detect faults successfully. FAR and MAR are calculated using the following equations (Samy & Gu, 2012): where Tfalse_alarm denotes the total time the residual remains above the threshold before actual fault occurrence, Tmissed_alarm is the time the residual remains below the threshold before actual fault occurrence, and Tfaults denotes the time the fault occurs.

PROPOSED APPROACH
The proposed approach is based on three steps: i) feature space construction, ii) drift indicators computing, and iii) drift monitoring and interpretation using the self-adaptive scheme.

Feature space construction
To construct our 2-D feature space, we use two types of residuals. The first dimension represents the residuals based on the satellite star tracker (SST), while the second represents gyro-based residuals. Both are equal to the sensor reading deviation from the reference value of the angular rate. Gyrobased residuals are computed using Eq. (3). For SST-based residuals, the approximation of micro-rotation of attitude quaternion is used (see Eqs. (4) through (7)).
The attitude quaternion is related to rotation vector using Eq.
where [e1,e2,e3] is the principal rotation vector and ( ) denotes the angle of rotation (Schaub & Junkins, 2009). For small rotations, the equality sin 2 2 holds. The error quaternion denoted ( q ) is computed as follows: where ( * q ) denotes the conjugate of the quaternion (q), stands for quaternion multiplication, and qk-1, qk are two successive attitude quaternions delivered by the SST. Setting (Ts) to be the system sampling rate, the approximation above yields Finally, the SST-based residuals is given by: This feature space structure aims at isolating actuators faults that affect both residuals and is beyond the scope of this paper.

Drift indicator
In this paper, the technique called variability-based selfadaptive dynamical classification (VSADC) is proposed. VSADC is a dynamical clustering tool for data in evolution. It is unsupervised and has auto-adaptation capacities to handle the classification needs for a wide range of dynamic systems. For ACS enabling three-axis stabilization, the nominal class of residuals obeys area concentrations near the origin in the feature space. For such a class, the center is near (0,0) with a no-null covariance matrix due to systematic noise. The data noise is considered Gaussian to be coherent with nowadays gyro-stellar attitude estimators (using Kalman filters) implemented on many satellites like CNES's Myriade family (Ghezal, Polle, Rabejac & Montel, 2005). The arrival of new observations Xnew enables learning rules activation by creating and adapting the data prototypes and/or classes. In addition, the smoothing of historical data (considering the residuals above) helps minimize the noise transmission in the detection channel. For this purpose, we have used the famous sliding windows (Bodenham, 2012) as a filtering technique.
Consequently, the prototype's adaptation using VSADC performs a recursive updating of the center and covariance matrix on a sliding window with some user-defined width. The latter can be configured based on expert knowledge of the system dynamics (e.g., closed-loop delays, controller gains. etc.).
The fault implies that the dissimilarity between nominal class Cn and evolving class Ce exceeds some predefined threshold.
To quantify this dissimilarity, we measure the distance (given by Eq. (8)) between gravity centers μn and μe. The drift indicator is equal to that distance being updated online with the reception of each new feature vector Xnew.
E nr g y r er g y r nr s s t er s s t d = + Where dE is the Euclidean metric. If dE exceeds some predefined threshold, this indicates the beginning of drift.
Nonetheless, additional information about this point will be further detailed in the subsequent subsection. Note that because the gyroscope system is orthogonal, this measure is taken separately for each axis without causing any performance loss.

Self-adaptive dynamical classification
In addition to the previous Euclidean metric that quantifies the gap between the gravity centers, the variability of the above distance is characterized by a standard deviation (σ). Taking this statistical feature into account further improves the fault identification performance. This is handled by considering some threshold σlim to be defined later. Other methods of dynamical classification may use a predefined constant value for σlim (e.g., 3 of the nominal class distribution) (Toubakh, Sayed-Mouchaweh, Benmiloud, Defoort & Djemai, 2020). Alternatively, our method dynamically adapts this threshold w.r.t occupation areas in feature space, hence incorporating self-adaptive characteristics. However, this threshold should maintain a good trade-off between false and missed alarms, especially when the drift is slow. It is reasonable to think that the behavior of such variance is twofold: Increasing in the drift region: in normal conditions, the variance of residuals is bounded ( _ , ∀ ∈ ) where σnom denotes the set of standard deviations in the nominal case. At the first appearance of fault, σ starts increasing until it exceeds σmax_nom. Hence, for efficient fault detection with minimized false alarms, it is judicious to choose the threshold σlim_1 to be σmax_nom.
Stagnated in the bias-like fault: in this case, setting the new threshold σlim_2 to be the mean of standard deviations of the last sliding windows is more efficient. Indeed, when another drift emerges, using σlim_2 helps detect this drift faster than σlim_1, which has no guarantee to do so (the new fault could be unseen if of related data is smaller than σlim_1). Figure 1 shows the explanation of σ evolution and its effect on self-adaptation applied in our approach.
The VSADC algorithm is depicted in Figure 2.

NUMERICAL SIMULATION
To validate our approach, a comparison between our scheme and several supervised learning techniques is conducted. These techniques are: k-Nearest Neighbor, Naïve Bayes, multiclass SVM.
For the latter, the adopted One-vs-All strategy requires three binary SVM classifiers to be trained. The selected supervised learning techniques are detailed in Table 1.

Simulation setting
The training data for offline classification is generated using the AOCS simulator. Table 2 summarizes the numerical values of simulation inputs. Furthermore, we have injected three fault scenarios affecting the X-axis gyro. These scenarios reflect the transition from a healthy gyro state (see Figure 3(a)) to faulty behavior (see Figure 3(b)). Both values are real-life telemetry of microsatellites at low earth orbit. These data were acquired at the beginning of life and ten years later (faulty gyro) from the Algerian remote sensing satellite ALSAT-2A (Kramer, 2021). The transition exhibits three different drift speeds. The fault scenarios are depicted in Figure 4. The training data is a batch (randomly selected) of 70% of the simulation data.

Results and discussion
After the injection of faults, the first step of feature space construction leads to the results shown in Figure 5. Clearly, it is hard to separate the overlapped transition areas, which help compare and evaluate the classification performance, particularly for slow and medium drifts. The classification results are divided into three categories: (1) the method's accuracy, (2) FAR/MAR metrics, and (3) detection delay. The sum of FAR and MAR is called the incorrect detection rate (IDR). IDR is also an evaluation criterion to be considered in this study. The classification accuracies are detailed in Table 3.  VSADC outperforms the other methods in fault classification (drift and bias). For SVM, the classifier whose kernel is 3degree polynomial gives better results than the rest of the SVM classifiers.
Also, MAR is improved using our approach in the case of medium and slow drifts. However, the FAR results show that using SVM with a 3D polynomial kernel and Naïve Bayes is more efficient (see Table 4 and Table 5). Note that minimizing MAR is crucial for system health monitoring. To further assess this comparison, incorrect detection rates are given in Table 6. It is clear that for all drift speeds, VSADC obtains the best IDR.
In the current study, linear kernel SVM gives poorer results due to under-fitting issues (3 classes), whereas 4D polynomial SVM, suffering from over-fitting, is also less performant. For kNN, better performance is inversely proportional to the number of neighbors. Indeed, a small number of neighbors is more efficient for classification in overlapping areas (inter-classes transition).    In addition to the classification metrics above, we draw the output labels ("0" for a healthy state, "1" for drift, and "2" for bias) w.r.t time. Figure 6 shows the labeling performed by the most accurate methods: 3D SVM, NB, and VSADC for slow drift cases. VSADC has the best performance in terms of (1) fast detection with accuracy and (2) low detection noise as compared to Naïve Bayes (see Figure 7). The reason for this superior performance of VSADC is assumed to be the dynamical adaptation of the standard deviation. This technique helps avoid the shattering effect in prediction. The other methods suffer from class overlapping at the mode transitions (healthy fault; fault type 1 fault type 2, etc.). So, when the gyro starts drifting, the gravity center of residuals moves in that direction. VSADC is particular in addressing this evolution using the variance of data, which is not the case with other methods. Let's take the example of kNN, where the nearest neighbors typically belong to the old class during the transition. Furthermore, in the case of slow drift, the number of new class samples is inferior to those of the old class. Therefore, kNN will take so long to assign the correct labels. Moreover, in the case of NB, the prior probability has a major impact that causes the classification to be biased, especially in the transition zones.
These findings showing the superiority of VSADC are also supported by the fact that setting the first threshold σlim_1 to be the maximum σ of the last measured Euclidean distances dE is beneficial in avoiding false alarms without deteriorating the detection speed. Furthermore, setting the second threshold σlim_2 to be the mean of σ of the last distances stabilizes the fault detection system and permits fast detection of new drifts (if any).

CONCLUSION
We addressed, in this paper, the FDI of spacecraft gyroscopes, and the so-called variability-based self-adaptive dynamical classification is applied. This technique relies on the statistical characteristics of the AOCS sensor residuals.
To minimize the false alarm rate and noise in raw data, we adopted data preprocessing by sliding windows. A comparative study with some supervised learning methods was conducted. VSADC outperforms the other schemes in terms of accuracy, minimizing missed alarm rate, lowering prediction noise, and speed of detection.
Future work will focus on hybridizing data-driven and model-based approaches to handle the FDI of the satellite's ACS in concert with fault-tolerant control. The overall strategy will enable stringent pointing for remote sensing microsatellites.

ACKNOWLEDGEMENT
The telemetry data for gyro health measurements used in this work is an offering from the Algerian space agency (ASAL).
This work is funded by : Direction Générale de la Recherche Scientifique et du Développement Technologique, Algeria. (DGRSDT).