# A Sun-Tracking Algorithm for Satellite-Borne Spectrometers Based on the Orbital Motion Model
## 3 On-Axis Tracking Control Method based on the Orbital Motion Model
### Target Motion Model
Without a loss of generality, it is assumed that \(\varphi\), \(\theta\), and \(\psi\) represent the rotating angles along the axes O\({}_{\text{O}}\)X\({}_{\text{O}}\), O\({}_{\text{O}}\)Y\({}_{\text{O}}\), and O\({}_{\text{O}}\)Z\({}_{\text{O}}\) of the satellite system, respectively, with respect to the orbital system. Matrix MOS is shown in Equation (2). \[M_{\text{OS}}=\left[ \begin{array}{ccc}c\theta c\psi-s\theta s\phi s\psi&c \theta s\psi+s\theta s\phi c\psi&-s\theta c\phi\\ -c\theta s\psi&c\phi c\psi&s\phi\\ s\theta c\psi+c\theta s\phi s\psi&s\theta s\psi-c\theta s\phi c\psi&c\phi c\phi \end{array} \right]=\left[ \begin{array}{ccc}m_{11}&m_{12}&m_{13}\\ m_{21}&m_{22}&m_{23}\\ m_{31}&m_{32}&m_{33}\end{array} \right] \tag{2}\]  
where \(c\theta=\cos\theta\), \(s\theta=\sin\theta\), and so forth. When the rotation angles of the azimuth axis and the pitch axis are \(A\) and \(E\), respectively, the transformation matrices are shown in Equations (3) and (4), and the analytical results for angles \(A\) and \(E\) can be obtained, as depicted in Equations (5) and (6). \[M_{A}=\left[ \begin{array}{ccc}\cos A&\sin A&0\\ -\sin A&\cos A&0\\ 0&0&1\end{array} \right] \tag{3}\]  
\[M_{E}=\left[ \begin{array}{ccc}1&0&0\\ 0&\cos E&\sin E\\ 0&-\sin E&\cos E\end{array} \right] \tag{4}\]  
\[\left\{ \begin{array}{c}A=-\arctan\frac{b_{1}}{2}\\ b_{1}=m_{11}\cdot X_{s}+m_{12}\cdot Y_{s}+m_{13}\cdot Z_{s}\\ b_{2}=m_{21}\cdot X_{s}+m_{22}\cdot Y_{s}+m_{23}\cdot Z_{s}\end{array} \right. \tag{5}\]  
\[\left\{ \begin{array}{c}E=\frac{\pi}{2}-\arcsin b_{3}\\ b_{3}=m_{31}\cdot X_{s}+m_{32}\cdot Y_{s}+m_{33}\cdot Z_{s}\end{array} \right. \tag{6}\]  
Moreover, the sun vector data in the orbital system of the four special days (spring equinox, summer solstice, autumn equinox, and winter solstice) are substituted into the model above, and the azimuth angle \(A\) and pitch angle \(E\) of the turntable can be obtained as shown in Figure 5. According to the results, it can be seen that the resulting curves for the azimuth and pitch angles of the turntable are approximately sinusoidal. Figure 5: Azimuth and pitch angle curves. To reach a compromise between the fitting accuracy and the calculation capacity of the controller, the azimuth and pitch angles are fitted with the three-term sinusoids, as shown in Equation (7). \[A=A_{1}+A_{2}+A_{3}=a_{1}\sin(b_{1}t+c_{1})+a_{2}\sin(b_{2}t+c_{2})+a_{3}\sin(b_{ 3}t+c_{3}) \tag{7}\]  
In Equation (7), \(A_{1}\) is the fundamental component representing the azimuth curve of the turntable when there is a cycle change of the sun vector in the orbit system. \(A_{2}\) and \(A_{3}\) denote the azimuth angles caused by nonlinear factors such as coordinate transformation and attitude control. In the four days shown in Figure 4, the amplitude of residual errors and periodicity of the azimuth and pitch angles in each orbit are basically the same when the fitting data is compared with that obtained from the satellite. Owing to the low speed of the satellite in orbit, the fitted data changes very slowly. Taking the azimuth curve in the first orbit of the spring equinox as an example, it can be seen that the standard deviation of the final error is about 0.02\({}^{\circ}\). The fitting parameters are shown in Table 1, and the results are shown in Figure 6. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline \(a_{1}\) & 13.0259066 \\ \(b_{1}\) & 0.001029832 \\ \(c_{1}\) & 2.8657158 \\ \(a_{2}\) & 0.05223328 \\ \(b_{2}\) & 0.003174308 \\ \(c_{2}\) & 1.7896428 \\ \(a_{3}\) & 0.02308526 \\ \(b_{3}\) & 0.004310233 \\ \(c_{3}\) & \(-2.9673356\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Fitting parameters in the first orbit of the spring equinox. Figure 6: Fitting results in the first orbit of the spring equinox.