# A Sun-Tracking Algorithm for Satellite-Borne Spectrometers Based on the Orbital Motion Model
## 4 Simulation and Tests  
### System Simulation and Result Analysis  
The azimuth motion compensation of the turntable is taken as the simulation object. To verify that the on-axis tracking algorithm based on the orbital motion model can improve the sun-tracking performance of the spectrometer, a simulation experiment that combines the on-axis tracking algorithm based on the orbital motion model with the azimuth tracking system of the spectrometer was performed.  
The simulation model and parameters are as follows. The model parameters in the first orbit of the spring equinox in 2020 are specified first, including the sun vector in the orbit system and the measured satellite attitude. The standard deviation of the attitude stability is assumed to be 0.002\({}^{\circ}\)/s, and the target motion model of the turntable is analyzed according to the aforementioned parameters. The simulation models of the tracking sensor and the position sensor are determined according to the selection of the spectrometer system. The refresh frequency of the tracking sensor is 40 Hz and the lag is 25 ms. The angular offset error is approximated as Gaussian white noise, whose standard deviation is about 1\({}^{\prime\prime}\). The refresh frequency of the position sensor is 1 kHz and the lag is 1 ms. The position measurement error is also approximated as Gaussian white noise whose standard deviation is about 1\({}^{\prime\prime}\). The driving control principle of the PMSM is shown in Figure 2, and the on-axis tracking control is finally established as shown in Figure 3. The system simulation time is 10 s. To simulate the process of guiding the sun into the center of the field of view, the offset is set to be about 0.05\({}^{\circ}\) when the sun is captured.  
The parameters of the target motion model, including the amplitude, frequency, and phase, are substituted into the predictive filtering algorithm based on orbital motion. Figure 7 shows the difference between the predictive target position and the actual one, along with the difference between the calculated target position with the offset and the actual position. In the figure, \"pos ref err kf\" represents the difference between the actual target position and the predicted target position, and \"pos ref err tracker\" represents the difference between the actual target position and the calculated target position with the offset. The figure clearly shows that the RMS of the target position deviation is reduced from 2.08\({}^{\prime\prime}\) to 0.77\({}^{\prime\prime}\) when the predictive filtering algorithm based on the orbital motion model is introduced. The angular offset lag of the tracking sensor is compensated effectively by the algorithm, whose noise is filtered as well.  
The on-axis tracking control system is compared with the case in which the offset output of the tracking sensor is directly used as the position loop control. The angle tracking curves are shown in Figure 8a,b. In the figure, \"track ref\" represents the reference target position and \"track fdb\" represents the actual tracking position. \"track err\" is the difference between the reference tracking position and the actual position. The tracking error curves in Figure 8a,b are compared; it was found that the RMS of the tracking error is reduced from 7.14\({}^{\prime\prime}\) to 0.97\({}^{\prime\prime}\) and the standard deviation of the tracking error is reduced from 1.39\({}^{\prime\prime}\) to 0.96\({}^{\prime\prime}\) when the on-axis tracking control strategy is adopted. This verifies that speed feedforward compensation can be achieved by on-axis tracking control, with the precise speed prediction of the target model and the fluctuation of tracking error being reduced.