## 2 Modeling and Experimental Procedures
### Simulation Study  
To evaluate the effectiveness and accuracy of the matching algorithm, theoretical simulation is carried out. An ideal freeform surface is designed as the theoretical surface, and the measured surface was obtained by adjusting the designed surface through six parameters of the coordinate transformation matrix. Then the accuracy of the simulation algorithm was calculated. The simulation flow chart is shown in Figure 4.  
Figure 3: Flowchart of compensation machining. To begin with, transfer the ideal surface in theoretical coordinate system to the measurement surface with coordinate transformation T\({}_{1}\). Then match the ideal and measured surface by the proposed algorithm. After surface matching, subtract the theory shape from the measurement in the same coordinate system to get the form error \(\varepsilon\), and the coordinate transformation T\({}_{2}\) is calculated. As the measured surface is obtained from the theoretical surface through coordinate transformation, the ideal form error \(\varepsilon\) is zero, and the coordinate transfer matrix T\({}_{1}\) and T\({}_{2}\) should be the same. Therefore, the value of form error \(\varepsilon\) and the deviation between T\({}_{1}\) and T\({}_{2}\) could verify the accuracy of theoretical model and the precision of matching algorithm. The designed ideal freeform surface is XY polynomial, the surface equation is shown in Equation (7), and the surface parameters are shown in Table 1. The parameters of coordinate transfer matrix \(T\) (\(\alpha\), \(\beta\), \(\gamma\), \(tx\), \(ty\), \(tz\)) are varied to obtain the corresponding simulation results. They are divided into 10 groups; the first four groups only perform translation coordinate transformations, the second four groups only perform rotation coordinate transformations, and the last two groups include translation and rotation. The results of simulation are shown in Table 2, and the form errors are shown in Figure 5. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Parameters** & **Value** & **Parameters** & **Value** \\ \hline Diameter & 10 mm & y\({}^{2}\) (c6) & 0.0002 \\ c & 0.01 & x\({}^{3}\) (c7) & 0.00112 \\ k & 0 & x\({}^{2}\)\(\times\) y (c8) & 0 \\ x (c2) & \(-\)0.03 & x \(\times\) y \({}^{2}\) (c9) & \(-\)0.0004 \\ y (c3) & 0.007 & y\({}^{3}\) (c10) & 0.0002 \\ x\({}^{2}\) (c4) & \(-\)0.0001 & x\({}^{4}\) (c11) & 0 \\ x \(\times\) y (c5) & \(-\)0.005 & x\({}^{3}\)\(\times\) y (c12) & 0.0005 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Surface shape parameters. Figure 4: Flowchart of surface matching simulation. As shown in Figure 5, when the surface is transformed by translation or rotation, the matching error is tiny. However, the matching error is different with different coordinate transfer matrix T1, which represents that different coordinate transformations have different effects on the results of matching model. The simulation error of coordinate rotation is smaller than that of coordinate translation, although they are on the same order of magnitude. Minimum error occurs when there are three directions of coordinate rotation. Although coordinate transformation involves translation and rotation of six degrees of freedom, the matching error is tiny, which verifies the high precision of the matching model. \[z=\frac{c\left(x^{2}+y^{2}\right)}{1+\sqrt{1-(1+k)c^{2}(x^{2}+y^{2})}}+\sum_{i =0}^{p}\sum_{j=0}^{p}C_{ij}x^{i}y^{j} \tag{7}\]  
It can be seen from Table 2 and Figure 5 that the freeform surface matching algorithm possesses sub-nanometer accuracy which represents the error from the theoretical model. Compared with the submicron precision of ultraprecision machining, this error is negligible. Thus, the validity of theoretical model is verified. The form error of PV is around 0.2 nm, and the value of RMS is about 0.06 nm. The error varies with six spatial parameters, and rotational transformation error is slightly less than translational transformation error.