Dynamic performance of microelectromechanical systems deformable mirrors for use in an active/adaptive two-photon microscope

Abstract. Active optics such as deformable mirrors can be used to control both focal depth and aberrations during scanning laser microscopy. If the focal depth can be changed dynamically during scanning, then imaging of oblique surfaces becomes possible. If aberrations can be corrected dynamically during scanning, an image can be optimized throughout the field of view. Here, we characterize the speed and dynamic precision of a Boston Micromachines Corporation Multi-DM 140 element aberration correction mirror and a Revibro Optics 4-zone focus control mirror to assess suitability for use in an active and adaptive two-photon microscope. Tests for the multi-DM include both step response and sinusoidal frequency sweeps of specific Zernike modes (defocus, spherical aberration, coma, astigmatism, and trefoil). We find wavefront error settling times for mode amplitude steps as large as 400 nm to be less than 52  μs, with 3 dB frequencies ranging from 6.5 to 10 kHz. The Revibro Optics mirror was tested for step response only, with wavefront error settling time less than 80  μs for defocus steps up to 3000 nm, and less than 45  μs for spherical aberration steps up to 600 nm. These response speeds are sufficient for intrascan correction at scan rates typical of two-photon microscopy.

Dynamic performance of microelectromechanical systems deformable mirrors for use in an active/adaptive two-photon microscope 1 Introduction Two-photon microscopy (TPM) is a powerful tool for imaging biological samples with high resolution, offering direct visualization of the behavior of cells in their natural environment. 1,2 However, the image quality decreases rapidly as the focal point of the TPM penetrates deeper into the sample. Although dependent on the type of tissue, TPM has not yet been able to acquire images with high resolution deeper than about 1 mm. 2,3 The fundamental depth limit is due to several factors including attenuation of the excitation light through absorption and scattering in the tissue and, importantly, aberrations that degrade both resolution and contrast, obscuring features of interest. These aberrations can be due to the optical inhomogeneity of the biological sample when penetrating through hundreds of microns of tissue (sample-induced aberration), and may also arise from an imperfect optical system (systematic aberration). In TPM, degradation of the beam focus contributes directly to signal loss at depth due to the squarelaw dependence of the measured signal on the peak intensity of the focused beam.
Adaptive optics is known to enhance resolution and contrast at depth for TPM. Adaptive optical elements such as microelectromechanical systems (MEMS) deformable mirrors (DMs) can perturb the illuminating wavefront to precompensate for optical path length variations in the optical system as well as the sample. [4][5][6][7][8][9][10] For example, Booth et al. 4 incorporated a DM into a confocal microscope and showed good results with aberration correction in a mouse intestine specimen. Kong and Cui 11 have demonstrated that the iterative multiphoton adaptive compensation technique can greatly improve the signal strength, resolution, and contrast for in vivo neuron imaging in mouse cortex at a large depth (∼660 μm). Others have shown promising results with a liquid crystal modulator for wavefront error compensation in biological samples. 10 To date, these demonstrations have adopted a single wavefront correction for a particular depth. The correction is fixed for all points within the field of view, and may not optimally correct the aberrations throughout the field of view.
In addition to managing aberrations, MEMS mirrors capable of large displacements can be used for dynamic focus control during imaging. [12][13][14] Compared to mechanical means of focusing that translate the objective lens or the sample, focusing by modifying the wavefront curvature using an MEMS mirror introduces no vibrations and can be accomplished at much higher speeds. This opens up the possibility of imaging along oblique sections or more convoluted surfaces, and for multidepth imaging within a single image frame.
A consequence of using an MEMS mirror (or a variable focus transmissive lens) for focus control is an introduction of additional systematic aberration. The objective lens and the relay lenses in a scanning laser microscope are optimized only for a particular imaging depth in the sample. When used to image at other depths, both spherical aberration and uncorrected off-axis aberrations arise. Combining a focus control mirror with an aberration correcting mirror leads to a flexible platform capable of aberration-corrected beam scanning throughout a three-dimensional (3-D) volume of tissue. This is the system we are developing that we call an active/adaptive two-photon microscope. A simplified diagram illustrating the capability of the instrument is shown in Fig. 1. In this diagram, it is assumed that the beam scanners and wavefront control mirrors are mutually conjugate to the aperture plane of the objective lens. The combination of focusing and aberration correction, synchronized with scanning, leads to control of the beam in three dimensions during image acquisition.
Fully flexible 3-D acquisition can be realized only if the focus and aberration correction mirrors can be modulated quickly enough to keep up with the fast-scan mirror. It is toward this end that we are characterizing MEMS mirrors, giving particular attention to the dynamic performance to ascertain whether they can be used to produce high Strehl ratio imaging while rapidly and continuously modulating the wavefront of the illumination beam.
To frame the problem in a more quantitative way, we might consider segmenting a single fast scan into multiple zones, with a unique focus or aberration setting in each zone. For example, a 1 kHz fast scan might be accomplished using a galvo scanner following a sawtooth waveform with 750 μs forward scan and 250 μs retrace. Dividing the forward scan into five zones allows 150 μs per zone. In this case, we might think about updating the DM at a frequency of 1∕150 μs ¼ 6.67 kHz, but we might demand a settling time that is small, perhaps 10% of the zone dwell time or 15 μs. We would want to investigate the step response of the DM to ensure it is capable of this type of performance.
On the other hand, we might think of interpolating between the five zones of the previous example and driving the mirror in a continuous trajectory. In that case, the mirror motion will be nearly periodic, with the same period as the scan mirror. But if, for example, the trajectory is to accurately follow a linear deflection during the forward scan and also accomplish a fast retrace, then the system bandwidth (DM and electronics) may need to be an order of magnitude higher than the scan frequency, or 10 kHz in our example. In this case, the more useful metric may be the frequency response of the system, rather than the step response.
Having measured the actual step response or frequency response of a potential DM, we can then make an informed choice about the maximum galvo scan rate, or the complexity of the mirror trajectory that might be possible while maintaining imaging integrity. It is worth noting here that we are measuring the full system response by dynamically measuring the shape of the DM, and not simply considering update rates supported by the electronics. Furthermore, we examine how different Zernike modes respond, recognizing that air damping is the dominant mechanism setting the bandwidth of these mirrors, and different shapes are displacing the air under the mirror membrane in different ways. It will be shown that some Zernike modes exhibit a significantly faster response than others. In this paper, we evaluate the dynamic performance of two MEMS DMs for use in an active/adaptive two-photon microscope for deep tissue imaging. A simplified schematic of that instrument is shown in Fig. 2. A large-stroke DM (Revibro Optics MFC mirror, 15 μm max deflection) is used for high-speed focus control and correction of depth-induced spherical aberration. This mirror, referred to as the "woofer," is capable of large deflection but low spatial frequencies. A Boston Micromachines Corporation (BMC) Multi-DM (1.5 μm max deflection) with 140 actuation channels is the "tweeter" that can handle aberrations with higher spatial frequency, including nonaxially symmetric modes (for example, astigmatism Z 2;2 , coma Z 3;1 , etc.). Our goal is to maintain a Strehl ratio exceeding 0.8 at any point in the 3-D imaging volume.
We measure the surface height of both DMs using a stroboscopic phase-shift interferometer.
Step response and sinusoidal steady-state response are measured using submicrosecond pulse widths, for a variety of specific aberration modes, in order to determine the maximum operating frequency for these mirrors. In addition to the response times of the mirrors, we quantify the dynamic behavior of the residual wavefront rms error when stepping the mirror. In this way, we determine the suitability of these wavefront modulation mirrors for our two-photon microscope.

Selection of MEMS DM and Zernike Modes for Test
Since speed is critical for active scanning and intrascan focus control and aberration correction, liquid crystal spatial light modulators that can achieve frame rates up to a few hundred Hertz are too slow and were not considered. On the other Fig. 1 With fast active wavefront modification, both the z-position of the beam focus and local aberration may be continually controlled during beam scanning, enabling oblique, or contoured sectioning of the sample. In this diagram, it is assumed that the beam scanners and wavefront control mirrors are mutually conjugate to the aperture plane of the objective lens. Fig. 2 The active/adaptive two-photon microscope with "woofer" and "tweeter" MEMS DMs for focus and aberration control.
hand, commercially available MEMS DMs have electronic update rates of hundreds of kHz and published mechanical response times of tens of μs, making them candidates for this application. Furthermore, previous publications 8, 10,15 demonstrate that MEMS DMs are capable of correcting sampleinduced aberration in a variety of tissue types up to imaging depths of a few hundred microns. To choose the proper MEMS DM for the active/adaptive microscope, we start with simulations of the systematic aberrations of the active/adaptive microscope in Zemax. This gives us a guideline for the selection of the MEMS DMs to be used in the active/adaptive microscope, and the Zernike modes that we will dynamically test. That simulation is described below.
There is another consideration in choosing the MEMS DM, which is the type of mirror. There are three main types of MEMS DM that are commercially available, which are the segmented mirror with only piston motion, the segmented mirror with piston/tip/tilt motion, and the continuous face sheet mirror surface. We are interested to know whether a segmented mirror is capable of creating the shapes that meet our prescription with a residual error that is small enough to achieve diffraction-limited imaging. Using Fourier optics analysis to compute the aberrated point spread function (PSF), we found that a segmented, piston-only array with 12 × 12 actuators like the BMC segmented multi-DM cannot reach a Strehl of 0.8 (our criteria for diffraction-limited imaging) when compensating the aberrations we expect to see. However, a continuous face sheet mirror, or a segmented mirror with piston/tip/tilt, such as the IrisAO PTT111 DM, provides sufficiently small residual error for a diffraction-limited PSF. Segmented, piston-only mirrors with a larger number of actuators such as the BMC kilo-DM might achieve our criteria, but at greater cost and complexity, and were not evaluated.
Candidate mirrors we considered for the "tweeter," therefore, included the tip/tilt/piston segmented IrisAO PTT111 DM with a 200-μs mechanical response time and an 8-μm mechanical stroke, and continuous face sheet mirrors such as the Alpao DM69 with an 800-μs settling time and 30 μm surface stroke, the Mirao 52-e with a 25-μm stroke (unspecified settling time), and the BMC multi-DM with a 60-μs response time and 1.5 μm stroke. For the "woofer," we considered the Alpao and Mirao mirrors, and the Revibro Optics 4-zone DM with a published settling time of less than 200 μs. Using response time as the primary discriminator, with the cost and computational burden associated with a higher actuator count mirrors as a secondary consideration, we selected the BMC multi-DM continuous face sheet mirror to evaluate for the "tweeter" and the Revibro Optics DM to evaluate for the "woofer." The Revibro DM, shown in Fig. 3, is based on a design described previously by Moghimi et al. 12 It comprises a stretched metalized membrane, suspended over four concentric annular electrodes, and includes vertical channels through the backplate to control air damping. The device described in this paper has 3 rings of 16 holes per ring (Model No. M00120T), but other configurations can allow for more or less air damping.
It is worth noting that while the published technical data on the mechanical response of the MEMS DMs provide an estimate of the static and dynamic performance that is possible, it does not provide quantitative information on residual error that may be expected when driving to an actual prescription on the DM, or, just as important, how quickly the residual error will settle when switching from one prescription to another. Our testing directly measures these important performance measures.
To know which Zernike modes will be most important in order to compensate systematic aberrations, we performed a Zemax simulation of an optical system that comprised the MEMS mirrors, relays, scan lens, tube lens, and a representative 25× 1.0 numerical aperture (NA) water immersion objective lens selected from the patent literature. 16 The MEMS mirrors are modeled as Zernike fringe surfaces, with the Zernike coefficients treated as variables for optimization. The focus control mirror is capable of a stroke of 15 μm, which corresponds to an 80-μm focus adjustment using NA ¼ 1.0 in an aqueous sample, using the equation 17 E Q -T A R G E T ; t e m p : i n t r a l i n k -; s e c 2 . 1 ; 3 2 6 ; 3 8 9 Δf where Δf is the focus adjustment, d is the peak to valley deflection of the MEMS DM, n is the refractive index of the sample, and NA is the numerical aperture of the objective lens. Simulations were carried out over this full 80 μm axial depth and for a lateral field of view of 500 μm. We used an effective NA ¼ 0.92 in our simulations.
The dominant aberrations of the optical system that the DMs must correct are coma Z 3;1 and spherical aberration Z 4;0 [we use the American National Standards Institute (ANSI) Z n;m indexing scheme for radial order n and azimuthal frequency m], arising from the fact that the active focus control makes the objective lens operate at a focus location other than its optimum working distance. Other off-axis aberrations also come into play when the galvo scanners steer the beam to larger scanning angles, with appreciable contributions from both the relay optics and the objective lens. The simulation results show significant astigmatism Z 2;2 , secondary astigmatism Z 4;2 , secondary coma Z 5;1 , trefoil Z 3;3 , and secondary spherical aberration Z 6;0 . The range of simulated aberration coefficients are summarized in Table 1. Note that we are using the "unnormalized" polynomials for our Zernike basis, given explicitly here: E Q -T A R G E T ; t e m p : i n t r a l i n k -; s e c 2 . 1 ; 6 3 ; 5 8 7 Defocus∶ Z 2;0 ðρ;θÞ ¼ 2ρ 2 − 1; Astigmatism∶ Z 2;2 ðρ;θÞ ¼ ρ 2 cos 2θ; The higher-order aberrations are within the deflection range that can be compensated by the Boston Micromachines multi-DM with a 1.5-μm stroke operating as the "tweeter," with defocus and spherical aberration handled by the Revibro Optics mirror as the "woofer." Based on these simulations, we chose to characterize astigmatism, coma, and trefoil on the BMC multi-DM in order to include both lower-order and higherorder shapes for comparison of the dynamic responses. For completeness, we also characterized primary spherical aberration using that mirror. Defocus and primary spherical aberration were characterized on the Revibro Optics DM.

Characterization by Stroboscopic Phase Shift Interferometry Synchronized to Mirror Movement
Stroboscopic interferometry can effectively freeze high-speed motion when the light pulses are sufficiently short and synchronized with the periodic movement of the MEMS DMs. In this case, exposure time is controlled by the laser pulse width rather than the integration time of the camera. The MEMS DM is driven with a periodic waveform. With proper delay, the pulsed laser diode illuminates the DM only at one specific phase of the periodic motion. The pulse width of the illumination is set short enough so as to maintain high fringe contrast for accurate phase unwrapping during data processing. We have constructed a custom phase-shifting Michelson interferometer for dynamic testing (Fig. 4). The sync hardware includes four function generators (two SRS DS345, HP 33120A, Sony Tektronix AFG320), which are capable of being controlled remotely. In order to ensure that the illumination takes place at the right phase of each periodic cycle, arbitrary waveforms for delays and laser pulse triggering are created and called through the control software. The control software is developed under the Labview environment, which interfaces to all the hardware including the function generators, a pulsed laser driver (DEI PCX-7410), camera, and piezo-electric stage.
To control the BMC multi-DM, we use the high-speed Xdriver with X-CL™ PCIe Interface Card. An SMA connector on the PCIe card allows external triggering to synchronize the movement of the DM and the strobe pulse. The 140 actuators on the BMC DM are set digitally, within the MATLAB environment, by assigning a matrix of values from 0 to 65535 mapped to a voltage range from 0 to 300 V. On the other hand, the Revibro DM is driven entirely in analog. For this, a two-channel function generator (Sony Tektronix AFG320) and a two-channel high speed high voltage amplifier (Trek 603 Piezo Driver/Power Amplifier) are coupled to provide the voltage needed for the electrostatic actuation of the metal coated polymer membrane on the Revibro DM. Although this mirror has four concentric actuation electrodes, potentially allowing fine control over higher-order spherical aberration (secondary spherical aberration Z 6;0 and tertiary spherical aberration Z 8;0 ), for dynamic testing, we connected the central two and outer two electrodes together to form a two-zone mirror. The two-zone control was sufficient to modulate primary spherical aberration independently from the focus setting.

Mirror Training
With a phase-shifting Michelson interferometer, we are able to capture the surface height of the DMs. For analysis, the surface height is fit to 55 spatially orthogonal aberration modes (the unnormalized Zernike modes, up to order n ¼ 10), with the surface deflection S reconstructed according to S ¼ P n;m a n;m Z n;m ðρ; θÞ. Since the commercially available DMs do not come with a mapping between surface shapes and control voltages, the first task was to train the mirror to the target shapes we elected to test.
An iterative algorithm was used to find the control voltages that produced a single Zernike mode of desired amplitude while suppressing all other terms. In brief, the algorithm is as follows. A target surface shape was calculated for the desired mode. The Table 1 The dominant aberrations over a 500 μm field of view and full 80 μm focus range, from our Zemax model. The numbering of the Zernike terms follows the ANSI Z n;m indexing scheme for radial order n and azimuthal frequency m. mirror surface deflection was then measured using the interferometer, and the height of a region near the center of each actuator zone was compared to the target for that location. The control voltage V i is updated according to V 2 i;nþ1 ¼ V 2 i;n þ αϵ i;n , where ϵ i;n is the error between the target height and the measured height and V i;n is the control voltage, for the i'th zone and the n'th iteration. The gain parameter α is chosen to facilitate convergence of the algorithm. We work with the square of the voltage, since the electrostatic force varies as the square of the applied voltage. It should be noted that because the BMC mirror and the Revibro mirror are electrostatically actuated they can be deflected only in one direction. On the other hand, the Zernike modes exhibit both positive and negative displacements. We, therefore, bias the mirror with an initial deflection, with the Zernike mode superimposed on that initial shape. For the BMC mirror, this initial deflection is an "active flat" surface with each actuator deflected to 50% of the rated 1.5 μm maximum deflection. For the Revibro mirror, the initial deflection is a midrange defocus setting that is purely parabolic in shape.
We were successful in training each of the test modes, with residual contribution from all other modes less than 20 nm rms.
Height maps from these trained shapes on the BMC multi-DM are shown in Fig. 5 (all mode amplitudes in the figure are 400 nm). Similarly, control voltages were determined to train both defocus and primary spherical aberration on the Revibro mirror.

Zernike mode frequency response
For continuous intrascan correction of aberrations such as coma or astigmatism, the time dependence of any particular wavefront shape will be nearly periodic, synchronized to the fast-scan mirror. In order to quantify the capability of the DM, we chose to measure a sinusoidal steady-state frequency response for specific aberration modes. The mode amplitude is varied sinusoidally at a particular frequency, and the mirror response is measured in terms of amplitude and phase delay of that specific mode relative to the driving waveform. These are plotted versus frequency using a Bode style plot.
As shown in Fig. 6, a sampled sinusoidal signal at frequencies ranging from near DC to several kHz drives the MEMS DM. For the BMC DM, a pulse triggers a new voltage map Fig. 4 The system setup for dynamic testing using stroboscopic phase-shift interferometry. Fig. 5 (a) Standard Zernike shapes trained on the BMC multi-DM using a closed loop feedback training process. From left to right, astigmatism, coma, defocus, primary spherical, and trefoil. The amplitude a n;m for these standard Zernike shapes is 400 nm. The residual rms error on these shapes is 5, 19, 7, 20, and 12 nm for astigmatism, coma, defocus, primary spherical, and trefoil, respectively. (b) 300 nm primary spherical aberration superimposed on 3 μm defocus trained on the Revibro DM. Scale bars show height in nm.
Journal of Biomedical Optics 121507-5 December 2016 • Vol. 21 (12) to be assigned to the 140 actuators, with 12 shapes per period comprising the stepwise sinusoidal trajectory. For example, in the figure, the mirror is driven to 12 different amplitudes of trefoil, with the amplitude following a sinusoidal time dependence. Synchronously, the phase-shifting interferometer strobe is progressively set to six different sampling delays, generating six different height maps. Each height map is decomposed into Zernike modes, and the measured amplitude of the mode of interest is then curve fit to find the magnitude and the phase relative to the driving phase. Using the X-driver and high speed camera card (X-CL™ PCIe Interface Card) we can update the BMC voltage map at a maximum speed of 400 kHz. This sets a maximum sinusoidal test frequency of 400∕12 ¼ 33 kHz. Our tests included a maximum sinusoid frequency of 12.5 kHz.

Zernike mode step response
To capture fast transients of the MEMS DM with a periodic square-wave driving signal, we use a short laser diode pulse ranging from 400 ns to 1 μs. The short pulse width ensures that averaging during image acquisition on the charge coupled device camera will not degrade the fringe contrast of the interferogram. As shown in Fig. 7, a pulse train with a proper delay has been created to capture 100 points spanning 200 μs during the rising edge and falling edge for the step response.

RMS surface error
Under the weak aberration limit, a Strehl intensity I ≥ 0.8 (diffraction limited) corresponds to an rms wavefront error less than 1∕14 of the operating wavelength. Therefore, when plotted against time, the rms error can function as a good indicator to tell not only how fast the mirror can achieve the desired shape, but also how soon the MEMS DM can compensate the target aberration to achieve diffraction-limited imaging. After the Zernike shape fitting, we are able to gather a matrix that contains the amplitudes of each Zernike polynomial, from which the residual rms error is calculated using the following equation: Error rms ¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi X n;m ½N n;m ða n;m − a n;m target Þ 2 ; r where a n;m is the amplitude of each Zernike term from the surface height fitting, a n;m target is the amplitude of the target shape of the specific Zernike mode, and N n;m is the rms normalization factor of the Zernike polynomial for the specific term Note that our error is for the mirror surface, so in order to maintain a wavefront error less than λ∕14 we must keep the mirror surface height error to less than λ∕28, since the mirror is used at near normal incidence where the wavefront retardation upon reflection is twice the mirror height variation. Assuming a two-photon excitation wavelength of λ ¼ 1.0 μm, the error threshold for λ∕28 is 36 nm rms. This threshold value is used when analyzing the error relaxation responses. 3 Results

BMC Multi-DM
3.1.1 Frequency response Figure 8 plots the magnitude and phase response for five different Zernike modes on the BMC multi-DM. The results show that astigmatism, defocus, and trefoil exhibit a 3-dB frequency near 6.5 kHz. Coma has a 3-dB frequency closer to 7 kHz, while spherical aberration has the largest 3 dB bandwidth near 10 kHz. All modes were driven with the same 400 nm amplitude, but the membrane shapes are different, as are the peak-to-peak deflections. Defocus, astigmatism, coma, and trefoil all have peak-to-peak displacements of the membrane equal to twice the Zernike amplitude (800 nm), while spherical aberration has a peak to peak displacement of 1.5 times the amplitude (600 nm). The higher 3-dB frequency of spherical aberration thus seems to correlate to a smaller peak-to-peak membrane deflection, but the damping due to air flow beneath the membrane is important, and its dependencies on mode shape and amplitude have not been separated here. It is noteworthy that the frequency response for all modes shows a smooth roll-off with no peaking, indicating that these mirrors are over-damped and exhibit no resonances at least up to 12.5 kHz.

3.1.2
Step response Figure 9 shows step response measurements for five different Zernike modes. Each mode was driven from the active flat membrane position to the mode shape with a 400-nm amplitude. Rise times (10% to 90%) are calculated and tabulated in Table 2. Rise times measured for all five aberration modes ranged from 44 to 61 μs. By computing the rms surface deviation from the final target shape, we can plot rms surface error versus time in an error relaxation plot. Although the step height for each mode has the same 400 nm amplitude, these are the nonnormalized Zernike modes and so exhibit a different rms deviation. That is reflected in the starting rms error value for each of the five modes. Note that the RMS error includes the error contribution from all modes, including the mode that is being stepped; the full transient membrane shape is accounted for. A meaningful metric is the error settling time, when the overall mirror rms error is less than λ∕28, corresponding to Maréchal's criterion for Strehl ≥ 0.8. With λ ¼ 1.0 μm, this limit is 36 nm rms, which is indicated by the solid red line in Fig. 9. Error settling time for all five of these mode steps is less than 42 μs. The results are tabulated in Table 3.
We also investigated the influence of mode amplitude on step response and error settling time. Figure 10 shows a family of step response curves for astigmatism with amplitudes ranging Fig. 7 Stroboscopic imaging for a step response. The submicrosecond illumination pulses capture the instantaneous movement of the rising edge during a step from flat to the target amplitude of a specific Zernike mode (trefoil shown in this figure). By using proper delays, we evaluate the full evolution of the mirror shape. from 100 to 500 nm, and also for −400 nm. Rise times range from 40 μs for the smallest step to 63 μs for the 400-nm step. Error settling times show a particularly strong dependence on mode amplitude, since the threshold of 36 nm error is barely exceeded for the full amplitude 100 nm astigmatism step.
Even the 500 nm astigmatism step settles to within the 0.8 Strehl limit within 46 μs. Table 2 summarizes the rise times, and Table 3 summarizes the wavefront error settling times for all five tested modes for amplitudes from 100 to 500 nm and for −400 nm. Within this range of correction, all of the steps reach the threshold for diffraction-limited precision in less than 52 μs.

3.2.1
Step response Figure 11 plots the response for five different defocus steps of the Revibro DM. The peak-to-peak deflection is twice the Zernike amplitude, so that 1-and 7.5-μm steps correspond to mirror sags of 2 and 15 μm, respectively. We see that the step response is somewhat underdamped with a slight overshoot, so that the error plots show some oscillation. The smaller step Fig. 9 Step response for different tested Zernike modes at a step from 0 to 400 nm in amplitude on the BMC multi-DM (referred to the right side y-axis). The rms error is also plotted against time for each Zernike mode step (referred to the left y-axis). The solid line at 36 nm RMS error is the threshold to recover to 80% Strehl, according to the Marechal's criterion (λ ¼ 1.0 μm).  10 Step response for different amplitudes of astigmatism on BMC multi-DM and the RMS error is plotted against time for astigmatism on BMC multi-DM at its rising edge during a step response.  11 Step response of active focus control with Revibro MEMS DM at 0 to 1, 0 to 3 μm, 2.9 to 3.1 μm, 0 to 5, and 0 to 7.5 μm. The RMS error is also plotted against time at the rising edge of a step response for different amplitudes in focus control on the Revibro multi-DM.
Journal of Biomedical Optics 121507-8 December 2016 • Vol. 21 (12) from 2.9 to 3.1 μm also shows a slight overshoot. Rise times (10% to 90%) range from 28 to 39 μs for these tests. Because of the ringing in the step response, the settling times are a bit longer for the larger focus steps, all of which require at least 76 μs (up to 226 μs for maximum deflection at 7.5 μm) to reach a diffraction-limited shape. The smaller defocus step from 2.9 to 3.1 μm has an error that settles much faster in about 32 μs. The rise times and settling times for defocus on the Revibro mirror are summarized in Table 4.
Finally, we measured the step response for a change in spherical aberration Z 4;0 on the Revibro mirror. We characterized mode amplitudes of 200, 400, and 600 nm. These are superimposed on a defocus bias of 3 μm (6-μm mirror sag). The results are plotted in Fig. 12. More ringing is observed for these steps, showing that the spherical aberration shape is less damped in this free-standing membrane. The rise times are quite short, less than 15 μs. The error settling times are variable, ranging from 13 to 45 μs, affected by the oscillation in the step response. The rise times and error settling times for primary spherical aberration on the Revibro DM are summarized in Table 5.

Discussion and Conclusions
We evaluated MEMS DMs from BMC and Revibro Optics to assess the dynamic performance for active focus control and aberration correction in an active/adaptive two-photon microscope. We observed that both of the mirrors could be trained to the desired shapes with a small rms error 20 nm or less for these low-order aberrations.
For smoothly changing aberrations, such as systematic aberrations that depend on the scan angle of the beam, sinusoidal steady-state frequency response may be a useful metric. As shown in the results for the BMC multi-DM, the 3-dB frequency was at least 6.5 kHz for all modes tested, and as high as 10 kHz for spherical aberration. While not measured directly here, the 3-dB frequency for both defocus and spherical aberration correction using the large stroke Revibro Optics mirror are calculated from the measured step response to be in excess of 9 kHz. In the context of on-the-fly focus adjustment during beam scanning, these mirrors should be able to adjust focus over the full DM deflection range and compensate aberrations for simple oblique sections or other "simple" focus profiles when scanning at low kHz scan rates using a nonresonant galvo scanner. This is the most typical setup for two-photon imaging. With a resonant scanner, these mirrors could likely support only moderatedepth oblique sections at frequencies up to 8 kHz, since larger deflections are more heavily damped. Active focusing and aberration correction during high-speed (8 kHz) scanning remains an open question requiring further experimental investigation.
For scan profiles that are discontinuous when scanning the beam across the sample, we may consider the rise time and rms error settling time as useful metrics. Examples of discontinuous scans might be different focus depths within the imaging field of view, or multiple adaptive zones within the frame, that require resetting the aberration correction prescription multiple times during a horizontal line scan. Similarly, a fast scan retrace during a sawtooth scan waveform might require a reset of the DM prescription. We found that error settling times are consistently less than 50 μs for both the BMC and the Revibro mirror for aberration correction and small defocus steps; smaller steps settle considerably faster. Larger defocus steps on the Revibro mirror required longer to settle: 76 μs for a 3-μm step, 138 μs for a 5-μm step, and 226 μs for a 7.5-μm step. Even the largest defocus step will settle to a diffraction-limited profile in the time it would take a galvo scan mirror to finish its retrace in our hypothetical 1 kHz sawtooth scanning system with a 750-μs forward scan and 250-μs retrace.
The measured dynamic performance of both the BMC mirror and the Revibro Optics mirror demonstrates that these mirrors can support intrascan correction during active/adaptive microscopy at scan rates up to about 1 kHz. With this control of both focus and aberrations, we can achieve nearly arbitrary focal spot trajectories at this speed in the tissue, turning the two-dimensional scanning microscope into an agile 3-D imaging tool. Furthermore, we hope to combine this agile scanning with adaptive correction of sample-induced aberrations to ultimately  Fig. 12 The step response for different amplitudes in spherical aberration correction on the Revibro MEMS DM. The RMS error (excluding defocus) during the step response is also plotted (referred to the y -axis on the left side). deliver diffraction-limited imaging throughout the accessible 3-D object space.