## 3 System and Simulation  
The construction of the simulation system for the heterodyne coherent angle measurement was predicated on the analysis of the above principle (see Figure 3 for a program block diagram). The initial angular deflections \(\alpha_{AZI}\) and \(\alpha_{PIT}\) were set along the azimuth and pitch directions, respectively, and converted to the phase \(\psi_{1}\), \(\psi_{2}\), \(\psi_{3}\), and \(\psi_{4}\) of the beat-frequency signals in each quadrant through the DWS process. The Monte Carlo method was adopted to simulate the spot presented by the laser beam in the QD photosensitive surface through random points, and the beat frequency signal was obtained based on the statistical points in each quadrant of the detector, which was used as the input signal of the Costas phase-locked loop simulation module. The NCO generates in-phase (COS) and quadrature (SIN) signals from the initial frequency word and multiplies them with the NCO signal through the multiplier MULT. The output will contain the phase difference \(\Delta\psi\) between the two signals. The result of the multiplication is then integrated and averaged in the integrator INT, and the interfering terms, such as the sum-of-frequencies component, are filtered out by using the periodicity of the sinusoidal signal. Subsequently, the in-phase and quadrature branch integration results are subjected to an _atan_ operation to obtain the phase difference, denoted as \(\Delta\psi\), at the current moment. If the phase difference caused by the initial angle deviation exceeds \(2\pi\), it is necessary to first capture the beat frequency signal, eliminate the integer \(2\pi\) parts of the phase difference, and then continue with phase tracking and detection. Concurrently,  
Figure 2: Relation between the local oscillation laser beam power and signal-to-noise ratio. the loop filter LPF dynamically adjusts the frequency word of the NCO according to \(\Delta\psi\). Thereafter, the frequency \(f_{NCO}\) of the NCO signal is continuously adjusted to ultimately realize phase tracking of the beat frequency signal. Once the loop is locked, each quadrant outputs the phase values of \(\psi_{1}\)\({}^{\prime}\), \(\psi_{2}\)\({}^{\prime}\), \(\psi_{3}\)\({}^{\prime}\), and \(\psi_{4}\)\({}^{\prime}\) at the current moment, based on the NCO index. The phase difference \(\Delta\psi_{AZI}\), \(\Delta\psi_{PIT}\) in the azimuth and pitch directions, respectively, are then calculated. The angular deflection, denoted as \(\alpha_{AZI}\)\({}^{\prime}\) and \(\alpha_{PIT}\)\({}^{\prime}\), is then obtained through the DWS phase-angle conversion process. This process enables the realization of the high-accuracy measurement and compensation of the initial angular deflection, \(\alpha_{AZI}\) and \(\alpha_{PIT}\). In the phase-locked loop, the loop filter dynamically adjusts the frequency of the NCO signal based on the leading and lagging characteristics of the phase of the NCO signal relative to the beat frequency signal. The NCO frequency is calculated based on the parameters of the current moment and the previous moment. The calculation process is as follows:  
\[f_{NCO}=f_{NCOold}+\frac{T}{\tau_{1}}\times\Delta\psi+\frac{\tau_{2}}{\tau_{1} }\times(\Delta\psi-\Delta\psi_{old}) \tag{22}\]  
In this equation, \(f_{NCO}\) and \(f_{NCOold}\) represent the current and previous NCO signal frequencies, respectively, \(\Delta\psi\) and \(\Delta\psi_{old}\) represent the phase difference between the beat frequency signal and the NCO signal, \(T\) denotes the integration time, and \(\tau_{1}\) and \(\tau_{2}\) represent the filter coefficients. The angular measurement accuracy is expressed as the fluctuation of the angle between the coherent beams recognized by the QD compared with the true result [17] and is evaluated by the standard deviation of the difference between the true value of the angular deflection \(\alpha_{AZI}\) and the measured value \(\alpha^{\prime}_{AZIi}\).