## 4 Numerical Simulation  
In order to verify the effectiveness of the proposed control method, the numerical simulation analysis is performed by using MATLAB Simulink. The closed-loop simulation program consists of the onboard software module and the satellite model module. The onboard software module is used to simulate the ADCS software that operates on the OBC, which is compiled and run by MATLAB. Its input data include attitude sensor measurement and attitude actuator status, and the output data are control commands of 3-axis MTQs. The satellite model module calculates the attitude data of the simulated satellite based on the mathematical models, such as the dynamics model, kinematics model, sensor measurement model, and disturbance torque model. The input of this module is orbit parameters, magnetic field, and control commands of 3-axis MTQs, and the output is the simulated sensors' measurement. The simulated satellite runs in a sun-synchronous orbit with an orbit altitude of 545 km and a descending node local time of 10:30. The solar panel of the simulated satellite is installed toward the \(-O_{b}Y_{b}\) axis. At the same time, the solar panel is also the designated plane of the satellite that needs to point to the sun in the spin-stabilized phase. In order to ensure that the sun is in the field of view of the sun sensor under the ground-oriented attitude, such as remote sensing imaging, the sun sensor is installed at a certain angle away from the \(-O_{b}Y_{b}\) axis. The angles between the optical axis of the sun sensor and the \(O_{b}X_{b}\), \(O_{b}Y_{b}\), and \(O_{b}Z_{b}\) axes of the satellite are set to be \(69.2952^{\circ}\), \(150^{\circ}\), and \(110.7048^{\circ}\), respectively. The field of view of the sun sensor is \(90^{\circ}\)\(\times\)\(110^{\circ}\). The angle between the optical axis of the sun sensor and the normal vector of the designated plane is up to \(30^{\circ}\), so the spin-up phase is divided into two subphases as mentioned in Section 3.3.3 in the simulation. Considering that the satellite may have uncertain angular momentum and the attitude is also in a random state after separation from the vehicle (or losing attitude control for a long period of time), the initial 3-axis angular rates are assumed to be \([-1.5\)\(-1.5\)\(-1.5]^{\circ}\)/s, and the initial attitude angles are assumed to be \([160\)\(20\)\(60]^{\circ}\). The simulation parameters are based on a microsatellite that is being developed, and Table 1 shows the detailed simulation parameters. The given spinning angular rate \(\omega_{spin}\) is chosen as \(1.146^{\circ}\)/s (about \(0.02\)\(rad\)/s). \begin{table}
\begin{tabular}{l l c} \hline \hline
**Site** & **Parameter** & **Value** \\ \hline \multirow{4}{*}{Orbit parameters} & Type of orbit & Sun-synchronous orbit \\  & Altitude & 545 km \\  & Local time of the descending node & 10:30 \\  & Eccentricity & 0 \\  & On-board orbit propagation model & SGP4 \\ \hline \multirow{4}{*}{Satellite parameters} & Inertia moment & \([1.37\)\(1.69\)\(2.05]\) kg\(\cdot\)m\({}^{2}\) \\  & Distance between pressure center and centroid & 0.034 m \\ \cline{1-1}  & Remanence & 0.02 A\(\cdot\)m\({}^{2}\) \\ \cline{1-1}  & Surface reflection coefficient & 0.600 \\ \cline{1-1}  & Solar panel installation direction & \([0-1\)\(0]\) \\ \hline \multirow{4}{*}{ Attitude sensors} & 3-axis magnetometer: & \\ \cline{1-1}  & Constant offset & 0.1 uT \\ \cline{1-1}  & Random noise (\(3\sigma\)) & 0.4 uT \\ \cline{1-1}  & Sun sensor: & \\ \cline{1-1}  & Optical axis direction & \([0.3536\)\(-0.8660\)\(-0.3536]\) \\ \cline{1-1}  & Field of view & \(90^{\circ}\)\(\times\)\(110^{\circ}\) \\ \cline{1-1}  & Accuracy & \(0.2^{\circ}\) \\ \hline Attitude actuators & Maximum magnetic torque of 3-axis magnetic torquers & \([2.52\)\(3.21\)\(2.52]\) A\(\cdot\)m\({}^{2}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Numerical simulation parameters. The control period is set to be 0.5 s in the simulation.