## 2 Proposed Methodology of This Study
### Threshold-Based Detection  
The baseline functional simulator already involves a simple fault detection algorithm, which is used as benchmark. This \"Classic\" algorithm is based on custom-made operators placed after each observed element, with the aim of achieving a simple fault detection. These blocks separate any 3-axis time-variant signal into its three components, then calculate the running variance and running mean on each of the signals, with a moving window of tunable length. The evolving variance of the signal, if checked in real time and coupled with the values of the signal itself, can be an already powerful indicator if some unusual  
Figure 2: Test instances for data-driven detection in this study. Variance-based detection has a rigid structure and therefore is employed only for its main use on the first row of this graph: it may raise a flag when monitoring an anomalous signals. Machine Learning algorithms, exhibiting more flexibility, are trained on 4-class detection of one or more faults, binary detection, and diagnosis on faulty signals. The last two instances of this graph, surrounded by the dashed line, represent the specific case-study tested within a live simulation. All of these tests are detailed in Section 5.  
behavior is observed [21]. Through a pipeline of logical operators and thresholds, outlined in Figure 3, this basic algorithm can output four different flags:  
* Generic anomaly: When any of the axes exhibits a particularly high variance in its signal, a threshold is violated and the block emits a flag. * Out-of-range signal: A simple threshold is put on the maximum magnitude all signals can have, mimicking the violation of the maximum range imposed by physical limits on onboard elements. * Stuck signal: When the block senses a variance drop in the signal to the point where it basically reaches zero, this flag is activated. * Data loss: Just like the previous case, a variance drop is recognized. The detection algorithm goes and checks the effective magnitude of the defective signal as well: if it is exactly zero, then the sensor or actuator monitored is not simply stuck, but it most certainly has stopped outputting meaningful data at all. Clearly, the generic flag \"Anomaly\" can be specialized into distinguishing the many faults described in Section 2.4: this, however, requires a much finer tuning of the detection block and the use of soft thresholding. A finer 6- or 7-class, data-driven, threshold-based detection is most certainly possible, but the tuning would be so specific and custom-tailored on the simulation parameters that it would lose any practical significance and attempt at generality. Some amount of fine-tuning is made nevertheless, to adapt the detector blocks to each of the monitored elements, and re-parametrized on each attitude mode of the satellite: despite the attempts at building an impartial system, given the fine-tuning performed and the fact that also faults are self injected, the correct detection rate is going to be very high. This is also a chance to point out that the necessity to manually and precisely tune so many parameters is one of the weaknesses of this method. In real detection algorithms, information on the possible behaviors of onboard signals is much more limited, and it is a good idea to keep an intermediate variance threshold: not too high, otherwise it might miss some faulty behaviors, and not too low, to avoid  
Figure 3: Classic detection block layout. The input is the low-pass filtered signal coming from a monitored sensor or actuator: it undergoes various threshold comparisons and value checks to understand if some fault is happening (signal exceeded the instrument range, is stuck, or there is partial loss of data). At the same time, the running variance of the signal is calculated axis by axis and is checked not to be too high (in which case, the anomaly flag is raised) and not too low (in that case, the information is transferred to the other part of the process, where other flags may be raised).