## 2 Error Analysis of Grating Ruling Machine
### Ideal Grating Energy Distribution Solution  
When a diffraction grating is illuminated by a point laser source, the energy distribution of the grating can be solved by using the Fraunhofer diffraction integral if the following conditions is satisfied.  
\[Z\gg\frac{k(x_{1}^{2}+y_{1}^{2})_{\text{max}}}{2} \tag{1}\]  
where \(Z\) is the distance between the grating and the diffraction screen, \(x_{1}\) and \(y_{1}\) are the aperture size. When the selected laser diameter is 0.1 mm, \(\lambda\) = 632.8 nm, \(Z\) should be greater than 0.4 m. When the Fraunhofer integral conditions are satisfied, the optical vibration distribution function on the diffraction screen depends on the illumination source and the shape of the diffraction hole. That is, the optical vibration distribution function:  
\[U_{1}(x_{1},y_{1},z_{1})=e(x_{1},y_{1},z_{1})t(x_{1},y_{1},z_{1}) \tag{2}\]  
where \(e(x_{1},y_{1},z_{1})\) is the illumination function of the light source and \(t(x_{1},y_{1},z_{1})\) is the transmission function of the diffraction hole.  
The diffraction grating groove shape and the established coordinates are shown in Figure 1. Let the reflectivity of the groove be 1, the effective reflective surface width be a, the length of the groove be infinite, the direction of the ruling width be along the \(x\) direction, and the aperture function be \(rect(\frac{x}{a})\). However, the phase of the reflected light at different points in a groove is different, so each reflected light should be multiplied by a phase factor. According to the geometric relationship, the phase function of the first grating groove can be found as  
\[\phi(x)=2\pi\xi x \tag{3}\]  
where \(\xi=\frac{1}{\lambda}\tan\alpha(\cos\theta_{i}+\cos\theta_{m})\). The equivalent transmission function of the first grating groove is then  
\[r_{1}(x)=rect(\frac{x}{a})e^{i\phi(x)} \tag{4}\]  
The latter grating groove is equivalent to the first grating groove translation along the \(x\)-axis; if the grating groove spacing is \(d\), then the transmission function of the latter grating groove general formula is  
\[r_{N}(x)=rect(\frac{x}{a})e^{i\phi(x)}\otimes\delta(x-(N-1)d) \tag{5}\]  
Then the total transmission function of \(N\) grating grooves is  
\[\begin{array}{ll}r(x)&=r_{1}(x)+r_{2}(x)+\cdots+r_{N}(x)\\ &=rect(\frac{x}{a})e^{i2\pi\xi x}\otimes\sum\limits_{m=1}^{N}\delta(x(m-1)d) \end{array} \tag{6}\]  
Figure 1: Diffraction grating groove shape and coordinates.  
Equation (11) is applied to solve the diffraction spectrum distribution of the ideal grating. The grating parameters are shown in Table 1.  
The relative intensity distribution (RID) of the diffracted light can be solved, as shown in Figure 3.  
According to Figure 3, it can be observed that the diffraction grating has five levels of \(-3\), \(-2\), \(-1\), \(0\), and \(1\). Among them, level \(0\) is just eliminated due to the superposition of the maximal value of the interference factor and the minimal value of the diffraction factor.  
\begin{table}
\begin{tabular}{c c c c c} \hline
**Groove Density** & **Wavelength** & **Blaze Angle** & **Blaze Level** & **Error Distribution** \\ \hline
600 g/mm & 632.8 nm & 22\({}^{\circ}\) & \(-2\) & \(-10\) nm, \(10\) nm, \(\cdots\) \\ \hline \end{tabular}
\end{table}
Table 1: Diffraction grating parameters.  
Figure 3: The relative intensity distribution of diffracted light.  
Figure 2: Conditions for the maximum value of grating diffraction.  
According to Figure 5, it can be observed that there are five levels of this diffraction grating: \(-3\), \(-2\), \(-1\), \(0\), and \(1\). Due to the presence of ghost lines in the middle of the two levels, the \(0\) level, which originally had no light, also has a light intensity distribution due to the phase expansion factor of the grating sub-groove function. The existence of ghost lines seriously affects the normal use of diffraction gratings and needs to be eliminated in the ruling process.