Notes on interaction and control matrices for Hokupa'a.

6 July 2001
M. Chun

1. General


The measurements [m] given by the wavefront sensor (WFS) can be related to the applied voltages on the deformable mirror (DM) by a simple matrix multiplication.

Equation 1 --> [m] = [imat] [a]
The vector [m] and [a] represent the vector of measurements and actuator drive voltages while the array [imat] maps motion of the actuators into sensor measurements. The relationship can be generated using the instrument or from theoretical considerations (given a model of the influence functions and boundary conditions of the mirror). The key to all of this is that the columns of [imat] correspond to the measurements in the sensor for a unit voltage applied to a single actuator. For example, the second column in the array [imat] is what is measured (on average) in the WFS if a unit voltage is applied to the second actuator (with all others set to zero).
[m11 .. .. .. ]
[m21 .. .. .. ]
[m31 .. .. .. ]
[... .. .. .. ]
^-- sensor measurements when actuator#1 is driven with unit signal
For the actual servo loop of the adaptive optics system, we want the inverse relationship. Namely we make measurements [m] and want to know the actuator commands [a]. To obtain this 'control matrix' we simply invert equation #1. This inversion can be done a number of ways but a "single value decomposition" turns out to be good since it also determines the main modes of correction of the mirror (mirror modes) plus the systems relative ability to measure and correct each of these modes.

2. Practice

The main issues in the measuring the 'interaction' matrix are (1) obtaining a good signal-to-noise ratio in the measurements and (2) dealing with hysteresis in the DM material. The procedure used by Hokupa'a is to flatten the wavefront, then make many measurements of the sensor for a positive displacement of a single actuator and again for a symmetric negative displacement. Using a symmetric signal (pos/neg) drives the actuator about its 'zero' voltage and should be less insensitive to hysteresis. In addition, the signal for a negative displacement is simply the opposite of the signal for a positive displacement so you can flip the sign of one set and average all the measurements for a higher signal-to-noise ratio.

Procedure:

a. Insert the internal source at the entrance focus of the instrument
b. Close the loop to flatten the wavefront (skip if no control matrix!)
c. Loop through actuators (cntr Iact)
i. For Icycles=1,n do
a) apply voltage +V to actuator Iact
b) measure average WFS signals over n cycles
c) apply voltage -V to actuator Iact
d) measure average WFS signals over n cycles
e) invert average measurement for negative V
f) average with positive measurement
ii. Place the average measurement vector into column Iact of the matrix [imat]
d. Repeat the process and average the results.


The above process for the 36-element system takes a few minutes.  The default number of cycles to average each measurement over is 100 and the number of iterations to average the entire matrix over is 100.

A note on the actuator voltages and membrane stroke to apply when measuring the interaction matrix: You want a signal modulation (I2-I1)/(I1+I2) ~ 0.3 (I think). This keeps the signal within the linear response of the system. However, the actual membrane stroke you use will depend on the seeing and extent of the guide source. So an interaction matrix really needs to be generated for several membrane strokes in anticipation of the range to be used during the observations. The entire process can be automated and done during the day (although it shouldn't change from night-to-night apart from variations in the membrane stroke due to temperature and humidity).

A visual display of the generated [imat] is useful (see figure imat.gif).  For a curvature system the interaction matrix is nearly diagonal since the sensor-to-actuator mapping is nearly one-to-one. The way to 'read' an interaction matrix is to read 'actuator' number across the bottom and sensor signals along the sides. The normal response is that when you 'poke' a particular actuator (say #23), you get a large signal on sensor #23 and a fainter signal on sensors that correspond to the nearest neighbors (both tangentially and radially). The influence function of the actuator will cause the signal in nearby sensors to be positive or negative depending on how far away the sensor is from the actuator.  Note that the outer ring of actuators is used to satify the edge slope condition so their effect on the sensors is different from the 'inner' actuators. Along the diagonal (plot a surface plot of [imat]), the variation in response of the actuators can be seen. As long as the SNR is good, these variations represent real variations in the actuators response.

imat.gif

CAPTION for figure (IMAT.imat.gif): Left figure shows the arrangement of the lenslets/actuators in the Hokupa'a-36 system. The sensors/actuators are numbered counter clockwise starting with the inner ring at the lenslet/actuator just above the positive x-axis. In the figure, the actuators are color coded with lenslet/actuator #1 being white and #36 darkest red.  The figure on the right shows an intensity plot of an interaction matrix taken with Hokupa'a in April 2001. The characteristic diagonal elements are clearly seen in the figure along with the influence on neighboring actuators/sensors.

3. Inverting [imat] for the control matrix

The AOS must calculate the mirror drive signals from measurements from the WFS. This is simply the inverse of the relation as stated for the interaction matrix (equation #1).
[act] = [imat]^-1 [meas]
The inverse of the interaction matrix is the control matrix and can be found a number of ways. The single value decomposition (SVD) finds the inverse by generating a set of orthonormal eigenfunctions and a set of singular values (the eigenvalues). There are a number of  routines available to do the SVD and the version used in Hokupaa is straight from Numerical Recipes.

The SVD of a square matrix [A] returns an array [U] whose columns represent an orthonormal set of basis functions, a vector [W] of singular values, and another array [V]. The input matrix [A] = [U] [diag W] [V]^t(ranspose) where the matrix [diag W] is a square matrix whose diagonal elements are equal to the elements in [W] and zero everywhere else. The inverse of the input matrix [A] can be written as

[A]^-1 = [V] [diag 1/w] [U]^t
where the diagonal elements of [diag 1/w] are the inverse of the elements of [W].

The array [U] is a set of functions that describe the modes of deformation of the mirror. These 'mirror modes' can be plotted by extracting each column and rearranging the elements in the form of the DM actuators.  Now the power of the SVD is that a given arrangement of actuators and sensors may or may not be good for measuring particular deformations (in particular mirror modes). A measure of this is given by the singular values.  For a well behaved system all the eigenvalues are large. In other words, all the modes of the mirror are well sensed by the wavefront sensor.  Here the usual thing to do it plot w/MAX(w). Values between 0.01 and 1 are 'large' while smaller values indicate that the system is unable to measure/correct for a particular mirror mode. The default 'condition number' for Hokupa'a is to reject all modes with singular values < 0.15.

eigenvalues.gif

CAPTION for figure (IMAT.figure.eigenvalues.gif): A plot of the eigenvalues for a Hokupa'a interaction matrix (imat816). The eigenvalues are normalized by the maximum eigenvalue.

The SVD's power is that the calculation of the control matrix can exclude  any of these singular mirror modes. This is simply done by setting the diagonal elements of [diag 1/w] to zero for any mode with small w.  The resulting control matrix does not include any wavefront error which is made up of these 'null' modes. This does not mean that the deformable mirror is completely free of these null modes. See note on loop processor for discussion.