## 3 Methodology of Complementary Filter Calibration
### Optimization Methodology
The systematic component of the error is modeled using a linear  
Figure 8: MAE variation as a function of TC in the range from 0.01 to 1. Figure 7: The dependence of MAE on TC for values in the range of 1 to 100.  
trend, while the residual term \(\epsilon\) captures the \"pure error\". Mathematically, the model can be expressed as  
\[y(t)=\beta_{0}+\beta_{1}t+\epsilon, \tag{15}\]  
where \(\beta_{0}\) represents the intercept, \(\beta_{1}\) is the slope of the trend, and \(\epsilon\) is the residual error. This formulation allows for the separation of systematic biases ( \(\beta_{0}+\beta_{1}t\)) from the stochastic components (\(\epsilon\)) in the centered signal. For each observed pitch and roll angle, the output signal exhibits distinct characteristics (see Table 1) caused by slightly different systematic errors. Therefore, it is necessary to approximate the systematic errors in the signal for each observed angle individually and subsequently select the optimal model for the systematic error. The null hypothesis for the intercept term is formulated as \((H_{0}:\beta=0)\). If this hypothesis is rejected, it indicates the presence of a systematic (constant) error in the model. Similarly, the null hypothesis for the coefficient of the variable \(t\) is \((H_{0}:\beta_{1}=0)\), suggesting that \(t\) has a statistically significant effect on the dependent variable. If this hypothesis is rejected, it suggests that \(t\) has a statistically significant effect on the dependent variable. In the case of roll angles, all null hypotheses were rejected, indicating the presence of both constant and time-dependent trends in the systematic errors. For pitch angles, however, the analysis revealed two specific cases of 10 and 25 degrees, where the coefficient of the time variable was not statistically significant, suggesting that only a constant trend is present for these angles. In the following, we provide the coefficients for each angle analyzed (Table 2). The next step involves removing systematic errors from the signal. Similarly to the process of selecting the optimal time constant, we chose to average the trend function. For roll angles, we applied a weighted average, while for pitch angles, we used a simple mean. \[\text{The systematic error of the roll angle}\ \ =-0.00242755-0.00019245t, \tag{16}\]  
and  
\[\text{The systematic error of the pitch angle}\ \ =0.03278214-1.3e-0.0000114t, \tag{17}\] \begin{table}
\begin{tabular}{c c c c c c} \hline
**Pitch Angle** & **TC** & **Minimum MAE** & **Roll Angle** & **TC** & **Minimum MAE** \\ \hline
0 & 0.11 & 0.049626 & 0 & 0.13 & 0.069190 \\
5 & 0.12 & 0.048810 & 5 & 0.19 & 0.051458 \\
10 & 0.13 & 0.047545 & 10 & 0.17 & 0.052601 \\
15 & 0.13 & 0.048458 & 15 & 0.16 & 0.057899 \\
20 & 0.12 & 0.046747 & 20 & 0.17 & 0.056838 \\
25 & 0.12 & 0.046995 & 25 & 0.19 & 0.052498 \\
30 & 0.12 & 0.049422 & 30 & 0.19 & 0.050939 \\ \hline \end{tabular}
\end{table} 
Table 1: Optimal TC and corresponding minimum MAE for observed pitch and roll angles. \begin{table}
\begin{tabular}{c c c c c c c} \hline
**Pitch Angle** & **0\_LM** & **5\_LM** & **10\_LM** & **15\_LM** & **20\_LM** & **25\_LM** & **30\_LM** \\ \hline
**(Intercept)** & 0.043588 & 0.026875 & 0.025521 & 0.035361 & 0.037425 & 0.034270 & 0.026435 \\
**t** & \(-0.000055\) & 0.000033 & 0.000000 & \(-0.000044\) & \(-0.000052\) & 0.000000 & 0.000038 \\ \hline
**Roll Angle** & **0\_LM** & **5\_LM** & **10\_LM** & **15\_LM** & **20\_LM** & **25\_LM** & **30\_LM** \\ \hline
**(Intercept)** & 0.010557 & \(-0.014750\) & \(-0.026526\) & \(-0.030684\) & \(-0.020162\) & \(-0.018307\) & \(-0.023530\) \\
**t** & \(-0.000305\) & \(-0.000055\) & \(-0.000004\) & \(0.000020\) & \(-0.000042\) & \(-0.000039\) & \(-0.000010\) \\ \hline \end{tabular}
\end{table} 
Table 2: LM coefficients for observed pitch and roll angles. where \(t\) is time. In the next subsection, we will analyze the optimized signal after the removal of systematic errors.