Calibration, Compensation and Accuracy Analysis of Circular Grating Used in Single Gimbal Control Moment Gyroscope

The accuracy of the circular grating is the key point for control precision of the single gimbal control moment gyroscope servo system used in civilian micro-agile satellites. Instead of using the multi reading heads to eliminate eccentricity errors, an algorithm compensation method based on a calibration experiment using a single reading head was proposed to realize a low-cost and high accuracy angular position measurement. Moreover, the traditional hardware compensation method using double reading heads was also developed for comparison. Firstly, the single gimbal control moment gyroscope system of satellites was introduced. Then, the errors caused by the installation of the reading head were studied and the mathematic models of these errors were developed. In order to construct the compensation function, a calibration experiment using the autocollimator and 24-sided prism was performed. Comparison of angle error compensation using the algorithm and hardware method was presented, and results showed that the algorithm compensation method proposed by this paper achieved the same accuracy level as the hardware method. Finally, the proposed method was further verified through a control system simulation.


Introduction
The attitude control for unmanned systems [1] and an aerospace system are very important, for the precision of the attitude control has great influence on the accuracy and reliability of the system [2]. Single gimbal control moment gyroscope (SGCMG) is a critical system for the attitude control of a space system that can offer significant accuracy and efficiency control torque for the attitude adjustment and stability of the spacecraft. Its application in spacecraft attitude control has always been a research hot spot [3][4][5]. The output of the rotor used in SGCMG is a constant angular momentum, and the control accuracy mainly depends on the accuracy of the gimbal servo control system. Therefore, the accuracy of the output torque has a significant impact on the performance of attitude control. Generally, the influence of electromagnetic signal on the sensor accuracy of aircraft and spacecraft systems are very small [6]. In recent years, in order to improve the accuracy of servo control systems, many scholars have focused on servo control algorithms development including robust iterative learning control via adaptive sliding mode control [7], a variable structure controller and an adaptive feed forward controller [8] and a cascade extended state observer [9].
The circular grating is an angular position sensor of the SGCMG control system for measuring the angular position of the gimbal, and the angular velocity is further obtained by the differential processing of sensor signal. Generally, the circular grating with high-resolution and high-precision are used as a system sensor of the satellite to achieve high system accuracy. However, the errors caused by machining and installation [10][11][12] will have significant impact on the measurement accuracy of the circular grating. Improving the measurement accuracy of the circular grating is still an active research subject in various industrial fields. Dateng Zheng et al. [13] developed the 6 circular grating eccentricity errors model of an articulated arm coordinate measuring machine (AACMM). They also perform calibration and error compensation to improve the measurement accuracy. Ming Chu et al. [14] proposed a method for circular grating eccentric testing and error compensation for robot joint using double reading heads. Guanbin Gao et al. [15] studied the mounting eccentric error of the circular grating angle sensors and proposed a compensation method to compensate the error of the joints of an articulated arm coordinate measuring machine. For self-errors of the angle measuring sensor, such as sub-divisional error, Jiawei Yu et al. [16] established mathematical models for different types of sub-division errors of photoelectric angle encoders. They also proposed an algorithm compensation method based on the established models to improve the tracking precision of a telescope control system. Xianjun Wang [17] analyzed the cause of angle measuring error of grating for large telescopes and compensated the angle measuring error by resonant equation. Liandong Yu [18] proposed the harmonic method to compensate for the circular grating angle measurement error of the portable articulated coordinate measurement instrument machines caused by ambient temperature change. Li Xuan et al. [19] presented a spider-web-patterned scale grating to realize the eccentricity self-detection of the optical rotary encoder by a dual-head scanning unit. However, the above compensated methods were developed for the ground system and the additional mass and power needed by these methods were not considered. The SGCMG system studied in this paper was used in the civilian micro-agile satellites. The mass of the whole satellite is less than 40 kg. Therefore, the requirements of the SGCMG system used in civilian micro-agile satellites are low mass, low power consumption, low cost and high precision. In general, the methods proposed by previous studies for compensating the eccentricity error of circular grating can be summarized as the hardware [20] and algorithm [21] compensation method. The hardware compensation method used multiple reading heads, which were symmetrical, mounted about the center of the circular grating to eliminate the eccentricity error [22][23][24]. The algorithm compensation method developed the compensation model, and the parameters of the model were obtained by the calibration experiments [25,26]. The method of using multi reading heads to eliminate eccentricity errors is easy to implement with high precision. However, for there are four SGCMG used in the satellite studied in this paper, and the compensation method should ensure accuracy requirements with relatively low power and mass. Moreover, few studies have focused on the effect of measurement accuracy on the performance of the servo control system, which is especially important for the SGCMG system development.
In general, the former research of scholars can be summarized as: (a) Most researchers have focused on the circular grating's accuracy of ground systems such as the articulated arm coordinate measuring machine (AACMM) and telescope control system. (b) Many scholars studied the compensation methods and self-calibration [27,28] of circular grating by multi reading heads. However, few research studies concerning the algorithm compensation can be found in recent years, and the comparison of the algorithm and hardware method has not been the focus of research on compensation of the circular grating. (c) A search of the literature revealed few studies that improved the performance of the servo control system that considered the accuracy of the circular grating sensors. The contribution of this paper is to propose an error compensation method for the angle measurement of the SGCMG system used in satellite. Only one reading head was used and the angle measurement errors were compensated based on the calibration experiment to verify the accuracy of the algorithm method was almost the same as the hardware method. Moreover, a SGCMG servo system model for velocity control accuracy simulation was investigated to prove that improving the accuracy of circular grating can improve the accuracy of the servo control system. In the next section the design of a single gimbal control moment gyroscope system is described. In Section 3, the source of circular grating errors was studied, and the mathematic models of tilt and eccentricity error are also presented. Section 4 introduces the circular grating calibration experiment. Detailed results of the calibration experiment and accuracy analysis of the proposed method are given in Section 5, followed by conclusions in Section 6.

Introduction of the SGCMG System
The SGCMG consists of constant-speed angular momentum flywheel, gimbal and servo control system, as shown in Figure 1a. The flywheel that is orthogonally mounted on the uniaxial gimbal generates the constant angular momentum by rotary motion. The gimbal generates a gyroscopic torque by changing the axis of the flywheel. The mathematic function of the output torque of the SGCMG is given as where T is the output torque; h represents the flywheel angular momentum; ω m is the angular velocity of the gimbal. The angular momentum of the flywheel is maintained at a constant 5 Nms. Then the direction and value of the output torque depends on the angular velocity vector, which is the differential of the angle value measured by the circular grating sensor. The contribution of this paper is to propose an error compensation method for the angle measurement of the SGCMG system used in satellite. Only one reading head was used and the angle measurement errors were compensated based on the calibration experiment to verify the accuracy of the algorithm method was almost the same as the hardware method. Moreover, a SGCMG servo system model for velocity control accuracy simulation was investigated to prove that improving the accuracy of circular grating can improve the accuracy of the servo control system. In the next section the design of a single gimbal control moment gyroscope system is described. In Section 3, the source of circular grating errors was studied, and the mathematic models of tilt and eccentricity error are also presented. Section 4 introduces the circular grating calibration experiment. Detailed results of the calibration experiment and accuracy analysis of the proposed method are given in Section 5, followed by conclusions in Section 6.

Introduction of the SGCMG System
The SGCMG consists of constant-speed angular momentum flywheel, gimbal and servo control system, as shown in Figure 1a. The flywheel that is orthogonally mounted on the uniaxial gimbal generates the constant angular momentum by rotary motion. The gimbal generates a gyroscopic torque by changing the axis of the flywheel. The mathematic function of the output torque of the SGCMG is given as where T is the output torque; h represents the flywheel angular momentum; ωm is the angular velocity of the gimbal. The angular momentum of the flywheel is maintained at a constant 5 Nms. Then the direction and value of the output torque depends on the angular velocity vector, which is the differential of the angle value measured by the circular grating sensor.

Control System
The servo control system of the SGCMG consists of one plant, one controller and two sensors. The plant is the system under control, which consists of a motor and mechanical structure. The mechanical structure is driven by a permanent magnet synchronous motor (PMSM) [29,30] that must follow the desired velocity profile. The current sensor and circular grating sensor are used to provide the feedback of the plant to controller.
As shown in Figure 1b, the servo controller consists of a current control loop and a velocity control loop. The servo system outputs a velocity reference signal ωref according to the desired and actual angular position of the SGCMG system. The velocity controller compares the commanded

Control System
The servo control system of the SGCMG consists of one plant, one controller and two sensors. The plant is the system under control, which consists of a motor and mechanical structure. The mechanical structure is driven by a permanent magnet synchronous motor (PMSM) [29,30] that must follow the desired velocity profile. The current sensor and circular grating sensor are used to provide the feedback of the plant to controller.
As shown in Figure 1b, the servo controller consists of a current control loop and a velocity control loop. The servo system outputs a velocity reference signal ω ref according to the desired and actual angular position of the SGCMG system. The velocity controller compares the commanded Sensors 2020, 20, 1458 4 of 15 velocity to actual velocity to increase or decrease the motor by generating the current command i q to current controller.
For modeling of the SGCMG gimbal servo system, few assumptions were made as follows: (1) The PMSM iron core is unsaturated, and the eddy currents and hysteresis losses are negligible. (2) The stator windings are strictly three-phase symmetrically distributed, and the winding axes are spatially different from each other by 120 • electrical angle. (3) There is no damped winding on permanent magnet rotor. (4) The induced electromotive force of the stator winding changes according to a strict sinusoidal law, ignoring the higher harmonic magnetic potential in the magnetic field.
The equation of PMSM dynamic model can be expressed as: where J is the load rotating inertia, B is the viscous friction coefficient and T e is the electromagnetic torque, which can be given as: in which P n is the number of magnetic poles on the rotor, ψ f is the permanent magnet flux linkage. The mathematical model of the calculation i q is as follows: where ψ q = L q i q is the stator flux linkages, L q is the stator inductances, u q is the stator voltages, respectively, and R is the stator resistance.

Eccentricity Error Modeling
The circular grating error is the difference between the measured angle value of the reading head and the actual angle value. In general, the errors caused by the angle measurement of circular grating consists of two parts: self-errors and installation errors. The self-errors include the graduation accuracy and sub-divisional error [31], which are the periodic systematic errors that are sourced from the circular grating and the reading head. Generally, these errors can be decreased by using high-precision circular gratings and reading heads [32]. The installation errors mainly include the tilt and eccentricity error, which are caused by the installation of the circular grating and reading head. The grating tilt is caused by installation tilt and shaft sloshing, as shown in Figure 2a. The shaft sloshing is caused by the attitude control of the satellite and the micro-vibration of the flywheel rotating. The influence of tilt error on measurement accuracy is very small in comparison with eccentricity error. Therefore, tilt error is usually negligible. The mathematic model of tilt error is presented briefly in Appendix A. velocity to actual velocity to increase or decrease the motor by generating the current command iq to current controller. For modeling of the SGCMG gimbal servo system, few assumptions were made as follows: (1) The PMSM iron core is unsaturated, and the eddy currents and hysteresis losses are negligible. (2) The stator windings are strictly three-phase symmetrically distributed, and the winding axes are spatially different from each other by 120° electrical angle. (3) There is no damped winding on permanent magnet rotor. (4) The induced electromotive force of the stator winding changes according to a strict sinusoidal law, ignoring the higher harmonic magnetic potential in the magnetic field. The equation of PMSM dynamic model can be expressed as: where J is the load rotating inertia, B is the viscous friction coefficient and Te is the electromagnetic torque, which can be given as: in which Pn is the number of magnetic poles on the rotor, ψf is the permanent magnet flux linkage. The mathematical model of the calculation iq is as follows: where q qq L i ψ = is the stator flux linkages, Lq is the stator inductances, uq is the stator voltages, respectively, and R is the stator resistance.

Eccentricity Error Modeling
The circular grating error is the difference between the measured angle value of the reading head and the actual angle value. In general, the errors caused by the angle measurement of circular grating consists of two parts: self-errors and installation errors. The self-errors include the graduation accuracy and sub-divisional error [31], which are the periodic systematic errors that are sourced from the circular grating and the reading head. Generally, these errors can be decreased by using high-precision circular gratings and reading heads [32]. The installation errors mainly include the tilt and eccentricity error, which are caused by the installation of the circular grating and reading head. The grating tilt is caused by installation tilt and shaft sloshing, as shown in Figure 2a. The shaft sloshing is caused by the attitude control of the satellite and the micro-vibration of the flywheel rotating. The influence of tilt error on measurement accuracy is very small in comparison with eccentricity error. Therefore, tilt error is usually negligible. The mathematic model of tilt error is presented briefly in Appendix A.  The eccentricity error is caused by the non-coincidence between the geometric center of the circular grating and the rotational center of the measured shaft [33,34]. The value of the eccentricity error changes periodically with the rotation of the shaft. Because the eccentricity error is determined after the installation of the reading head and circular grating, the eccentricity error can be modeled by geometric method. Figure 2b shows the relationship between the actual rotation angle β of the circular grating and the measurement angle α of the reading head. A is the geometric center of the circular grating; O is the rotational center of measurement system; P is the zero angular position; C is the angle measuring position where the reading head is installed. Because the lines OP and AC intersect, where γ and θ are the angle value of ∠OPA and ∠OCA, respectively. According to the sine theorem, the relationship between side length and the angle of triangle ∆OAP and ∆OAC are given as where ε is the value of eccentricity (the distance between the geometric center and rotational center) and r is the radius of the circular grating; ϕ represents the direction of the eccentricity. Then, γ and θ can be expressed as follows: The grating measurement error of reading head is given as where δ is the measurement error of the circular grating. By substituting Equations (5), (8) and (9) into (10), one can obtain, If r is no less than 52 mm and the eccentricity ε is controlled within 0.01 mm, then Based on the small-angle approximation theory, the simplification of the Equation (11) is given as where the sine value of the δ approaches 0, and the cosine value of δ approaches 1. Then sin(ϕ + β) is approximated as follows: Sensors 2020, 20, 1458 6 of 15 The Equation (13) can be reduced to , (15) in which

Compensation Principle
In order to achieve a relative high accuracy range by using the algorithm compensation method for the circular grating angle measurement in the SGCMG system of a satellite, a circular grating calibration and compensation system was proposed in this paper. Figure 3 shows the principle of measurement error calibration and compensation.

Compensation Principle
In order to achieve a relative high accuracy range by using the algorithm compensation method for the circular grating angle measurement in the SGCMG system of a satellite, a circular grating calibration and compensation system was proposed in this paper. Figure 3 shows the principle of measurement error calibration and compensation.  In order to prove a high precision angle measurement reference, the optical measurement method was also performed by using a 24-sided prism with the angle measurement accuracy 0.5''. The angular position is measured every 15° during the rotation of the circular grating. The reading head-prism calibration was performed to calculate the measurement error of reading head 1. Then, In order to prove a high precision angle measurement reference, the optical measurement method was also performed by using a 24-sided prism with the angle measurement accuracy 0.5". The angular position is measured every 15 • during the rotation of the circular grating. The reading head-prism calibration was performed to calculate the measurement error of reading head 1. Then, the algorithm compensation model was constructed by the fitting process. Finally, the constructed compensation model was used for the error correction of the circular grating. where α 1 is the measured value of reading head 1, H(x) is the algorithm compensation function and α c_alg is the angle value after algorithm compensation. Moreover, for the hardware compensation method, another reading head was installed on the circular grating, and the two reading heads were located symmetrically about the center of the circular grating. The principle of eccentricity error compensation using double or multiple reading heads was introduced in Reference [24]. As shown in Figure 4, the synthetic angle of the double reading heads can be given as where α 1 and α 2 are the angle value measured by reading head 1 and 2, respectively; α c-hard represents the compensated angle value using the hardware compensation method.
compensation model was used for the error correction of the circular grating.
where α1 is the measured value of reading head 1, H(x) is the algorithm compensation function and αc_alg is the angle value after algorithm compensation. Moreover, for the hardware compensation method, another reading head was installed on the circular grating, and the two reading heads were located symmetrically about the center of the circular grating. The principle of eccentricity error compensation using double or multiple reading heads was introduced in Reference [24]. As shown in Figure 4, the synthetic angle of the double reading heads can be given as where α1 and α2 are the angle value measured by reading head 1 and 2, respectively; αc-hard represents the compensated angle value using the hardware compensation method.
Reading head 1 Reading head 2  Finally, the accuracy of the algorithm and hardware compensation methods are calculated as where i respects the algorithm (alg) or hardware (hard) compensation method; εi represents the accuracy of method i; αc_i is the angle value after compensation using method i.

Calibration Experiment Setup
The experimental system includes an SGCMG system, autocollimator, 24-sided prism and vibration isolation platform, as shown in Figure 5. The schematic diagram of the experiment is shown in Figure 6. For isolating the vibration disturbance of the external environment, the SGCMG system was mounted on a vibration isolation platform. The autocollimator was used for generating parallel light and receiving the reflection optical signal of the 24-sided prism. The prism was mounted on the shaft of the SGCMG gimbal servo system. Note that it is critical to ensure that the optical axis of the light pipe is perpendicular to the prism's surface. Reading head 1 and 2 were mounted on the circular grating symmetrically. The software for data recording and processing were also developed. The shaft system rotated 15° each time, and 24 angle positions were measured during the rotation of the system. The angle measuring values of the two reading heads and prism at Finally, the accuracy of the algorithm and hardware compensation methods are calculated as where i respects the algorithm (alg) or hardware (hard) compensation method; ε i represents the accuracy of method i; α c_i is the angle value after compensation using method i.

Calibration Experiment Setup
The experimental system includes an SGCMG system, autocollimator, 24-sided prism and vibration isolation platform, as shown in Figure 5. The schematic diagram of the experiment is shown in Figure 6. For isolating the vibration disturbance of the external environment, the SGCMG system was mounted on a vibration isolation platform. The autocollimator was used for generating parallel light and receiving the reflection optical signal of the 24-sided prism. The prism was mounted on the shaft of the SGCMG gimbal servo system. Note that it is critical to ensure that the optical axis of the light pipe is perpendicular to the prism's surface. Reading head 1 and 2 were mounted on the circular grating symmetrically. The software for data recording and processing were also developed. The shaft system rotated 15 • each time, and 24 angle positions were measured during the rotation of the system. The angle measuring values of the two reading heads and prism at each calibration position were recorded. Then both the algorithm and hardware compensation method were performed. each calibration position were recorded. Then both the algorithm and hardware compensation method were performed.

Test Data Processing
In order to obtain a higher accuracy compensation model, 30 sets of calibration experiments were performed separately, and the measuring values of the two reading heads and prism of the third calibration experiment are shown in Table 1. The main data flows of the data processing are shown in Figure 7. The results of the 30 experiments were divided into two datasets at first: 20 sets of experimental results for fitting (fitting dataset 67%) and 10 sets of experimental results for verification (testing dataset 33%). Then, the model of the algorithm compensation method was fitted using the 20 fitting datasets. Both the algorithm and hardware compensation (double reading heads) method were performed to correct the measurement errors of the 10 testing datasets. Furthermore, accuracy of the two methods were analyzed.

Test Data Processing
In order to obtain a higher accuracy compensation model, 30 sets of calibration experiments were performed separately, and the measuring values of the two reading heads and prism of the third calibration experiment are shown in Table 1. The main data flows of the data processing are shown in Figure 7. The results of the 30 experiments were divided into two datasets at first: 20 sets of experimental results for fitting (fitting dataset 67%) and 10 sets of experimental results for verification (testing dataset 33%). Then, the model of the algorithm compensation method was fitted using the 20 fitting datasets. Both the algorithm and hardware compensation (double reading heads) method were performed to correct the measurement errors of the 10 testing datasets. Furthermore, accuracy of the two methods were analyzed.

Test Data Processing
In order to obtain a higher accuracy compensation model, 30 sets of calibration experiments were performed separately, and the measuring values of the two reading heads and prism of the third calibration experiment are shown in Table 1. The main data flows of the data processing are shown in Figure 7. The results of the 30 experiments were divided into two datasets at first: 20 sets of experimental results for fitting (fitting dataset 67%) and 10 sets of experimental results for verification (testing dataset 33%). Then, the model of the algorithm compensation method was fitted using the 20 fitting datasets. Both the algorithm and hardware compensation (double reading heads) method were performed to correct the measurement errors of the 10 testing datasets. Furthermore, accuracy of the two methods were analyzed. Based on Equation (15), the Fourier curve fitting is used to construct the compensation function of the algorithm method. The mathematical model of compensation function is given as δ 1 = a 0 + a 1 sin(ωα 1 ) + a 2 cos(ωα 1 ), (20) where the parameters of a 0 , a 1 , a 2 and ω of Equation (20) were determined by the fitting process through the measured values (α 1 , δ 1 ) of the 20 fitting datasets. Table 2 shows the results of the fitting process. Statistical measure r-square was used to evaluate the prediction accuracy.  Based on Equation (15), the Fourier curve fitting is used to construct the compensation function of the algorithm method. The mathematical model of compensation function is given as where the parameters of a0, a1, a2 and ω of Equation (20) were determined by the fitting process through the measured values (α1, δ1) of the 20 fitting datasets. Table 2 shows the results of the fitting process. Statistical measure r-square was used to evaluate the prediction accuracy.   Then, the measurement errors of reading head 1 (δ1) of the 10 testing datasets were compensated based on the prediction values using the algorithm compensation method. Figure 8a shows the angle errors before and after the algorithm compensation of the first testing dataset. It is apparent that the algorithm was remarkably effective. Moreover, the hardware compensation method was also performed based on Equation (18). Both the compensation errors between the actual values (the angle values of prism) and predicted angle values of the algorithm and hardware compensation methods are shown in Figure 8b.  Then, the measurement errors of reading head 1 (δ 1 ) of the 10 testing datasets were compensated based on the prediction values using the algorithm compensation method. Figure 8a shows the angle errors before and after the algorithm compensation of the first testing dataset. It is apparent that the algorithm was remarkably effective. Moreover, the hardware compensation method was also performed based on Equation (18). Both the compensation errors between the actual values (the angle values of prism) and predicted angle values of the algorithm and hardware compensation methods are shown in Figure 8b.

Accuracy Analysis
In order to further identify the accuracy of the proposed method, both the peak-to-valley (PV) and Root Mean Square (RMS) errors of the angle errors before and after compensated are presented in Table 3. The system accuracy of circular grating used in this study, including the graduation accuracy and sub-divisional error, is 5.49″. The PV error of algorithm and hardware compensation method are 6.23″ and 6.43″, respectively. Therefore, a good agreement can be observed between the system accuracy of circular grating and the two compensation methods (13% and 17%). The errors caused by the installation of the circular grating were reduced significantly by the compensation methods. Moreover, the accuracy of the algorithm method was almost the same as with the hardware method. The repeatability of the algorithm compensation method was also evaluated. The compensation errors of the 10 testing datasets using the algorithm compensation method are shown in Figure 9a. Repeatability [35] is the closeness between the results of successive measurements of the same measure carried out under the same conditions. Therefore, the repeatability Sj of the circular grating compensation results at each measurement position is expressed as where i and j represent the number of the 10 testing datasets and 24 angle measurement positions, respectively; εij is the measurement error after algorithm compensation of the j th angle measurement position in i th testing datasets; j ε is the average value of the measurement errors after compensation at each measurement position; n = 10 is the number of testing datasets.
The repeatability results of the 10 testing datasets at 24 angle measurement positions are shown in Figure 9b. In order to further analysis the accuracy of the algorithm compensation method, both error/(°) Figure 8. (a) Errors using one reading head before and after compensation. (b) Errors of algorithm and hardware compensation using one and double reading heads, respectively.

Accuracy Analysis
In order to further identify the accuracy of the proposed method, both the peak-to-valley (PV) and Root Mean Square (RMS) errors of the angle errors before and after compensated are presented in Table 3. The system accuracy of circular grating used in this study, including the graduation accuracy and sub-divisional error, is 5.49". The PV error of algorithm and hardware compensation method are 6.23" and 6.43", respectively. Therefore, a good agreement can be observed between the system accuracy of circular grating and the two compensation methods (13% and 17%). The errors caused by the installation of the circular grating were reduced significantly by the compensation methods. Moreover, the accuracy of the algorithm method was almost the same as with the hardware method. The repeatability of the algorithm compensation method was also evaluated. The compensation errors of the 10 testing datasets using the algorithm compensation method are shown in Figure 9a. Repeatability [35] is the closeness between the results of successive measurements of the same measure carried out under the same conditions. Therefore, the repeatability S j of the circular grating compensation results at each measurement position is expressed as where i and j represent the number of the 10 testing datasets and 24 angle measurement positions, respectively; ε ij is the measurement error after algorithm compensation of the j th angle measurement position in i th testing datasets; ε j is the average value of the measurement errors after compensation at each measurement position; n = 10 is the number of testing datasets. The repeatability results of the 10 testing datasets at 24 angle measurement positions are shown in Figure 9b. In order to further analysis the accuracy of the algorithm compensation method, both the PV and RMS errors of the maximum of 10 testing datasets and repeatability are presented in Table 4. The maximum PV value of the 10 testing datasets is 6.78". The maximum RMS value of the 10 testing datasets is 3.17". Therefore, a good agreement can be observed between the repeatability experiment of the 10 testing datasets in Figure 9a and the algorithm compensation method in Figure 8. The maximum value of the repeatability of the compensation results using the algorithm method is 1.19". The RMS value of the repeatability of the compensation results using the algorithm method is 0.50".
Sensors 2019, 19, x FOR PEER REVIEW 11 of 15 experiment of the 10 testing datasets in Figure 9a and the algorithm compensation method in Figure  8. The maximum value of the repeatability of the compensation results using the algorithm method is 1.19''. The RMS value of the repeatability of the compensation results using the algorithm method is 0.50''.

SGCMG Simulation Results
In order to further verify the effect of the compensated measurement results on the control accuracy of the SGCMG system, the system simulation according to the model of control system introduced in Section 2 was also performed, and the parameters used in the simulation are shown in Table 5. Simulation 1 and 2 were performed considering the angular measurement error before and after compensation, respectively. The angle inputs of the control system were the sum of the angle outputs of the motor and the errors calculated by the error model at every simulation step. The probability distributions of the error before and after compensation are shown in Figure 10. It is apparent that both errors before and after compensation were approximately normal distribution. Then, random errors were generated from the normally distribution with the same mean and variance at every simulation step.

SGCMG Simulation Results
In order to further verify the effect of the compensated measurement results on the control accuracy of the SGCMG system, the system simulation according to the model of control system introduced in Section 2 was also performed, and the parameters used in the simulation are shown in Table 5. Simulation 1 and 2 were performed considering the angular measurement error before and after compensation, respectively. The angle inputs of the control system were the sum of the angle outputs of the motor and the errors calculated by the error model at every simulation step. The probability distributions of the error before and after compensation are shown in Figure 10. It is apparent that both errors before and after compensation were approximately normal distribution. Then, random errors were generated from the normally distribution with the same mean and variance at every simulation step. variance at every simulation step.  The same control parameters were used in the two simulations, and the desired angular velocity of motor was 60 • /min. Figure 11 shows the angular velocity of the motors of the two simulations. The two simulations of accuracy of the control system are summarized in Table 6. The velocity of the motors of the two simulations were in the rang 59.50-60.75 • /min and 59.94-60.07 • /min respectively. The Velocity Root Mean Square Error (RMSE) was 0.0283 • /min and 0.0001 • /min, respectively. It is apparent that the control performance and accuracy was improved greatly by the compensation of the angle measurement error. The same control parameters were used in the two simulations, and the desired angul locity of motor was 60 °/min. Figure 11 shows the angular velocity of the motors of the tw mulations. The two simulations of accuracy of the control system are summarized in Table 6. T locity of the motors of the two simulations were in the rang 59.50-60.75 °/min and 59.94-60. min respectively. The Velocity Root Mean Square Error (RMSE) was 0.0283 °/min and 0.0001 °/m spectively. It is apparent that the control performance and accuracy was improved greatly by th mpensation of the angle measurement error.

Conclusions
In order to improve control precision of the SGCMG, a general and systematic methodology esented to compensate the measurement error of circular grating. A calibration experiment w oposed to measure the error of the circular grating. The interactions among the measureme ror, compensation accuracy and control accuracy were investigated. Both the algorithm an

Conclusions
In order to improve control precision of the SGCMG, a general and systematic methodology is presented to compensate the measurement error of circular grating. A calibration experiment was proposed to measure the error of the circular grating. The interactions among the measurement error, compensation accuracy and control accuracy were investigated. Both the algorithm and hardware compensation method were performed, and a comparison and appraisal were made for both methods. In general, therefore, it seems that the proposed method was effective, offering compensation for the measurement error of the circular grating with only one reading head. The results of this study indicate that the error calibration and compensation have achieved accuracy solutions for measuring and predicting the measurement error of circular grating. Based on the results of this study, the following main conclusion can be drawn: (1) Eccentricity error is the main source of measurement error of circular grating. (2) The key step in the proposed method is that the error calibration process includes calibration and fitting of the measurement error to provide accurate fitting compensation models to predict measurement errors. (3) The accuracy of the algorithm method was almost same with the hardware method in this study.
We also conducted fitting processing with a two-term Fourier compensation model, and the accuracy of the measurement was not obviously improved.
Generally speaking, we observe that the algorithm compensation method proposed in this paper effectively offers good potential to be applied to the angle measurement of circular grating used in the space system in order to meet the requirements of lower-mass and high accuracy.