## 4 Simulation and Dataset Generation
### Spacecraft Description  
The spacecraft architecture is chosen to be representative of many instances of real satellites orbiting Earth: this mimics a standard mission in the chosen spacecraft class, where computational capabilities are limited and where the result of this work could be useful and actually implementable. At the start of each run, randomized parameters slightly modify many architecture characteristics, but specific scenarios simulated are realistic enough to confidently generalize all of the results obtained: Table 3 gives more details on these simulation parameters. The case study follows a small satellite at around 700 Km altitude, on an almost circular orbit. The spacecraft has different moments of inertia along its three main axes, since in this case study, the design chosen was not axial-symmetric. Initial angular rates set at the beginning of each run are dependent on which attitude mode is chosen; orbital parameters of the satellite's trajectory are randomized, while always keeping the orbit almost circular and the altitude within a 200 Km range from the average value. All perturbations modeled by the functional simulator have a small but measurable effect on the spacecraft: principal inertia, magnetic dipole, and other main physical details of the spacecraft are reported in Table 3 for reference. Going deeper on the description of onboard elements, the spacecraft is equipped with a sensors suite composed of a three-axis gyroscope, a Sun sensor, and a magnetometer. The output of these elements can exhibit the faults described in Section 2: since this is the raw data upon which classifiers need to work, a realistic model should take into consideration also the errors and noise affecting the sensors. Generic sensors, as depicted in Figure 7, are affected by random and systematic errors such as scale factors, small misalignment, cross-axis sensitivity, biases, and white and brown noise. Furthermore, as a result of the resolution of the sensors and their sampling time, quantization and discretization of the signal play a substantial role in defining characteristics of the final output [1]. The gyroscope outputs the three measured angular rates in terms of [deg/s]; the signal output by the Sun sensor is \begin{table}
\begin{tabular}{l l l l} \hline
**Element** & **Details** & **Value** & **Units** \\ \hline \multirow{3}{*}{Spacecraft’s Inertia} & \multirow{3}{*}{Asymmetric} & \(I_{xx}=1.000\) & \multirow{3}{*}{[kg m\({}^{2}\)]} \\  & & \(I_{yy}=0.250\) & \\ \cline{3-4}  & & \(I_{zz}=0.950\) & \\ \cline{3-4}  & & \([0.1\,0.1\,0.1]\) & \([\)A m\({}^{2}\)] \\ \cline{3-4}  & & Mode: No Control & \(\sim\,[0.1\,0.1\,0.1\,]\) & \\ \cline{3-4}  & Mode: Earth pointing & \([10^{-6}\,10^{-6}\,10^{-6}]\) & \([\)rad/s\(]\) \\ \cline{3-4}  & Mode: Slew & \([10^{-6}\,10^{-6}\,10^{-6}]\) & \\ \cline{3-4}  & & \(\phantom{\frac{\frac{\partial}{\partial}}{\partial}}\) & \\ \cline{3-4}  & & \(\phantom{\frac{\partial}{\partial}}\) & \\ \cline{3-4}  & & \(\phantom{\frac{\partial}{\partial}}\) & \\ \cline{3-4}  & & \(\phantom{\frac{\partial}{\partial}}\) & \\ \cline{3-4}  & & \(\phantom{\frac{\partial}{\partial}}\) & \\ \hline \end{tabular}
\end{table} 
Table 3: Simulation parameters at the start of each run. simply a three-dimensional unitary vector indicating the Sun's direction with respect to a body-frame of the satellite; magnetometers output the three-axis electromagnetic fields components measured in [\(T\)]. Raw signals coming from the sensors are processed by a 4 th order low-pass Butterworth filter: this is fundamental to generate more manageable output and it is often a default function of real sensors. Data is then passed to the attitude estimation, which retrieves the satellite's orientation in terms of quaternion and angular rates, through a Multiplicative Extended Kalman Filter (MEKF) [23].