A strategy for sensing the petal mode in the presence of AO residual turbulence with the pyramid wavefront sensor

Context. With the Extremely Large Telescope (ELT) generation of telescopes come new challenges. The complexity of these tele-scopes’ pupils creates new problems for adaptive optics (AO) that prevent the telescopes from reaching the theoretical resolutions that their size allows. In particular, the large spiders necessary to support the massive optics of these telescopes create discontinuities in the wavefront measurement. These discontinuities appear as a new phase error dubbed the “petal mode.” This error is described as a differential piston between the fragment of the pupil separated by the spiders and is responsible for a strong degradation in the imaging quality, reducing the European ELT’s resolution to that of a 15m telescope. Aims. The aim of this paper is to study the measurement of the petal mode by AO sensors. In particular, we want to understand why the pyramid wavefront sensor (PyWFS), the first-light wavefront sensor of any ELT-generation telescope, cannot measure this petal mode under normal conditions, and how to enable this measurement by adapting the AO control scheme and the PyWFS. Methods. To facilitate our study, we considered a simplified version of the petal mode, featuring a simpler pupil than the ELT. This allowed us to quickly simulate the properties of the petal mode and its measurement by the PyWFS. We studied specifically how a system that separates the atmospheric turbulence from the petal measurement would behave. Studying the petal mode’s power spectral density, we proposed using a spatial filter to reduce the contribution of AO residuals to the benefit of petal mode contribution, eventually enabling it to be measured. Finally, we demonstrated our proposed system with end-to-end simulations. Results. A solution proposed to measure the petal mode is to use an unmodulated PyWFS (uPyWFS), but the uPyWFS does not make accurate measurements in the presence of atmospheric residuals. A spatial filtering step, consisting of a pinhole around the pyramid tip, reduces the first path residuals seen by the uPyWFS and restores its accuracy. This system was able to measure and control the petal mode during the end-to-end simulation. Conclusions. To address the petal problem, a two-path AO with a sensor dedicated to the measurement of the petal mode seems necessary. The question remains as to what could be used as the second path petalometer. Through this paper, we demonstrate that an uPyWFS can confuse the petal mode with the residuals from the first path. However, adding a spatial filter on top of said uPyWFS makes it a good petalometer candidate. This spatial filtering step makes the uPyWFS less sensitive to the first path residuals while retaining its ability to measure the petal mode.


Introduction
Due to the atmospheric turbulence, building a telescope bigger than 15 centimeters in visible light improves only in its capacity to collect more light, but not in the angular resolution.Telescopes bigger than this threshold have to use Adaptive Optics (AO) to compensate for the effect of the atmosphere before the light reaches the science instruments.This AO compensation step allows one to restore the diffraction limit and the gain in resolution offered by a larger primary pupil.The next generation of 30m-class telescopes is under construction and will have AO capability from the first light.In particular, in this paper, we focus on the Extremely Large Telescope (ELT) (Cayrel (2012)).
To meet the challenge of the size of these new telescopes, the classical AO wavefront sensor, the Shack-Hartmann (SH), is less adapted.Its separation of the pupil in multiple subpupils makes it less sensitive for each subpupil, as shown by Vérinaud (2004).To produce a diffraction-limited Point Spread function (PSF) on a larger telescope, the number of actuators needed, and consequently, the number of subpupils required for the measurement increase.The SH becomes more susceptible to noise and hence not adapted to low flux regimes.Furthermore, the SH needs more pixels to the point where it is not compatible with current AO cameras.As a result, the SH is being replaced by a new kind of WaveFront Sensor (WFS) for Single Conjugated Adaptive Optics (SCAO), where our only source of light is a Natural Guide Star (NGS).This kind of WFS is called the Pyramid Wavefront Sensor (PyWFS), proposed by Ragazzoni (1996), and is employed in the SCAO mode of each 30m-class telescope.
The utility of SCAO is to provide high-quality wavefront correction near a bright natural guide star.Specifically, the most demanding science case for such a system is the search for exoplanets, which requires high AO performance to detect faint objects close to their stars.The PyWFS allows the ELT-class telescopes to reach their diffraction limit and angular resolution with fainter targets than a SH.
Simulations of the HARMONI SCAO module taking the ELT pupil and the segmented M4 (Schwartz et al. (2017) ) showed a new limit to the SCAO performances, with differential piston appearing between the pupil fragment separated by the large spiders of the ELT.This is due to the inability of the SCAO system to measure this differential piston and the absence of constraints on this differential piston with a segmented DM.Owing to its occurrence in multiple systems, this effect has been specifically termed the 'petal mode basis', which is a linear combination of the differential pistons between the pupil fragments.This effect can be greatly reduced by adding constraints on the ELT deformable mirror, using techniques such as minioning (originally called slaving) or a continual DM basis Bertrou-Cantou et al. (2020).
This adjustment reduces the differential piston to an atmospheric turbulence contribution under the spider rather than across the entire pupil.In this configuration, the turbulence is predominantly influenced by the size of the spider, and the r 0 .In Fig. 1a, we simulate how the petal residuals of an AO loop using a modulated pyramid are impacted by the petal mode with minioning of the DM actuators (done in the simulation by using a continuous DM).In particular for the ELT-size spider at 50cm, with 15cm r0 (not plotted), we observe a mean petal residuals of 80nm Peak-To-Valley (PTV) in residual phases (= 40nm rms).When we correct by the amplitude change caused by ϕ(r 0 ) ∝ 1 (r 0 ) 5/3 , as shown in Fig. 1b we see that the amplitude of petal is directly proportional to the phase amplitude of the atmosphere.For the current SCAO instruments, this level of petal residuals falls within error budgets.
There are multiple questions about the origin of the petal mode and ways to mitigate it.One possibility is to study the efficiency of different reconstructors.As this paper is tackling the petal problem by improving the sensor's measurement of petal mode, we used the simplest wavefront reconstruction available for our sensor: a matrix linear reconstruction using Intensity map, as presented in Fauvarque et al. (2016).It has been shown by Bertrou-Cantou (2021) that an MMSE reconstructor exhibits similar performances to a minioned DM basis with a linear reconstructor, as reported in Schwartz et al. (2018).Notably, using a sensor that is not sensitive to the petal mode-such as the Shack-Hartmann in a centre of gravity measurement mode, or when the subapertures are smaller than the spider-can still significantly reduce the petal mode.However, the petal will achieve errors comparable to the remaining petal flares in a minioning system, as observed in Bonnefond et al. (2016).
We detail in Sect.2.2 the different sources of petal modes and why this approach is not suited for all of them.While effective for first-light instruments with purely atmospheric turbulence as the wavefront error, this method will not be adequate for all sources of petal mode.Additionally, it will not meet the error budget for second-generation instruments equipped with Extreme Adaptive Optics (EXAO).This paper will aim to understand why the pyramid wavefront sensor cannot measure the petal mode and propose a second path in the AO system dedicated to petal mode sensing.We separate here the problem of the ELT phasing of the segments of the ELT (the 798 x 1.45m hexagonal mirrors which we don't consider) and the phasing of the fragments of the pupil (the 6 areas separated by the spiders).This would allow the measurement of residual petal mode after minioning and the measurement of exterior petal mode like Low Wind Effect (LWE) (explained in Sec.2.3), allowing EXAO instruments into the ELT.For the system to be quickly adaptable to an ELT instrument, we will use the same wavelength constraint as the HARMONI instrument with a sensing wavelength of 850nm.
Article number, page 2 of 18 As it must measure the fast-evolving atmospheric turbulence petal modes, it needs to be an AO-type sensor with a high sensitivity and linear reconstruction, so we will start with the already used AO sensor as the baseline for this paper.

Petal Properties
To reach the diffraction limit the petal mode would need to be lower than a few tens of nanometers in the residuals.
Uncorrected petal mode creates light residuals in the PSF comparable to slit interference patterns.The resolution on long exposure (with completely uncorrected petal mode) is then limited not by the size of the pupil of the telescope, but by the size of one fragment (≈15m).This means petal mode can be responsible for a loss of resolution up to N fragment .With the atmospheric petal only, the loss of resolution is not of this order, as the mode does not reach high values.However, LWE petal is expected to reach values over λ.From the differential piston between each fragment, we can define a petal mode basis constituted of 5 orthogonal petal modes for the ELT (as appears in Bertrou-Cantou et al. (2022)).One particularity of the petal mode is that although it appears in the residual after an AO stage, it can be projected on modes that are measured and compensated by the AO stage.The most obvious is Tip-Tilt, onto which a lot of the ELT petal modes (or the one from our simplified pupil seen in Fig. 2) can be projected.One might be tempted to orthogonalize this petal mode with the other mode of the basis.As the petal mode can be described in phase space as a Heaviside function, this can be done with an infinity of modes.The resulting petal, orthogonalized to a Zernike mode basis, will tend to a discontinuity phase mode around the spider.The orthogonalized petal mode resulting in this operation becomes very different from the mode appearing in AO residuals, such as Schwartz et al. (2018).To preserve the same mode as our studied mode, we choose to retain the original differential piston petal mode definition.However, to avoid confusion with other modes during phrase reconstruction, we also calibrate the basic Zernike modes (like tip-tilt, see Sec. 3.2 for more details).To simplify the problem, we will consider a pupil with only one spider and, consequently, only one petal mode.

Toymodel
For a simplification of the problem, we will study a simplified pupil with a single spider and only 2 fragments and therefore only have 1 petal mode.This simple case scaled to a 10m diameter telescope can be simulated with a coarser sampling and considerably reduces our computational time.To keep the representativity of the ELT case it uses the following parameters: Spider size = 50cm.20x20 DM (same pitch of a DM actuator = 50cm as the ELT M4).
The petal mode is shown in Fig. 2. We note that this petal is defined with an RMS amplitude of 1 radian and thus has a PTV of 2 radians between the left and right fragment.To stay consistent throughout this article, we will use an RMS unit for petal mode.With this normalization, an amplitude of π radians RMS means a PTV of 2π radians, hence a λ OPD wrap.

Sources of petal mode
As was shown by Bertrou-Cantou (2021), the petal mode is badly sensed by the modulated PyWFS.This means an effect akin to the waffle mode can appear where the mode is amplified by the reconstruction of the AO.Furthermore, if the DM can create this mode, it will create loop instabilities.As the petal mode in this case comes from the AO loop and in particular its control, it evolves as fast as the AO correction.It is currently solved by a technique called minioning (Bond et al. (2022)).This technique acts on the control part of the AO loop by forbidding the creation of any differential piston by the DM.The remaining error is the atmospheric petal which exists under the spider.This residual atmospheric petal's amplitude depends on the size of the spider and the r 0 as was shown in the introduction in Fig. 1a.There are 2 problems with this approach.First, this approach only works for atmospheric turbulence petalling.As the petal is not measured if it comes from other sources than atmospheric turbulence it will not fall within the acceptable first light instruments constraints.Then for the Extreme Adaptive Optic (EXAO) system, this is not an acceptable level of residual wavefront error.For a coronographic system for instance, while it is possible to design coronographs less impacted by this type of wavefront error ( Leboulleux et al. (2022)), it is at the cost of inner working angle.
Another source of petal mode in the phase is the LWE.It is a phenomenon that was discovered on the VLT during the first light of the SPHERE instrument and described in Sauvage et al. ( 2015)).This effect was mitigated on the VLT by improving the emissivity of the spider (i.e. the temperature of the spider is close to the temperature of the environment), but with the larger spiders of the ELT-class telescopes, LWE is expected to be stronger.A simulation of the airflow around the spiders has recently shown a 1µm OPD around the spiders according to Martins et al. (2022), much larger than the petal residual after minioning.As the LWE is poorly understood we will consider it in this paper only as an uncontrolled source of petal mode.It will appear in the end-to-end simulation as a brutal petal mode appearing in the phase.It is to be separated from the atmospheric petal as it is a perturbation created by the telescope and not by the atmosphere though the final phase mode is equivalent.

Wavefront sensing measurement problem
The petal mode being a differential piston, means that in monochromatic light the whole phase screen wraps every λ.This makes a petal larger than λ impossible to detect correctly with a monochromatic sensor and thus the petal mode has a 'built-in' limited range of measurements.This comes back to a phase-unwrapping problem, that we leave aside for the study presented here.In this paper, we only consider monochromatic light and test whether a measurement can be done accurately in ELT conditions.
Article number, page 3 of 18 Any slope sensor will not be able to measure the petal mode in a subpupil.It is not a problem when the spiders are small like on the VLT where the petal created by the spiders is negligible.But with 50cm spiders, it becomes a mode large enough to decrease EXAO performances.Phase sensors like the Zernike Wavefront Sensor (ZWFS) or the unmodulated PyWFS (uPyWFS) have been proposed as their intrinsic response is more sensitive to phase discontinuities.However, their dynamic is not large enough to measure the atmosphere at the same time.
There are two ways to solve the petal problem proposed in the literature: modify the AO wavefront sensor, or add an additional sensor dedicated to measuring the petal mode, a petalometer.The first solution appears in the METIS instrument.This instrument senses the Wavefront at a longer wavelength.Thanks to a lower turbulence phase and more linear sensor, it doesn't show any petal mode in its residuals (see Hippler et al. (2019) and Carlomagno et al. (2020)).Another solution is the flip-flop method proposed by Engler et al. (2022) where the modulation of the PyWFS is cut to use a temporary uPyWFS and measure the petal mode in the residual.
The GMT has opted for the second solution with the development of the Holographic Dispersed Fringe Sensor (HDFS, see Haffert et al. (2022)), a sensor dedicated to the phasing of the GMT mirrors.
Moving all AO systems to IR looks like a simple solution but there are a lot of advantages to keeping the sensing in the visible light.IR detectors are slower and noisier than their visible counterparts, meaning fainter stars can be used as NGS by visible systems.Astronomical observations are mainly using IR for most of the first-light instruments.We make our simulation with the wavelength used in the HARMONI instrument: 850nm.We instead study the petalometer approach in the rest of this paper.
Article number, page 4 of 18

2-Path AO system
As was shown by Bertrou-Cantou (2021) the uPyWFS produces a strong signal for the petal mode even in the presence of spider compared to the modulated PyWFS.However, it is not able to measure the petal mode accurately among the whole atmospheric turbulence for a realistic r 0 .It is proposed instead to use the uPyWFS to measure the petal mode among the residuals of an AO loop, as a petalometer.The question in this part is whether the uPyWFS can reconstruct accurately the petal mode among AO residuals.To test this capability we analyze the petal mode reconstructed by the PyWFS used as a petallometer with the 2path system shown in Fig. 3.
There is a single Deformable Mirror (DM) correcting the aberrations in the AO loop.This mirror is described by a modal basis including a pure petal mode of our toymodel pupil, as well as Gaussian influence functions of a 20x20 regular actuator grid.The Gaussian influence functions are controlled by the modulated PyWFS and are dedicated to the atmospheric turbulence compensation.The second path includes a petalometer which controls the pure petal mode of the DM.Diverse sensors could be proposed as petalometers for the second path.As we know that the uPyWFS is a possible alternative in terms of sensing, we use it in this first test.The uPyWFS only controls the petal mode though it can measure other modes.
The first source of petal mode is atmospheric turbulence.We use this configuration to take advantage of the reduced atmospheric petal mode in the residuals after a first stage using a minioning DM.The petalometer aims to measure and allow the control of both atmospheric petals and LWE.We also added a fixed petal after some iterations to simulate LWE.

uPyWFS petal mode reconstruction
We use the Intensity Map method described in Fauvarque (2017) so using all the pixels.The linearity curves presented later have been reproduced with the slopes map method and have given the same results.There does not seem to be a preferred method for measuring petal mode.The first step is to calibrate the interaction matrix of our system.We create this interaction matrix by simulating the Intensity map for a variety of modes.For the atmospheric control, the calibrated phase modes will be the zonal base of the 400 actuators.For the petal mode interaction matrix, we need not only to measure the petal mode but also other Zernike modes in particular tip and tilt to avoid confusion between these low-order modes and the petal modes.In practice, we calibrate a modal basis containing the Petal mode + 30 Zernikes phase modes.
with I(ϕ) the intensity on the PyWFS detector for a given phase ϕ ϵ a factor small enough to work in the linear regime of the PyWFS.
In simulation, we use 10 − 10 δI(ϕ) is the push-pull intensity map of the mode ϕ Article number, page 5 of 18 D = (δI(ϕ 1 ), ..., δI(ϕ i ), ..., δI(ϕ N )) (2) See equation 1 for the computation of δI(ϕ 1 ) Then the interaction matrix is inverted using a Moore-Penrose pseudo inverse to get the control matrix D † .We use a conditioning number of 100.Assuming small phase we should have the relationship : We express any phase as its decomposition on the modal basis used with a i the amplitude of the mode with âi the estimated amplitude of the mode ϕ i .

Linearity curve of petal mode reconstruction
We want to test the measurement of petal mode with a PyWFS used as a petalometer.To that end, we compute the linearity curve to a petal mode first without AO residuals to set the ideal case, and then with typical AO residuals.To plot this linearity curve we take a given phase screen and add a given petal mode amplitude, varying between [−π : π].As we are using monochromatic light the signal is wrapped outside of these boundaries and computing the linearity curve for higher amplitude is of no use.
In the absence of residuals we see the expected result previously shown by Esposito et al. (2003): with â1 the estimated petal mode amplitude for an input of a 1 expressed in rms value.This expression emphasizes the wrapping of the petal mode estimation with monochromatic light.In the absence of residuals, there is no difference in whether there is a spider or modulation as these are noiseless tests.We see here the intrinsic non-linearity of the PyWFS and specifically the non-linearity of the petal mode itself.The linearity of both modulated and uPyWFS is tested here because the first question that arises with any feature is whether the feature would remain with a modulated pyramid.However, it is inefficient for a real system to try to reconstruct petal mode with a modulated PyWFS and we only keep this curve to demonstrate that the problem remains.We simulate the AO residuals with an AO loop using the parameters summed up in table 1.As the petal mode has very high frequency parts aliasing could be the source of a lot of issues.To reduce that problem we will be using a large oversampling here with 100x100 subapertures.All the further results have been confirmed with a 20x20 subapertures case.The resulting residuals have an amplitude of 120nm RMS and give a 55% SR at the top of the pyramid.The residuals are simulated without a spider and filtered from petal mode to make sure that the further injected petal will be the only petal mode present in the phase.The tip-tilt which could be changed by the petal mode filtering has a negligible amplitude as it is already phase residuals and has an RMS amplitude of 14nm.
The resulting linearity curves are very different between the unobstructed pupil and toymodel case as seen in Fig. 4. In the unobstructed pupil case, we see mostly the Optical Gains (OG) (Fig. 4b) g which reduce the amplitude of the reconstructed petal Article number, page 7 of 18 Amplitude of petal mode in phase (in rad) reference sine function Fig. 5: Linearity curve with 10 independent residuals with uPyWFS mode.We can make a separation here between the optical gains coming from all the other modes present in the residuals g, and the optical gain coming from the petal mode itself, the sin function.â1 = g * sin(a 1 ).( 7) With the spider present, the linearity curves are offset.It means that the uPyWFS measures a petal mode amplitude when there is no petal mode in the phase, it confuses another mode with petal mode.This confused mode is seen in the linearity curve as a fixed offset value added to the sinusoidal that we note c and call the "Petal Confusion".Furthermore, as is shown in Fig. 5, c depends on the AO residual.
The typical amplitude of petal confusion c is a few tenths of a radian, which makes the value reconstructed by the PyWFS for a null input very far from the true value of petal (0 here).We need to understand this parameter to use the petalometer efficiently.c is computed by taking the mean of the linearity curve.There is also sometimes a term of dephasing appearing.The first possible origin of this dephasing would be a petal mode in the residuals, but in this simulation, we made sure to specifically filter it.We consider it as another defect of the reconstruction.Examples can be seen with various residual on Fig. 5 â1 = g * sin(a We also note that for some extreme cases the petal confusion is so large that the linearity curves only estimates non-zero values of petal mode.Its phase reconstruction doesn't cross the 0 petal mode measured line.Another important parameter is its speed.each curve plotted in Fig. 5 is separated by 500ms.The petal confusion changes fast with each phase screen.
Article number, page 8 of 18

Dependence of petal confusion to AO residuals
The first possible origin of this petal confusion comes from the non-linearity of the uPyWFS.We test the dependence of the petal confusion on the amplitude of AO residuals.To do so, we plot the petal confusion (as the average value of the linearity curve) with respect to the amplitude of AO residuals.The scaling parameter is a multiplier on the original AO phase residuals.To this end, we use the same residual phase screen as before and scale them by a multiplicative factor s ∈ [−1, 1].The dependence curve of c with respect to AO residuals is plotted in Fig. 6 as a function of this scalar.10 uncorrelated residual realizations were used and the curves of amplitude with scaling were averaged.When s is close to 0 we can write : c(s * ϕ) = s × c(ϕ).The petal confusion is very much a linear effect.

Origin of the petal confusion
The origin of the petal confusion seems nonetheless to be in the phase residuals.We have found a specific shape it takes for the PyWFS, but its effects were already reported for the PyWFS and Zernike wavefront sensor by Bertrou-Cantou et al. (2022).Furthermore, it seems to be a linear effect as was shown by the scalar test.The linearity of the confusion effect means we can construct the phase mode associated with it.
To that end, we compute a map of the confusion, e.g.how much each phase pixel creates petal confusion separately.As it is a linear effect we can then sum the petal confusion contribution of each pixel into a phase map.For this construction, we put all phase pixels at 0 except one which is at 1 rad.We orthogonalize this phase pixel to the petal mode to avoid our reconstruction creating petal mode.We use this phase as the residual and test the linearity of the petal mode with this residual.Then we compute the petal confusion caused by this pixel c x,y .We then plot the full map of confusion shown in Fig. 7.
This map, which we refer to as "confusion map", is expressed in phase space and can be interpreted as the phase mode responsible for the petal confusion.The mode creating petal confusion seems to have two distinct parts: a high-frequency line on each side of the spider (or discontinuity mode), and a low spatial frequency sinusoidal phase.This low-order mode comes from the number of modes Article number, page 9 of 18 calibrated in the interaction matrix for the reconstruction of the petal mode.This stems from the petal mode which can be projected on an infinity of spatial frequencies.The high-frequency signal always appears even with very high-frequency Zernike integrated in the petalometer interaction matrix.This mode is too high frequency to be controlled by our DM and cannot be separated from the rest of the typical AO residuals.As petal mode contains high frequency due to its discontinuity talking about a high frequency being reconstructed as a lower frequency is tricky but petal confusion (in particular the spider discontinuity component) can be seen as a form of aliasing.It is not a classical aliasing as oversampling the phase measurement was tested and doesn't solve the problem.
The conclusion of the analysis on petal confusion identification is there will always be some petal confusion that cannot be separated from residuals.Therefore to measure petal mode efficiently we need to reduce the effect of AO residuals to increase the accuracy of the petal mode measurement.

Reduce the impact of residuals on petal mode measurement
To reduce the impact of the residuals on the signal, a solution would be a longer integration time, or moving to a longer wavelength for sensing.This is not compatible with our original aim which was a fast measurement in the visible, so we need a new strategy to reduce the impact of residuals on the measurement.

Reduce the effect of residuals in phase space
We now compute the PSD of atmosphere contribution and the PSD of the petal mode.The residuals PSD is computed using the same first stage system as in part 4 and then their PSF are averaged over 1000 independent residual phase screens.We can see in Fig. 8 (solid lines) that they have a different distribution in the spatial frequency domain.The PSD of petal mode is plotted for the same RMS amplitude of petal mode as the RMS amplitude of residuals (120nm RMS).Residuals have lower PSD values than petal mode in the low spatial frequencies but dominate in the high spatial frequencies.So if one can filter selectively to keep only the low spatial Article number, page 10 of 18 frequencies, it makes the separation between the petal mode and residuals easier.One can consider the residual as a form of noise on our petal mode measurement, then we want to improve the SNR by filtering selectively the residuals.In the focal plane, there is already this organization by frequency and there is a focal plane already accessible when using a PyWFS: the tip of the PyWFS.We have a new kind of sensor adapted to be a petalometer: a spatially filtered uPyWFS (SF+uPyWFS).It is to be noted that Usuda et al. (2014) already proposed such a PyWFS for their second WFS channel to lift the λ uncertainty but with a reverse filtering.It was proposed for GMT to filter the low-order frequencies with a chip hiding the heart of the PSF.When looking at the PSD, the petal mode does indeed evolve differently at higher frequencies than the atmosphere or residuals.Due to the discontinuity in the phase, at high spatial frequencies, the petal mode PSD is over the atmospheric PSD for a comparable amplitude.In terms of petal confusion that would mean a reduction of the low-order part of the petal confusion so it would be interesting to test it in a further paper.
We simulate the effect of a spatial filter at the tip of the pyramid, as observed from the pupil phase.In this example, we start with the electric field in the entrance pupil plane, propagate it to a focal plane, use a focal plane filter (a circular pinhole), and propagate it to a pupil plane following Fig. 9a.
We then computed the PSD of residuals and petal mode after focal plane filtering (Fig. 8).The pinhole size used for this computation is 5λ/D of radius.
We see that the first path residuals are suppressed before the petal mode by this focal plane filter.The balance has to be found between reducing the first stage residual and keeping the spatial filter opened to let as much light as possible still.To decide what would be the best size of filter we can think in terms of Signal to Noise Ratio.The Signal we are interested in is the petal mode.The 'noisy signal' are the residuals.We compute the variance of residuals and variance of petal mode with different Spatial Filter size (SF size).With our simulation parameter, the 2λ/D spatial filter has the best phase SNR (see Fig. 9).However, having a small SF means limiting the intensity entering the WFS.There is a compromise to find here between SNR and loss of intensity.We make the following simulation with a 5λ/D spatial filter.With this spatial filter, we have a SNR of 4 and lose 50% of the intensity.In Fig. 9 curve we see a drop of SNR starting at 10λ/D.this is due to the residual of the AO (in particular the fitting error) which appears as the intensity at a spatial frequency higher than 10λ/D.In practice, the spatial filter doesn't filter the AO residuals anymore if it is larger than this radius.

effect of the spatial filter on PyWFS signal
A spatially filtered PyWFS (SF+PyWFS) is implemented in simulation.From a mathematical point of view, a SF+uPyWFS has a phase (PyWFS) and amplitude mask (SF) in the focal plane.A modulated PyWFS needs the spatial filtering step before the modulation step and is not simply a change of the focal plane mask.
Article number, page 12 of 18 The previous linearity test was done using the SF+uPyWFS as the second path petalometer (Fig. 10) There are two remarkable effects of spatial filtering.The first is less impact on the optical gains.As the spatial filter reduces the residuals drastically, the PyWFS is used in a regime closer to the low aberration approximation.Hence the linearity of the signal improves visible here as OG are closer to 1. Another effect is in the modes impacted by the spatial filter.The sensitivity to modes now drops when the spatial filter radius is under the spatial frequency of the mode.In Fig. 11 we compare the sensitivity of petal mode, a 3λ/D and 10λ/D sinusoïdal mode with respect to spatial filter size.The sensitivity drops fast once the modulation radius is under the spatial frequency of the phase mode.In Fig. 12 we computed the sensitivity of different SF+uPyWFS compared to uPyWFS (dark red curve).These two effects make the measurement of petal mode with a SF+uPyWFS more accurate, as is visible with multiple different residuals in Fig. 13.Compared to Fig. 5, the petal mode reconstruction is closer to the expected sinus reconstruction when using a SF+uPyWFS.

Performance on an AO system assisted by a petallometer
Finally we simulate the full system of the 2-path sensor to test the proposed concept of petalometer as presented in Fig. 3.We compare an uPyWFS and a SF+uPyWFS.The full system is described previously in Part 3. The AO first path sensor (a modulated PyWFS) controls the DM (with simple Gaussian continuous influence functions, 20x20 actuators), so it creates minioning type petal residuals.The petalometer commands a hypothetical DM with a pure petal mode as influence function.We subtract the atmospheric petal mode at frame 0 from the atmospheric phase screen during the whole loop to start from a 0 petal.Measuring the petal with a SF+uPyWFS is equivalent to using the pyramid in a full aperture gain mode (see Plantet et al. (2015)).With an optimized sensor, we can at least expect a flux distribution between AO-WFS and petal-WFS of 4000 / 6: number of modes used for AO, and number of petal modes.This would turn into a very small reduction (1/1000th in flux) in terms of system limit magnitude.On top of this, the characteristic times might be different between petal mode and atmosphere mode, depending on their origin.If the petal mode is slow enough (like Article number, page 13 of 18 Atmosphere + petal jump Fitting error minioning DM minioning DM + petal jump 2nd path uPyWFS 2nd path SF+uPyWFS Fig. 14: RMS error from atmosphere in black, first path AO residuals in green, first path assisted by uPyWFS-petalometer in blue and first path assisted by SF+uPyWFS-petalometer in magenta.A pure petal mode is added at frame 400 of 300nm PTV to simulate a petal mode exterior to the atmosphere.We see regular flares of the first path PyWFS while the SH+uPyWFS helps to keep the residual stable around zero petal during the whole sequence LWE for instance), its measurement can be averaged with time on a few frames of AO loop, allowing to reduce furthermore the flux taken for the petalometer path.Since we are using monochromatic PyWFS the best possible result is to have petal mode locked at its initial value (zero) during the whole simulation.A bad petalometer would not be able to lock the petal mode at a stable value.Furthermore, we add (starting at frame 400 = 0.4ms of simulation a 300nm RMS static petal mode in the atmospheric phase.The aim is to test if our proposed strategy can measure and compensate for petal mode from other sources than the atmosphere.The parameters are the same as in Table 1 and cover a 1s simulation.the results in RMS error and projected on petal mode are shown in Figs. 14 and 15 respectively The result shows that our continuous influence functions allow the petal mode to stay around zero in the presence of petal flares.The residuals are mostly dominated by fitting error (dotted red line) with petal mode on top of it.But if an exterior petal mode is added during the simulation it is not measured and remains uncorrected as shown by the difference between the green and dotted green line (respectively with and without the 300nm petal mode jump).The uPyWFS is not a good petalometer: due to the first path residuals it does not measure correctly the petal mode and jumps randomly of 2π petal mode value.We have shown that the SF+uPyWFS can measure correctly the petal mode surrounded by AO residuals, and use this measurement in a correction loop.Moreover, it is able to measure a sudden petal mode jump during the whole simulation.This 2-path system allows the AO to stay as close to the fitting error as possible.

Conclusion
When the 30m-Class telescopes will be completed and take their first scientific images, the petal mode will most certainly be an issue.Either for first light instrument where LWE is not controlled or for 2 nd generation instrument and in particular ExAO where the current petal is unacceptable.This paper proposed a new way to measure and control the petal mode in the loop using visible light.For this aim, we studied a 2-path system with one sensor dedicated to atmospheric turbulence measurement and a second one dedicated to the measurement of the petal mode.As a first proposed implementation we simulated a 2 path system using a modulated PyWFS for the atmospheric control and an uPyWFS as the petalometer.We showed that the residuals of the first path still prevent the accurate reconstruction of the petal mode even by an uPyWFS.Another step is needed to reconstruct accurately the petal mode.By analysing the spatial structure of the residuals and the petal mode we showed that a focal plane spatial filter can improve significantly the petal mode reconstruction.After simulation and optimization of the spatial filter size the spatial filter seemed to greatly improve our reconstruction.With end-to-end simulation we confirmed its interest as a petalometer, precise enough to lock petal mode during the AO loop and capable of measuring unexpected petal flares.The next steps are three fold.First the spatial filtering assisted reconstruction of petal mode should be tested on bench then on-sky using respectively the LOOPS bench Article number, page 16 of 18 0 200 400 600 800 1000 Iteration number -6 : -5 : -4 : -3 :  Other potential petalometer solutions can be proposed and would surely benefit from the spatial filtering step as well (interferometric measurement with a adapted number of observables).Finally the solution must also be optimized to real system: ELT and GMT proposed SCAO systems to prepare for the second generation of instruments.

Fig. 1 :
Fig. 1: Petal mode with variable r 0 and spider size.Fig. a): Petal variation for large spiders and variable r 0 in first stage residuals.For spiders larger than the pitch of the ELT DM, the petal mode increases quickly, Fig. b) : Petal variation for large spiders and variable r 0 in first stage residuals corrected of atmospheric turbulence amplitude.

Fig. 2 :
Fig. 2: Toymodel petal mode Fig. 3: 2 Path sensor scheme considered.The green path is dedicated to atmosphere wavefront sensing and features a modulated PyWFS and a classical 20x20 actuator DM.The blue path is dedicated to the sensing of petal mode and features an uPyWFS and controls only the petal mode of the DM

Fig. 4 :
Fig. 4: Linearity curve in presence of residuals for unobstructed pupil and toymodel pupil.Fig. a) : Unobstructed pupil.Fig. b) : Linearity curve of petal mode around residual phase screen for unobstructed pupil.Fig. c): Obstructed pupil.Fig.d) : Linearity curve of petal mode around residual phase screen for toymodel pupil

Fig. 8 :
Fig. 8: PSD comparison Atmosphere and first path Residual and petal mode without (plain line) and with 5λ/D filter (dotted line)

Fig. 9 :
Fig. 9: Petal mode to Residual ratio for variable spatial filter size.Fig. a): Optical path considered for the spatial filtering tests , Fig. b) : Signal to noise ratio for petal mode and first path residuals compared to the intensity going through the spatial filter

Fig. 10 :
Fig. 10: Comparison of the petal mode reconstruction between a uPyWFS and SF+uPyWFS

Fig. 11 :Fig. 12 :Fig. 13 :
Fig. 11: Comparison of sensitivity of 3 modes for various spatial filter radius.Low spatial frequency is a 3λ/D sinus and high spatial frequency is 10λ/D sinus

Fig. 15 :
Fig.15: Residual phase of Fig.14projected on petal mode.The first path creates petal mode residuals visible as oscillations between −π and +π.uPyWFS keeps the residual petal closer to 0 petal, but with a jump of -6pi (around iteration 250) where it loses its locking of petal, while SF+uPyWFS stays locked around zero petal