# Experiments of two pupil lateral motion tracking algorithms using a Shack-Hartmann sensor

Xiaolin Dai, Stefan Hippler, Eric Gendron

► To cite this version:

Xiaolin Dai, Stefan Hippler, Eric Gendron. Experiments of two pupil lateral motion tracking algorithms using a Shack-Hartmann sensor. Journal of Modern Optics, 2016, 64 (2), pp.127-137. 10.1080/09500340.2016.1212415. obspm-02268044

HAL Id: obspm-02268044

https://hal-obspm.ccsd.cnrs.fr/obspm-02268044

Submitted on 22 Aug 2022

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_2.png" /></figure>

# Experiments of two pupil lateral motion tracking algorithms using a Shack-Hartmann sensor

Xiaolin Dai, Stefan Hippler & Eric Gendron

To cite this article: Xiaolin Dai, Stefan Hippler & Eric Gendron (2017) Experiments of two pupil lateral motion tracking algorithms using a Shack-Hartmann sensor, Journal of Modern Optics, 64:2, 127-137, DOI: 10.1080/09500340.2016.1212415

To link to this article: https://doi.org/10.1080/09500340.2016.1212415

<figure><img src="image_3.png" /></figure>

© 2016 The Author(s). Published by Informa UK Limited, trading as Taylor & Francis Group

<figure><img src="image_4.png" /></figure>

Published online: 21 Jul 2016.

<figure><img src="image_5.png" /></figure>

Submit your article to this journal

<figure><img src="image_6.png" /></figure>

<figure><img src="image_7.png" /></figure>

Article views: 254

<figure><img src="image_8.png" /></figure>

View related articles

<figure><img src="image_9.png" /></figure>

<figure><img src="image_10.png" /></figure>

View Crossmark data

<figure><img src="image_11.png" /></figure>

<figure><img src="image_12.png" /></figure>

Citing articles: 1 View citing articles

<figure><img src="image_13.png" /></figure>
<figure><img src="image_14.png" /></figure>

<figure><img src="image_15.png" /></figure>

OPEN ACCESS

# Experiments of two pupil lateral motion tracking algorithms using a Shack-Hartmann sensor

Xiaolin Dai<sup>a,b</sup>, Stefan Hippler<sup>a</sup> and Eric Gendron<sup>c</sup>

<sup>a</sup>Max-Planck Institute for Astronomy (MPIA), Heidelberg, Germany; <sup>b</sup>Laboratory of Adaptive Optics, Institute of Optics and Electronics, Chinese Academy of Sciences, Chengdu, China; <sup>c</sup>LESIA, Observatoire de Paris, Université Paris Diderot, Paris, France

## ABSTRACT

Pupil stability is one of the factors which limit the performance and operational stability of adaptive optics (AO) systems. This paper analyses two pupil-tracking methods to measure the lateral pupil shift: the first one utilizes the fluxes in all outer edge sub-apertures of a Shack-Hartmann sensor and the second one utilizes the real-time interaction matrix used in an AO system. Experiments with 9×9 Shack-Hartmann sensor are conducted to verify both pupil-tracking algorithms. The results show that both algorithms are effective, after two correction steps, the residual pupil shift is reduced to less than 5% of a Shack-Hartmann sub-aperture.

## ARTICLE HISTORY

Received 1 April 2016
Accepted 7 July 2016

## KEYWORDS

Adaptive optics; pupil-tracking; Shack-Hartmann wavefront sensor; interaction matrix

## 1. Introduction

Nowadays, adaptive optics (AO) has become one of the key technologies for large ground-based telescopes (1) and has been adopted in almost all 8-10 m class telescopes to improve their optical quality while observing through the turbulent atmosphere. To make full use of the AO system, the wavefront sensing channels and correcting device channels need to be registered precisely during closed-loop operation to guarantee optimal performance of the AO system (2).

GRAVITY is an AO-assisted beam combiner for the second generation very large telescope (VLT) interferometer (VLTI) instrumentation (3,4) within which there is a system named Coudé infrared adaptive optics (CIAO) (5,6) used to ensure the required wavefront quality for the interferometer. Figure 1 shows the schematic of a CIAO system, in total four CIAO units are available for GRAVITY to correct the wavefronts of the beams of the four telescopes of VLT. For each telescope, after being corrected by the deformable mirror (MACAO DM), the light is split into two parts by the Star Separator: the light of the wavefront reference (star) goes into the near-infrared (IR) wavefront Sensor, which composes the AO system together with the MACAO DM. The light of the object and the reference star goes into the Beam Combiner Instrument, where they interfere with the corresponding signals from other telescopes.

Misalignments or the motions of the optical elements between the deformable mirror and the Shack-Hartmann wavefront sensor (SHWFS) can induce both lateral and

rotational pupil shifts during the telescope's operation. These shifts lead to the mis-registration between the optical pupils defined by the DM and the wavefront sensor sub-apertures which are registered to the actuators of the DM. As a result, pupil shift can lead to the loss of light as well as the degradation of the performance of the AO system (7). This paper focuses on the lateral pupil shift in the CIAO system which exists between the DM and SHWFS. A pupil actuator (field lens) located in CIAO cryostat can be used to stabilize the pupil position (8) (Figure 2). This requires a precise measurement of the actual pupil position.

This paper analyses two pupil-tracking methods: Section 2 describes the first method which utilizes the fluxes in all outer edge sub-apertures of the Shack-Hartmann sensor and Section 3 describes another method which utilizes the real-time interaction matrix obtained during the closed-loop control of the AO system. Experiments are conducted to verify these two methods; the results are shown, respectively, in Sections 2 and 3. In Section 4, we make a comparison of these two algorithms. Section 5 summarizes our conclusions.

## 2. The intensities method

### 2.1. Principle of the intensities method

The CIAO SHWFS is used here to illustrate the method. We use the 9×9 square microlens array of the CIAO SHWFS (Figure 3) to measure the integrated fluxes in certain sub-apertures and detect whether the pupil is shifted.

<figure><img src="image_16.png" /></figure>
<figure><img src="image_17.png" /></figure>

<figure><img src="image_18.png" /><figcaption>**Figure 1.** Schematic overview of the CIAO system.</figcaption></figure>

<figure><img src="image_19.png" /><figcaption>**Figure 2.** Optical path inside the CIAO WFS cryostat. After entering the entrance window, the beam passes through a field lens (mounted on an X-Y piezo stage – N-111 NEXLINE OEM Linear Actuator) which can shift the pupil on two orthogonal directions, an achromatic doublet, and a filter (mounted in a filter wheel), before imaging the pupil on the lenslet array and the detector.</figcaption></figure>

In the intensities method, we choose the fluxes in the 24 outer edge sub-apertures to measure the pupil shift.

The integrated fluxes of the sub-apertures are marked with $O_1, O_2, \dots, O_{24}$ (outer ring sub-apertures) and $I_1, I_2, I_3, I_4$ (inner ring sub-apertures). When the lateral pupil shift is smaller than the length of a sub-aperture, the pupil's central position $P_X$ and $P_Y$ can be calculated via Equations (1) and (2):

$$P_X = \frac{\sum_{i=1}^{24} O_i \cdot \cos \theta_i}{\sum_{i=1}^{24} O_i} \quad (1)$$

$$P_Y = \frac{\sum_{i=1}^{24} O_i \cdot \sin \theta_i}{\sum_{i=1}^{24} O_i} \quad (2)$$

where $\theta_i$ is the angle between the centre of the sub-aperture $O_i$ and X-axis (Figure 3).

## 2.2. Result of the experiment using the intensities method

We use the CIAO SHWFS in the laboratory to perform the experiment. As shown in Figure 3, the fluxes in the
<figure><img src="image_20.png" /></figure>

24 outer edge sub-apertures of the 9×9 Shack-Hartmann sensor are used to measure the pupil shift. Due to the internal optical alignment of the wavefront sensor as well as the stroke of the pupil actuator, we could only introduce a lateral pupil shift between -0.4 and 0.4 in the length of a sub-aperture on the SHWFS, which corresponds to a shift of -0.36 to 0.36 m on the VLT's primary mirror.

<figure><img src="image_21.png" /><figcaption>**Figure 3.** Schematic of the CIAO lenslet array with pupil coverage. The grey circles define the ring-shaped illuminated area of the lenslet array, which ideally matches the geometrical size of the VLT's M8 pupil.</figcaption></figure>

To verify the performance of the algorithm, we conduct the following experiment: we move the pupil's centre along Y-axis from -0.4 to 0.4 sub-aperture while keeping the pupil's centre on X-axis fixed at different values. We measure 200 frames of fluxes in the SHWFS at each position, and then use the intensities of all the 24 outer edge sub-apertures of each pupil's position to calculate pupil's shift $P_Y$. Finally, we compare $P_Y$ with the applied shift to evaluate the performance of this algorithm. To compensate the deviation in the measurement of the pupil shift caused by the non-uniformity of the illumination in the pupil, a flat-field calibration is implemented. The measurement of pupil shift on X-axis is similar to the measurement of pupil shift on Y-axis. The result of the experiment is shown in Figure 4.

Figure 4 shows that the measurement of the pupil shift on Y-axis is quite precise when 'shiftx' = 0 (the dot-dash-line), the maximal deviation is less than 0.05 sub-aperture. The deviation of the measurement gets larger as 'shiftx' departs from 0.

We adopt the maximal deviation between the measured pupil shift and the applied pupil shift to be the indicator to evaluate the performance of the algorithm. The result is shown in Figure 5. As the range of the applied pupil shift on Y-axis shrinks from ±0.4 (–0.4 to 0.4 sub-aperture) to 0, while keeping ‘shiftx’ at 0, the maximal deviation (dotted curve) reduces from 0.042 to 0, other curves which represent different ‘shiftx’ also have the same tendency. On the other hand, as ‘shiftx’ varies from –0.4 to 0, the average values of the curves also decline, which means the deviation

<figure><img src="image_22.png" /><figcaption>**Figure 4.** Variation of measured pupil shift $P_Y$ on Y-axis by the intensities method due to the applied pupil shift ‘shifty’ on Y-axis while keeping pupil’s shift on X-axis ‘shiftx’ at different values. The dashed line represents the ideal result of the measured pupil shift.</figcaption></figure>
<figure><img src="image_23.png" /></figure>

<figure><img src="image_24.png" /><figcaption>**Figure 5.** Variation of the maximal deviation between the measured and applied pupil shift on Y-axis due to the stroke/range of the applied pupil shift on Y-axis. The diamond blocks mark the residual pupil shifts after each correction.</figcaption></figure>

of the measurement is reduced when ‘shiftx’ decreases. The results of the measurements, when ‘shiftx’ varies from 0 to 0.4, are not shown here because they are basically the same with the results when ‘shiftx’ varies from 0 to -0.4.

The maximum of the maximal deviations of the measured pupil shift in Figure 5 is 0.095 sub-aperture (the diamond block marked with ‘1st correction’). It means for an initial pupil shift within -0.4 to 0.4 sub-aperture on both axes, the residual pupil shift after one pupil shift correction will decrease to under 0.095 sub-aperture. Furthermore, this residual deviation decreases to less than 0.01 sub-aperture (the ‘2nd correction’ diamond block) after performing the correction for the second time. In CIAO, the budget of the wavefront error caused by the misalignment between the DM and the SHWFS is 50 nm, which corresponds to a residual pupil shift after the correction of 10% of the length of a sub-aperture (9,10). As the smaller the pupil shift is, the better the CIAO system works, here we adopt a stricter demand: 5% of the length of a sub-aperture – this could be achieved within two correction steps with the intensities method when the initial pupil shift on both axes are within -0.4 to 0.4 sub-aperture.

## 2.3. Using additional sub-apertures

For completeness, we consider another similar algorithm in which the four inner sub-apertures are also utilized. The formulas of this algorithm are:

$$P_X = \frac{\sum_{i=1}^{24} O_i \cdot \cos \theta_i}{\sum_{i=1}^{24} O_i} - 2 \frac{\sum_{i=1}^{4} I_i \cdot \cos \theta_i}{\sum_{i=1}^{4} I_i} \quad (3)$$

$$P_Y = \frac{\sum_{i=1}^{24} O_i \cdot \sin \theta_i}{\sum_{i=1}^{24} O_i} - 2 \frac{\sum_{i=1}^{4} I_i \cdot \sin \theta_i}{\sum_{i=1}^{4} I_i} \quad (4)$$

The factor 2 in Equations (3) and (4) is to normalize the value of the formula to 1 or -1 when the pupil shift is an entire sub-aperture in either positive or negative direction.

We analyse the data with this algorithm to compare it with the former one which just utilizes the outer sub-apertures. The result is shown in Figure 6. Compared with Figure 4, although when ‘shiftx’ = 0, the precision of the measurement in Figure 6 is pretty high, it degrades when ‘shiftx’ departs from 0 – even approaches about 0.15 sub-aperture when ‘shiftx’ = -0.4 and ‘shifty’ = 0.4 – which means the precision of the algorithm degrades fast when the pupil shift departs from the axes. As a result, in general, the performance of the algorithm which only utilizes the fluxes in the 24 outer sub-apertures is better than the one which utilizes the fluxes in both inner and outer sub-apertures.

## 2.4. Error discussion

### 2.4.1. Integration time

Disturbances and noises such as the atmosphere turbulence (to simulate the atmosphere turbulence in the actual observation, an artificial turbulence with a seeing of 0.5 arcsec is added in the experiment), photon noise and detector noise can induce errors to the measurement of the pupil shift and these errors can be reduced
<figure><img src="image_25.png" /></figure>

<figure><img src="image_26.png" /><figcaption>**Figure 6.** Variation of measured pupil shift on Y-axis with the intensities method which utilizes both the 4 inner and 24 outer sub-apertures due to the applied pupil shift on Y-axis while keeping pupil's shift on X-axis at different values. The dashed line represents the ideal result of the measured pupil shift.</figcaption></figure>

<figure><img src="image_27.png" /><figcaption>**Figure 7.** Variation of the variance of measured pupil shifts due to the number of frames gathered in the experiment.</figcaption></figure>

by gathering more frames of data in the experiment (in other words, extending the integration time). Assume $\sigma_{P_x}^2$ is the variance of the measurement signal $P_x$, to detect a pupil shift as small as 5% of a sub-aperture, $\sigma_{P_x}^2$ needs to be less than $10^{-4}d^2$ with $d$ as the length of a sub-aperture (which means an average measurement error of about 1% sub-aperture).

We test the impact of the number of gathered frames in our experiment on the variance of the measured pupil shift for the intensities algorithms. The result is shown in Figure 7 (grey curve).

The grey curve in Figure 7 shows that the variance of the measurement for the intensities algorithms decreases as more frames are gathered. If we want to reduce $\sigma_{P_x}^2$ to
<figure><img src="image_28.png" /></figure>

<figure><img src="image_29.png" /><figcaption>**Figure 8.** Comparison of the measured pupil shifts on Y-axis due to the applied pupil shift before and after the flat-field calibration. 'shiftx' = 0.</figcaption></figure>

less than $10^{-4}d^2$, the least number of frames that should be gathered for the intensities method is 150. In fact, we set the number to 200 in our experiment. As the frequency of the AO closed-loop operation is 500 Hz, the integration time is 0.4 s.

### 2.4.2. Non-uniformity of the illumination of the pupil

The pupil in the experiment is not illuminated uniformly, this non-uniformity leads to deviation in the intensities method – it causes a deviation of 0.13 sub-aperture – when the pupil's centre is at the original point.

A flat-field calibration is implemented to eliminate the deviation and it records the intensities in the sub-apertures when the pupil's centre is at the original point. Every frame of intensity data has to be divided by this calibration frame before further process. Figure 8 shows the comparison of the measurements of the pupil shift before and after the flat-field calibration with 'shiftx' = 0. The deviation caused by the non-uniformity of the illumination in the pupil is significantly eliminated after implementing the flat-field calibration.

### 2.4.3. Precision of the pupil actuator

The pupil position located on the lenslet array of the SHWFS is moved via a pupil actuator based on an internal piezo walk mechanism. The precision of this actuator determines the precision of the applied pupil shift in the

<figure><img src="image_30.png" /><figcaption>**Figure 9.** Distribution of the deviation of the pupil actuator (field lens).</figcaption></figure>

experiment. As the length of a sub-aperture of the SHWFS in our experiment corresponds to a pupil actuator motion of 300 µm and we want the deviation caused by the pupil actuator to be smaller than 1% of a sub-aperture, the location precision of the actuator needs to be smaller than 3 µm. We test the error distribution for this actuator in the stroke -0.4 to 0.4 sub-aperture, the result is shown in Figure 9.

The error distribution of the actuator complies with a Gaussian distribution whose mean value is -0.08 µm and standard deviation is 0.21, thus the precision of the actuator is -0.50 to 0.34 µm with a confidence interval of
<figure><img src="image_31.png" /></figure>

95% – which is much smaller than 3 µm, as a result, the deviation caused by the pupil actuator can be neglected in our analysis.

### 2.4.4. Pupil rotation

Pupil rotation can lead to the change of the intensities' distribution in the SH sensor. But in our experiment, the piezo walk mechanism can only move the pupil along two orthogonal directions, therefore the pupil rotation is negligible.

<figure><img src="image_32.png" /></figure>

## 3. The matrix method

### 3.1. Principle of the matrix method

The matrix method computes the pupil shift by comparing two interaction matrices (IM) of the DM which are measured, respectively, before and during the closed-loop AO operation. The former IM is also called the nominal IM ($M_0$) which is obtained when the applied pupil shift is zero.

Figure 10 shows the structures of matrix $M_0$ in CIAO SHWFS, as each of the 68 sub-apertures has two tilts ($X$

<figure><img src="image_33.png" /><figcaption>**Figure 10.** Schematics of $M_0$ with pupil coverage. The grey circles define the ring-like illuminated area of the lenslet array. Only the 68-squared sub-apertures with at least 50% of their area covered by the pupil are used for wavefront sensing. $M_0$ is decomposed to $M_{0x}$ (left figure) and $M_{0y}$ (right figure). $S_{xij}$ and $S_{ij}$ ($i=1,2,\dots,60; j=1,2,\dots,68$) are the tilts in the valid sub-apertures on $X$ and $Y$ directions of every actuator. ($M_1$ has the same structure with $M_0$, but its tilts are signed as $S'_{xij}$ and $S'_{ij}$).</figcaption></figure>

<figure><img src="image_34.png" /><figcaption>**Figure 11.** Schematics of $dM_{0x}$ (left figure) and $dM_{0y}$ (right figure), which are obtained by differentiating $M_{0x}$ and $M_{0y}$ on $X$ and $Y$ directions. $dS_{xij}$ and $dS_{ij}$ ($i=1,2,\dots,60; j=1,2,\dots,68$) are the differentiations of $S_{xij}$ and $S_{ij}$ in $M_{0x}$ and $M_{0y}$.</figcaption></figure>
and Y directions), $M0$ can be decomposed into $M0_X$ and $M0_Y$. Because there are 60 actuators on the back of the DM and each actuator has its own IM, both $M0_X$ and $M0_Y$ are $60 \times 68$ matrices. The DM's IM varies when the pupil shifts during the closed-loop AO operation. Let $M1$ be the real-time DM's IM obtained during the closed-loop AO operation, $M1$ has the same structure as $M0$ and can be decomposed into $M1_X$ and $M1_Y$.

To apply the matrix algorithm, we need to differentiate the matrix $M0$ on X and Y directions to get two new matrices, $dM0_X$ and $dM0_Y$, which represent $M0$'s gradients on the two directions. Figure 11 shows the structures of $dM0_X$ and $dM0_Y$. As with $M0_X$ and $M0_Y$, both $dM0_X$ and $dM0_Y$ are $60 \times 68$ matrices.

The matrix method uses $M0$, $M1$ and $dM0$ to calculate the pupil shift. Assume a pupil shift ($P_X$, $P_Y$) which is much smaller than the length of a sub-aperture and the corresponding real-time IM obtained in the AO closed-loop control is $M1$. Because the shift is small, we have:

$$ \begin{aligned} M0_X + dM0_X \cdot (-P_X) &= M1_X \\ M0_Y + dM0_Y \cdot (-P_Y) &= M1_Y \end{aligned} \qquad (5) $$

Equation (5) with least square estimation, $P_X$ and $P_Y$ can be written as:

$$ \begin{aligned} P_X &= -(dM0_X^T \cdot dM0_X)^{-1} \cdot dM0_X^T \cdot (M1_X - M0_X) \\ P_Y &= -(dM0_Y^T \cdot dM0_Y)^{-1} \cdot dM0_Y^T \cdot (M1_Y - M0_Y) \end{aligned} \qquad (6) $$

As $P_X$ or $P_Y$ is just a number instead of a matrix, Equation (6) can be written as:

$$ P_X = -(M1_X - M0_X)/dM0_X = - \frac{\sum_{i=1}^{60} \sum_{j=1}^{68} \frac{S_{x'j} - S_{xjj}}{dS_{xjj}}}{60 \times 68} \qquad (7) $$

$$ P_Y = -(M1_Y - M0_Y)/dM0_Y = - \frac{\sum_{i=1}^{60} \sum_{j=1}^{68} \frac{S_{y'j} - S_{yjj}}{dS_{yjj}}}{60 \times 68} $$

## 3.2. Result of the experiment using the matrix method

We conduct the experiment of the matrix method on the CIAO bench in the lab. As shown in Figure 3, there are 68 sub-apertures in the SH sensor, each sub-aperture can measure the average wavefront slopes at X and Y directions in every frame. The deformable mirror (MACAO DM) has 60 actuators and we need to measure the voltages applied to the 60 actuators to calculate the real-time IM. Assume a DM command $C_{comm}$ and the SHWFS's measurement $W_{meas}$ after performing $C_{comm}$, we have:

$$ W_{meas} = M1 \cdot C_{comm} + T_{turb} \qquad (8) $$

where $T_{turb}$ is the atmosphere turbulence during the SHWFS's measurement and $M1$ is the real-time interaction matrix. Furthermore, we have:

$$ \Delta_{\text{meas}} = M1 \cdot \Delta_{\text{comm}} + \Delta_{\text{turb}} \qquad (9) $$

where:

$M1$ is the real-time IM (dimension: $136 \times 60$),

$\Delta_{\text{meas}}$ is the difference between two successive SHWFS measurements (dimension $136 \times 1$),

$\Delta_{\text{comm}}$ is the difference between two successive DM command vectors (dimension $60 \times 1$),

$\Delta_{\text{turb}}$ is the turbulence increment between the two successive frames

We are able to measure a wealth of pairs ($\Delta_{\text{meas}}$, $\Delta_{\text{comm}}$) by acquiring slopes and voltages data. As $\Delta_{\text{turb}}$ is uncorrelated from $\Delta_{\text{comm}}$, it can be considered just like a 'noise' term. Thus, getting plenty of measurements allow us to solve Equation (9) for $M1$ by the least square estimation. Assume $\Delta_M = [\Delta_{\text{meas1}} \ \Delta_{\text{meas2}} \ \dots \ \Delta_{\text{measN}}]$ and $\Delta_C = [\Delta_{\text{comm1}} \ \Delta_{\text{comm2}} \ \dots \ \Delta_{\text{commN}}]$ with $N$ the number of frames acquired, $M1$ can be calculated:

$$ M1 = \Delta_M \cdot \Delta_C^T \cdot (\Delta_C \cdot \Delta_C^T)^{-1} \qquad (10) $$

The experiment is conducted as follows: move the pupil's centre along Y-axis from -0.4 to 0.4 sub-aperture while keeping the pupil's centre on X-axis fixed at different values. We measure 2000 frames of the slopes in the 68 sub-apertures of the SH sensor and the voltages of the 60 actuators during the closed-loop control at each pupil position, then make use of the slopes and voltages to calculate $M1$ with Equation (10). Finally, we compute the pupil shift by comparing $M1$ with the nominal IM $M0$ using Equation (7).

The result of the experiment is shown in Figure 12: the matrix method works well when 'shiftx' is small, but its precision degrades fast as 'shiftx' departs from 0, the maximal deviation reaches more than 50% when 'shiftx' = -0.4. To evaluate the performance of the measurement, we adopt the maximal deviation between the measured pupil shift and the applied pupil shift to be the indicator. As the deviation of the measurement is too high, when the pupil centre gets far from the original point, we verify this algorithm's performance when the applied pupil shift is within only -0.2 to 0.2 sub-aperture on both axes. The result is shown in Figure 13.

Figure 13 shows that the average values of the curves decline when 'shiftx' varies from -0.2 to 0, in addition the maximal deviations also decrease as the range of applied pupil shift on Y-axis ('shifty') shrinks from ±0.2 (-0.2 to 0.2 sub-aperture) to 0. The deviation of the pupil shift measured by this algorithm decreases fast after applying multiple pupil shift corrections. The two diamond blocks in Figure 13 show that an initial pupil shift within -0.2 to 0.2 sub-aperture on both axes can be reduced to 0.097
<figure><img src="image_35.png" /></figure>

<figure><img src="image_36.png" /><figcaption>**Figure 12.** Variation of measured pupil shift on Y-axis $P_y$ with the matrix method as a function of the applied pupil shift on Y-axis 'shifty' while keeping pupil's shift on X-axis 'shiftx' fixed at different values. The dashed line represents the ideal result of the measured pupil shift.</figcaption></figure>

<figure><img src="image_37.png" /><figcaption>**Figure 13.** Variation of the maximal deviation between the measured and applied pupil shift on Y-axis measured by the matrix method due to the stroke/range of the applied pupil shift on Y-axis. The diamond blocks mark the residual pupil shifts after each correction.</figcaption></figure>

and 0.036 length of a sub-aperture after 1 and 2 pupil shift correction steps, which means the requirement on residual pupil shift ~ 5% of the sub-aperture ~ can be achieved within two correction steps with the matrix method.

### 3.3. Error discussion

#### 3.3.1. Integration time

We test the impact of the number of gathered frames in our experiment on the variance of the measured pupil shift
<figure><img src="image_38.png" /><figcaption>**Table 1.** Comparison of the intensities algorithm and the matrix algorithm.</figcaption></figure>

<table><thead><tr><th>Comparison/Algorithm</th><th>Intensities algorithm</th><th>Matrix algorithm</th></tr></thead><tbody><tr><td>Valid Range</td><td>Large</td><td>Small</td></tr><tr><td>Correction Frequency</td><td>High</td><td>Low</td></tr><tr><td>Object Brightness Requirement</td><td>High</td><td>Low</td></tr><tr><td>Suitable Situation</td><td>Bright Object, High-Frequency Correction and Large Pupil Shift</td><td>Faint Object, Low-Frequency Correction and Small Pupil Shift</td></tr></tbody></table>

for the matrix algorithm. The result is shown in Figure 7 (black curve).

The black curve in Figure 7 shows the variance of the measurements for the matrix algorithm decreases as more frames are gathered. To reduce $\sigma_{p_x}^2$ to less than $10^{-4}d^2$, the least number of frames that should be gathered is 1100. In fact, we set the number to 2000 in our experiment. As the frequency of the AO closed-loop operation is 500 Hz, the integration time is 4 s.

### 3.3.2. Pupil rotation and the precision of the pupil actuator

Pupil rotation can lead to the mis-registration seen by the interaction matrix of the AO system. But in our experiment, the piezo walk mechanism can only move the pupil along two orthogonal directions, thus the pupil rotation is negligible.

The pupil actuator used in the experiment for the matrix method is identical with the one used for the intensities method. Thus, the result of the test shown in 2.4.3 is still valid here, which means the deviation caused by the pupil actuator can be neglected in the experiment of the matrix algorithm.

## 4. Comparison of the two algorithms

Table 1 shows the comparison of the two algorithms. Firstly, in our experiment, the deviation of the matrix algorithm reaches more than 50% when the pupil shift's range exceeds -0.2 to 0.2 sub-aperture, while the intensities algorithm can keep the deviation lower than 25% within the range -0.4 to 0.4 sub-aperture, thus the intensities algorithm has a larger valid range. Secondly, compared with the matrix algorithm's 4 s integration time, the intensities algorithm only needs a 0.4 s integration time, which makes it more suitable for those situations which need high-frequency pupil corrections. Thirdly, unlike the intensities algorithm, the matrix algorithm does not directly utilize the fluxes in the sub-apertures, thus it has a lower requirement on the brightness of the observed object and is more suitable for observing faint science objects.

Generally, the intensities algorithm works better in situation with bright object, high-frequency pupil correction and large pupil shift, while the matrix algorithm is more

suitable for situation with faint object, low-frequency pupil correction and small pupil shift.

## 5. Conclusion

We analyse two pupil-tracking methods which can measure the lateral pupil shift with a SH sensor based on AO system. The first one utilizes the fluxes in all outer edge sub-apertures of a Shack-Hartmann sensor and the second one utilizes the real-time interaction matrix obtained during closed-loop operation of the AO system. We conduct two experiments with the CIAO system to verify these pupil-tracking algorithms. The results of the experiment show that both algorithms are effective, after two correction steps, the residual pupil shift is reduced to less than 5% of a sub-aperture. The intensities algorithm works better in situation with bright object, high-frequency pupil correction and large pupil shift, while the matrix algorithm is more suitable for situation with faint object, low-frequency pupil correction and small pupil shift.

## Disclosure statement

No potential conflict of interest was reported by the authors.

## References

(1) Davies, R.; Kasper, M. Adaptive Optics for Astronomy. Annu. Rev. Astron. Astrophys. 2012, 50, 305–351.

(2) Montagnier, G.; Fusco, T.; Beuzit, J.-L.; Mouillet, D.; Charton, J.; Jocou, L. Pupil Stabilization for SPHERE’s Extreme AO and High Performance Coronagraph System. Opt. Exp. 2007, 15, 15293–15307.

(3) Eisenhauer, F.; Perrin, G.; Brander, W.; Christian Straubmeier; Karine Perraut; António Amorim; Markus Schöller; Stefan Gillessen; Pierre Kervella; Myriam Benisty; Constanza Araujo-Hauck; Laurent Jocou; Jorge Lima; Gerd Jakob; Marcus Haug; Yann Clénet; Thomas Henning; Andreas Eckart; Jean-Philippe Berger; Paulo Garcia; Roberto Abuter; Stefan Kellner; Thibaut Paumard; Stefan Hippler; Sebastian Fischer; Thibaut Moulin; Jaime Villate; Gerardo Avila; Alexander Gräter; Sylvestre Lacour; Armin Huber; Michael Wiest; Axelle Nolot; Pedro Carvas; Reinhold Dorn; Oliver Pfuh; Eric Gendron; Sarah Kendrew; Senol Yazici; Sonia Anton; Yves Jung; Markus Thiel; Élodie Choquet; Ralf Klein; Paula Teixeira; Philippe Gitton; David Moch; Frédéric Vincent; Natalia Kudryavtseva; Stefan
<figure><img src="image_39.png" /></figure>

Ströbele; Eckhard Sturm; Pierre Fédou; Rainer Lenzen; Paul Jolley; Clemens Kister; Vincent Lapeyrère; Vianak Naranjo; Christian Lucuix; Reiner Hofmann; Frédéric Chapron; Udo Neumann; Leander Mehrgan; Oliver Hans; Gérard Rousset; Jose Ramos; Marcos Suarez; Reinhard Lederer; Jean-Michel Reess; Ralf-Rainer Rohloff; Pierre Haguenauer; Hendrik Bartko; Arnaud Sevin; Karl Wagner; Jean-Louis Lizon; Sebastian Rabien; Claude Collin; Gert Finger; Richard Davies; Daniel Rouan; Markus Wittkowski; Katie Dodds-Eden; Denis Ziegler; Frédéric Cassaing; Henri Bonnet; Mark Casali; Reinhard Genzel; Pierre Lena. GRAVITY: Observing the Universe in Motion. *Messenger* **2011**, *143*, 16–24.

(4) Gillessen, S.; Eisenhauer, F.; Perrin, G. GRAVITY: A Four-
telescope Beam Combiner Instrument for the VLTI. *Proc.
SPIE* **2010**, *7734*, 77340Y.

(5) Kendrew, S.; Hippler, S.; Brandner, W. GRAVITY Coudé Infrared Adaptive Optics (CIAO) System for the VLT Interferometer. *Proc. SPIE* **2013**, *8446*, 84467W.

(6) Scheithauer, S.; Brandner, W.; Casey P. Deen; Tobias Adler; Henri M. Bonnet; Pierre Bourget; Fanny Chemla; Yann Clénet; Françoise Delplancke-Stroebele; Monica Ebert; Frank Eisenhauer; Michael Esselborn; Gert Finger; Éric Gendron; Adrian Glauser; Frédéric Yves

Joseph J. Gonté; Thomas Henning; Stefan Hippler; Armin
Huber; Zoltan Hubert; Gerd Jakob; Liselotte Jochum;
Laurent Jocou; Sarah Kendrew; Ralf Klein; Johann Kolb;
Martin Kulas; Werner Laun; Rainer Lenzen; Marcus
Mellein; Eric Müller; Javier Moreno-Ventas Mateos; Udo
Neumann; Sylvain Oberti; Jürgen Ott; Laurent Pallanca;
Johana Panduro; José R. Ramos; Miguel Riquelme;
Ralf-Rainer Rohloff; Gérard Rousset; Nicolas Schuhler;
Marcos Suárez Valles; Gérard Zins. CIAO – Wavefront
Sensors for GRAVITY. *Proc. SPIE* **2016**, 9909. Submitted
for publication.

(7) Clénet, Y.; Gendron, E.; Rousset, G. Dimensioning the Gravity Adaptive Optics Wavefront Sensor. *Proc. SPIE* **2010**, 7736, 77364A.

(8) Deen, C.; Yan, P.; Huber, A. Integration and Bench Testing for the GRAVITY Coude IR Adaptive Optics (CIAO) Wavefront Sensor. *Proc. SPIE* **2014**, 9148, 91482T-1.

(9) Hippler, S.; Brandner, W. VLTI GRAVITY Phase C: *Wavefront Sensor System Design*; Technical Report of ESO Project GRAVITY, Doc No. VLT-TRE-GRA-15881-5101: Heidelberg, **2014**.

(10) Clenet, Y.; Gendron, E. VLTI GRAVITY Phase C: Wavefront Sensor Adaptive Optics Performance; Technical Report of ESO Project GRAVITY, Doc No. VLT-TRE-GRA-15882-5201: Heidelberg, **2012**.