Analysis and Optimization of Image Quality Evaluation Function in Computer-aided Alignment of Precision Optical System

The consistent application of computer-aided alignment technology could surmount aimlessness and significantly shorten the align period of complex optical systems. Wherein, the appropriate system image evaluation function is the primary condition to solve the system misalignment successfully. This paper first establishes the relationship between the amount of misalignment and the system aberration through mathematical modelling and then analyzes the relationship between Zernike coefficient, geometric aberration and system image quality in detail, proposes to construct a system image evaluation system using the idea of Zernike coefficient weighting to solve the problem of numerical instability and imprecision of the solutions caused by the direct selection of Zernike coefficients. Subsequently, the experimental alignment of an infrared optical system was performed using the optical system image quality evaluation method established in this paper. The alignment results showed that the RMS value of the system image quality improved by 24.8% under the same solving algorithm compares to the direct selection of the Zernike coefficient and the weighted Zernike coefficient as the system image quality evaluation function. Therefore, the application of the weighted Zernike coefficient-based optical system image evaluation function proposed in this paper is reasonable, feasible, and effective in the computer-aided alignment process.


Introduction
Optical instruments play an essential role in the exploration of micro and macro fields (Yang, 2005). With the development of modern optics, the requirements for optical systems are increasing, and the system structure is becoming more complex. Optical systems with large linear fields of view, image quality close to the diffraction limit, large relative apertures, and no central occlusion are required in some applications. Information technology has greatly facilitated the development of optical technology. With the help of computer technology, people can design and manufacture more complex optical systems than before, to obtain ideal imaging quality (Yao, Hu & Jiang, 2019). The reflective optical system does not produce chromatic aberration, and the aperture can be made larger, is suitable for lightweight, has a more significant advantage in thermal resistance, and can correct the aberration through the aspheric surface. Therefore, it has received long-term attention from researchers in the field of space remote sensing. In aerospace remote sensing, engineers have begun to use off-axis four-reflection optical systems with complex structures but excellent performance. The complexity of the optical system brings a great challenge to optical alignment. The level of alignment accuracy directly affects the final imaging quality, and the optical alignment has become the critical link to determine whether the abstract design can be converted into the equipment with excellent performance (Gu, 2016).
With the rapid development of computer technology and its wide application in different fields, optical researchers explore to use it in the process of optical alignment. Use it to process a large number of optical imaging detection data to determine the amount of misalignment and guide the alignment process of an optical system. This method is called computer-aided alignment technology. The core part of this technology is to find out the misalignment state of each element of the optical system, that is, the deviation between the position of each element and the designed ideal position, including the direction of deviation and the amount of deviation, according to a certain model and algorithm based on the wave aberration results of the optical system measured in a certain state (Figoski, Shrode & Moore, 1989). Thus, after each cycle of alignment, each element in the optical system is closer to the designed position state than before. The consistent application of this technology could surmount the aimlessness of the alignment process and greatly shorten the alignment period of complex optical systems.
In the 1980s, Ira M. Egdall first proposed to use the detection results of the optical system to calculate the misalignment of the components, that is, the computer-aided alignment technology (Egdall, 1985). Currently, computer-aided alignment technology of optical system mainly includes sensitivity matrix model (Hvisc & Burge, 2008), inverse optimization method (Kim, S, Yang, Lee & Kim, S.W, 2007), differential wavefront sampling method (Lee, Dalton & Tosh, 2007), artificial neural network method (Oteo & Arasa, 2013), vector aberration model (Thompson & Rolland, 2014), etc. The most widely used computer-aided alignment method is the sensitivity matrix method, which is a method of correcting aberration by building a mathematical model of the amount of misalignment and the aberration coefficient based on the analysis of aberration characteristics.
In the computer-aided alignment of the optical system based on the sensitivity matrix model, Zernike aberration coefficients are usually directly used as the evaluation function of the imaging quality of the system (Sun, Lv, Yao & Liu, 2014). But due to the uncertainty of the system's aberration solving and the inevitable problem of solving residuals, the direct use of Zernike coefficients will bring about numerical instability and inaccuracy. This article analyzes the contribution of each Zernike coefficient to the root mean square of the wavefront image quality of the optical system in detail, and proposes the idea of redistributing the solving residuals among the aberration coefficients in the evaluation function. Through appropriate optimization, with certain residual solution errors, the system image quality can be optimized evidently. Finally, establishes an imaging quality evaluation function method based on the weighted Zernike coefficient, and performs an experimental alignment of an infrared optical system based on this method. The alignment results show that the image quality evaluation function based on the weighted Zernike coefficient is reasonable, feasible, and effective, which can significantly improve the system align accuracy and obtain better imaging quality.

Sensitivity Matrix Model for Computer-Aided Alignment
The main purpose of an optical system is imaging (Luo, 2017), and how well the system is imaged is the primary measure of the quality of the optical system (Li, Fu, Wang & Duan, 2013). But the actual optical system cannot be without aberration. On the one hand, the optical processing will introduce mirror processing error; on the other hand, in the alignment process, the optical system image quality deteriorates because the mirrors are not in the relative position of the theoretical design.
Especially for complex optical systems, optical assembly misalignment will lead to the deterioration of the optical system's performance, resulting in serious degradation of the system imaging quality, and usually, the determination and correction of the system misalignment with experience and conventional means of assembly is quite difficult.
The purpose of computer-aided alignment is to determine the direction and magnitude of the optical system's misalignment amounts based on the actual measured system image quality and to guide the alignment process (Luo, 2017). Thus brings the optical system closer to the theoretical design of the optical system after each alignment cycle, and ultimately meets the design requirements.
Mathematically, the aberration is a function of the structural parameters of each mirror's position (Zhang et al., 2015). The aberration of the system is expressed in F j (j=1,2,···,n), and the position structure parameters of each mirror are expressed in x i (i=1,2,···,m). There must be a functional relationship between the two expressed as:  In the above equation; F i =f i (x 1 ,···,x m ) represents the functional relationship between aberration and mirror position, which is a very complex set of nonlinear equations. From the mathematical point of view, the computer-aided alignment of an optical system is to establish and solve this equation group. According to the imaging quality (F 1 ~F n ) required by the system, by reverse solving the above equation group, we can find out that (x 1 ~x m ) is the structural parameter of the component position we require. But because of the complexity of the actual problem, it is often unable to find out the specific form of the function F i =f i (x 1 ,···,x m ).
According to Taylor's expansion, the function can be expressed as the power series of its independent variable, which can be decomposed to a certain power according to the required accuracy. Then, through the method of experimental or numerical calculation, the function values of some sampling points can be obtained, and enough equations can be listed. The coefficients of the power series can be solved so that the power series form of the function can be determined.
In the simplest case, only selects one term of power series, and a linear equation approximately replaces the functional relationship between the misalignment and the system aberration: Where F 0j is the optical system's residual designed errors, x 0n is the each optical element's initially designed position parameter, F j is the system wavefront aberration's current measured value, is the partial derivative of the wavefront aberration function, usually replaced by the differential quotient , and obtains the approximate linear equations of the system aberration and the misalignment of optical element position parameter: Writing in matrix form and meanwhile, considering measurement noise; Equation (3) can be rewritten as: Equation (4) is the sensitivity matrix model for the reverse solving of misalignment in computer-aided alignment technology. Among them, A is the sensitivity matrix, and each element of the matrix represents the change of the corresponding aberration coefficients generated by the unit offset. It reflects the contribution of each dimensional adjustment of the frame to the aberration coefficients of the system, which is jointly influenced by the optical design data, the actual processing of the optical system, the motion accuracy of the optical adjustment frame and other factors.
△X = X-X 0 is the position change of each mirror in the system that needs to be adjusted, i.e. misalignment. Including x, y, and z panning of each mirror and rotation around the x and y axes.
△F = F-F 0 represents the difference between the actual measured value of each calibration object and the optically designed value, which is the change value of the image quality of the system with the amount of misalignment, and is determined by the current measured value of the image quality of the optical system and the data of the system design and optical processing results, which could usually be gained by interferometry.
N represents the noise matrix, which includes the inaccuracy of the measurement instruments in system image interferometry and data acquisition errors introduced by the effects of the test environment. Since the noise cannot be quantified, usually, the noise matrix N is ignored in optical experiments, but to reduce the influence of noise by reducing airflow disturbances, vibration isolation of optical platforms and other measures.
The higher accuracy of the mathematical model can fasten the convergence of the alignment process, and the decrease in model accuracy will directly affect the convergence speed of the alignment process. However, due to the complexity of the optical system, it is often unable to accurately obtain the functional relationship between the system aberration and the mirror position. By using the idea of linear approximation, Equation (3) simplifies the functional relationship between aberration and mirror position. To reduce the difficulty of solving Equation (1) brought about by the complicacy of the function F i =f i (x 1 ,···,x m ), the higher-order terms are lost and sacrifices the accuracy of the model establishment. The purpose is to balance the mutual restriction between the difficulty of solving and the accuracy of the model brought about by the complicacy of F i =f i (x 1 ,···,x m ).

Analysis of Evaluation Functions
The key to computer-aided alignment technology is the determination of system misalignment. By analyzing and processing the measured image quality data containing the system misalignment obtained from the measurement, to obtain the position misalignment of the relevant position adjustment parameters of the optical system by inverse solution, and to realize the quantitative and orderly alignment of the system. Determining the amount of system misalignment is a data processing process, as well as a numerical optimization process, a rational system image quality evaluation function, is the first condition to solve the system misalignment successfully.

Wave Aberrations Represented by Zernike Polynomials
If the optical system is capable of an ideal image, all geometric aberrations are zero, and all light emitted from the same object passes through the system to the ideal image point. According to the correspondence between the light and the wavefront plane, the light is the normal of the wavefront plane, which is a curved surface perpendicular to the light. Therefore, in the ideal imaging case, the corresponding wavefront plane should be a spherical plane centered on the ideal image point. If there is an aberration, the corresponding actual wavefront is no longer a sphere centered on the ideal image point, but a curved surface with a certain shape (Luo, 2017). Usually, uses the optical path difference between the actual wavefront and the ideal wavefront as an indicator of the quality of the image point and is called wave aberration.
Zernike polynomial is suitable for the wavefront fitting basis function system (Figoski, Shrode & Moore, 1989). By using Zernike polynomials for wavefront fitting, we can fit the digital wavefront data of discrete sampling into a continuous wavefront, and the position of sampling points does not limit the wavefront reconstruction. Besides, Zernike polynomials and commonly used Seidel aberration coefficients in the optical design are easy to correspond to.

Geometric Aberrations and Zernike Aberration Coefficient
While obtaining the wavefront error of the exit pupil plane of the optical system with interferometry, we can obtain the various aberration coefficients of the optical system according to the relationship between the two. In fact, in the process of precise alignment, the high-order aberrations of the whole optical system are constant. The high-frequency errors of the optical elements themselves cannot be removed by alignment, so the alignment process only controls the primary spherical aberration, coma, and astigmatism (Yang, 2005 According to the previous discussion, the wave aberration of the exit pupil of the system can be expressed by Zernike polynomials as: Thus, obtains the corresponding relationship between Zernike polynomial coefficients and Seidel aberrations by comparing the two expressions: Primary Spherical Therefore, it obtains the primary aberrations of the optical system from the Zernike coefficients.

Selection of Evaluation Function
The Zernike polynomials expressed wavefront function could accurately represent the wavefront quality of the complex optical system with fewer data. Therefore, the wavefront function expressed by Zernike polynomials is often used to form the evaluation function in the computer-aided alignment mathematical model of a complex optical system.
The RMS value of the wavefront is often selected as the evaluation index for the final inspection of the imaging quality of the optical system. Because the solution of the misalignment quantity is ill-posed, we can not avoid the solving residual's existence. There must be a deviation between the wave aberration of the system obtained by the practical alignment and the designed values. The contribution of each Zernike coefficient to the RMS value of wavefront is different (Luo, 2017), so when directly uses Zernike coefficients of the wavefront as the optimization objective function in the computer-aided alignment mathematical model of the complex optical system, the minimum RMS value of the wavefront is not equivalent to the minimum variance of Zernike coefficients deviation. Therefore, when selecting the Zernike coefficients as the evaluation function in the computer-aided alignment mathematical model of the complex optical system, we should carefully consider the weight of each Zernike coefficient.

Aberration Coefficient Deviation Matrix △ F and Zernike Aberration Coefficient
The goal of the optical system alignment is to obtain ideal imaging quality. Generally, uses the RMS wavefront error to describe the wavefront quality. The smaller the RMS value of the system wavefront error, the better the imaging quality of the optical system. RMS (root mean square) of wavefront error is the deviation of the detected wavefront from the reference wavefront, it is the main index to evaluate the wavefront as well as the peak valley value (P-V). Figure 1(a) shows the relationship between RMS and PV of a plane wavefront; Figure 1(b) shows the relationship between RMS and PV of a spherical wavefront.   ρ θ ρ ρ θ π ρ θ ρ ρ θ π Choosing an appropriate referential wavefront can make W Δ zero, such a referential wavefront is the optimized referential plane.
The appearance of the digital interferometer calculates RMS very conveniently and accurately, and now it has become an important index to evaluate the accuracy of surface shape. Each data point of the interferogram calculates the RMS value of wavefront error, it takes the contribution of each point to the profile error into account, so it can accurately reflect the profile accuracy of the inspected surface, and it is more meaningful to use it as the evaluation criterion.
The alignment of optical systems can only correct the primary aberration, so usually, we only consider the primary aberration. When dealing with interferograms, the three non-aberration terms of vertex misalignment, tilt, and defocus in equation (7) are usually removed. For the Zernike aberration coefficients of Z 5 -Z 9 we adopt, we only consider the contribution of each aberration to the wave surface RMS in the following five cases: there are only 0º/90º Astigmatism, 45º Astigmatism, X-Coma, Y-Coma, and primary spherical aberration.
(1). Only consider the 0º/90º Astigmatism, and thus, (2). Only consider the 45º Astigmatism, and thus, (3). Only consider the X-Coma, and thus, (4). Only consider the Y-Coma, and thus,  ρ ρ ρ θ ρ ρ ρ θ π π = Δ − Δ The target of optical system alignment is to obtain the best image quality through the system image quality optimization process; which means the RMS value of system aberrations is the minimum. By the above Zernike coefficients and Seidel aberrations relationship, calculates the weights of Zernike aberration coefficients of Z 5 -Z 9 in system image quality as follows: Therefore, forming the system aberration coefficient deviation matrix △F, it is more reasonable and reliable to multiply the deviation of Zernike aberration coefficients and designed values of each field Z 5 -Z 9 by their weight. Thus, selects the mapping relationship between the system aberration coefficient deviation matrix and Zernike aberration coefficients of each field Z 5 -Z 9 as follows: △F 5 0.298(Z 9 -Z 90 )

Actual Alignment Test
To verify the rationality of the system image quality evaluation method constructed by the idea of Zernike coefficient weighting proposed in this paper, a comparative alignment experiment was conducted for a large aperture off-axis three-reflection infrared optical system with a working wavelength of 2.7um. Because the operating band of the infrared optical system is far longer than that of visible light. The residual aberration coefficients of each system design are relatively large under the interference measurement of the visible light band (the operating wavelength is 0.6328um). Thus, it is easier to investigate the effectiveness of the evaluation function optimization.
Under visible interferometry, the designed wavefront aberration coefficients Z 5 -Z 9 of one field of view are:  Figure 2(a) shows the designed system wavefront aberrations, and before the alignment, in a state, Figure 2(b) shows the system wavefront aberrations: The directly used Zernike coefficients, as well as the weighted Zernike coefficients, are respectively used to be the system image quality evaluation indicators, and the same reverse solution algorithm is used to calculate the offset. Figure 3(a) and Figure 3 It can be seen from Figure 3 that when Zernike coefficients are directly used as the system image quality evaluation function to solve the misalignment, the deviation between the system image quality and the designed value after alignment is large due to the existence of the solution residual; when the weighted Zernike coefficient evaluation function is used, the deviation between the system image quality and the designed value after alignment is reduced due to the redistribution of the solution residual. There is a significant improvement in system image quality. The comparison of alignment results are as follows:

Conclusion
During the computer-aided alignment process of optical systems, due to the ill-posed nature of the problem of solving the offset, the residual error cannot be avoided. The system wave aberration obtained by the actual alignment is generally worse than the designed result. The contribution of each Zernike coefficient to the RMS value of the wavefront is different. Hence, the aberration coefficients of the residuals in the evaluation function are redistributed. After optimization, minimizes the RMS of system image quality when the residual value is fixed. Therefore, the idea of Zernike coefficient weighting is proposed to construct the system image quality evaluation system. The alignment experiment results show that using the weighted Zernike coefficient as the system image quality evaluation function can solve the numerical instability and the imprecision of the solving algorithm induced by the direct selection of the Zernike coefficient, which can significantly improve the alignment accuracy and obtain better image quality. Therefore, the weighted Zernike coefficient-based optical system image quality evaluation function proposed in this paper is reasonable, feasible, and practical. However, the effectiveness of the weighted Zernike coefficients as system image quality evaluation function under other types of inverse solving algorithms needs further research and comparative testing.