## 2 Attitude Control System Model
### Attitude Dynamics  
This paper focuses on micro-satellites. Generally, the solar panels of a micro-satellite are closely attached to its outer shell so that the micro-satellite can be treated as a rigid body. Hence, the satellite's center of mass is chosen as the reference point. According to the angular momentum theorem, the time derivative of the angular momentum of the rigid satellite concerning its center of mass equals the external torque acting on the center of mass, i.e., \(\mathrm{d}\mathbf{H}_{\rm i}/\mathrm{d}t=\mathbf{T}\). Here, \(\mathbf{H}_{\rm i}\) represents the components of the angular momentum of the satellite concerning its center of mass in the inertial coordinate system, and \(\mathbf{T}\) is the external torque acting on the satellite's center of mass.  
The angular momentum is typically calculated in the satellite's body coordinate system. Therefore, in the satellite's body coordinate system, and based on the time derivatives of vectors in different coordinate systems, the dynamics can be expressed as follows:  
\[\frac{\mathrm{d}\mathbf{H}_{\rm b}}{\mathrm{d}t}+\mathbf{\omega}_{\rm bi}\times\mathbf{H}_ {\rm b}=\mathbf{T} \tag{3}\]  
where \(\mathbf{\omega}_{\rm bi}\) are the components of the angular velocity vector of the satellite's body coordinate system relative to the inertial coordinate system in the body coordinate system. \(\mathbf{H}_{\rm b}=\mathbf{J}\mathbf{\omega}_{\rm bi}\) represents the components of the angular momentum of the satellite about its center of mass in the body coordinate system, and \(\mathbf{J}\) is the total moment of inertia of the satellite.  
Assuming that \(\mathbf{J}\) remains constant during the satellite's rotation, then:  
\[\frac{\mathrm{d}\mathbf{H}_{\rm b}}{\mathrm{d}t}=\mathbf{J}\dot{\mathbf{\omega}}_{\rm bi} \tag{4}\]  
Considering that the micro-satellite body carries CMGs, let their total angular momentum be \(\mathbf{h}_{\rm b}\), and the installation matrix be \(\mathbf{C}\). Equation (3) then becomes:  
\[\mathbf{J}\dot{\mathbf{\omega}}_{\rm bi}+\mathbf{\omega}_{\rm bi}\times(\mathbf{J}\mathbf{\omega}_ {\rm bi}+\mathbf{CI}_{\rm b})=-\mathbf{C}\frac{\mathrm{d}\mathbf{h}_{\rm b}}{\mathrm{d}t}+ \mathbf{T} \tag{5}\]where \(-C\frac{\mathrm{d}h_{b}}{\mathrm{d}t}\) represents the control torque output by the CMGs.  
The angular velocity error is denoted as \(\mathbf{\omega}_{e}=\mathbf{\omega}_{bi}-\mathbf{C}_{e}\mathbf{\omega}_{r}\), where \(\mathbf{C}_{e}=(q_{e0}^{2}-q_{e\sigma}^{T}\mathbf{q}_{e\sigma})I_{3}+2q_{e\sigma}q_{e \sigma}^{T}-2q_{e0}q_{e\sigma}^{\times}\) is the transformation matrix from the inertial coordinate system to the body coordinate system, and \(\mathbf{\omega}_{r}\) is the desired angular velocity [23]. Substituting into Equation (5) yields the dynamics equation based on angular velocity error as follows:  
\[\dot{\mathbf{\omega}}_{e}=-(\mathbf{\omega}_{e}-\mathbf{C}_{e}\mathbf{\omega}_{r})\times[\mathbf{J} (\mathbf{\omega}_{e}-\mathbf{C}_{e}\mathbf{\omega}_{r})+\mathbf{C}\mathbf{h}_{\mathrm{b}}]+\mathbf{J} (\mathbf{\omega}_{e}\times\mathbf{C}_{e}\mathbf{\omega}_{r}-\mathbf{C}_{e}\dot{\mathbf{\omega}}_{ r})-C\frac{\mathrm{d}\mathbf{h}_{\mathrm{b}}}{\mathrm{d}t}+\mathbf{T} \tag{6}\]