# Calibration of Rotary Encoders Using a Shift-Angle Method
## 2 Theory and Configuration
### Shift-Angle Method for Polygon
The measured value using the autocollimator contains the angle error of the rotary encoder, the summation of the pitch angle deviations, and the setup error, as follows:  
\[\varepsilon_{\text{ij}}=\alpha\{(i-1)\times 15^{\circ}+S\}+\sum_{k=j}^{\text{ MOD}([i+1-1),24]}\beta_{\text{K}}+U_{\text{j}} \tag{3}\]  
where \(\varepsilon_{\text{ij}}\) is the value measured by the autocollimator at an angle of \(i\times 15^{\circ}\), and \(i\) is the number of steps of rotation of the rotary encoder. \(i\) equals \(1\) at a starting angle of \(0^{\circ}\). \(S\) denotes the shift-angle. \(j\) denotes the \(j\)th face of the 24-faced polygon as the starting face. \(MOD\), modulo operation, calculates the remainder of \((j+i-1)\) divided by 24. \(U_{\text{j}}\) denotes the setup error, starting from the \(j\)th face. For the rotary encoder at \(0^{\circ}+S\), because \(i\) equals \(1\), each face of the 24-faced polygon can be the starting face and can be measured using the autocollimator. When different faces are used as the starting face, the setup errors differ. The measured values are as follows:  
\[ \begin{split}\varepsilon_{1,1}&=\alpha(0^{\circ}+S) +\beta_{1}+U_{1}\\ \varepsilon_{1,2}&=\alpha(0^{\circ}+S)+\beta_{2}+U_{2 }\\ &\ldots\\ \varepsilon_{1,23}&=\alpha(0^{\circ}+S)+\beta_{23}+U_{2 3}\\ \varepsilon_{1,24}&=\alpha(0^{\circ}+S)+\beta_{24}+U_{2 4}\\ \end{split}  \tag{4}\]  
All measured values are listed in Table 1. In this table, \(j\) denotes the \(j\)th face of the 24-faced polygon as the starting face in the first column. \(i\) denotes the number of rotation steps of the rotary encoder in the first row. Equation (4) is listed in the second column of Table 1. According to Equation (3), the rotary encoder rotates in steps of \(15^{\circ}+S\), where \(i\) equals \(2\). Each face of the 24-faced polygon is measured by the autocollimator at \(15^{\circ}+S\). All of the measured values, where \(i\) equals \(2\), are listed in the third column of Table 1. The other columns are similar. The angle errors, from \(0^{\circ}+S\), \(15^{\circ}+S\),..., \(345^{\circ}+S\) in steps of \(15^{\circ}\), can be measured by following the same procedure. A total of 576 measured values are presented in Table 1.  
The pitch angle deviations of the 24-faced polygon are calculated using the measured values. The difference  
Table 2. According to the same procedure, the values listed in the fourth column \(\varepsilon_{\rm 3}\) reduce the values listed in the third column \(\varepsilon_{\rm 2}\) in Table 1. The different measured values are listed in the fourth column of Table 2. The value of n varies from 23, 24, and 1 to 22 in the third column of Table 2. All measured values are listed in Table 2. The second row contains 24 measured values as follows:  
\[ \begin{array}{c}\delta_{2,1,24}=\varepsilon_{2,24}-\varepsilon_{1,24}=\alpha (15^{\circ}+S)-\alpha(0^{\circ}+S)+\beta_{1}\\ \delta_{3,2,23}=s_{3,23}-\varepsilon_{2,23}=\alpha(30^{\circ}+S)-\alpha(15^{ \circ}+S)+\beta_{1}\\ \ldots\\ \delta_{24,23,2}=\varepsilon_{24,2}-\varepsilon_{23,2}=\alpha(345^{\circ}+S)- \alpha(330^{\circ}+S)+\beta_{1}\\ \delta_{25,24,1}=\varepsilon_{25,1}-\varepsilon_{24,1}=\alpha(0^{\circ}+S)- \alpha(345^{\circ}+S)+\beta_{1}\\ \end{array}  \tag{6}\]  
Table 2. Shift-angle method for polygons. The average of Equation (6) yields the pitch angle deviation of the first face of the 24-faced polygon. With the values listed in the third row, the pitch angle deviation of the second face can be calculated. The pitch angle deviations of all faces can be calculated using Table 2.