{'fraction_non_alphanumeric': 0.02348840433327392, 'fraction_numerical': 0.007803061810547997, 'mean_word_length': 4.609197956009775, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Simulating the optical alignment of the multiconjugate adaptive optics module for the extremely large telescope

Adaptive optics (AO) instruments for the future extremely large telescopes (ELTs) are characterized by advanced optical systems with diffraction-limited optical quality. Low geometric distortion is also crucial for high accuracy astrometric applications. Optical alignment of such systems is a crucial step of the instrument integration. Due to relative inaccessibility of these giant instruments, automatic alignment methods are also favored to improve the instrument availability after major events, such as extraordinary maintenance. The proposed alignment concept for these systems is described: the notable example which is analyzed here is the case of the multiconjugate AO relay for the future ELT. The results of ray-tracing simulations carried out to validate the method are discussed in detail, covering the error sources, which could degrade the alignment performance.


Introduction
The future generation of extremely large telescopes 1-3 will host instruments which need large optics if a large Field of View (FoV) shall be covered. The Adaptive Optics 4 (AO) architecture is essential to exploit the large telescope aperture and achieve various science goals which rely on angular resolution. AO instruments are complicated and need a fair number of optical elements to re-image the telescope focal plane with diffraction-limited optical quality. The complexity of these optical system is due to many aspects such as the off-axis, not rotationally symmetric shape of optical elements and a high number of degrees of freedom (DoFs). Large, complex and very demanding in terms of performances, the new generation of instruments will require time consuming and difficult alignment procedures. In many cases, it is difficult to divide the system into parts that can be aligned separately, testing the performance of the resulting subsystem at every step of the integration process by means of several optical tools. Due to relative inaccessibility of these instruments, which will be installed at the focal stations of the telescopes, maintenance is also an issue: automatic alignment procedures should be favoured, in order to minimise the instrument downtime after major maintenance events, e.g. after optics re-coating or possible slight misalignment after an earthquake. The issues discussed above motivate a different approach to optical alignment which is based on automatic methods and numerical algorithms. 5 This paper proposes a reverse optimization algorithm which uses the merit function minimization of commercial software for optical systems design. The development of such kind of algorithms has been originally treated by M. Egdall 6 as a possible solution for the alignment of large aspheric mirrors. Optical systems, including components which are off-axis sections of rotationally symmetric parent surfaces, are not trivial to align. For example, the alignment of a two off-axis mirror system by minimizing the root mean square (RMS) wavefront error (WFE) at the centre of the FoV, could exhibit large aberrations at the edge of the field. 7 In the last three decades, many authors have applied reverse optimization algorithms to study the alignment of non-rotational symmetric optical systems. [8][9][10] One of the first successful applications, by using reverse optimization and a Hartmann screen, has been achieved by A. Lundgren and M. Wolfe. 11 However, they stated that even if an acceptable alignment was achieved, the system did not perform as well as predicted. Possible explanations for this mismatch were errors that made the real system deviate from the nominal one (e.g. errors in the actual shape of the mirrors). The simulation, described in this paper, considers also the alignment and manufacturing errors in order to predict the performance during the real system integration phase. The design of future Multi-Conjugate Adaptive Optics (MCAO) instruments 12,13 for extremely large telescopes aims to enhance the astrometric performance of current MCAO-assisted cameras. 14 For this reason, the alignment of such instruments has to provide not only an excellent optical quality but also a very low geometric distortion. As a test case, the reverse optimization technique is applied to MAORY, 12 the MCAO relay of the Extremely Large Telescope (ELT), 1 exploring (as it has never been done before) a wide range of error sources and demonstrating the reliability of the algorithm to bring the optical system close to its nominal performance in terms of RMS WFE and geometric distortion. The paper is organized as follows: in Section 2, the alignment concept and the logic behind the method are described. In Section 3, a brief introduction to MAORY is given along with its nominal performances in terms of optical quality and geometric distortions. The implementation of the alignment method to MAORY is described in Section 4. The verification of the alignment method has been done by simulation and it is presented in Section 5. A Monte Carlo approach has been used to simulate a range of optics misalignments considering also different error sources that affect the measurements. These are described in detail in Section 6 where each possible error source is analyzed separately and the complete results are shown at the end.

Optical alignment concept
The sensitivity analysis is the first step in optical design to identify components which are highly sensitive to certain errors, such as tilts or decenters. The analysis is also valuable for finding the optimum number of compensators and the required range of adjustment which are necessary to reduce the performance degradation of an overall misaligned optical system. The compensators should work in combination with a metrology system that provides the necessary information to change the optical path according to estimated misalignments. A possible method is based on Singular Value Decomposition (SVD) and regularization of the sensitivity matrix. Wavefront data can be expressed in polynomial form and Zernike polynomials 15 are commonly used to describe wavefront aberrations over a circular aperture. Since the future generation of large instruments will have approximately circular apertures, we will refer to Zernike coefficients for the rest of the paper. The DoFs sensitivities are measured in terms of Zernike coefficients across the field. By perturbing each of the individual DoFs for each optical surface, the change of each Zernike coefficient is recorded in a matrix whose rows and columns are respectively the total number of Zernike values per field point and the total number of DoFs. This sensitivity matrix includes all the necessary information to simulate the alignment using the best set of compensators. It is defined as: where the WFE is decomposed into n Zernike polynomials (Z i ; 0 < i < n) and the root sum squared (RSS) of Z i is the total RMS WFE. ∂Z i is measured from the nominal configuration as (Z perturbed,i − Z nominal,i ) while ∂x j is the j th DoF perturbation. Once the coupling between DoFs and their effect on Zernike coefficients is understood, a solution on misalignments could be found. During the alignment phase, the Zernike coefficients have to be measured for different field points by means of one or more wavefront sensors (WFSs) or they could be estimated by imaging techniques such as the phase diversity. 16,17 Following an earthquake or any other intervention, as well as during the alignment phase, an instrument needs a set of reference sources at the so-called object space and one or more detectors at the image space to perform wavefront measurements by phase diversity. The AO instruments can use the WFS which requires a single image to derive the wavefront, unlike the phase diversity that needs at least two images (in-focus and/or intra/extra focal images). Let us consider the Zernike coefficients as a metric to evaluate the system performances (M F ) and all the available DoFs listed in a vector (x c ). The relation between the two can be written: The goal is to find the best x c that minimize M F . This relation could be non-linear and interdependencies between DoFs could occur. The method followed to solve the problem is based on the one described by Chapman et al. 18 where, through the SVD of the sensitivity matrix, the eigenvectors define the best set of DoFs used to compensate for misalignments. The sensitivity matrix is decomposed as follows: where U and V are column orthogonal matrices and M is a diagonal matrix containing the singular values listed in decreasing order along the diagonal. They are always positive numbers and define the strength of the type of aberrations that result from changes in the DoFs. The most sensitive aberration due to a set of DoFs misalignment has the largest singular value. Columns of U are Zernike coefficients introduced by changes in DoFs listed in columns of V , the strength of which is given by the M singular values. The goal is to find the most linearly independent set of compensators within the sensitive subspace of aberrations. This is done by truncating the sensitivity matrix until the sum of residuals of the new singular values are below a given threshold. Looking at the singular values of M in decreasing order, there is a well-defined gap at some point. The threshold has been chosen to remove all the singular values below the gap. The truncated sensitivity matrix S tr contains less singular values close to zero and it is well conditioned. The converging solutions in terms of changes in DoFs that minimize the WFE is the following: where (−V tr M −1 tr U T tr ) is the pseudo-inverse SVD of S tr and Z is the matrix of Zernike aberrations. This method gives accurate solutions only when the misalignments of optical components are located within the linear regime of sensitivities (i.e. perturbations around the nominal positions). In cases of large misalignments, a non-linear algorithm for minimising MF must be used. The method implemented in this paper is based on the damped least squares algorithm of Zemax R ray-tracing software and it has been named Zemax Reverse Optimization (ZeRO). 19 In general, the method can be used with any ray-tracing software that implements a programming tool. Once a merit function for system performances is defined, the goal is to minimize the function: where V i is the current value of the i th Zernike coefficient, T i the i th target value, and W i the weight. The best set of compensators (i.e. variable parameters of the MF) is defined by the method previously described, and the perturbations required to correctly align the system, are found by minimizing the M F . By using ZeRO, if we want to align both the focal plane and the exit pupil to their nominal positions, the measurements on Zernike coefficients are not enough. Additional observables, that could be used as targets of the M F , are the images centroids and the chief ray angles (e.g. by using a Hartmann screen 9 ). If a Shack-Hartmann WFS (SH-WFS) is available, the flux within the sub-apertures, instead of the chief ray angle, can be used as observable for the exit pupil position. The flux within the Shack-Hartmann (SH) sub-apertures is a direct measure of the x, y coordinates of the pupil 20 as shown in Figure 1. Considering four areas at the edges of the x, y axes of the lenslet array, the integrated flux of each area is defined as I m (m = 1, ..., 4). If d is the length of the sub-aperture side which defines the area, the x, y coordinates shift of the pupil are: Thus, if we have an array of sources at the object space, the V i and T i values of equation 5 are the Zernike coefficients of their wavefronts, the x, y coordinates of their exit pupils and the images centroids coordinates at the focal plane. In principle, the observables of one source at the FoV centre are enough to align the exit pupil and focal plane, but more field points may be used to better constrain the merit function and reduce the errors. The ZeRO alignment algorithm is based on a reference optical design which is the model of the ray-tracing software. This model is a perfectly aligned system and the observables, measured from the real misaligned system, are set as optimization targets. The chosen compensators, as described above, are set as variables of the optimization routine. The ZeRO outputs are the compensators motions that minimize the M F and that should be applied in a reverse way to achieve the alignment.
The future generation of instruments will use a laser tracker (LT) as main tool of the integration phase. The LT will be used as the global metrology system to survey and align every interface and to assemble and integrate every subsystem to the instrument main structure. The LT is a portable coordinate measuring machine that permits linking the positions of the optical elements at the instrument main structure. Spherically mounted retro-reflectors (SMRs) are the reference points used by the LT. The accuracy of the LT decreases with the distance between the LT and the measured objects and with the angle that the LT head needs to assume in order to 'see' all the SMRs on the opto-mechanics. 21 As we will show at the end of the paper, the MAORY integration by only using a LT is not enough to achieve the requested performance. Thus, the ZeRO routine has to be considered.

MAORY
MCAO is a technique first proposed by Beckers 22 to compensate the atmospheric turbulence effects over a wide field of view (FoV), by introducing more correcting elements (Deformable Mirrors, DMs) along the optical path, optically conjugated to different altitudes from the telescope pupil. MAORY will be placed on the straight-through focus of the ELT Nasmyth platform. The MCAO wavefront sensing scheme is based on six Laser Guide Stars (LGSs) and three Natural Guide Stars (NGSs). In particular, high-order wavefront sensing is performed by using LGSs while loworder wavefront sensing is performed by using NGSs to overcome the unreliability of the LGSs measurements for these modes. 23

Opto-mechanical design
The Post-Focal Relay Optics (PFR) sub-system of MAORY 24 re-images the telescope focal plane to the exit ports. The sub-system contains the following channels: • Main path optics (MPO), which relay the telescope focal plane to the exit ports for the science instruments: the Multi-AO Imaging Camera for Deep Observations (MICADO) 25 and a 2 nd instrument as yet undefined; • LGS objective, which creates an image plane for the LGSs, used by the LGS wavefront sensor (WFS) sub-system to measure in real-time the high-order wavefront aberrations for the MCAO mode of MAORY.
Light separation between the two channels is accomplished by a LGS dichroic beam-splitter, which splits the light reflecting the science light path and transmitting the LGS light path. The baseline optical design of the MPO consists of 6 mirrors plus the dichroic beam-splitter. The mirrors are usually labelled from M6 (the first mirror in MAORY, after M5 in the telescope) to M11. All the mirrors with optical power, except the DMs, are off-axis section from a larger parent surface. In detail, the optical design of the MPO, shown in Figure 2, consists of: • Concave M6 and convex M7, which produce a pupil image of the appropriate size (a concave mirror alone would not be enough, given the available space between the telescope focal plane and the edge of the Nasmyth platform); • Two concave DMs (M8 and M9), with the same optical power, optically conjugated to the required ranges from the telescope entrance pupil. In a partial implementation of the instrument, the deformable mirror M9 would be replaced by a rigid (i.e. non-adaptive) mirror. For the scope of this paper, they should be intended as rigid mirrors; • LGS dichroic, close to the pupil image; in the baseline design, this component is assumed to reflect the science light; • Convex M10, the last mirror with optical power before the exit focal plane; • Flat 45 • -tilted mirror (M11), which folds the light to the gravity-invariant port for MICADO. The second instrument port is achieved by inserting a flat folding mirror (M11b) between M10 and M11, and ensures the delivery of the nominal optical quality focal plane as for the MICADO port.
The focal ratio at the MICADO focal plane is 17.745, basically equal to the ELT focal plane one. The exit pupil delivered to MICADO is located at about 9120 mm before the MICADO focal plane. A summary of the MPO specifications is listed in Table 1.
In general, each optical element within the MPO consists of an optical component (reflective or refractive) and its cell: the optical components are assumed here to be delivered already integrated into their cells. The assembly (optical component + cell) is supported by an optical mount. Every optical mount includes the actuators for the adjustment of the optical element. Some of them are motorized and will be used by ZeRO during the alignment, the others are manual. In Section 4, the details for choosing motorised compensators is described. The motion of these compensators are provided with two motors which permit the rotations in azimuth and elevation by means of two kinds of gimbals. This layout, shown in Figure 3, presents the advantage that the pivot point corresponds with the center of the optical element (surface vertex). The motors have two different positions on the mount:  1. Attached to the cell to provide the elevation (θ y ).
2. Attached to the gimbal at the base to provide the azimuth (θ x ).

Optical performance
MAORY requirements are driven by the science cases which request high angular resolution and astrometric accuracy. System requirements have been broken down into sub-systems requirements which lead the sub-systems design. Strictly speaking about optical performance, the design of the MPO shall satisfy the following requirements: • Diffraction limited performance in J band over the full scientific FoV.
• Low geometric distortion to constrain the Point Spread Function (PSF) blur within 1/10 of its full width at half maximum (FWHM) during a single-exposure image. The details are described below.
The nominal RMS WFE at the exit focal plane of the MPO is shown in Figure 4. In particular, the WFE is below 40 nm RMS over the MICADO FoV. In order to satisfy the MPO requirements, the error budget allows an additional 40 nm of RMS WFE after the manufacturing, assembly and integration of the instrument. MAORY/MICADO astrometric observations are taken at different epochs in order to detect motions of astronomical sources. The current MAORY optical design has distortions of up to tens of milli-arcsec at the edges of the field. Geometric distortions from the MPO are asymmetric. As the imaged sky rotates with respect to the optics during an exposure, the PSF of a point-like source on the exit focal plane follows an imperfect trajectory, which may be described as an arc of a circle, with small perturbations due to the geometric distortions from the optics. Field de-rotation only compensates for the circular part of the trajectory. On the MICADO FoV, the residual motion of the PSF, when integrated over a finite exposure time, translates into PSF blur. The distortion analysis presented in this paper considers the maximum integration time for narrow band astrometric observations at 80 • of telescope elevation, i.e. 10 • from zenith. At the time of writing, the requirement on geometric distortions from the optics is described in the following: 26 • T ≈ 120 sec. It is the maximum integration time for narrow band astrometric observations; • A ≈ 13.7 x (1/cos(80 • )) ≈ 79 arcsec/s. It is the maximum de-rotator angular velocity; • T x A ≈ 2.6 • . It is the maximum field rotation within a single exposure image. During this rotation, the FWHM of the long-exposure PSF due to the MAORY optics shall not increase by more than 1/10 of its nominal value. For wavelength λ =1 µm, the amount of distortion shall be < 2.4 mas at the MAORY exit focal plane on the MICADO FoV (F/17.74 focal ratio). The positions of a set of N test stars placed over a regular grid have been used to evaluate the geometric distortion. Let us define X 1n , Y 1n , (n = 1, ..., N ), the initial coordinates of star centroids and X 2n , Y 2n , the coordinates of the star centroids after the maximum astrometric exposure time (i.e. 2.6 • FoV rotation and counter-rotation angle). The PSF centroids move, because of geometric distortions, by ∆X n = (X 2n − X 1n ) and ∆Y n = (Y 2n − Y 1n ). The vector sum of ∆X n and ∆Y n is the geometric distortion experienced by the n th test star and shown in Figure 5. Over the full scientific FoV, the maximum geometric distortion value of the nominal design is ∼ 0.3 mas.
Assuming a linear combination of the effects, the allowed degradation after the manufacturing, assembly and integration of the instrument is ∼ 2.1 mas in order to satisfy the requirement of 2.4 mas.

MAORY prerequisites for the ZeRO
The MPO integration concept is based on positioning the optics within the accuracy of a LT, then using active compensators with the ZeRO to refine the alignment. A dedicated unit for calibration purposes is mandatory to simulate the ELT focal plane in a 180 arcsec FoV at Nasmyth focus of the telescope where MAORY is planned to be placed. This calibration unit will be used to generate a set of reference sources and materialize the ELT focal plane and optical axis. The current calibration unit design is similar to the one which has been developed by NFIRAOS. 27 The PSFs and wavefronts coming from the sources and delivered at the MPO exit focal plane are the observables used for the alignment purposes. Two or more commercial cameras are placed at the MPO focus to detect the PSFs of the sources and some WFSs are used to measure the wavefronts. The WFSs could be commercial sensors dedicated to the the Assembly Integration and Verification (AIV) phase or the instrument NGS WFSs when available. The cameras and WFSs are supposed to be placed on a de-rotator and have to be moved to span the 180 arcsec FoV which is about 600 mm in diameter. The current baseline is to use two LT positions on the bench (see Figure 2) in order to integrate all the MAORY opto-mechanical elements. The alignment routine, presented in the following, is then used to restore the nominal optical performances.

Active compensators selection
As discussed in Section 2, the truncated sensitivity matrix identifies the worst offender DoFs for the system performance. The analytic approach of Section 2 has been pursued considering different optical parameters, besides the Zernike coefficients, in order to separate and better understand the DoFs perturbations impact on the alignment performance. The results, listed in the tables below, correspond to the variation of a given optical parameter with respect to the nominal design when moving, one by one, a given DoF of a single optical element. The movements correspond to 1 mm of axial shift or to the corresponding tilt after 1 mm of displacement at the mirror edge. The ratios between the variation and the nominal values are reported since the ratios are more effective in the determination of the DoFs sensitivity to a given parameter.        The sensitivity analysis shows that RMS WFE (the RSS of Zernike coefficients) is the most sensitive parameter. The worst offenders DoFs are the M8 shift along the optical axis, the tilts of M7, M8, M9 and of the dichroic. They are foreseen to be used as active compensators for the optical alignment. By acting on these DoFs, it is possible to partially compensate the optical parameters variation introduced by the DoFs misalignments not used as active compensators. The worst offender DoFs for the other optical parameters are a subset of the RMS WFE ones. Extending the discussion to the instrument operations (which is beyond the scope of this paper), MAORY needs an active M11 compensation that works in combination with the MCAO architecture (which includes the telescope tracking) to control the exit pupil and focal plane positions. M11 tilts are then added as compensators during the instrument alignment to relax the control of exit pupil and focal plane position by the others DoFs compensators. The latter will not be active during the operations.

ZeRO ray-tracing simulation
The alignment simulation is based on Zemax Programming Language (ZPL) macros combined with a Monte Carlo approach in order to take into consideration the probabilistic behaviour of the manufacturing and assembly process. As stated in Section 2, the ZeRO alignment algorithm has to refer to an optical design model. The reference design, to which the alignment performance will refer to, is the 'as built' or measured design. At the end of the manufacturing process, the shape of the optical surfaces will be measured within a certain precision to verify the compliance to tolerances. The measured design will undergo an optimization of optics positions to take into account the measured low order surface irregularities and mitigate their effects on the MPO optical quality. 26 This optimized design will be the reference. In the following simulations the performance degradation after the alignment is referred to the nominal design and not the foreseen 'as built' design, which is unknown at the moment of this writing. Since all the presented results are in the form of variation with respect to a reference, the described analysis is independent from the chosen reference design. The ray-tracing simulation shall reproduce the main steps of the MPO alignment as the following: (a) The optics are pre-aligned in their mounts prior to installation on the optical bench structure.
(b) The LT reads the SMRs locations once the interface plate is installed on the optical bench. Then, the mount is shimmed and settled into position according to the LT measure.
(c) Once the optics are properly located on the bench, they have to be aligned by using the compensators controlled by active components.
Points (a) and (b) are related to the assembly phase of the MPO that is simulated by a random set of assembled optical elements within specified tolerance ranges. For point (a), the considered tolerance range is ±0.2 mm with the assumption that this is the error in measuring the surfaces vertex position (see Table 9). As reference, this error is coarser than what prescribed in Chambers et al. 28 The used values for point (b) are the predicted LT accuracy, listed in Table 7. 500 Monte Carlo trials have been run following a parabolic distribution of the predicted assembly tolerances that we consider as misalignments. Since the parabolic distribution yields selected values that are more likely to be at the extreme ends of the tolerance range, rather than near the middle as for a Gaussian distribution, this approach is conservative. The main steps of the ZeRO ray-tracing simulation are: 1. Generate n Monte Carlo trials where the optics has been perturbed within the defined ranges of misalignments. 8. Optimize the reference design with the Zemax damped least squared algorithm using the compensators as variable parameters.
9. Add M11 tilts as variable compensators to improve the exit pupil and focal plane alignment.
10. The ZeRO outputs are C i values that minimize M F . These are the motions that should be applied in a reverse way to achieve the MPO alignment.
The method verification has been done assuming that there are no measurement errors or manufacturing uncertainties. Field sampling should be considered to address the best trade-off between alignment performance and number of sources. The simulation was run considering three different sets of 5, 9 and 12 sources, arranged as in Figure 6, and 500 Monte Carlo trials. The results are summarized in terms of the mean residual RMS WFE. It is the difference of the mean RMS WFE, across the entire FoV, between the reference value and the measured value after the alignment procedure. Boxplots are  The case of 5 sources, placed on a cross geometry, is more critical for the ZeRO accuracy. Going from 9 to 12 sources there are no significant improvements in the ZeRO convergence, thus 9 sources are the best compromise. As highlighted by the sensitivity analysis, the RMS WFE is the leading parameter of the ZeRO validation. If the alignment is successful in terms of RMS WFE, the other optical parameters are within the specification. This statement will be confirmed by the simulation which includes all the considered errors at the end of this paper.

Error analysis
Once the optimal number of sources has been defined (eight at the edge of the FoV and one at the centre), the alignment simulation has been run considering different sources of error that are expected to affect the real application of the ZeRO to the MAORY system. These errors are treated separately considering each element involved in the alignment procedure. The observables are extracted from the Monte Carlo trials: point 4 to 6 of the simulation described in Section 5. The observables are perturbed according to the considered error and used as inputs for the ZeRO: point 7 of Section 5. The outputs of ZeRo are the compensators movements that should be applied in a reverse way to achieve the MPO alignment. When applied to the Monte Carlo trials, the compensators motions are randomly perturbed in order to consider the motors repeatibility as described in the following sub-section. At the end of this Section, the full simulation, including all errors, shows the expected ZeRO performance in terms of RMS WFE, geometric distortion and main optical parameters variation with respect to the reference design. The simulation also provides the ranges of DoFs motion to achieve a successful alignment.

Compensators repeatability
The ZeRO outputs are given with numerical precision. To care about the active compensators repeatability, the motions are randomly perturbed considering the real motors (available on the market) repeatability which is expected to be about 0.5 µm. To be conservative, the simulation considers a repeatability of 2 µm. Therefore, before applying the DoFs compensations to the Monte Carlo trials, the output values have been randomly perturbed by ±2 µm. Figure 7 show the results of the ZeRO in terms of RMS WFE. The plot show the difference between the reference design and the aligned Monte Carlo trials. Median values are very close to zero and the standard deviation is very small (<2 nm), meaning the alignment has achieved the reference performance.
(a) (b) After the ZeRO alignment, the worst Monte Carlo trial, in terms of maximum PSF blur, reaches about 0.35 mas at the edge of MICADO FoV which is well below the limit of 2.4 mas.

Mountings pivot uncertainty
The position between the optical element and its mount needs to be characterized before the alignment in order to match the local coordinates of the optical element with the local coordinate of the mount. In order to fix the position of the optical element (vertex and axis) with respect to the optical mount, the optical cell is characterized by a coordinate measuring machine (CMM), then the optical element is characterized in the same way.
After the characterization of the position of the optical components inside their cells, the next step is the characterization of the axis of rotation around the gimbals. This can be done by a CMM measurement of the cylindrical surface. Then knowing the position of the optical centre with respect to the cell, the optical element is characterized, and using shims or screwing the gimbals it is possible to adjust the position of the rotation axis. This procedure can be done for both the axes; the accuracy of this process depends on the manufacturing process and on the measurement error. If the pivot point of the cell was not centered to the surface vertex, a tilt, to be applied as result of the ZeRO, would become a decentre and an axial shift of the optical element. In particular, a mismatch d between the pivot point and surface vertex, translates into d sin θ axial shift and d(1 − cos θ) decentre, where θ is the applied tilt angle. A random distance within the range of ±1.2 mm (in the plane of the optic) between the cell pivot point and the real surface vertex has been considered as error. This is a very conservative error which in turn has been used to define the tolerance of mounting. The effect in terms of RMS WFE is quite limited as shown in Figure 8. The same effect of the pivot point mismatch is caused by the surface vertex position uncertainty due to manufacturing. For clarity, it has been decided to analyse the errors independently emphasizing a lower accuracy in mechanical integration.

Errors on calibration unit sources
To exactly simulate a re-imaged star field by ELT, a set of artificial sources are placed at the entrance focal plane of MAORY. Optical fibres are the baseline choice. The sources must be set with a proper chief ray angle to reproduce the telescope exit pupil position. The surface connecting the sources must be spherical with a curvature radius of 9.88 m. The baseline is to implement a limiting aperture in front of each source to define the F-ratio. This solution has been also considered by NFIRAOS 27 where the optical fibre emission angle is limited by conical baffles. The ELT is not telecentric and the chief ray angle of a point-like source changes along the field radius. Thus, at the entrance focal plane, if the sources will be mounted on a circumference, they will have the same chief ray angle and the same sag (the component of the surface displacement from the vertex) reducing the complexity in terms of mechanical manufacturing. The source, which simulates a re-imaged star by ELT at the centre of the FoV, defines the MAORY optical axis and global origin. Therefore, also the exit pupil and focal plane centre positions are defined by the central source. In this context, the considered errors are on the off-axis sources relative to the on-axis one. We do not simulate the intensity profile of the source and/or diffraction effects which could affect the intensity profile of the spots at the image plane and thus, the centroids accuracy (see subsection 6.6). Field errors should be considered as part of the mechanical manufacturing of the mask that simulates the ELT focal plane. Tolerances in the x, y, z coordinates have been allocated as well as tolerance in the beam angle between the surface normal and the incident ray at the surface which defines the ELT focal plane. Assumed source position errors are ±0.1 mm and ±0.1 • for x, y, z coordinates and chief ray angle, respectively. The effect of these errors is the loss of a direct relation between the observables and the sources defined in the reference design. The worst offender is the ±0.1 • chief ray angle variation. Tilting the nominal chief ray angle of a source generates a shift of its beam footprint on the optical surfaces which means a different wavefront and PSF centroid, with respect to the nominal, at the exit focal plane. The same consideration is valid for the x, y, z coordinates variation. The effect on the observables due to the variation of sources parameters are summarized in Table 8 in terms of variation with respect to the nominal values. This means the ZeRO simulation was run with that bias on the observables. The sources shall deliver the proper focal aperture (F/17.74). An error on this parameter produces two effects: 1. A different wavefront at the exit focal plane since the beam footprints on the optics are different with respect to the reference case even though the chief rays are coincident. A relative error of 1% translates to a variation of the reference wavefront of about 2-3 nm RMS in the worst case.

2.
A different response of the WFS since the pupil size on the lenslet array changes its size. At the present stage both errors have been considered to be inside the WFS error budget described in Section 6.5.
The results, in terms of RMS WFE, of the ZeRO simulation considering errors on x, y, z coordinates of sources and chief ray angles are shown respectively in Figure 9 and Figure 10.

Optics manufacturing uncertainty
The mirrors are assumed to be delivered by the suppliers with a full characterization of their surfaces. In principle, the measured values of surface parameters are implemented in the nominal design which becomes the 'as-built' reference design. In case the information is missing or inaccurate, the impact of surface irregularities on the effectiveness of the algorithm is shown in Figure 13. The irregularities have been divided into Low-Order (LO) and High-Order (HO) and modelled by Zernike polynomials. 15 Table 9 lists the manufacturing uncertainties used in the simulation.
500 Monte Carlo trials have been run where, in addition to the assembly tolerances, all the manufacturing uncertainties of Table 9 have been used to perturb the optical surfaces. Table 9 Expected uncertainties regarding the optical manufacturing process. Zernike values are specified by the tolerance analysis. Surface irregularities (deviations from the nominal surface) are modelled by means of standard Zernike coefficients whose max tolerance value is the exact RMS error of the surface. When a range of modes is indicated, the value refers to the RSS of values within that range. There is not a specific of manufacturing process that drives the definition of Zernike terms into ranges. In Zemax simulation, one can define a range of Zernike coefficients and an RMS value (Zemax operand 'TEZI'). The optical surface is modelled by the Zernike polynomials whose coefficients are set to a value so that the square root of the sum of the squares of the coefficients yields the specified RMS value. For the Monte Carlo analysis each polynomial term is assigned a coefficient randomly chosen in the range ±1, and the resulting coefficients are then normalized to yield the exact RMS tolerance. When considering a wide range of Zernike coefficients, one has to deal with the power spectra of the coefficients within the range. Zemax satisfies the Monte Carlo statistics but could generate surfaces with larger RMS irregularities in the highest edge of the Zernike coefficients range. In the tolerance analysis, 26 we wanted to avoid this kind of bias and a sub-division into ranges can give us more control on the statistic. The number of Zernike coefficients we can simulate is not infinite, so we stopped to Zernike 55 to speed up the simulation (a lot of coefficients require a lot of simulation time). However, the values of the last Zernike range could be interpreted as Z>45 for the purpose of a manufacturing process.

Low orders
Zernike coefficients values (RMS error of the surface) are the same as the MAORY tolerance analysis specifications. 26 The available DoFs are able to partially compensate aberrations until Zernike coefficient 11 (the 'spherical' term), hence the computed LO irregularities include Zernike polynomials from 4 (the defocus term) to 11. The uncertainty about the radius of curvature is one order of magnitude lower than its specified tolerance and it is a reasonable expected measurement accuracy 29 . 30 Figure 11 and Figure 12 show the separate contribution in term of RMS WFE variation after the ZeRO affected by LO and HO surface uncertainties, respectively. Figure 13 is the result of ZeRO when both LO and HO irregularities are considered.  Table 9. Random values in the ranges of Table 9 (that considers LO) have been added to optical surfaces within the Monte Carlo trials.  Table 9. Random values in the ranges of Table 9 (that considers HO) have been added to optical surfaces within the Monte Carlo trials.  Table 9. Random values in the ranges of Table 9 have been added to optical surfaces within the Monte Carlo trials.

WFS measurement accuracy
The MAORY WFSs are supposed to work in closed loop and they are requested to provide relative (differential) wavefront measurements, rather than absolute ones. Nevertheless, after calibrations they can give fairly accurate wavefront measurements. By inserting a point source at the entrance focal plane of the WFS, it is possible to measure the internal systematic WFE due to the WFS itself and use it as slope offsets. The exit pupil displacement can be corrected by internal pupil adjustment in the WFS, e.g. by tilting a pick-off mirror. When measuring an off-axis wavefront, the WFS can be centered by nulling the tilt signal and the pupil centering can be adjusted if required. In this way it is assumed that the WFE measurement are in the same conditions as the on-axis calibration and that a reasonable measurement error can be considered. Taking into account the calibrations and the measurement strategy of the wavefront, it is assumed that the WFS has 10 nm RMS per mode of measurement accuracy. We have not considered a detailed error break-down for the wavefront sensor accuracy. 10 nm RMS per mode is a random error which has been added to the observables extracted from the Monte Carlo trials: point 4 of the simulation described in Section 5. This assumption is supported by the declared accuracy of most commercial WFSs.

Centroid measurement accuracy
The centroids are used to align the exit focal plane with the de-rotator mechanical axis. The measurement accuracy of the centroids depends on several factors: positional accuracy of the measurement camera, PSF shapes and illumination profiles of the sources. With artificial sources, the detectors work in the photon noise regime. After the LT alignment the dominant aberration is defocus. The effect of defocus is the enlargement of the PSFs which could cause the loss of accuracy in the centroid measurement. Figure 15 shows the 9 PSFs of two different Monte Carlo trials before and after the removal of the defocus term. This could be done by shifting the exit focal plane, or the entrance focal plane, or moving M11 or M8 along the optical axis. M8 is the only compensator for focus among the DoFs used by the ZeRO. The spot shrinking is evident. In the worst case the radius of the out-of-focus PSF, at which 90% of the energy is encircled, is about 300 µm. Correcting the defocus, the radius decreases to about 50 µm. In the ZeRO simulation the centroids are measured on the PSFs delivered by Zemax. In the real system the centroids coordinates could be different due to optical fibre effects or diffraction effects at the calibration unit level. We assume that any systematic error due to an irregular intensity profile, coming from the optical fibre and/or diffraction effects, is within 5 µm which is (as a rule of thumb) 1/10 of the worst expected spot radius. The measurement of the absolute value of the off-axis image positions, at the exit focal plane, is given by the determination of the off-axis camera positions with respect to the optical axis. The mechanical axis of the de-rotator defines the optical axis which has to be coincident with the image position of the central source. At the central camera local coordinates (CAM0), when the system is not aligned, the PSF moves on a circle centered to the optical axis. It is possible to calculate the absolute position of the PSF which is given by the circle radius (see Figure 16). Regarding the image position of the off-axis camera (CAM1), it is possible to measure the radial distance of CAM1 by using the de-rotator. Let us consider the coordinates x 0 , y 0 of CAM1 where the mechanical axis of the de-rotator is the origin. After rotation by an angle β, the camera detects the source image whose coordinates are: x s = x 0,β + x s,β y s = y 0,β + y s,β x 0,β , y 0,β are the new camera coordinates after the rotational transformation and x s,β , y s,β are the spot centroid coordinates with respect to the camera local reference system. These centroid coordinates can be brought to the camera local reference system before the rotation by using the transformation: ∆x β = x s,β cos β + y s,β sin β ∆y β = y s,β cos β − x s,β sin β If the same process was done with an angle α = β, it would be possible to measure ∆x α and ∆y α . Defining: After some algebra, the x 0 , y 0 coordinates of CAM1 are: This is the position of CAM1 with respect to the optical axis necessary to know the absolute positions of the PSF centroids. The worst offender of these measurements could be the de-rotator accuracy, which implies the uncertainty about the knowledge of α and β angles. We assume it would be possible to measure the rotational angle by using the LT and thus, the off-axis centroids should be known with an error of ≈50 µm which is the accuracy level of the LT. The alignment goal is to center the optical axis, defined by the central source, with the de-rotator axis. In principle, the absolute central image position is sufficient to achieve the goal and it is not affected by de-rotator errors since is given by the radius of a circle as previosly described. The ZeRO uses the off-axis centroids to better constrain the MF but the weighting value of these centroids is 100 times lower. During the ZeRO simulation 55 µm has been allocated as centroid accuracy which correspond to 16.5 mas on sky. To be conservative, this is the order of magnitude accuracy of the LT plus any possible effects coming from the artificial sources and corresponds to about the size of the worst in-focus PSF, as discussed above.

All errors simulation
The complete simulation of the MPO alignment by means of ZeRO includes all the errors described up to this point. Figure 17 shows the RMS WFE distribution of the Monte Carlo trials and its median map at the beginning of the procedure, when ZeRO has not achieved the alignment condition yet. It is the starting point, in terms of RMS WFE, considering the 'all errors' simulation. The major contribution to the RMS WFE, as discussed in the previous sub-section, is the defocus term. The errors which mostly contribute to the defocus are the uncertainties on surfaces curvature radii and chief ray angle of the artifical sources. Figure 18 is the same set of Monte Carlo trials where the exit focal plane has been shifted to remove the mean defocus contribution to the RMS WFE. The median RMS WFE map within the scientific FoV is above the diffraction limit in J band (∼89 nm) supporting the need of the ZeRO algorithm.  Table 10 lists the extreme values of movements, as result of the algorithm output, that DoFs compensators had to apply through the Monte Carlo trials. Tilts (M7-M8-M9-Dichroic) Axial shift (M8) Tilts (M11) ±5 mrad ±2.5 mm ±0.5 mrad Figure 19 shows we are able to achieve a residual median RMS WFE of ∼20 nm with a standard deviation of ∼15 nm. This is within the 40 nm RMS WFE allocated in the error budget for manufacturing, assembly and integration of the instrument. The RMS WFE distribution of Figure 19 is similar to Figure 13, showing that the uncertainty about the optical surface irregularities are the major contributors to the RMS WFE variation with respect to the reference design. A major contribution to the variation of the geometric distortion, as shown in Figure 20(a), is given by the residual misalignment of the MAORY optical axis with respect to the de-rotator mechanical rotation axis. Since 55 µm as centroid accuracy has been considered, the exit focal plane deviates from its nominal position within a range defined by the centroid accuracy. As previously described, this focal plane drift will be permanently compensated by MCAO producing a real variation of the geometric distortion as shown on Figure 20(b). The MCAO should also remove the plate scale component of the geometric distortion further reducing the values of Figure 20(b) but this analysis is beyond the scope of this paper where the obtained results are within the specifications. We achieved a maximum value of 1.4 mas of PSF blur which is below the allocated 2.4 mas (Section 3).   The ZeRO acts on some DoFs which are in common path with the LGS objective channel. A successful alignment of the MPO could be sub-optimal for the LGS objective. To evaluate the effect on the LGS image plane, the RMS WFE of 6 sodium LGSs has been extracted from the aligned Monte Carlo trials of the full errors ZeRO simulation. Fixing the LGS constellation at 45 arcsec angular radius which is the baseline asterism configuration, Figure 22 shows the variation of the RMS WFE vs. Zenith angle with respect to the nominal value. Tip-Tilt, defocus and astigmatism (Z < 6) have been excluded since they will be measured by the NGS WFSs within the MCAO loop.
The LGS objective alignment procedure is beyond the scope of this paper. The goal of Figure 22 is to demonstrates that if the LGS objective has been already aligned, after the ZeRO on the MPO, the optical quality variation of the LGS channel is negligible.

Conclusions
This paper describes an alignment method for complex optical systems. It is divided into two steps: mechanical alignment by LT and optical alignment by ZeRO. The results have been presented for the MAORY case, but they are generally valid for every optical system since the procedure is independent from the optical design. Misalignments at the level of LT accuracy have been considered as well as different error sources that could increase the ZeRO uncertainty. The ray-tracing simulations that have been run to verify the alignment method, also play a crucial role in defining the requirements on the geometry and number of sources for the calibration unit. From a performance point of view, the optics parameters and irregularities must be within the tolerances which have been defined considering a possible compensation during the alignment. The HO surface irregularities cannot be compensated and they are the major contributors to the RMS WFE degradation. The ray-tracing simulations verified that the ZeRO method is able to recover the nominal optical performance with very low residuals on RMS WFE, geometric distortions and main optical parameters. The method is fully automatic and is a powerful tool to reduce the amount of time allocated to some activities during the AIV phase. Moreover, it could be used to actively control instrument optics at telescope site as part of routine re-alignment during maintenance or calibration operations.