Tolerance analysis method for Shack-Hartmann sensors using a variable phase surface

Even after good calibration, the measurement accuracy of a Shack-Hartmann sensor can be affected by the fabrication and alignment tolerances of the wavefront sensing optical system. The shifts of the Shack-Hartmann spots caused by misalignments correspond to ray intercept errors on the detector that typically have to be converted into a meaningful input wavefront measurement error. This conversion cannot be directly obtained from a conventional tolerance analysis using optical design software, because of the intrinsic wavefront sampling by the lenslet array. The tolerancing method proposed in this paper solves the problem of converting conventional merit function degradation into input wavefront measurement error without employing a separate wavefront reconstruction algorithm. Using the proposed method, this investigation shows the effect of fabrication and misalignment errors on the accuracy of a calibrated Shack-Hartmann sensor, as a function of input wavefront vergence. ___________________________________________________________________________


Introduction
Optical systems using sampling devices, such as Hartmann and Shack-Hartmann sensors have been widely used in wavefront measurement for various applications -astronomy, optical element testing, ophthalmology, etc. [1][2][3]. The central element of such sensors is a sampling device or sub-aperture array that breaks up the input wavefront into individual ray bundles that are subsequently recorded onto a detector. The positions of the ray bundles on the detector, commonly known as Shack-Hartmann spots, are analyzed to determine their departures from a preset mapping obtained during calibration using a well-known reference wavefront, typically a plane wavefront. These departures represent local gradients of the input wavefront slope. A reconstruction algorithm is employed in order to determine the input wavefront under test [4]. The accurate mapping of the Shack-Hartmann spots is critical to the successful estimation of the absolute wavefront or to the operation of a closed-loop correction system. Errors in the position of the Shack-Hartmann spots are directly related to the absolute wavefront measurement error.
The sampling device in a Shack-Hartmann sensor is a lenslet array placed at the entrance pupil of the system or in a plane conjugate to the optics under test. In the case of optical element testing, an image of the tested optics pupil is projected onto the lenslet array. This assures that individual lenslets accurately map onto the optics pupil plane and that the wavefront at the lenslet array is identical to that at the optic. Supporting sub-systems, such as beam reducers or expanders and relay systems, often complete a Shack-Hartmann wavefront sensor. Depending on the application, beam reduction or expansion optics can be used in front of the lenslet array. Beam reduction is necessary, for example, for short dynamic range wavefront slopes when high accuracy is required. In this case the beam reduction yields higher slopes arriving at the lenslet array increasing thus the sensitivity of the sensor. The beam reduction specifically magnifies the angular spread of the beam thus increasing the magnitude of the gradients, or tilts, of the ray bundles from micro-radians to milli-radians for typical testing configurations [5]. Measurements of such large angles are less prone to errors from mechanical and thermal instabilities in the sensor apparatus, therefore measurements become more accurate. On the other hand, for severely aberrated input wavefronts, the beam size can be expanded so that the localized slopes of the wavefront become more moderate. Following the lenslet array, relay systems of various magnifications are often used to transfer the optical output of the lenslet array onto fixed size detectors. The schematic in Fig. 1 shows a Shack-Hartmann system containing an expanding afocal system that increases the dynamic range of the sensor, a lenslet array and a demagnifying relay system. In this paper we first explain the need for tolerancing of such a wavefront sensor system. We then present the nominal design of a model Shack-Hartmann system. We introduce the proposed tolerance analysis method, and we apply it to the model system. We then quantify the wavefront measurement error caused by different misalignment tolerance levels for a given input wavefront vergence range. This research expands on an earlier investigation presented at the International Symposium on Optical System Design (2005), where we showed the possibility of using a phase surface to translate output ray error into input wavefront error for systems containing wavefront sampling devices [6]. New material in this paper includes taking into account the calibration of such systems and quantifying the measurement accuracy degradation showing that in spite of calibration, measurements of wavefronts at the extreme of the dynamic range of the sensor are still susceptible to error. The key contribution of this paper is providing an efficient method of estimating the effect of fabrication and assembly tolerances on the measurement accuracy when designing a Shack-Hartmann sensor system.

Need for tolerancing
Misalignments of the lenslet array and adjacent optical sub-systems of a Shack-Hartmann sensor can result in errors in the position of the spots in the image plane, which are directly related to the absolute wavefront measurement error. If the spot departures from the reference grid are caused by anything other than the wavefront departure from the reference wavefront used for calibration, wavefront reconstruction error will occur. Through calibration, the promise is that all system departures from the nominal design caused by fabrication and alignment are accounted for. The assumption is that the departures of the spots for a test wavefront with respect to the calibration reference merely represent the test wavefront departure from the reference wavefront. This is true for applications where the range of measured wavefront aberrations is relatively small. This work reveals that for large range of measurements, calibration only reduces measurement errors as opposed to eliminating them fully. This problem is correlated to the fact that typically the calibration is performed using only one input wave, usually a plane wavefront, or a known wavefront in the center of the dynamic range of the sensor. Input wavefronts at the extremes of the dynamic range could still be erroneously mapped because of misalignments. Thus, calibration will quasi eliminate the measurement error for the reference (central) input wavefront, but will only decrease, not eliminate the error for measurements of other wavefronts in the dynamic range on the sensor.
The importance of alignment errors in Shack-Hartmann sensors was first revealed by Pfund et al [7]. In their work the authors investigated how various misalignments of the lenslet array with respect to the CCD can be compensated by recalibrating with different reference wavefronts. Analytical forms of the effect of misalignments of the Shack-Hartmann sensor were studied, but complete reconstructed polynomials of the measurement error could not be obtained because of the non-integrability of rotation misalignments. In their work, the authors did not consider additional optical sub-systems besides the lenslet array and the CCD detector. For systems containing additional complex relay lenses, it may be cumbersome for the lens design engineer to express the impact of all misalignments analytically. Knowing the system and the measurement error that can be tolerated, the effect of fabrication and assembly error on the measurement accuracy of the system can be quickly estimated through a tolerance analysis. A one-step tolerance analysis that will directly provide the wavefront measurement error is not supported however by current optical design software tools because of the intrinsic discrete nature of the sampling system [8,9]. In an optical design software, a traditional tolerance analysis will provide the ray departure error with respect to the ray ideal location on the detector, due to misalignments. But since the wavefront under test is broken up by the lenslet array during the sequential ray tracing, the software tool would need a wavefront reconstruction algorithm in order to translate the ray error into input wavefront error. A widely employed procedure is to translate spot departures caused by misalignments into slope errors and then convert the slope errors into wavefront measurement error using a reconstruction algorithm available with Shack-Hartmann analysis software. We propose a step-by-step tolerance analysis technique that enables the optical design engineer to translate ray error due to fabrication and assembly tolerances into RMS input wavefront measurement error, and to estimate measurement error for the entire dynamic range of the sensor, without the use of separate reconstruction algorithms.

Nominal design
To illustrate our method, we have chosen a Shack-Hartmann sensor system comprised of three optical sub-systems: an afocal expansion system relaying the input wavefront from the entrance pupil of the system to the lenslet array -the pupil magnification of 3.2:1 reduces the local angular slopes of the wavefront, thus increasing the dynamic range of the system; A lenslet array with a contiguous square aperture pattern of 0.6 mm pitch and a focal length of 37 mm; And a demagnification relay system that images the spot pattern from the focal plane of the lenslet array to a detector plane that is 3.2 times smaller than the intermediary image at the focal plane of the array. The conceptual layout (not to scale) is shown in Fig. 1.
Both the afocal relay and the demagnification relay systems use the same combination of lens groups, for simplicity. This explains the demagnification factor being the reciprocal of the pupil magnification factor. Both the relays and the lenslet array are well corrected, diffraction limited systems. The design layout is shown in Fig. 2

Tolerance analysis
The tolerancing technique we propose consists of a Monte Carlo tolerance analysis based on a specific merit function, followed by a re-optimization of the 90% cut-off system containing a variable "dummy" phase surface at the entrance pupil of the system. We present the tolerance analysis technique as five distinct steps. In presenting our method, we use a sub-set of the available Shack-Hartmann spots and sub-set of the available Zernike coefficients. We also use a limited number of Monte Carlo runs (100) in order to expedite simulation time. Moreover, we select only two specific wavefronts (experiencing positive and negative defocus respectively) for analysis. These parameters are not inbuilt for this procedure. The values used were chosen only to illustrate the concept behind the method and the self-imposed concessions do not affect the generality of our method. The parameters can and should be varied depending on the system, application, fabrication limitations, and the designer's objective.

Step 1: Range of measurement
The dynamic range of wavefront measurement for the sensor depends on the application and it is usually provided in the design specifications. In our example the vergence range of the input wavefront was set to [-2; +2] m -1 . In this range we chose three representative wavefronts for which the analysis would be preformed: -Right extreme wavefront (denoted by WF R ) is a converging spherical wavefront focusing at 500mm to the right of the entrance pupil.
-Mid-Range wavefront (denoted by WF 0 ) is a plane wavefront -Left extreme wavefront (denoted by WF L ) is a diverging spherical wavefront with its center of curvature at 500 mm to the left of the entrance pupil Step 2: Reference coordinates computation The CCD plane coordinates of real rays passing through the center of 17 (out of 1075) selected effective lenslet sub-apertures for the three above-mentioned input wavefronts were recorded as given by the ray-tracing software. For each of the 17 sub-apertures we obtained three sets of coordinates: Such vectors were used to compute the reference coordinates for the tolerance and optimization merit functions in the following steps. We selected only 17 representative subapertures in order to expedite the simulation runtime. The ray spots corresponding to the selected sub-apertures are shown in Fig. 4.

Step 3: Monte Carlo tolerance analysis
Using the central wavefront input WF 0 (plane wave) and its corresponding reference spot coordinates, a sensitivity tolerance analysis was performed prior to the Monte Carlo runs in order to identify the worst offenders of the system. In our case the worst offenders were the assembly errors (air thicknesses, decenters, and tilts of the lens groups). Therefore, we chose to ignore lens fabrication tolerances and focus only on assembly errors for the rest of the procedure. Among the group of worst offenders, the lens group tilt had considerably more impact on performance than the others. In order to better visualize the impact of the tilt misalignments we performed five analyses for five different tilt tolerance values, while maintaining the other tolerance values constant. Tolerance values used are shown in Table 2.

Tolerance
Value Lens group position (on z-axis) ± 0.1 mm Lens group decenter ± 0.01 mm Lens group tilt ± 0.25º (loose tolerance) ± 0.2º (moderate-loose tolerance) ± 0.1º (moderate tolerance) ± 0.05º (moderate-tight tolerance) ± 0.025º (tight tolerance) We used the CCD image plane defocus, decenter, and tilt as compensators. A 100-run Monte Carlo tolerance analysis was performed using WF 0 as input and the square root of the sum of the squared departures from the reference spot coordinates computed in step 2 as the merit function criterion. All individual Monte Carlo trials were saved during the run. The result of the Monte Carlo run was a set of 100 randomly misaligned systems that had different levels of merit function degradation. To estimate the wavefront measurement error we could expect from a manufacturable system we needed to select an emblematic Monte Carlo trial out of the 100 set. We selected the Monte Carlo trial system with a merit function value corresponding to 90% cut-off boundary, as provided by the tolerance analysis statistic, where that percentage means 90% of real-life assembled systems would have a better or equal merit function value as the selected trial system. In a more cautious approach one could choose the worst case (100%) trial. However, we felt that the 90% figure is a reasonable choice for a manufacturable system.

Step 4: Taking calibration into account
A real-life system would be calibrated before use in order to reset the mapping of the Shack-Hartmann spots with the very purpose of reducing assembly errors and misalignments. To account for calibration of the selected trial system, we needed to determine new reference spot coordinates on the detector for all three input wavefronts WF 0 , WF R , and WF L . We thus passed the central wavefront WF 0 through the trial system and obtained the new calibrated coordinates, 0 0 , C C y x . Using the vector values computed in step 2, we compute a new set of reference coordinates for WF R and WF L that take into account calibration, as shown in Fig. 5. We were now ready to perform the final step of the procedure, in which we would determine the measurement error we could expect from our system at the extremes of the dynamic range.
Step 5: Optimization using variable "dummy" phase surface If we take the extreme input wavefronts under test WF R and WF L and pass them through the 90% cut-off trial system, we observe that the actual spot coordinates, In order to express this spot departure into input wavefront measurement error we introduced a variable "dummy" Zernike phase surface (denoted Δ WF) at the entrance pupil of the system, and we performed an optimization trying to minimize the spot departures from their ideal position. This idea was inspired from previous work in which a variable Zernike surface was used during lens optimization to model the behavior of a spatial light modulator [10]. In the present case the variable Zernike coefficients of the phase surface would attempt to nullify the discrepancy between actual spot and ideal spot position, during optimization. The merit function applied during optimization can be expressed with Equation 3.
The misaligned system containing the Zernike phase surface is conceptually illustrated in Fig. 7. Using cylindrical coordinates, the wavefront in the entrance pupil of the system can be expressed in terms of Zernike polynomials.  We set the first 15 normalized Zernike coefficients as variables and we optimized the 90% system with respect to the merit function from Eq. (3), using WF R and WF L as inputs, respectively. The "optimized" Zernike coefficients of the Δ WF surface represent the departure from the ideal input wavefronts needed to compensate for the assembly errors. Thus, Δ WF represents the wavefront measurement error of the system when measuring those particular wavefronts at the extremes of the dynamic range. The RMS wavefront error is given by Equation 5.
The same analysis can be performed against any particular input wavefront, provided that we build a reference mapping and a respective merit function for that wavefront.

Results
Analysis results can be expressed in a multitude of formats. Impact of individual assembly errors as well as system measurement error dependence on tolerance strictness can be plotted for the entire dynamic range of the system. We show the RMS wavefront measurement error in the [-2 to +2] m -1 range for five different tilt tolerance values in Fig. 8. The RMS wavefront measurement error is zero for the central wavefront used for calibration WF 0 but it increases to 2 waves, depending on the tolerance values used, for the extremes of the dynamic range WF L and WF R . It is to be noted that the two wavefronts used for analysis in this paper are experiencing only positive and negative defocus. For wavefronts experiencing more complex aberrations the measurement error results may differ. As a future task, it would be interesting to investigate the effect of misalignments on wavefronts experiencing other particular optical aberrations, or a combination of them.

Conclusions
We presented a step-by-step tolerance analysis for a Shack-Hartmann wavefront sensor containing three optical sub-systems. We employed a traditional Monte Carlo tolerance analysis on the nominal system followed by an optimization using a "dummy" variable Zernike surface at the entrance pupil of the system. Thus, we were able to convert the sampled wavefront ray-intercept merit function degradation into input wavefront measurement error. We also demonstrated that even though a calibration was performed using a central reference wavefront, alignment errors still caused measurement error for wavefronts at the extremes of the dynamic range of the sensor. The example presented was used only to illustrate the underlying concept. This tolerance technique can be used for other systems containing sampling devices, where traditional tolerancing provides limited insight into input measurement error caused by fabrication and assembly faults. Finally, although presented as a step-by-step procedure, the method can be easily converted into a scripted macro.