## 3 Control Algorithm Design
### Attitude Controller Design
#### 3.3.4 Spin-Stabilized Phase  
In this phase, when the satellite is in the suntic zone of the orbit, the calculation formula of the desired control torque \(\mathbf{T}_{c4}\in\Re^{3}\) is the same as that of \(\mathbf{T}_{c3}\), i.e., Equation (17). When the satellite is in the shadow zone of the orbit, due to the angular momentum along the spin axis of the satellite, the sun-oriented attitude is maintained during the shadow zone of the orbit, so that the normal vector of the designated plane is aligned with the solar vector as the satellite returns to the suntic zone of the orbit. In order to ensure that the spinning angular rate of the satellite is always near the given value \(\omega_{spin}\), the desired control torque of the controller during the shadow zone of the orbit is given by the following equation:  
\[\mathbf{T}_{c4}=-K_{9}\mathbf{J}\Big{(}\mathbf{\omega}_{bi}^{b}-\omega_{spin}\mathbf{e}_{p}^{b} \Big{)}+\mathbf{\omega}_{bi}^{b}\times\Big{(}\mathbf{I}\mathbf{\omega}_{bi}^{b}\Big{)}, \tag{18}\]  
where \(K_{9}\) is the control coefficient larger than zero. Then, the desired control torque \(\mathbf{T}_{c4}\) will be outputted by the 3-axis MTQs. We next prove the stability of the closed-loop system with the proposed control method and the attitude control of the suntic zone of the orbit in the spin-stabilized phase is taken as an example without loss of generality. The control errors of the controller (17) are defined as:  
\[\left\{ \begin{array}{l}\mathbf{e}_{1}=\mathbf{S}^{b}-\mathbf{e}_{p}^{b}\\ \mathbf{e}_{2}=\mathbf{\omega}_{bi}^{b}-\omega_{spin}\mathbf{S}^{b}\end{array} \right.. \tag{19}\]  
**Theorem 1**. : _Consider the attitude control system of the microsatellite described by the nonlinear dynamics (3) and the controller (17). Suppose that Assumption 1 holds and the initial conditions of the controller satisfy \(\|\mathbf{e}_{2}\|<\frac{\varepsilon}{K_{9}\min(\mathbb{I}_{x}J_{y}J_{z})}\), the control error \(\mathbf{e}_{2}\) is uniformly ultimately bounded (UIUB)._  
**Proof of Theorem 1. ** The proof is based on the Lyapunov stability theory. Define a candidate Lyapunov function for \(\mathbf{e}_{1}\) and \(\mathbf{e}_{2}\) as:  
\[V(t)=0.5K_{5}\mathbf{e}_{1}{}^{\mathrm{T}}\mathbf{e}_{1}+0.5\mathbf{e}_{2}{}^{\mathrm{T}}\mathbf{ e}_{2}. \tag{20}\]  
The unit vector \(\mathbf{S}^{b}\) satisfies \(\mathbf{S}^{b}=\mathbf{C}_{1}^{b}\mathbf{S}^{i}\), where \(\mathbf{C}_{i}^{b}\) is the direction cosine matrix between coordinate systems \(O_{i}X_{i}Y_{i}Z_{i}\) and \(O_{b}X_{b}Y_{b}Z_{b}\), and \(\mathbf{S}^{i}\) is the solar vector represented in the coordinate system \(O_{i}X_{i}Y_{i}Z_{i}\). The approximation is that \(\dot{\mathbf{S}}^{i}=0\), and then we obtained that \(\dot{\mathbf{S}}^{b}=\mathbf{S}^{b}\times\mathbf{\omega}_{bi}^{b}\)[31]. Then,  
\[\dot{V}(t) =K_{5}\mathbf{e}_{1}{}^{\mathrm{T}}\mathbf{e}_{1}+\mathbf{e}_{2}{}^{\mathrm{ T}}\mathbf{e}_{2} \tag{21}\] \[=K_{5}\Big{(}\mathbf{S}^{b}-\mathbf{e}_{p}^{b}\Big{)}^{\mathrm{T}}\Big{(} \mathbf{S}^{b}\times\mathbf{\omega}_{bi}^{b}\Big{)}+\Big{(}\mathbf{\omega}_{bi}^{b}-\omega _{spin}\mathbf{S}^{b}\Big{)}^{\mathrm{T}}\Big{(}\dot{\mathbf{\omega}}_{bi}^{b}-\omega _{spin}\mathbf{S}^{b}\times\mathbf{\omega}_{bi}^{b}\Big{)}\ \.\]  
According to Equations (3) and (17), it follows that:  
\[\dot{\mathbf{\omega}}_{bi}^{b}=K_{5}\mathbf{e}_{p}^{b}\times\mathbf{S}^{b}+K_{6}\mathbf{S}_{ prev}^{b}\times\mathbf{S}^{b}-K_{7}\mathbf{S}^{b}\times\mathbf{\omega}_{bi}^{b}\times\mathbf{S}^{b}-K_{8} \Big{(}\mathbf{\omega}_{bi}^{b}-\omega_{spin}\mathbf{S}^{b}\Big{)}+J^{-1}\mathbf{d}. \tag{22}\]  
Substituting (22) into (21), we obtain:  
\[