1
Desktop-based Simulation of Adaptive Optics Systems for Astronomical Applications Mikhail V. Konnik and James Welsh Faculty of Engineering and Built Environment, The University of Newcastle, Australia S UMMARY Adaptive optics systems are highly complicated networks of devices that makes an analytical study of such systems difficult. Hence numerical simulations are crucial in providing a quantitative evaluation of capabilities of adaptive optics systems. The proposed AORTA (Adaptive Optics Real Time Analyser) simulator is written on MATLAB-compatible programming language and contains routines for simulation of atmospheric turbulence, wind profiles, Fresnel/Fraunhofer light propagation, model of Shack-Hartmann wavefront sensor, and zonal wavefront reconstruction. The aim of the project is to develop a complete adaptive optics simulator and investigate the controller design based on optimal control methods and Kalman filter. The mathematical description of the simulator’s components is provided. The results of simulation of light propagation through turbulent atmosphere are presented. M OTIVATION The proposed AORTA simulator is written on GNU/Octave open-source language that is a free alternative to MATLAB. AORTA simulator contains routines for complete sim- ulation of light propagation through turbulent atmosphere, wavefront registration and reconstruction. This is necessary for design a optimal controller with Kalman filter. Such simulator allows to study an influence of noise from different sources on the per- formance of the whole adaptive optics system. The aim of this project is to develop a complete adaptive optics simulator and investigate the controller design based on optimal control methods and Kalman filter. B ENCHMARKS OF AORTA S IMULATOR The GNU/Octave language was chosen rather than MATLAB because of speed: GNU/Octave is faster than MATLAB on FFT operations that are used extensively in simulations of light propagation through the atmosphere. 10 -5 10 -4 10 -3 10 -2 10 -1 10 0 10 1 10 2 10 0 10 1 10 2 10 3 10 4 Median computational time, [seconds] The size of the matrix, NxN MATLAB v7, Linux GNU/Octave v3, Linux 10 7 10 8 10 9 10 10 10 0 10 1 10 2 10 3 10 4 Mean computational time, [bytes] The size of the matrix, NxN MATLAB GNU/Octave Figure 1: Benchmarks of Octave and MATLAB: (top) computation time versus matrix size for FFT, (bottom) memory consumption on FFT operations versus matrix size. According to our benchmarks (see Fig. 1), on typical size of matrices in adaptive optics simulations (thousands by thousands of elements) Octave is almost 3 times faster than MATLAB in FFT operations. However, Octave uses more memory than MATLAB. For small matrices (less than 1024 × 1024) it can be 2.5-3 times more memory, and for large matrices (2048 × 2048 and more) that is typically 10-20%. Thus, although Octave is faster than MATLAB on FFT, Octave consumes more memory than MATLAB while performing FFT and thus may run out of memory on large matrices. However, the speed of calculations is more important for such type of simulators. A TMOSPHERE TURBULENCE The statistics of refractive index inhomogeneities follows that of temperature inhomo- geneities and can be described by the Kolmogorov-Obukhov law of turbulence. The spatial density of turbulent fluctuations Φ(k ) are described by Kolmogorov’s spectrum called sometimes “two-thirds law”: Φ(k )dk V 2 k 2/3 (1) From the results of simulations (see Fig. 2) it is evident that there are two groups of models: Kolmogorov-alike and von K´ arm´ an-alike. The main difference is the be- haviour at the hight spatial frequencies: more accurate models tend to attenuate the high-frequency oscillations. From the analysis of Fig. 2 it is clear that for very small structures within the atmosphere, the Kolmogorov-alike spectrum models significantly overestimate power spectrum. 10 -40 10 -35 10 -30 10 -25 10 -20 10 -15 10 -10 10 -5 10 0 10 5 10 10 10 15 10 -2 10 -1 10 0 10 1 10 2 10 3 10 4 Atmosphere power spectrum Spatial frequency, κ [rad/m] Hill model Tatarskii model Kolmogorov model Modified von Karman von Karman Figure 2: Comparison of the power spectrum models. Models derived from von K´ arm´ an model describe small turbulence structures more adequately. The simulation of layered atmosphere using von K´ arm´ an power spectrum density model is shown on Figure 3. From the results of simulations it was concluded to use modified von K´ arm´ an model as more consistent with experimental data. Figure 3: Simulation of layered atmosphere using von K´ arm´ an model. M ONTE -C ARLO SIMULATIONS The variation of the refractive index in the atmosphere is a random process. Hence turbulence models give statistical averages of the structure function and power spec- trum of refractive index. The phase fluctuations may be presented as a weighted sum of basis functions such as Zernike polynomials or Fourier series coefficients. The method based on Fourier series is commonly used and produces adequate results. In the AORTA simulator, phase fluctuations φ(x , y ) were assumed as Fourier- transformable functions: φ(x , y )= + −∞ + −∞ Φ(f x , f y ) exp[i 2π (f x · x + f y · y )]df x df y (2) where Φ(f x , f y ) is the spatial-frequency-domain representation of the phase. To generate phase screens on a finite grid, the phase φ(x , y ) can be described in terms of Fourier series: φ(x , y )= N /2 n=N /2 N /2 m=N /2 c n,m exp[i 2π (f x n · x + f y m · y )], (3) where f x n and f y m are the discrete x and y directed spatial frequencies, and the c n,m are the Fourier-series coefficients. The results of Monte-Carlo simulations for different power spectrum models are shown on Fig. 4. hill Atmosphere phase Turbulence Profile 50 100 150 200 250 300 350 400 450 500 50 100 150 200 250 300 350 400 450 500 radian -60 -40 -20 0 20 40 60 80 vonkarman Atmosphere phase Turbulence Profile 50 100 150 200 250 300 350 400 450 500 50 100 150 200 250 300 350 400 450 500 radian -15 -10 -5 0 5 10 Figure 4: Comparison of the power spectrum models: (top) Kolmogorov spectrum and (bottom) von arm´ an spectrum. Layered model is a fairly good approximation. For accurate atmosphere representa- tion, typically 5-10 phase screens are used in the simulations. M ODELS OF POINT SOURCES OF LIGHT Mathematical model of a point light source is represented by a Dirac delta function: U pls (r 1 )= δ (r 1 r c ), (4) where r c =(x c , y c ) is the location of the point source in the (x 1 ; y 1 ) plane. But such a point light source has an infinite spatial bandwidth, while most optical sources are spatially band-limited. AORTA simulator uses sinc-sinc model : two sinc functions to generate narrow point source. The model uses two sinc functions to generate narrow point source. For example, if a square region of width D is used then window function is the following: W (r 2 r c )= A rect x 2 x c D rect y 2 y c D , (5) where A is an amplitude factor, x c and y c are coordinates the location of the point source in the (x 1 ; y 1 ) plane. The model of sinc-sinc point source is given by: ˜ U pls (r 1 )= Ae ik z 2z r 2 1 e ik z 2z r 2 c e ik z 2z r 1 r c D λz sinc D (x 1 x c ) λz sinc D (y 1 y c ) λz (6) Figure 5: Light point source simulated with sinc-sinc model. The simulated point source that represents astronomical object is shown on Fig. 5. O PTICAL IMAGES FORMATION When the source light P is at long distance from the aperture, the curvature of the wavefront reaching the aperture may be considered plane. If the energy of the plane is constant E A over the aperture A, then the optical disturbance U (P ) at point P at time t is: dU (P )= E A z exp[i (ω t kz )]dS , (7) where ω is the temporal frequency of radiation, k = 2π λ is the wavenumber, and z is the distance between dS and P . The total disturbance at P can be found by integrating the contributions from each element of dS . The source plane has coordinates (x 1 , y 1 ) and (x 2 , y 2 ) in the observation plane. The distance between the source and observation planes is z . The problem is: given the source-plane optical field U (x 1 , y 1 ) we need to find observation-plane field U (x 2 , y 2 ). The solution is given by the Fresnel diffraction integral : U (x 2 , y 2 )= e ik z i λz + + U (x 1 , y 1 )e i k 2z [(x 1 x 2 ) 2 +(y 1 y 2 ) 2 ] dx 1 dy 1 (8) This equation presents a paraxial approximation that is appropriate is seeing angles are not too far from zenith. The quadratic phase factor inside the Fresnel diffraction integral is not band-limited, so it poses some challenges related to sampling. In the proposed simulator it has been implemented the following approaches for light propagation: Fraunhofer diffraction; one-step Fresnel diffraction; two-step Fresnel diffraction; angular spectrum propagation. S IMULATION OF LIGHT PROPAGATION THROUGH TURBULENT ATMOSPHERE Using the Monte-Carlo simulations of turbulence atmosphere with von K´ arm´ an model of turbulence power spectrum, one can calculate the propagation of point light source through layered atmosphere. As a result, the scattering of light can be observed (see Fig. 6). Figure 6: Light propagation through the turbulent atmosphere: (left) point source propagation through 3 turbulent layers, (right) point source propagation through 6 turbulent layers. In order to characterise the image’s quality, Strehl ratio was used as traditional crite- rion of images quality in optics. Strehl ratio is the ratio of the observed peak intensity at the detection plane of an imaging system compared to the maximum peak intensity of a perfect imaging system at the diffraction limit (Airy disk): S = MTF g (ν x y )d ν x , d ν y MTF ideal (ν x y )d ν x , d ν y (9) The algorithm for evaluation of Strehl ratio includes arbitrary-sized region of interest (ROI) and cubic interpolation within that ROI. Numerical simulations were conducted for investigation of how the ROI size influences on the value of Strehl ratio. The results of simulations are summarised in Table 1. Table 1: Strehl ratio evaluation with ROI: influence of ROI size on Strehl ratio. Atm. Strehl ratio, Strehl ratio, Strehl ratio, Strehl ratio, Strehl layers ROI 16 pix ROI 32 pix ROI 64 pix ROI 128 pix ratio, theory 1 1.00000 1.00000 1.00000 1.00000 1.00000 2 0.34017 0.33745 0.33609 0.33533 0.19381 3 0.10768 0.10620 0.10528 0.10479 0.08540 4 0.01801 0.01478 0.01389 0.01363 0.02029 5 0.02730 0.01341 0.01149 0.01090 0.01117 6 0.04194 0.01429 0.00920 0.00829 0.00888 Analysis of the results from Table 1 allows to conclude that small size of ROI tends to overestimate the value of Strehl ratio. Optimal size of ROI is between 64 and 128 pixels for the 512 × 512 grid. WAVEFRONT S ENSING The wavefront may be sensed as a displacement of the light spots focused by the sensor’s lenslet array. Each lens takes a small part of the aperture (sub-aperture), and forms an image of the source. When an incoming wave-front is plane (see Fig. 7), all images are located in a regular grid defined by the lenslet array geometry. Figure 7: Principle of the Shack-Hartmann wavefront sensor: (left) positions of light spots for undistorted reference wavefront, (right) positions of light spots for distorted wavefront passed though turbulent atmosphere. If the wavefront is distorted, the images of light spots are displaced from their nominal positions. Displacements of image centroids in two orthogonal directions x , y are proportional to the average wave-front slopes in x , y over the sub-apertures: x = i ,j x i ,j I i ,j i ,j I i ,j , y = i ,j y i ,j I i ,j i ,j I i ,j , (10) where I i ,j are the intensities of light on the detector’s pixels. Z ONAL WAVEFRONT R ECONSTRUCTION For the Shack-Hartmann sensor, we need to measure the x and y gradients in the same sub-aperture. This can be done using Fried geometry, as shown on Fig.8a. The horizontal dashes indicate positions of x slope sampling, the vertical dashes are the y slope sampling positions. The filled circles are the estimated phase points. The measured phase differences are converted from length into phase: φ x = 2π λ L x θ x , φ y = 2π λ L y θ y (11) where L x is a length of the element, and θ x is the measured angle of arrival compo- nent. The reconstruction of wavefront slopes can be performed as follows: S x i ,j = (φ i +1,j + φ i +1,j +1 )/2 (φ i ,j + φ i ,j +1 )/2 h (12) S y i ,j = (φ i ,j +1 + φ i +1,j +1 )/2 (φ i ,j + φ i +1,j )/2 h (13) where h = D /N , and D is the diameter of the aperture and the N is the number of lenslets. The estimation of phase can be done as follows: ˆ φ = A S . (14) where inverse of gradient interaction matrix A are evaluated using Moore-Penrose pseudo-inverse A . a) 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 Gradients that are restored from centroids b) 2 4 6 8 10 12 14 16 18 20 2 4 6 8 10 12 14 16 18 20 -10 -5 0 5 x 10 -3 c) Figure 8: Zonal reconstruction of the wavefront: a) Fried geometry of slope measurements; b) matrix of gradients for the wavefront; c) reconstructed wavefront using zonal approach. In the proposed simulator, Fried geometry of wavefront reconstruction is implemented. The calculated matrix of gradients is presented on Fig. 8b. The simulation of recon- structed wavefront is presented on Fig. 8c. C ONCLUSION Adaptive optics is a technique that allows to compensate the impact of atmospheric turbulence in real-time thus improving the quality of astronomical images. However, adaptive optics systems are highly complicated networks of devices that makes analytical study of such systems difficult. The aim of this project is to develop a complete adaptive optics simulator and investigate the controller design based on optimal control methods and Kalman filter. The proposed adaptive optics simulator is written on MATLAB and runs on GNU/Octave. According to conducted benchmarks, on typical size of matrices in adaptive optics simulations Octave is almost 3 times faster than MATLAB, but typically uses 10-20% more memory than MATLAB. The simulator contains software routines for modelling of atmospheric turbulence, wind profiles, Fresnel and Fraunhofer propagation, model of wavefront sensor, and zonal wavefront reconstruction. Using the developed simulator, it is possible to design and study the controller based on optimal control techniques and Kalman filter. Design of the controller is the next stage of this research project.

Desktop-based Simulation of Adaptive Optics Systems …mikhailkonnik.pbworks.com/f/workshop-Poster.pdfDesktop-based Simulation of Adaptive Optics Systems for Astronomical Applications

Embed Size (px)

Citation preview

Page 1: Desktop-based Simulation of Adaptive Optics Systems …mikhailkonnik.pbworks.com/f/workshop-Poster.pdfDesktop-based Simulation of Adaptive Optics Systems for Astronomical Applications

Desktop-based Simulation of Adaptive Optics Systemsfor Astronomical Applications

Mikhail V. Konnik and James WelshFaculty of Engineering and Built Environment, The University of Newcastle, Australia

SUMMARY

Adaptive optics systems are highly complicated networks of devices that makes an analytical study of such systems difficult. Hence numerical simulations are crucial in providing a quantitative evaluation of capabilities of adaptive optics systems. The proposed AORTA(Adaptive Optics Real Time Analyser) simulator is written on MATLAB-compatible programming language and contains routines for simulation of atmospheric turbulence, wind profiles, Fresnel/Fraunhofer light propagation, model of Shack-Hartmann wavefront sensor,and zonal wavefront reconstruction. The aim of the project is to develop a complete adaptive optics simulator and investigate the controller design based on optimal control methods and Kalman filter. The mathematical description of the simulator’s components isprovided. The results of simulation of light propagation through turbulent atmosphere are presented.

MOTIVATION

The proposed AORTA simulator is written on GNU/Octave open-source language thatis a free alternative to MATLAB. AORTA simulator contains routines for complete sim-ulation of light propagation through turbulent atmosphere, wavefront registration andreconstruction. This is necessary for design a optimal controller with Kalman filter.Such simulator allows to study an influence of noise from different sources on the per-formance of the whole adaptive optics system. The aim of this project is to developa complete adaptive optics simulator and investigate the controller design based onoptimal control methods and Kalman filter.

BENCHMARKS OF AORTA SIMULATOR

The GNU/Octave language was chosen rather than MATLAB because of speed:GNU/Octave is faster than MATLAB on FFT operations that are used extensively insimulations of light propagation through the atmosphere.

10-5

10-4

10-3

10-2

10-1

100

101

102

100

101

102

103

104

Media

n c

om

puta

tional tim

e, [s

econds]

The size of the matrix, NxN

MATLAB v7, LinuxGNU/Octave v3, Linux

107

108

109

1010

100

101

102

103

104

Mean c

om

puta

tional tim

e, [b

yte

s]

The size of the matrix, NxN

MATLABGNU/Octave

Figure 1: Benchmarks of Octave and MATLAB: (top) computation time versus matrix size for FFT,(bottom) memory consumption on FFT operations versus matrix size.

According to our benchmarks (see Fig. 1), on typical size of matrices in adaptive opticssimulations (thousands by thousands of elements) Octave is almost 3 times fasterthan MATLAB in FFT operations. However, Octave uses more memory than MATLAB.For small matrices (less than 1024 × 1024) it can be 2.5-3 times more memory, andfor large matrices (2048 × 2048 and more) that is typically 10-20%. Thus, althoughOctave is faster than MATLAB on FFT, Octave consumes more memory than MATLABwhile performing FFT and thus may run out of memory on large matrices. However,the speed of calculations is more important for such type of simulators.

ATMOSPHERE TURBULENCE

The statistics of refractive index inhomogeneities follows that of temperature inhomo-geneities and can be described by the Kolmogorov-Obukhov law of turbulence. Thespatial density of turbulent fluctuations Φ(k) are described by Kolmogorov’s spectrumcalled sometimes “two-thirds law”:

Φ(k)dk ∼ V 2 ∼ k−2/3 (1)

From the results of simulations (see Fig. 2) it is evident that there are two groupsof models: Kolmogorov-alike and von Karman-alike. The main difference is the be-haviour at the hight spatial frequencies: more accurate models tend to attenuate thehigh-frequency oscillations. From the analysis of Fig. 2 it is clear that for very smallstructures within the atmosphere, the Kolmogorov-alike spectrum models significantlyoverestimate power spectrum.

10-40

10-35

10-30

10-25

10-20

10-15

10-10

10-5

100

105

1010

1015

10-2

10-1

100

101

102

103

104

Atm

osphere

pow

er

spectr

um

Spatial frequency, κ [rad/m]

Hill modelTatarskii model

Kolmogorov model Modified von Karman

von Karman

Figure 2: Comparison of the power spectrum models.

Models derived from von Karman model describe small turbulence structures moreadequately. The simulation of layered atmosphere using von Karman power spectrumdensity model is shown on Figure 3. From the results of simulations it was concludedto use modified von Karman model as more consistent with experimental data.

Figure 3: Simulation of layered atmosphere using von Karman model.

MONTE-CARLO SIMULATIONS

The variation of the refractive index in the atmosphere is a random process. Henceturbulence models give statistical averages of the structure function and power spec-trum of refractive index. The phase fluctuations may be presented as a weighted sumof basis functions such as Zernike polynomials or Fourier series coefficients. Themethod based on Fourier series is commonly used and produces adequate results.In the AORTA simulator, phase fluctuations φ(x, y) were assumed as Fourier-transformable functions:

φ(x, y) =

+∞∫

−∞

+∞∫

−∞

Φ(fx, fy) exp[i2π(fx · x + fy · y)]dfxdfy (2)

where Φ(fx, fy) is the spatial-frequency-domain representation of the phase.To generate phase screens on a finite grid, the phase φ(x, y) can be described interms of Fourier series:

φ(x, y) =

N/2∑

n=−N/2

N/2∑

m=−N/2

cn,m exp[i2π(fxn · x + fym · y)], (3)

where fxn and fym are the discrete x− and y−directed spatial frequencies, and thecn,m are the Fourier-series coefficients. The results of Monte-Carlo simulations fordifferent power spectrum models are shown on Fig. 4.

hill Atmosphere phase Turbulence Profile

50 100 150 200 250 300 350 400 450 500

50

100

150

200

250

300

350

400

450

500

radian

−60

−40

−20

0

20

40

60

80

vonkarman Atmosphere phase Turbulence Profile

50 100 150 200 250 300 350 400 450 500

50

100

150

200

250

300

350

400

450

500

radian

−15

−10

−5

0

5

10

Figure 4: Comparison of the power spectrum models: (top) Kolmogorov spectrum and (bottom) vonKarman spectrum.

Layered model is a fairly good approximation. For accurate atmosphere representa-tion, typically 5-10 phase screens are used in the simulations.

MODELS OF POINT SOURCES OF LIGHT

Mathematical model of a point light source is represented by a Dirac delta function:

Upls(r1) = δ(r1 − rc), (4)

where rc = (xc, yc) is the location of the point source in the (x1; y1) plane. But sucha point light source has an infinite spatial bandwidth, while most optical sources arespatially band-limited.AORTA simulator uses sinc-sinc model : two sinc functions to generate narrow pointsource. The model uses two sinc functions to generate narrow point source. Forexample, if a square region of width D is used then window function is the following:

W (r2 − rc) = A rect(

x2 − xc

D

)

rect(

y2 − yc

D

)

, (5)

where A is an amplitude factor, xc and yc are coordinates the location of the pointsource in the (x1; y1) plane. The model of sinc-sinc point source is given by:

Upls(r1) = Ae− ik∆z2∆z r2

1 e− ik∆z2∆z r2

c e− ik∆z2∆z r1rc

(

D

λ∆z

)

sinc[

D(x1 − xc)

λ∆z

]

sinc[

D(y1 − yc)

λ∆z

]

(6)

Figure 5: Light point source simulated with sinc-sinc model.

The simulated point source that represents astronomical object is shown on Fig. 5.

OPTICAL IMAGES FORMATION

When the source light P′ is at long distance from the aperture, the curvature of thewavefront reaching the aperture may be considered plane. If the energy of the planeis constant EA over the aperture A, then the optical disturbance U(P) at point P attime t is:

dU(P) =EA

zexp[i(ωt − kz)]dS, (7)

where ω is the temporal frequency of radiation, k = 2πλ

is the wavenumber, and z isthe distance between dS and P. The total disturbance at P can be found by integratingthe contributions from each element of dS.The source plane has coordinates (x1, y1) and (x2, y2) in the observation plane. Thedistance between the source and observation planes is ∆z . The problem is: given thesource-plane optical field U(x1, y1) we need to find observation-plane field U(x2, y2).The solution is given by the Fresnel diffraction integral :

U(x2, y2) =eik∆z

iλ∆z

+∞∫

+∞∫

U(x1, y1)ei k2∆z [(x1−x2)

2+(y1−y2)2]dx1dy1 (8)

This equation presents a paraxial approximation that is appropriate is seeing anglesare not too far from zenith. The quadratic phase factor inside the Fresnel diffractionintegral is not band-limited, so it poses some challenges related to sampling.In the proposed simulator it has been implemented the following approaches for lightpropagation:◮ Fraunhofer diffraction;◮ one-step Fresnel diffraction;◮ two-step Fresnel diffraction;◮ angular spectrum propagation.

SIMULATION OF LIGHT PROPAGATION THROUGHTURBULENT ATMOSPHERE

Using the Monte-Carlo simulations of turbulence atmosphere with von Karman modelof turbulence power spectrum, one can calculate the propagation of point light sourcethrough layered atmosphere. As a result, the scattering of light can be observed (seeFig. 6).

Figure 6: Light propagation through the turbulent atmosphere: (left) point source propagation through3 turbulent layers, (right) point source propagation through 6 turbulent layers.

In order to characterise the image’s quality, Strehl ratio was used as traditional crite-rion of images quality in optics. Strehl ratio is the ratio of the observed peak intensityat the detection plane of an imaging system compared to the maximum peak intensityof a perfect imaging system at the diffraction limit (Airy disk):

S =

∫∫

MTF g(νx, νy)dνx, dνy∫∫

MTF ideal(νx, νy)dνx, dνy(9)

The algorithm for evaluation of Strehl ratio includes arbitrary-sized region of interest(ROI) and cubic interpolation within that ROI. Numerical simulations were conductedfor investigation of how the ROI size influences on the value of Strehl ratio. The resultsof simulations are summarised in Table 1.

Table 1: Strehl ratio evaluation with ROI: influence of ROI size on Strehl ratio.

Atm. Strehl ratio, Strehl ratio, Strehl ratio, Strehl ratio, Strehllayers ROI 16 pix ROI 32 pix ROI 64 pix ROI 128 pix ratio, theory

1 1.00000 1.00000 1.00000 1.00000 1.000002 0.34017 0.33745 0.33609 0.33533 0.193813 0.10768 0.10620 0.10528 0.10479 0.085404 0.01801 0.01478 0.01389 0.01363 0.020295 0.02730 0.01341 0.01149 0.01090 0.011176 0.04194 0.01429 0.00920 0.00829 0.00888

Analysis of the results from Table 1 allows to conclude that small size of ROI tendsto overestimate the value of Strehl ratio. Optimal size of ROI is between 64 and 128pixels for the 512 × 512 grid.

WAVEFRONT SENSING

The wavefront may be sensed as a displacement of the light spots focused by thesensor’s lenslet array. Each lens takes a small part of the aperture (sub-aperture),and forms an image of the source. When an incoming wave-front is plane (see Fig. 7),all images are located in a regular grid defined by the lenslet array geometry.

Figure 7: Principle of the Shack-Hartmann wavefront sensor: (left) positions of light spots forundistorted reference wavefront, (right) positions of light spots for distorted wavefront passed thoughturbulent atmosphere.

If the wavefront is distorted, the images of light spots are displaced from their nominalpositions. Displacements of image centroids in two orthogonal directions x, y areproportional to the average wave-front slopes in x, y over the sub-apertures:

x =

i,j xi,jIi,j∑

i,j Ii,j, y =

i,j yi,j Ii,j∑

i,j Ii,j, (10)

where Ii,j are the intensities of light on the detector’s pixels.

ZONAL WAVEFRONT RECONSTRUCTION

For the Shack-Hartmann sensor, we need to measure the x− and y−gradients in thesame sub-aperture. This can be done using Fried geometry, as shown on Fig.8a. Thehorizontal dashes indicate positions of x−slope sampling, the vertical dashes are they−slope sampling positions. The filled circles are the estimated phase points. Themeasured phase differences are converted from length into phase:

φx =2π

λLxθx, φy =

λLyθy (11)

where Lx is a length of the element, and θx is the measured angle of arrival compo-nent. The reconstruction of wavefront slopes can be performed as follows:

Sxi,j =

(φi+1,j + φi+1,j+1)/2 − (φi,j + φi,j+1)/2

h(12)

Syi,j =

(φi,j+1 + φi+1,j+1)/2 − (φi,j + φi+1,j)/2

h(13)

where h = D/N, and D is the diameter of the aperture and the N is the number oflenslets. The estimation of phase can be done as follows:

φ = A†S. (14)

where inverse of gradient interaction matrix A are evaluated using Moore-Penrosepseudo-inverse A†.

a)0 0.1 0.2 0.3 0.4 0.5 0.6 0.7

0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

0.5Gradients that are restored from centroids

b)

2

4

6

8

10

12

14

16

18

202

46

810

1214

1618

20

−10

−5

0

5

x 10−3

c)

Figure 8: Zonal reconstruction of the wavefront: a) Fried geometry of slope measurements; b) matrixof gradients for the wavefront; c) reconstructed wavefront using zonal approach.

In the proposed simulator, Fried geometry of wavefront reconstruction is implemented.The calculated matrix of gradients is presented on Fig. 8b. The simulation of recon-structed wavefront is presented on Fig. 8c.

CONCLUSION

Adaptive optics is a technique that allows to compensate the impact of atmospheric turbulence in real-time thus improving the quality of astronomical images. However, adaptive optics systems are highly complicated networks of devices that makes analytical studyof such systems difficult. The aim of this project is to develop a complete adaptive optics simulator and investigate the controller design based on optimal control methods and Kalman filter. The proposed adaptive optics simulator is written on MATLAB and runs onGNU/Octave. According to conducted benchmarks, on typical size of matrices in adaptive optics simulations Octave is almost 3 times faster than MATLAB, but typically uses 10-20% more memory than MATLAB. The simulator contains software routines for modellingof atmospheric turbulence, wind profiles, Fresnel and Fraunhofer propagation, model of wavefront sensor, and zonal wavefront reconstruction. Using the developed simulator, it is possible to design and study the controller based on optimal control techniques andKalman filter. Design of the controller is the next stage of this research project.