## 2 ADCS System Model
### Attitude and Orbit Dynamics  
The coordinate frames used in this work are Earth Centered Inertial frame (ECI) \(\mathcal{N}\): \(\{\hat{n}_{1},\hat{n}_{2},\hat{n}_{3}\}\), orbit frame \(\mathcal{O}\): \(\{\hat{t}_{r},\hat{t}_{\theta},\hat{t}_{h}\}\), CubeSat's body frame \(\mathcal{B}\): \(\{\hat{b}_{1},\hat{b}_{2},\hat{b}_{3}\}\), and reference frame \(\mathcal{R}\): \(\{\hat{r}_{1},\hat{r}_{2},\hat{r}_{3}\}\). The DCM between \(\mathcal{O}\) and \(\mathcal{R}\) is defined such that \([OR]=diag( \begin{bmatrix}-1&-1&1\end{bmatrix} )\). Notice that this condition ensures that, if \([BR]=I_{3\times 3}\), this camera is pointing towards Earth with in addition \({}^{B}\omega_{B/\mathcal{R}}=\mathbf{0}_{3\times 1}\). The geometric representation of these reference frames is shown in Figure 3.  
Once the nanosatellite operational modes are defined, both rotation and orbit mathematical models are quantified to establish attitude control and estimator methods. In general, an orbit such as that whose eccentricity is zero (\(e=0\)) is not achievable. In this way, the Gauss variational equations are useful, since these describe the dynamics of the  
Figure 3: Geometric representation for coordinate reference systems. Payload (RGB camera) is aligned with \(\hat{\mathbf{b}}_{1}\) vector (fixed to CubeSat’s body frame); 3-1-3 Euler angles (\(\Omega-i-\theta\)) are utilized to represent the rotation between the orbit frame and ECI (inertial frame). satellite six orbit elements. Let the disturbance orbit force expressed in the orbit frame \(\mathbf{u}= \begin{smallmatrix}\mathcal{O}\\ u_{r}\end{smallmatrix}\begin{bmatrix}u_{\theta}&u_{h}\end{bmatrix} ^{T}\), so the Gauss variational equations are given by the following [40]:  
\[\dot{a} =\frac{2a^{2}}{h}(e\sin(f)u_{r}+\frac{p}{r}u_{\theta}) \tag{1}\] \[\dot{e} =\frac{1}{h}(p\sin(f)u_{r}+((p+r)\cos(f)+re)u_{\theta})\] \[\dot{i} =\frac{r\cos(\theta)}{h}u_{h}\] \[\dot{\Omega} =\frac{r\sin(\theta)}{h\sin(i)}u_{h}\] \[\dot{\omega} =\frac{1}{he}(-p\cos(f)u_{r}+(p+r)\sin(f)u_{\theta})-\frac{r\sin( \theta)\cos(i)}{h\sin(i)}u_{h}\] \[\dot{M} =n+\frac{b}{ahe}((p\cos(f)-2 re)u_{r}-(p+r)\sin(f)u_{\theta})\]  
Otherwise, the use of these equations is useful when it is intended to develop a formation orbit control algorithm; it also presents a convenient way to analyze the long-term behavior of each orbit element. However, these equations present numerical issues when \(e\) is near zero, despite the analytical accuracy of the previous equations; a near-circular orbit is modeled assuming that \(\mathcal{O}_{\mathbf{\dot{r}}_{\mathcal{H}/\mathcal{N}}}= \begin{smallmatrix} \mathcal{O}\\ r\end{smallmatrix}\begin{bmatrix}r\end{bmatrix}\begin{bmatrix}0\end{bmatrix} ^{T}\) and \(\mathcal{O}\mathbf{\omega}_{\mathcal{H}/\mathcal{N}}=\begin{smallmatrix} \mathcal{O}\\ 0\end{bmatrix} \begin{bmatrix}0\end{bmatrix}\begin{bmatrix}\sqrt{\frac{E_{\text{ Earth}}}{r^{3}}}\end{bmatrix} ^{T}\). By applying the transport theorem, it is obtained that \(\mathcal{O}_{\mathbf{\dot{r}}_{\mathcal{H}/\mathcal{N}}}=\begin{smallmatrix} \mathcal{O}\\ 0\end{bmatrix} \begin{bmatrix}r\sqrt{\frac{E_{\text{Earth}}}{r^{3}}}\end{bmatrix} ^{T}\). Furthermore, the rotation matrix \([HN(t)]\) can be computed directly from the 3-1-3 rotation given by \(\Omega-i-\theta\); notice that \(\theta=\omega+f=\frac{h_{\text{Earth}}}{r^{3}}\cdot[t-t(\theta_{0})]+\theta_{0}\), where \(f\) represents the CubeSat's true anomaly. Concerning attitude kinematics, it will be modeled using quaternions, which are a compact representation of rotations in 3D space since numerical discontinuities can be avoided. In this work, the quaternion is denoted by \(\mathbf{q}= \begin{bmatrix}q_{1}&q_{2}&q_{3}&q_{4}\end{bmatrix} ^{T}= \begin{bmatrix} q_{\
u}^{T}&q_{4}\end{bmatrix} ^{T}=q_{1}\mathbf{i}+q_{2}\mathbf{j}+q_{3}\mathbf{k}+q_{4}\), so \(q_{\
u}= \begin{bmatrix}q_{1}&q_{2}&q_{3}\end{bmatrix} \) represents the imaginary part of the quaternion and \(q_{4}\) the real part.