# In-Orbit Attitude Determination of the UVSQ-SAT CubeSat Using TRIAD and MEKF Methods
## 3 Attitude Determination Methods
### Multiplicative Extended Kalman Method
#### 3.2.5 Propagation  
The propagation part aims to propagate the expected values and covariance at time \(t_{k+1}\). First of all, we compute the estimate of the gyrometer components corrected based on the factors, drifts, and misalignments obtained from the previous step as (Equation (29))  
\[\mathbf{\hat{\omega}}^{+}(\mathbf{t})=[I_{3}-\hat{S}(t)][\mathbf{\hat{\omega}}^{-}(t)- \mathbf{\hat{\beta}(t)}] \tag{29}\]where \(S\) characterizes the gyrometer biases and misalignments and is defined as (Equation (30)):  
\[S=\begin{bmatrix}s_{1}&k_{lI1}&k_{lL2}\\ k_{L1}&s_{2}&k_{lU3}\\ k_{L2}&k_{L3}&s_{3}\end{bmatrix} \tag{30}\]  
Based on the knowledge of the updated angular rate and quaternion at time \(t_{k}\), the quaternion's estimate at time \(t_{k+1}\) is defined in Equation (31) as  
\[\mathbf{\hat{q}}_{\mathbf{k+1}}^{-}=\tilde{\Theta}(\hat{\boldsymbol{\omega}}_{ k}^{+})\mathbf{\hat{q}}_{\mathbf{k}}^{+} \tag{31}\]  
where \(\tilde{\Theta}(\hat{\boldsymbol{\omega}}_{k}^{+})\) is defined as (Equation (32))  
\[\tilde{\Theta}(\hat{\boldsymbol{\omega}}_{k}^{+})=\begin{bmatrix}\cos\left( \frac{1}{2}\
orm{\hat{\boldsymbol{\omega}}_{k}^{+}}\
orm{\Delta t}I_{3}-[ \hat{\mathbf{f}}_{k}^{+}\times]&\hat{\Psi}_{k}^{+}\\ -\hat{\Psi}_{k}^{+}&\cos\left(\frac{1}{2}\
orm{\hat{\boldsymbol{\omega}}_{k}^ {+}}\
orm{\Delta t}\right)\right]\end{bmatrix} \tag{32}\]  
where \(\Delta t\) is the duration between the two considered epochs. \(\hat{\Psi}_{k}^{+}\) is computed in Equation (33) as  
\[\hat{\Psi}_{k}^{+}=\frac{\sin\left(\frac{1}{2}\
orm{\hat{\boldsymbol{\omega}} _{k}^{+}}\
orm{\Delta t}\right)\hat{\boldsymbol{\omega}}_{k}^{+}}{\
orm{ \hat{\boldsymbol{\omega}}_{k}^{+}}} \tag{33}\]  
The covariance matrix \(P\) estimate at \(t_{k+1}\) is such that (Equation (34))  
\[P_{k+1}^{-}=\Phi_{k}P_{k}^{+}\Phi_{k}^{T}+\Gamma_{k}Q_{k}\Gamma_{k}^{T} \tag{34}\]  
where \(Q_{k}\) is defined as in Equations (35)-(37) at the initialization and during the iterations as  
\[Q(t)=block\;\;diagonal([\sigma_{v}^{2}I_{3}\;\sigma_{u}^{2}I_{3}\;\sigma_{s}^{ 2}I_{3}\;\sigma_{U}^{2}I_{3}\;\sigma_{L}^{2}I_{3}]) \tag{35}\]  
\[Q_{k}=\Delta t\;G\;Q\;G^{T} \tag{36}\]  
\[G(t)=\begin{bmatrix}-(I_{3}-\hat{S})&0_{3\times 12}\\ 0_{12\times 3}&I_{12}\end{bmatrix} \tag{37}\]  
where \(\Phi_{k}\) is the state transition matrix that is computed as follows (Equations (38)-(40b)) for a simple first-order approximation:  
\[\Phi_{k}=I_{15}+\Delta tF(t_{k}) \tag{38}\]  
\[F(t)=\begin{bmatrix}-[\hat{\boldsymbol{\omega}}(\boldsymbol{t})\times]&-(I_ {3}-\hat{S})&diag(\boldsymbol{\omega}-\hat{\boldsymbol{\beta}})&-\hat{U}&- \hat{L}\\ 0_{12\times 3}&0_{12\times 3}&0_{12\times 3}&0_{12\times 3}&0_{12\times 3} \end{bmatrix} \tag{39}\]  
\[\hat{U}=\begin{bmatrix}\omega_{2}-\hat{\boldsymbol{\beta}}_{2}&\omega_{3}- \hat{\boldsymbol{\beta}}_{3}&0\\ 0&0&\omega_{3}-\hat{\boldsymbol{\beta}}_{3}\\ 0&0&0\end{bmatrix} \tag{40a}\]  
\[\hat{L}=\begin{bmatrix}0&0&0\\ \omega_{1}-\hat{\boldsymbol{\beta}}_{1}&0&0\\ 0&\omega_{1}-\hat{\boldsymbol{\beta}}_{1}&\omega_{2}-\hat{\boldsymbol{\beta} }_{2}\end{bmatrix} \tag{40b}\]  
These calculation steps are applied to the inputs for each time step. In the case where the uncertainties related to the dynamics model are not very important, the corrections related to the gyro will converge at least in the short term. Nevertheless, they could evolve with the aging of the instrument and the flight conditions; thus, real-time calibration is legitimate.