# A Sun-Tracking Algorithm for Satellite-Borne Spectrometers Based on the Orbital Motion Model
## 4 Simulation and Tests
### Tests  
To verify the effectiveness and accuracy of the theory and simulation results, a spectrometer tracking experiment was set up in a laboratory environment to simulate the sun tracking of the spectrometer in orbit. The test environment is shown in Figure 9. A collimator is placed in front of the tracking sensor, at whose focal plane a strong light source is placed to simulate sunlight. It is important to ensure that the sunlight is always within the effective field of view of the tracking sensor throughout the tracking process. The spectrometer was placed on a six-degree-of-freedom (6-DOF) platform that simulates the motion of the satellite. The rotation range of the 6-DOF platform is larger than that of the turntable, using which the attitude control accuracy of the satellite platform in orbit could be simulated.  
Figure 8: (**a**) tracking position curve of on-axis tracking control; (**b**) tracking position curve of closed-loop simulation.  
Figure 7: Deviation curve of the target position.  
The experimental parameters were in accordance with those of the simulation model. The 6-DOF platform must move according to the sun vector in the first orbit of the spring equinox in 2020 and simulate the stability of the satellite attitude control at the same time. The update frequency and error results of the tracking sensor and position sensor on the spectrometer were in accordance with those from the simulation model. The turntable controller could receive the injection parameters of the on-axis tracking control, and the light source tracking was realized by following the instructions of the on-axis tracking control model proposed in this paper or by directly using the offset of the tracking sensor.  
First, the predictive filtering algorithm of on-axis tracking control was tested, and the results are shown in Figure 10. In the figure, \"pos ref model\" denotes the target position of the model, and \"pos ref kf\" denotes the target position calculated by the algorithm. \"pos ref err\" is the difference between the target position of the model and the predicted target position. The RMS of the measured target position deviation is 0.738\", which approximates the simulation result \"pos ref err kf\" in Figure 7. This indicates that the target motion model and the tracking sensor model in the simulation model are relatively accurate, and the delay of the tracking sensor can be effectively compensated by the predictive filtering algorithm with the angular offset filtered.  
Figure 10: Measured curve of the target position.  
Figure 9: Test environment for sun tracking.  
The closed-loop tracking test was conducted in the aforementioned environment. The output offset curves of the tracking sensor under the two known control strategies are shown in Figure 11. Under the two tracking strategies, the sun was always in the effective field of view of the tracking sensor, and sun tracking could be achieved.  
The angular tracking curves under the two control strategies are shown in Figure 12a,b. In the figures, \"track ref\" denotes the tracked target position and \"track fdb\" denotes the actual output position of the position sensor. \"track err\" represents the tracking error. In comparison to the simulation model, the measurement error of the encoder was introduced in the actual position in the test, which had little influence on the comparison of the tracking error under the two control strategies. Finally, the RMS of the tracking error was reduced from 5.72'' to 1.43'' after the adoption of the on-axis tracking strategy. These results show that the sun tracking error of the spectrometer can be effectively reduced by the on-axis tracking strategy based on the orbital motion model proposed in this paper.  
Figure 11: Offset curve of sun tracking.