# Laser R-Test for Angular Positioning Calibration and Compensation of the Five-Axis Machine Tools
## 3 System Measurement Method  
In this paper, the rotary axis angular positioning measurement uses the linear encoder of the target machine tool to provide the machine coordinate: \(\left(x_{\mathrm{P}},y_{\mathrm{P}},z_{\mathrm{P}}\right)\). Suppose we have five points, \(\mathrm{A}_{\left(X_{\mathrm{x}},Y_{\mathrm{x}},Z_{\mathrm{a}}\right)}\), \(\mathrm{B}_{\left(X_{\mathrm{b}},Y_{\mathrm{b}},Z_{\mathrm{b}}\right)}\), \(\mathrm{B}^{\prime}_{\left(X_{\mathrm{y}},[PERSON]_{\mathrm{y}},[PERSON]_{\mathrm{y}}\right)}\), \(\mathrm{C}_{\left(X_{\mathrm{c}},Y_{\mathrm{c}},Z_{\mathrm{c}}\right)}\), and \(\mathrm{O}_{\left(X_{\mathrm{c}},Y_{\mathrm{c}},Z_{\mathrm{c}}\right)}\) with respect to machine coordinate frame \(\mathrm{O}_{\mathrm{P}}x_{\mathrm{P}}y_{\mathrm{P}}Z_{\mathrm{P}}\) as shown in Figure 10. Where the A point is the initial position of the ball lens, the B point and C point are the positions of the ball lens after rotating an arbitrary \(\varphi\) angle, the B' point is the actual position of ball lens that the A point should rotate after, the O point is the center point of CNC machine table, and the \(\theta\) angle is the error angle that needs to be calculated. The locations of A point, B point, and C point are given by CNC system \(\left(X_{\mathrm{a}},Y_{\mathrm{a}},Z_{\mathrm{a}}\right)\), \(\left(X_{\mathrm{b}},Y_{\mathrm{b}},Z_{\mathrm{b}}\right)\), and \(\left(X_{\mathrm{c}},Y_{\mathrm{c}},Z_{\mathrm{c}}\right)\), respectively. Considering the 2D coordinate (x, y), the circle with the center point \(\mathrm{O}_{\left(X_{\mathrm{b}},Y_{\mathrm{y}}\right)}\) and radius r is defined by the Equation (10) in order to reduce mathematical calculation instead of the 3D coordinate (x, y, z) because the values on the \(Z\)-axis will not be changed:  
\[\left(x-X_{\mathrm{o}}\right)^{2}+\left(y-Y_{\mathrm{o}}\right)^{2}=r^{2} \tag{10}\]  
Substituting the location of three points (A, B, C) into Equation (10) yields the following:  
\[\left\{ \begin{array}{c}\left(X_{\mathrm{a}}-X_{\mathrm{o}}\right)^{2}+\left( Y_{\mathrm{a}}-Y_{\mathrm{o}}\right)^{2}=\mathrm{r}^{2}\\ \left(X_{\mathrm{b}}-X_{\mathrm{o}}\right)^{2}+\left(Y_{\mathrm{b}}-Y_{\mathrm{ o}}\right)^{2}=\mathrm{r}^{2}\\ \left(X_{\mathrm{c}}-X_{\mathrm{o}}\right)^{2}+\left(Y_{\mathrm{c}}-Y_{\mathrm{ o}}\right)^{2}=\mathrm{r}^{2}\end{array} \right. \tag{11}\]  
Equation (10) could be achieved by solving the system of Equation (11) with the center point and the radius. \[\mathrm{O}=\left[ \begin{array}{c}X_{\mathrm{o}}\\ Y_{\mathrm{o}}\end{array} \right],\mathrm{r}=\mathrm{c} \tag{12}\]  
The Figure 11 shows two coordinate frames, with frame \(\mathrm{AX}_{\mathrm{a}}Y_{\mathrm{a}}\) in the initial position and coordinate frame \(\mathrm{BX}_{\mathrm{b}}Y_{\mathrm{b}}\) being obtained by rotating table \(\mathrm{O}_{\left(X_{\mathrm{o}},Y_{\mathrm{o}}\right)}\) by an angle \(\varphi\)  
Figure 10: Simply description of the angular error of rotary axis. Considering the ball lens' coordinate frame \(\rm AX_{a}Y_{a}\), the \(\rm A^{\prime}_{\langle x_{a},y_{a^{\prime}}\rangle}\) point indicates the error measured from the Laser R-test system (\(\rm x_{a^{\prime}}\)= 0 and \(\rm y_{a^{\prime}}\)= 0). The coordinate frame \(\rm BX_{b}Y_{b}\), with the \(\rm B^{\prime}_{\langle x_{b^{\prime}},y_{b^{\prime}}\rangle}\) is obtained by using the Laser R-test system, and the angle error \(\theta\) is defined by the \(\rm B^{\prime}\)OB angle. The location of the \(\rm B^{\prime}\) point with respect to the machine coordinate frame \(\rm O_{p}X_{p}Y_{p}Z_{p}\) can be written as Equation (13). By projecting the \(\rm B^{\prime}\) point onto the horizontal axis crossing the O point, we obtain the \(\rm B^{\prime\prime}\) point as shown in Figure 12.  
\[\rm B^{\prime}=\left[ \begin{array}{c}X_{b^{\prime}}\\ Y_{b^{\prime}}\end{array} \right]=\left[ \begin{array}{c}(x_{b^{\prime}}+X_{b} )\\ (y_{b^{\prime}}+Y_{b})\end{array}