To guarantee that a spectrometer can obtain effective solar spectral data, it is important that the two-dimensional turntable that carries the spectrometer tracks the sun with high accuracy for long time periods, such that the sun is always near the center of the field of view of the spectrometer. However, there is an offset lag problem for the tracking sensor, leading to an increase in the sun-tracking error and inaccuracies in solar spectrum data. To mitigate this problem, an on-axis tracking control algorithm—based on the orbital motion model—is proposed in this paper. First, the sun-tracking model of the spectrometer is established based on the coordinate transformation method, and the analytical relationship between the adjustment angle of the turntable and the solar vector in the orbit system is given by means of the inverse kinematics solution of the target model. Then, the predictive filtering algorithm of the target model is derived to acquire the target position, based on which, the on-axis tracking control algorithm of the spectrometer system is realized to compensate the offset lag and increase the sun-tracking accuracy. Finally, the simulation analysis and experimental verification were performed under the actual working conditions of an orbit. The simulation results demonstrate that the root-mean-square (RMS) of the target position deviation decreased from 2.08″ to 0.77″ after prediction filtering, and the RMS of the tracking error decreased from 7.14″ to 0.97″. The RMS of an orbit’s sun-tracking error decreased from 5.72″ to 1.43″ in the ground test. The simulation and experimental results verify that the algorithm proposed in this paper can improve the tracking accuracy of the spectrometer, providing a reference for the design of a spectrometer in orbit.