# 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
### Predictive Filtering Algorithm  
The next step after obtaining the orbital motion model is to predict and estimate the target position. As a state optimal estimation algorithm in the time domain, the Kalman filter is advantageous in terms of its simple structure, high calculation speed, and high estimation accuracy; therefore, it was selected as the predictive filter algorithm of the control system for spectrometer on-axis tracking. According to the motion model of the turntable, the target angle of the turntable is approximated as the superposition of three sinusoids. The phase angle of each sinusoid is related to the moment when the spectrometer tracks the sun. Under the premise that working time is known, the amplitude, frequency, and phase angle of each sinusoid are updated by parameter injection from the ground before each orbit, which helps realize the adaptive function of the predictive filtering algorithm when working in different orbits every day. To realize the practical engineering of the model, the angular position and velocity of the target angle are chosen as the system state. The angular positions are \(\theta_{1}\left(t\right)=a_{1}\ast\sin\left(b_{1}t+c_{1}\right)\), \(\theta_{2}\left(t\right)=a_{2}\ast\sin\left(b_{2}t+c_{2}\right)\), and \(\theta_{3}\left(t\right)=a_{3}\ast\sin\left(b_{3}t+c_{3}\right)\). The corresponding angular velocities are \(\omega_{1}\left(t\right)\), \(\omega_{2}\left(t\right)\), and \(\omega_{3}\left(t\right)\). The system state is shown in Equation (8), and the state-space expression of the control system is shown in Equation (9). \[x(t)=\left[ \begin{array}{cccccc}\theta_{1}(t)&\theta_{2}(t)&\theta_{3}(t)& \omega_{1}(t)&\omega_{2}(t)&\omega_{3}(t)\end{array} \right]^{\text{T}} \tag{8}\]  
\[\left\{ \begin{array}{cccccc}\dot{x}(t)=fx(t)+w(t)&&\\ f=\left[\begin{array}{cccccc}0&0&0&1&0&0\\ 0&0&0&0&1&0\\ 0&0&0&0&0&1\\ -b_{1}^{2}&0&0&0&0&0\\ 0&-b_{2}^{2}&0&0&0&0\\ 0&0&-b_{3}^{2}&0&0&0\end{array}\right]&\\ y(t)=Hx(t)+v(t)&&\\ H=\left[\begin{array}{cccccc}1&1&1&0&0&0\end{array}\right]&\\ \end{array} \right. \tag{9}\]  
In Equation (9), \(w\left(t\right)\) is the process noise of the system, which mainly occurs owing to the errors of the target motion model. \(v\left(t\right)\) is the measurement noise of the system, which arises from the measurement noise of the encoder and tracking sensor. According to the physical interpretation, the process noise and measurement noise are not correlated with each other and are approximated as Gaussian white noise with a zero mean [21]. The discrete state-space expression of the system target model is derived as shown in Equation (11), where \(T\) is the sampling period of the system and \(Q_{k}\) is the non-negative definite variance matrix of the process noise sequence \(W\left(k\right)\). \(R_{k}\) is the variance of the measurement noise \(V\left(k\right)\). \[\left\{ \begin{array}{c}E\Big{[}W(k)W(j)^{T}\Big{]}=Q_{k}\\ E\Big{[}V(k)V(j)^{T}\Big{]}=R_{k}\\ E[W(k)V(j)]=0\\ X(k+1)=F(T,b_{1},b_{2},b_{3})X(k)+W(k)\\ Y(k+1)=HX(k+1)+V(k+1)\end{array} \right. \tag{10}\]\[F(T,b_{1},b_{2},b_{3})=L^{-1}\Big{[}(sI-f)^{-1}\Big{]}\] \[=L^{-1}\left[ \begin{array}{cccc}\frac{s}{s^{2}+b_{1}^{2}}&0&0& \frac{1}{s^{2}+b_{1}^{2}}&0&0\\ 0&\frac{s}{s^{2}+b_{2}^{2}}&0&0&\frac{1}{s^{2}+b_{2}^{2}}&0\\ 0&0&\frac{s}{s^{2}+b_{3}^{2}}&0&0&\frac{1}{s^{2}+b_{3}^{2}}\\ \frac{-b_{1}^{2}}{s^{2}+b_{1}^{2}}&0&0&\frac{s}{s^{2}+b_{1}^{2}}&0&0\\ 0&\frac{-b_{2}^{2}}{s^{2}+b_{2}^{2}}&0&0&\frac{s}{s^{2}+b_{2}^{2}}&0\\ 0&0&\frac{-b_{2}^{2}}{s^{2}+b_{2}^{2}}&0&0&\frac{s}{s^{2}+b_{3}^{2}}\\ \end{array} \right] \tag{12}\] \[=\left[ \begin{array}{cccc}\cos(b_{1}T)&0&0&\frac{\sin(b_{1}T)}{ b_{1}}&0&0\\ 0&\cos(b_{2}T)&0&0&\frac{\sin(b_{2}T)}{b_{2}}&0\\ 0&0&\cos(b_{3}T)&0&0&\frac{\sin(b_{3}T)}{b_{3}}\\ -b_{1}\sin(b_{1}T)&0&0&\cos(b_{1}T)&0&0\\ 0&-b_{2}\sin(b_{2}T)&0&0&\cos(b_{2}T)&0\\ 0&0&-b_{3}\sin(b_{3}T)&0&0&\cos(b_{3}T)\\ \end{array} \right]\]  
The initial state of the Kalman filter can be determined by the target model equation and the start time.