In visual experiments that require real-time partial correction of wavefront aberrations, small errors occur that accumulate over time and lead to drifts in Zernike coefficients of the uncorrected aberrations. A simple algorithm that does not require the inclusion of an additional optical path to obtain independent measurements of the eye’s aberrations is described here, and its effectiveness in preventing these drifts is demonstrated.
© 2017 Optical Society of America
Aberrometry and adaptive optics (AO) have made their way from observational astronomy into visual optics only relatively recently [1–3]. This technological translation has led to significant improvements in retinal imaging of the living eye [4,5] and to performing applications in visual optics and psychophysics that would have not been possible otherwise [5,6]. Whereas for imaging the goal of AO is to correct all of the aberrations of the eye to obtain the best possible image of the retina (or to leave some defocus to obtain images of the retina at different depths), for visual optics, the goal is often to induce patterns of aberrations and measure their influence in subjects’ response or performance of visual tasks.
In experimental visual optics, wavefront aberrations are described typically with Zernike polynomials. Manipulation of wavefront aberrations can then be done by manipulation of the coefficients multiplying these polynomials. In a generic AO closed loop setup, a target wavefront specified with Zernike coefficients is subtracted from the measured wavefront and the difference used to calculate changes in position of the actuators of a deformable mirror. Calculation of changes in the deformable mirror is only possible after characterizing how changes in the position of the actuators influence the measured wavefront aberrations through local changes in the shape of the deformable mirror. For simplicity, the influence function is typically assumed to be linear, and the relation between actuator position and measured wavefront aberrations is approximated by the interaction matrix [7–9]. Its inverse, the command matrix, maps the deformable mirror’s actuator positions with wavefront aberrations.
Although the iterative application of generic AO closed loop operations is effective to correct all aberrations and to induce fixed wavefront targets (see e.g., [7,9]), it breaks down for partial wavefront correction. Figure 1 illustrates the effects of this problem with the Mirao 52e deformable mirror (Imagine Eyes, Orsay, France). (Details about the system are given in Section 2.) Measured Zernike spherical defocus is shown after setting all other Zernike coefficients to 0 μm with the deformable mirror. On the left panel, spherical defocus was set to 1 diopter (D) or 0.58 μm for a pupil with 4 mm diameter, whereas on the right panel, spherical defocus was left uncorrected—that is, as measured in each iteration.
In this particular example, the errors in spherical defocus for the fixed target wavefront on the left panel were positive for almost all iterations but never greater than 0.02 D. The sum of the errors over iterations was about 0.4 D in this example. Systematic errors in fixed target wavefront correction that do not cancel out over time have been reported with another AO setup and deformable mirror (see right panel of Fig. 6 in Ref. ). Although these systematic errors are unimportant for fixed wavefront targets, they add up, causing drifts in Zernike coefficients of uncorrected aberrations in partial wavefront corrections, as the one observed for defocus in the right panel of Fig. 1. In each iteration of the partial wavefront correction, the defocus of the target wavefront is updated with the previous measurement after the deformable mirror induced some undesired defocus. Since the induced defocus by the deformable mirror in successive iterations does not cancel out, unlike for fixed target wavefronts, the error accumulates over iterations. In this particular and rather extreme (but not uncommon) example, the error in defocus was about D per iteration and after 50 iterations summed to almost 1 D. Drifts similar to that shown in the right panel of Fig. 1 have also been observed with the commercial crx1 visual simulator (Imagine Eyes, Orsay, France).
Drift artifacts in partial wavefront corrections are a direct consequence of assuming linearity between the electronics that modify the AO system and real optical changes, whereas the relation between actuator voltage and mirror deflection is typically nonlinear, and mirror displacement is spatially coupled with adjacent actuators [8,9]. Drifts are often nonlinear and unpredictable and can occur for any Zernike coefficient left uncorrected, not only spherical defocus. They depend on measured pupil center and radius, and because of the intrinsic relationships between Zernike modes, they also depend critically on which aberrations are being corrected and which are left uncorrected.
A solution to drift artifacts is to use a more complex characterization of the AO system than a simple interaction matrix that takes into account the nonlinearities of the system and coupling between adjacent actuators. But such characterization would be too complex and impractical, requiring the determination of a multivariate, most likely nonlinear function that depends not only on wavefront slopes but also on pupil center and radius. Another solution is to disentangle the wavefront aberrations of the eye from the wavefront aberrations induced by the mirror. One way to do this is to incorporate an optical path in the system that can make direct measurements of the natural aberrations of the eye independent from the state of the mirror [10,11]. But this more complex optical setup requires two different optical paths, with the corresponding additional optics and signal losses that adding optics entails. Luckily, drift artifacts can also be effectively controlled by software with an algorithm that is computationally efficient and only moderately more complex than the generic AO closed loop.
In the remainder of this paper, the system’s characterization and the generic AO closed loop operation are described in Sections 2.A and 2.B; the generic and a drift-control AO closed loop algorithms are described in Section 2.C; examples comparing both algorithms are shown in Sections 3.A and 3.B; and final remarks given in Section 4. Partial wavefront corrections such as those in the examples in Section 3 have been used previously to study the effects of monochromatic aberrations on the accommodative response of the eye to steady-state , step , and sinusoidally moving visual stimuli .
A. System’s Characterization Through the Interaction Matrix
In a conventional setting with a Shack–Hartmann wavefront sensor with micro-lenses and a deformable mirror with actuators, an AO closed loop operation is performed iteratively to correct all aberrations of the system or of the eye. But this operation is only effective if the AO system is well characterized with a multivariate interaction function that determines with precision how the commands necessary to change the position of the set of actuators of the deformable mirror modulate wavefront aberrations. In the Mirao 52e deformable mirror, the commands are voltages to be applied to change the actuators position.
The wavefront aberrations can be characterized using a set of Zernike coefficients and polynomials, as in Ref. ; any other set of polynomials over the continuous unit disk; or with the slopes that are directly recorded by the wavefront sensor, as in here and in Ref. . The wavefront aberrations are thus arranged as a vector with elements corresponding to the slopes in the axis and axis recorded in each of the micro-lenses. Regardless of whether the wavefront aberration vector is described with a Zernike base or slopes, the interaction function necessarily depends on the number of micro-lenses that are lit in the wavefront sensor corresponding to the system’s pupil aperture or the pupil of the eye, and its center and radius. The inverse of the interaction function could then be used to calculate the commands to change the position of the set of actuators of the deformable mirror to generate a particular wavefront aberration.
But as already noted in Section 1, the determination of such interaction function would be too complex and impractical. Therefore, for simplification, the interaction function is generally assumed to be linear so that it can be expressed as a matrix multiplication between an interaction matrix and the set of actuator commands of the deformable mirror, thus,
The interaction matrix can be obtained in different ways. One method, known as push and pull, entails applying voltages of and to each actuator individually to obtain a total of wavefront aberration vectors. If, for a particular actuator, are the slopes obtained for a voltage of and the slopes for a voltage of , then its influence (change per unit of voltage increase) on the overall wavefront aberration is . The interaction matrix, hence, has dimensions . In practice, because commonly the AO system has a pupil aperture that is smaller than the surface of the wavefront aberrometer, some micro-lenses will never be lit, and the interaction matrix will have rows of zeros that can just be removed.
The custom-designed AO system used in this paper had a Shack–Hartmann wavefront sensor with micro-lenses (HASO4 First, Imagine Eyes, Orsay, France) and a Mirao52e deformable mirror with 52 actuators. Figure 2 shows a diagram of the system. The system is calibrated with a He–Ne laser, but eye measurements and correction are done with the infrared (IR) diode. A more complete description of the system can be found in Refs. [13,14]. The voltage used for the push and pull method to determine the interaction matrix was 0.2 V as recommended by the vendor.
B. Generic AO Closed Loop Operation
The inverse operation that gives the actuator commands to achieve a particular wavefront aberration vector can be obtained by computing the Moore–Penrose pseudo-inverse of . Alternatively, for practical purposes, the interaction matrix can be broken down into its eigenvalues and eigenvectors (52 for the Mirao52e deformable mirror) with single value decomposition. Its inverse can then be reconstructed after filtering out the eigenvectors with very small eigenvalues that correspond to unimportant, weak aberrations that can generate instabilities in iterative AO closed loop operations. Call the reconstructed inverse matrix the command matrix . Then,
Because Eq. (1) is a linear transformation from to , the same interaction matrix can be used to compute how differences in actuator commands modulate differences in wavefront aberration vectors . Likewise, the linear transformation in Eq. (2) is used to compute how actuator commands need to change in order to modify wavefront aberration vectors by .
To correct all the aberrations of the system or of an eye, it is necessary to acquire an image with the wavefront sensor, to compute slopes for each of its micro-lenses, and to arrange the slopes in vector form . The change in actuator commands to correct the measured wavefront aberration vector can be computed from Eq. (2). The generic AO closed loop operation consists of sending the commands to the deformable mirror to move the actuators by and to acquire an image and compute resulting slopes from the wavefront sensor.
The same AO closed loop iterative procedure can be performed to induce wavefront aberrations. If is the vector with slopes defining target wavefront aberrations, then Eq. (2) can be used to obtain the change in actuator commands from . The slopes can be used to obtain a description of the wavefront in terms of coefficients that multiply the conventional basis of Zernike polynomials. The target Zernike coefficients can be obtained by ordinary least squares fitting of the Zernike polynomials’ first derivatives to . Its calculation requires the determination of the center and radius of the system’s pupil aperture or of the pupil of the eye being measured by the wavefront sensor. Likewise, from a set of target Zernike coefficients for a determined pupil center and radius, the target wavefront aberration vector can be obtained by direct computation of the Zernike polynomials’ first derivatives.
As mentioned in Section 1 and because of nonlinearities, including spatial coupling of actuators, a single AO operation is increasingly inaccurate as greater changes are required [8,9]. For most applications, iteratively applying the generic AO closed loop operation is necessary to induce the target wavefront aberrations with precision. And yet, small systematic errors still remain  (see also the left panel of Fig. 1) that lead to drifts in partial wavefront correction (see the right panel of Fig. 1) if a naïve AO closed loop algorithm, as described in Section C.1, is performed.
C. Algorithms for Partial Wavefront Correction
The AO closed loop algorithms described here are similar to the one described in the previous section that iteratively computes the changes in actuator commands to reach a target wavefront, with the key difference that the target wavefront is no longer fixed. Indeed, the target is changed in each iteration according to the wavefront aberrations measured in the previous iteration.
To make accurate measurements of the aberrations of an eye, it is necessary to first correct the aberrations of the AO system. Iterative application of the generic AO closed loop is generally applied until correction is appropriate, i.e., the root mean square (RMS) of the wavefront aberration vector is at its minimum. The voltages that correct the system’s aberrations can be recorded and kept as reference. In fact, they are important to calculate the aberrations induced by the deformable mirror and to perform the drift-control algorithm explained in Section C.2.
1. Naïve AO Closed Loop Algorithm
The steps for the most straightforward algorithm for partial wavefront corrections are as follows:
- 1. Get wavefront aberration vector and pupil center and radius from lit micro-lenses in the Shack–Hartmann wavefront sensor.
- 2. Compute Zernike coefficients from and pupil center and radius calculated in Step 1.
- 3. Set to zero the Zernike coefficients in to be corrected to obtain the target Zernike coefficients .
- 4. Compute the target wavefront from the target Zernike coefficients .
- 5. Compute the differences between recorded and target wavefront slopes, thus, .
- 6. Compute changes in commands from slope differences, thus, .
Then, apply the command changes to move the actuators of the deformable mirror.
Notice that the algorithm can be simplified further if in Step 3 the Zernike coefficients set to zero are those to leave uncorrected, as the wavefront vector computed from them would be the same as computed in Step 5. This algorithm can be easily modified to induce stimulus vergence (inverse of distance) changes with time. For instance, to generate a sinusoidal profile, calculate the relative change in spherical defocus in each AO closed loop operation and add to the resulting set of target Zernike coefficients in Step 3.
2. Drift-Control AO Closed Loop Algorithm
The goal in this algorithm is to disentangle the aberrations of the eyes from the aberrations induced by the deformable mirror without a secondary optical path and Shack–Hartmann aberrometer, as in Refs. [10,11]. Its key steps are to calculate the wavefront aberrations that the deformable mirror is inducing unwillingly, say, (where e stands for error), and to recalculate the command changes to send to the deformable mirror.
The steps to mitigate drift artifacts following those of the naïve algorithm are:
- 7. Get current voltages applied to the actuators, say, .
- 8. Add these voltages to the command changes calculated in Step 6 and subtract those for which the system’s aberrations are corrected, .
- 9. Calculate the wavefront aberration vector induced by the mirror from the actuator commands calculated in the previous step using Eq. (1), thus .
- 10. Get the corresponding Zernike coefficients from the aberrations .
- 11. Calculate the errors in Zernike coefficients committed in the naïve AO closed loop that lead to drifts by setting all Zernike aberrations to correct to zero in .
- 12. Get the error in wavefront aberration vector from the modified Zernike coefficients .
- 13. Get the relative command changes from these slopes using Eq. (2), thus .
- 14. Subtract these command changes in actuators from those obtained in Step 6 to get the corrected command changes, thus .
Then, apply the command changes instead of in Step 6 to move the actuators of the deformable mirror.
In Step 9, the aberrations of the eye could be calculated by subtracting the aberrations induced by the mirror to the measured aberrations . With a system with two aberrometers, where one is used to perform AO and the other to take direct measurements of the eye , it would be possible to compute the wavefront induced by the deformable mirror as the difference between the measurements from each aberrometer, and the rest of the algorithm from Step 10 could be applied to control for drifts. The algorithm can be easily modified to induce stimulus vergence changes with time in a similar fashion as with the naïve algorithm.
3. EXAMPLES OF DRIFTS AND THEIR CORRECTION
For these examples, wavefront partial corrections were implemented in MATLAB (MathWorks, Inc., Natick, MA, USA) with Imagine Optic’s software development kit that controls the HASO4 First and the Mirao 52e and contains tools to run AO closed loop algorithms. In all the examples, wavefront aberrations were measured and partially corrected at 20 Hz. The command matrix in Eq. (2) used in the closed loop operations for the naïve and drift-control algorithms was reconstructed with the first 48 modes of the single value decomposition of the interaction matrix in Eq. (1). The first 37 modes in the Wyant Zernike term expansion (which includes all Zernike polynomials up to sixth order) were used to manipulate wavefront aberrations for partial correction.
A. Measurements with the He–Ne Calibration Laser
Figure 3 shows the defocus in D and fourth-order spherical aberration (SA) and vertical and oblique tetrafoil Zernike aberrations in μm scaled for a 4 mm pupil for the naïve algorithm (left panel) and the drift-control algorithm (right panel), while odd-order Zernike aberrations, but not even-order aberrations, were corrected with the AO system. Measurements were taken with a He–Ne laser. A phase plate with a Zernike SA of 0.06 μm for a 4 mm pupil was placed in front of the He–Ne laser. Only spherical defocus, SA, and vertical and oblique tetrafoil are shown for illustration, but the drift occurs in all other Zernike aberrations left uncorrected. Drifts also occur if only odd-order Zernike aberrations or any other subset of Zernike aberrations are left uncorrected. The undesired drift using the naïve AO closed loop algorithm (upper left panel) when the mirror was intended to leave a constant spherical defocus (dashed line) was a consequence of very small errors accumulated over the 1 min trial. The error was about D per iteration, or 0.03 D per second. The undesired change in spherical defocus was about 1.6 D over the 1 min trial. For SA, the drift was per second. Vertical and oblique tetrafoil also suffered drifts. The drift using the drift-control algorithm (upper right panel) was D per second for spherical defocus and μm per second for SA. The undesired change in spherical defocus was D over the 1 min trial, a very small drift. The AO correction of the rest of aberrations shown in the lower panel was good, with an RMS always below 0.08 μm.
Figure 4 shows defocus in D and SA in μm when the AO closed loop was intended to change vergence sinusoidally at 0.2 Hz and with 1 D amplitude, while odd-order Zernike aberrations, but not even-order aberrations, were corrected with the AO system. Similar drifts with the naïve AO closed loop algorithm as in Fig. 3 were observed for both spherical defocus and SA. Furthermore, the amplitude of the desired sinusoidal change in vergence was also reduced. After detrending, the amplitude was calculated to be 0.7 D, about 30% smaller than intended. The AO correction of the rest of the aberrations shown in the lower panel was also good, with an RMS always below 0.09 μm.
B. Measurements with a Real Accommodating Eye
Figure 5 shows the accommodative demand and response in D of a real eye from the first author with all odd-order Zernike aberrations, but not even-order aberrations, corrected. The desired accommodation stimulus was a Maltese cross spanning 1.96 deg of visual angle moving sinusoidally at 0.2 Hz from 1 to 3 D from the subject’s far point presented over 1 min. The same type of stimulus was used in Refs.  and . Notice that whereas the drift-control algorithm was successful in generating the sinusoidal accommodation stimulus profile (upper right panel), the naïve algorithm failed (upper left panel). In particular, the departure from the desired accommodative demand was clear 45 s after the start of the trial. This drift after second 45 seems to have changed the response of the eye (middle left panel). A signal analysis showed that the accommodative response obtained at 0.2 Hz with the drift-control AO algorithm had gain of 0.9, whereas the gain in response at 0.2 Hz was 0.8 for the naïve AO algorithm, about 10% lower. The RMS of the AO correction for this real eye was worse, as expected, than for the artificial measures taken with the He–Ne calibration laser of the system, but typically below 0.1 μm.
4. FINAL REMARKS
The simple drift-control algorithm effectively prevents undesired drifts in spherical defocus and other low- and higher-order aberrations in visual experiments requiring partial corrections of wavefront aberrations. This is achieved without the need for a second optical path that includes a Shack–Hartmann aberrometer to measure eye aberrations that are independent of the state of the deformable mirror. The algorithm calculates the aberrations induced with AO from the shape of the deformable mirror and uses them to compensate the small yet cumulative errors introduced by the generic AO closed loop operations that lead to drifts. This fix to the generic AO closed loop does not correct the nonlinearities directly (which is taken care of by the iterative use of the closed loop). The fix merely prevents the inaccuracies of the closed loop in each iteration from building up.
These types of drifts are to be expected in any custom-made AO system attempting to do any partial wavefront correction. Because the application of most commercial AO systems is for retinal imaging, and this entails the correction of astigmatism and higher-order aberrations and induction of fixed amounts of defocus to image at different depths, these drift problems will not occur.
There may be other factors affecting the drifts reported here, such as small system misalignments or hysteresis in the response of the deformable mirror, but linear calibration of nonlinear systems and coupling between actuators seem to be the key reasons for drifts. The goal of this paper was not so much to provide a thorough and comprehensive account of all possible factors that generate drifts as much as it was to find a practical solution to avoid them in real-time partial wavefront correction. The solution presented here, the drift-control algorithm, can be applied to any custom-made or commercial AO system.
With real eyes, it is even more complicated to predict the drift with the naïve AO algorithm, since pupil center and diameter and the accommodative state of the eye are changing constantly. And since the wavefront sensor can only measure accommodative error and cannot disentangle the demand induced by the mirror from the response of the eye, another undesirable positive feedback occurs between the eye (which responds to the defocus induced) and the AO system (in which response is dependent on the accommodative state of the eye). The results that obtained here with the naïve AO closed loop algorithm were clearly incorrect.
In addition to the systematic errors discussed here that lead to drifts, other measurement errors are expected to occur as the eye moves and blinks or eyelashes get in the way of the measurements. These errors are typically “noise” and not systematic. Therefore, they do not generate drifts. Any source of systematic error in the measurements generating drifts in aberrations would not be possible to correct with either the drift-control algorithm presented here or the dual wavefront sensor system by Hampson and colleagues —or even with the best possible calibration of the AO system. The problem would be even more severe because it would mean that direct eye measurements would artifactually change over time, even for a system without adaptive optics.
Small systematic errors in partial wavefront correction of the same magnitude as those in the left panel of Fig. 1 are expected to occur with the drift-control algorithm. But these errors are below the threshold to be noticeable or to impact experimental outcomes. Care is needed when measuring young eyes since, as demonstrated in Fig. 5, the drift in spherical defocus induced by the deformable mirror can drive their accommodative response while remaining hidden to the Shack–Hartmann aberrometer.
H2020 European Research Council (ERC) (ERC-2012-StG-309416-SACCO); Universitat de València (UV-INV-PREDOC14-179135).
We thank Karen Hampson and David H. Foster for critically reading the manuscript and Ilan Stefanon and Laurent Vabre from Imagine Eyes for support with HASO and CASAO software and Imagine Optic’s software development kit. Xavier Levecq is with Imagine Eyes, Orsay, France. Atracció de talent (University of Valencia) research scholarship granted to Antonio J. Del Águila-Carrasco. None of the authors declare any conflicts of interest.
1. J. Liang, D. R. Williams, and D. T. Miller, “Supernormal vision and high-resolution retinal imaging through adaptive optics,” J. Opt. Soc. Am. A 14, 2884–2892 (1997). [CrossRef]
2. L. N. Thibos, “The new visual optics,” Optom. Vis. Sci. 74, 465–466 (1997). [CrossRef]
3. A. J. Adams, “The new visual optics,” Optom. Vis. Sci. 83, 329–330 (2006). [CrossRef]
4. D. T. Miller, “Retinal imaging and vision at the frontiers of adaptive optics,” Phys. Today 53(1), 31–36 (2000). [CrossRef]
5. S. Marcos, J. S. Werner, S. A. Burns, W. H. Merigan, P. Artal, D. A. Atchison, K. M. Hampson, R. Legras, L. Lundstrom, G. Yoon, J. Carroll, S. S. Choi, N. Doble, A. M. Dubis, A. Dubra, A. Elsner, R. Jonnal, D. T. Miller, M. Paques, H. E. Smithson, L. K. Young, Y. Zhang, M. Campbell, J. Hunter, A. Metha, G. Palczewska, J. Schallek, and L. C. Sincich, “Vision science and adaptive optics, the state of the field,” Vis. Res. 132, 3–33 (2017). [CrossRef]
6. A. Roorda, “Adaptive optics for studying visual function: a comprehensive review,” J. Vis. 11(5):6, 1–21 (2011). [CrossRef]
7. E. J. Fernández and P. Artal, “Membrane deformable mirror for adaptive optics: performance limits in visual optics,” Opt. Express 11, 1056–1069 (2003). [CrossRef]
8. J. B. Stewart, A. Diouf, Y. Zhou, and T. G. Bifano, “Open-loop control of a MEMS deformable mirror for large-amplitude wavefront control,” J. Opt. Soc. Am. A 24, 3827–3833 (2007). [CrossRef]
9. W. Zou and S. A. Burns, “High-accuracy wavefront control for retinal imaging with adaptive-influence-matrix adaptive optics,” Opt. Express 17, 20167–20177 (2009). [CrossRef]
10. K. M. Hampson, S. S. Chin, and E. A. H. Mallen, “Dual wavefront sensing channel monocular adaptive optics system for accommodation studies,” Opt. Express 17, 18229–18240 (2009). [CrossRef]
11. S. S. Chin, K. M. Hampson, and E. A. H. Mallen, “Effect of correction of ocular aberration dynamics on the accommodation response to a sinusoidally moving stimulus,” Opt. Lett. 34, 3274–3276 (2009). [CrossRef]
12. L. Chen, P. B. Kruger, H. Hofer, B. Singer, and D. R. Williams, “Accommodation with higher-order monochromatic aberrations corrected with adaptive optics,” J. Opt. Soc. Am. A 23, 1–8 (2006). [CrossRef]
13. M. Jaskulski, I. Marín-Franch, P. Bernal-Molina, and N. López-Gil, “The effect of longitudinal chromatic aberration on the lag of accommodation and depth of field,” Ophthalmic Physiol. Opt. 36, 657–663 (2016). [CrossRef]
14. A. J. Del Águila-Carrasco, I. Marín-Franch, P. Bernal-Molina, J. J. Esteve-Taboada, P. B. Kruger, R. Montés-Micó, and N. López-Gil, “Accommodation responds to optical vergence without feedback, but not to defocus blur alone,” Invest. Ophthalmol. Visual Sci. 58, 1758–1763 (2017). [CrossRef]