A high precision influence matrix measurement is usually performed using a detection system directly aimed at the primary mirror using a high-quality light source. This high-precision influence matrix is then used in the active optics system. Then, the S-H wavefront sensor of the active optics system detects the primary surface deformation. However, if the wavefront has an obvious rotation with respect to the influence matrix, the correction ability will be largely deteriorated.

Since the active optics system detects primary mirror deformations, the detection of a specific deformation could aid in determining the wavefront rotation. This detection requires no additional measurement components. A unique mirror deformation such as the influence of one actuator could perform this function, but the low-order bending mode is much more ‘soft’ that a small mode force can make a large deformation for detection. Moreover, the low-order mode surface has a low spatial frequency that is easily detected and introduces less detection error. Therefore, using the first order mode could result in high-precision detection.

As mentioned in Section 2.2, the mode surface could be precisely rebuilt on the primary mirror by adding its mode force on the actuators. Then, the detection is performed by adding a mode force on the support, detecting the wavefront of the rebuilt mode, and comparing the wavefront surface with the mode surface to determine the rotation angle.

For a regular structure support system, the first order bending mode is like an astigmatism, which has two symmetric valleys and peaks. Therefore, the rotation *α* detected using this mode can be either of two symmetric rotations: *α* and 180 ° + *α*. An additional detection is needed to ensure that the true result is obtained, using an asymmetric surface, such as the influence function of one actuator or an asymmetric low order mode.

### Zernike coefficient rotation

The detected wavefront of the S-H wavefront sensor is described in terms of Zernike coefficients. The Zernike coefficients are easy to be rotated since all the Zernike polynomials are circularly symmetric or orthogonal in pairs. Rotation of orthogonal polynomial pairs is performed by multiplying a rotation matrix with their coefficients. The angle of the rotation matrix is equal to the phase angle of the Zernike polynomial pair, which is equal to the rotation angle multiplied by the rotation order of the Zernike polynomial. For example, a rotation of *α* corresponds to a phase angle 3*α* for a trefoil. Rotating the Zernike coefficients of the surface directly could introduce less fitting error than rotating the surface image rebuilt by the Zernike coefficients.

### Optimum search detection

The simulation of wavefront rotation detection is performed using the experimental data from Section 4.1. The calculated modes #1 and #5 surfaces and their rebuilt surfaces are used. The rebuilt mode surfaces are rotated by a certain angle *θ* to simulate the rotated wavefront surfaces of the rebuilt mode. Mode #1 is used for the main detection and mode #5 for the additional detection.

To detect the rotation angle of the two surfaces, an optimum search could be a suitable approach. The rotated wavefront surface is the search target. The calculated mode surface is rotated to fit the target, and the rotation angle *α* is the parameter to be optimized. This is a simple two-way search. The optimum search begins with an initial rotation angle *α*_{0}, an initial searching rate *φ*_{0} and a rate scale factor *ρ*. In the searching step *i*, the calculated mode surface rotated by *α*_{i} is compared with those rotated by *α*_{i} + *φ*_{i} and *α*_{i} − *φ*_{i}. If the mode surface rotated by *α*_{i} + *φ*_{i} or *α*_{i} − *φ*_{i} fits the target better, then *a*_{i + 1} = *a*_{i} + *φ*_{i} or *a*_{i + 1} = *α*_{i} − *φ*_{i}, and *φ*_{i + 1} = *φ*_{i}. If it does not, then *a*_{i + 1} = *a*_{i} and *φ*_{i + 1} = *ρ* ⋅ *φ*_{i}. The search is terminated after a certain number of searching steps or if the search rate *φ*_{i} is less than a given value.

Comparison of each search step is performed using an evaluation function. The function evaluates the fitting of the rotated mode surface and target surface. The root mean square error (RMSE) and cross-correlation coefficient of the two surfaces and RMSE of the discrete cosine transform (DCT) of the two surfaces are tested as evaluation functions. The DCT image is transformed in 4 × 36 blocks divided in polar coordinates.

The simulation is set with *θ* = 30 ° , *α*_{0} = 20 ° , *φ*_{0} = 22.5 ° , and *ρ* = 0.8. The target surface is the rebuilt mode #1 surface rotated by *θ* = 30°. The first attempt is direct RMSE, which is to determine the RMSE of the rotated mode surface and target surface. The searching rate reduces to 0.12413 ' ' in 100 steps, the searching result is *α* = 29.714°, and the detection error is 0.286°. Then, the DCT RMSE and cross-correlation coefficient are tested under the same conditions. However, the result of cross-correlation coefficient is *α* = 29.691°, which is close to that of direct RMSE, and the result of DCT RMSE is equal to that of direct RMSE. The detection error is mainly caused by the difference between the calculated mode surface and rebuilt mode surface. The searching value *α*_{i} of the three evaluation functions is shown in Fig. 4, and they are almost the same. Direct RMSE, which requires less computation, is chosen as the evaluation function for the optimum search.

### Top-line detection

The precision of the optimum search is limited by the difference between the calculated mode and rebuilt mode. To obtain better detection for further correction, we use another approach based on the mode surface features. Mode #1 has two obvious aligned peaks. Then, a top-line that passes through the surface center and the tops of two peaks is selected for detection.

To identify the top-line, a series of rings, which are concentric with the surface, are set on the surface. The top-point of the two peaks on each ring is selected. The top-line angle is detected by a least mean square (LMS) fitting of these top-points. The angle between the top-lines of the source surface (calculated mode #1) and target surface (rotated rebuilt mode #1) is the detected rotation angle. The detection mainly depends on the features of the mode #1 surface, which are obvious and introduce little detection error. This mode #1 top-line detection also involves the issue of 180° symmetry solution, and requires an additional detection to acquire the correct result.

The top-line detection is tested with the same simulation data used in Section 3.2. The target surface is still the rebuilt mode #1 surface rotated by *θ*_{0} = 30°. The detection uses 44 rings to find 88 top-points. In each ring, the maximum point is found as the top-point of one peak, and a search in the opposite direction of this top-point is processed to detect the top-point of the other peak. Then, a top-line is detected by an LMS of these 88 top-points. The searching precision of the top-point is 1.40625 ' '. The top-line angle of the calculated mode #1 surface is 92.028°, and that of the rotated rebuilt mode #1 surface is 121.943°. The detected rotation angle is 29.915°, and the detection error is 0.085°, which is much better than the values obtained in the optimum search. The calculated mode #1 and the rotated rebuilt mode #1 with their top-lines are shown in Fig. 5.