Running the AO loop gain optimization tool




An adaptive optics system does not deliver perfect image quality because of residual wavefront errors. Two of the largest wavefront errors are the following:

Bandwidth errors:
Uncorrected turbulence due to the AO system not running fast enough (i.e., the uncorrected turbulence is faster than that corrected by the AO system)
Measurement noise errors:
Noise in the commands introduced to the tip-tilt mirror or DM due to the measurement errors in the wavefront sensor propagating to the mirror.
Increasing the frame rate (or reducing the integration time) and increasing the loop gain (up to a point) both have the effect of reducing the bandwidth error while increasing the measurement noise error. Hence, the optimal correction is achieved by trading off these two error terms by selecting the optimal frame rate and loop gain.

The NGWFC has two WFC parameters called the centroid-to-arcsecond conversion: one for the WFS, wscngn and one for STRAP, stcngn. There is an additional keyword, stcentgn, that keeps track of the STRAP centroid-to-arcsecond conversion so that if the WFC needs to be rebooted, the last value is automatically reloaded. The centroid to arcsecond conversion is multiplied by the raw centroid to obtain the centroid in arcsecond units. The bigger the spot size, the higher the value of the centroid-to-arcsecond conversion.

In the case of the WFS, there are 608 centroid-to-arcsecond conversion factors, one per orientation of each subaperture. When operating in NGS, all 608 values are the same. However, for LGS AO, the values depend on the LGS elongation and so vary from subaperture to subaperture. They also differ for x and y. For STRAP, there is only one value. It is important that these keywords have approximately the correct value for two reasons:

  • The control law (loop gains) can only be optimized if the centroid-to-arcsecond conversion is correct
  • The centroid origins (cog files) are correct only if the centroid-to-arcsecond conversion is correct

By setting the correct centroid-to-arcsecond conversion and estimating the turbulence and noise, we are able to find the frame rate and nominal gain that optimizes the performance of the AO system. For more information on how the optimization widget works, read the NGS or LGS AO characterization papers.



To bring the optimization tool up, right click on the screen to get the Menu, then click on K2 AO tools, then AO Ops, then Optimization widget. If you cannot do this from the pulldown, in a k2aoserver window type idl. At the prompt, type bw_widget. The optimization widget should come up.


Select the mode from the Ops Mode pulldown. The IF mode should be used whenever the DT Control offset is not set to zero and the system is used in NGS AO mode. The IF mode ignores the average value of the tip-tilt controller.
Once the mode has been selected for the type of diagnostic you wish to take, the next step is to take the diagnostic.

Regardless of the mode, we can select the number of diagnostics by editing the text box DIAG LENGTH. The maximum number of diagnostics the tool will allow is 10000. The total time will be the value of DIAG LENGTH divided by the frame rate, or DIAG LENGTH multiplied by the integration time for STRAP diagnostics. Note that the data is always captured in the past, starting from approximately the time when the button is pressed.Ensure that the AO system was in the state that you want for an appropriate amount of time (i.e.,, you wait at least DIAG LENGTH/FRAME RATE seconds after making a change or closing the loops). Then press the DIAGNOSTIC button, which will record the data from the subsequent frames. Now wait until the diagnostic is complete.


The Optimization Tool will automatically analyze the diagnostics after the data acquisition is complete. However, you may wish to analyze the last (or any other) diagnostic again, after changing the centroid gain value to better fit the data. To replot after changing the centroid gain, press ANALYZE.

After the diagnostic is complete, you may change the centroid gain parameter until there is a good fit between the measured noise and the modeled noise, as can be seen in the figure below. The wavefront sensor noise is assumed to be white (equal at all frequencies) and uncorrelated. However, the AO system colors the noise (amplifies the noise at some frequencies and suppresses it at others) by changing the voltages in the mirror in response to the noise. By measuring the power spectrum of the noise, we are able to discern the effective loop gain of the system. The modeled noise is overplotted on top of the measured power spectrum, which also contains the uncorrected turbulence. Hence, the measured power spectrum should always be equal to or greater than the modeled noise at all frequencies (except for small random fluctuations in the diagnostics). We define the centroid gain to be the highest value of the centroid gain for which this holds true. Once the centroid gain has been found (this should typically be a value somewhere between 0.5 and 2.0), and you have a good fit to the data, then click Update. Pressing UPDATE will update the centroid-to-arcsecond conversion keywords and will set the centroid gain back to 1. The reason for this is that the centroid gain you have calculated is effectively the difference between the centroid-to-arcsecond conversion that you operating with and the centroid-to-arcsecond conversion that you measure. When you update the centroid-to-arcsecond conversion, the two are the same.

The centroid-to-arcsecond conversion cannot be adjusted for LGS AO, since it is automatically set by the reconstructor depending on the elevation, pupil angle and the minimum and maximum LGS spot size specified in the LGS checkout. For this reason, you cannot change the centroid gain parameter in LGS mode.

DO NOT EVER CLICK UPDATE UNLESS:

  • You know what you are doing, and
  • You have a good fit of the data to the model

Centroid gain=0.9 Centroid gain=1.1 Centroid gain=1.3

Here is an example of a diagnostics with three centroid gains. I believe that the correct centroid gain for this case is 1.1. As long as the centroid gain is known to about ~20%, the loops can be optimized.

With the NGWFC, we still have the problem (as of November 2007) that the reconstructor load can often cause an additional, fixed delay in the control loop. In that case, the measured and modeled power spectra will not agree the loops cannot be easily optimized. The figure below shows what a power spectrum might look like in this case.

Bad fit due to the problem with the reconstructor load. There is also a vibration spike in the DM power spectrum at around 250 Hz, but this is unrelated.

At the beginning of the night, take a 10000 sample STRAP diagnostic of the 10-mag star with the loop gain set high (e.g., 0.4). Find the centroid gain value that best fits the data. Once you have done this, UPDATE the centroid-to-arcsecond conversion. Take another diagnostic to ensure that the centroid-to-arcsecond conversion is good. Then enter the diagnostic number in the TURB PS box. Record both the diagnostic number and the centroid-to-arcsecond conversion: this is printed in the IDL terminal or can be seen by typing show -s ao stcngn.

In LGS AO, it is more important to optimize the STRAP loop. Fitting the STRAP centroid gain is very difficult if the tip-tilt guide star is faint. If you cannot determine the centroid gain, do not update it; instead, use the existing value. If the star is fainter than 16, do not bother to try to optimize using the diagnostics unless you are a guru (check that you are a guru first). Instead, we will use the settings provided by the LGS AO acquisition widget (it calls the same functions that CALC OPT GAIN and SET OPT GAIN do).

For the DM loop, make sure that the noise fit reasonable. There is no way to know from the diagnostics whether the star was lost, the loops were open, etc, so if in doubt, take another diagnostic.

If using diagnostics to optimize and the recommended gain is very different to the current gain, then update in increments (e.g., current gain is 0.3, optimal gain is 0.8? Set gain to 0.6 and take a new diagnostic).

The tip-tilt gain should not be set higher than 0.5, since it is possible to make the tip-tilt mirror resonate if the gain is too high.

OPS MODE
Sets the operation mode for both taking diagnostics or analyzing them. For example, if the mode is set to LGS and a diagnostic is taken, it will be analyzed as if it were LGS AO data (this information is NOT recorded in the diagnostic, which is why the mode must be selected).
DIAG NO
Need to set this to analyze a diagnostic other than the last one that was taken.
DIAGNOSTIC
Triggers a new diagnostic of the type defined by OPS MODE
ANALYZE
Analyzes the diagnostic with a number given by DIAG NO and of the type defined by OPS MODE
SET PATH
Sets the path for where to look for the diagnostic if the diagnostic is not in the default location. Commonly used to analyzed archival data, but not needed on the sky.
LGRTHM/LINEAR
Change the display of the y-axis of the plots from logarithmic to linear and vice-versa. Press ANALYZE after changing the display mode to redisplay the plots. The default is logarithmic.
DISMISS
Dismisses the GUI and the IDL session.
CENTROID GAIN
Sets the centroid gain for the existing mode (STRAP, NGS or IF) for trying to determine the centroid-to-arcsecond conversion. This is applied to analysis of the next diagnostic or can be used to reanalyze the current diagnostic if ANALYZE is pressed.
UPDATE
Uses the value in the CENTROID GAIN field to update the centroid-to-arcsecond conversion. The centroid gain value will then go to 1.
AUTO/MANUAL
Used to automatically estimate the centroid gain from the power spectrum. This does not always work, so the accuracy of the centroid gaine stimate should be sanity checked using the plots of the power spectra used to derive the estimates.
TURB PS
Select the diagnostic number that has already been analyzed with the correct centroid gain and set this power spectrum to be a default power spectrum representative of the current atmospheric conditions. This is used to set the STRAP gain automatically for each new star and also to set the gain when guiding on very faint tip-tilt guide stars and it is not possible to make an accurate measurement of the turbulence because the data is too noisy.
STRAP CALC ERROR
Calculate the wavefront error as a function of gain for the current number of counts on STRAP. Press this button after the tip-tilt guide star has been acquired.
STRAP SET OPT GAIN
Set the optimal gain as the gain on STRAP. The optimal gain must have been previously calculated either by analyzing a diagnostic or by pressing CALC ERROR.
For more information, please contact
.