User's Guide to the Adaptive Optics System


Table of Contents


Introduction
Observing Information
Preparing for an AO Run
Graphical User Interface
Other Software
Procedures
Gallery of Aberrations
Optics
Other Hardware
Trouble-Shooting
Logsheet
AO Song

Mt. Hamilton Homepage

Other Software

Real-time Controller:

AO IDL
LGS Airmass
Renishaw Pointing and Centering


Real-time Controller

Communications and Commands

Communication with the new Lick AO control System occurs via a single bi-directional Ethernet socket, with the control system acting as the server and the Host system acting as a client.

The socket sends and recieves data streams (as opposed to data-grams). Although this has the benefit of assuring successful transfer of all packets, and in the order sent, it also means that there is no guarantee that data will be sent in the 'chuncks' that the program sends them in. In other words, the messages can be split into multiple packets and messages can be concatenated into single packets. For this reason, the packets have to be parsed. Start and end sequences will be includedin the messages, as necessary, to facilitate this.

All data, in both directions, are in ASCII format.

Host to Control System Communications

All communication from the Host to the Control System takes the form of commands. These commands must be ASCII strings terminated with either a null character ('\0') or a new-line character ('\n'), but not both. With two exceptions, all commands have either zero or one parameter. The two exceptions are centoffs that has 80 float parameters and fillcm that has a filename as a parameter. The commands are described below.

COMMANDDESCRIPTIONNOTES
MISCELLANEOUS
gsmode xselects natural guide star (ngs) mode or laser guide star (lgs). (x: integer; 0 selects ngs mode, 1 selectes lgs mode)
abortaborts long commands (such as recent or cm)
quitquits the control system program
restartrestarts the control system from scratch (i.e., reboots)
shutdownshuts down Linus (in preparation for powering down)
parmsreads all parameter files into memorysame as cparms
CAMERA INTERFACE
rate xsets the frame rate of the camera (x: integer; 55, 100, 200, 250, 350, 500, 750, or 1000 frames per second)used by tcl
cgain xset the camera gain (x: integer; 1 or 2)
crtgain xsets the CRT gain (adjusts the video output only, has no effect on the images used by the control system) (x: integer; 1, 2, 3, or 4)
sratereads the frame rate from the camera and reports it to the host.
scgainreads the gain from the camera and reports it to the host
scrtgainreads the CRT gain from the camera and reports it to the host
centbinchanges to 4x4 binned by 2 quad cell centroider algorithm (to make a quad cell with larger pixels)
centcmchanges to center-of-mass centroider algorithm
centquadchanges to quad cell centroider algorithm
thresh xsets threshold used by the centroider on the images (new data) from the WFS (the threshold is subtracted from the raw data and them any resulting values less than zero are set to zero) (x: integer; 0 to 4095 ADC counts)
cflatdetermines new centroid flat field values (these are actually backround, or dark data, values), makes them current, and stores them to disk; these values are subtracted from the raw image data in the centroiding algorith; the file that the data are stored in is yyddmm/cflat_xx
refcentdetermines new reference centroids, makes them current, and stores them to disk; these values are subtracted from computed centroids in the centroiding algorithm; the file that the data are stored in is yymmdd/refcent?_xx, where ? is b, c, or q depending on the centroiding algorithm
centoffs x1 ... x80makes 80 centroid offsets received from the host current (these values are computed by the host as a function of image-sharpening slider positions); these values are subtracted from computed centroids in the centroiding algorithm (x1 ... x80; floats; -1.0 to 1.0 pixel units; 40 X centroids followed by 40 Y centroids)
saveoffsstores 80 current centroid offsets to disk; the file that the data is stored in is yymmdd/centoffs_xx
cparmsreads all parameter files into memory same as parms
sparmsmakes current reference centroids all zeroes (but does not store to disk>
RECONSTRUCTION
cmcreates a system matrix and saves it to disk (in preparation for computing a control matrix, cm, offline)
fillcm filenameloads the control matrix from the file specified by 'filename', which must be in the parms directory, from disk and makes that matrix current (filename: null-terminated string; can be any file name, including additional path information, e.g., cmNew, yymmdd/cmTest, etc.)
DM LOOP CONTROL
closecloses the AO loop used by tcl
openopens the AO loop, leaving the DM in its latest closed-loop state used by tcl
estopemergency stop - opens both the AO and TT loops
gain xsets the AO loop gain to x; can be issued with loop open or closed (x: float; 0.0 to 1.0) used by tcl
int xsets the AO loop integrator value to x; can be issued with loop open or closed (x: float; 0.0 to 1.0) used by tcl
cwt1 xsets the AO loop compensator weight 1 value to x; can be issued with loop open or closed (x: float; -1.0 to 0.0) lead/lag compensator
cwt2 xsets the AO loop compensator weight 2 value to x; can be issued with loop open or closed (x: float; -1.0 to 0.0) lead/lag compensator
mflataverages actuator voltages and stores the result to disk as the 'flat' voltages; the file that the flat voltages are stored in is yyddmm/flat_xx
flatten'flattens' the DM by loading the last flat voltages recorded and applying them to the DM
msharpaverages actuator voltages and stores the result to disk as the 'image-sharpened' voltages; the file that the flat voltages are stored in is yyddmm/sharp_xx
sharpen'sharpens' the DM by loading the last image-sharpened voltages recorded and applying them to the DM
reg xrepeatedly cycles the specified actuator to test the registration of the DM with the WFS, the health of hte actuator, etc. (this can be executed multiple times to move multiple actuators) (x: integer; see Registration Codes for details)
regokstops the cycling of all actuators started with reg
TIP/TILT CONTROLLER
ttclosecloses the TT loop used by tcl
ttopenopens the TT loop used by tcl
ttgain xsets the TT gain to x (x: float; 0.0 to 1.0) used by tcl
ttxmov xsets the TT X mirror voltage (x: float; -5.0 to +5.0 Volts) this is a temporary setting
ttymov xsets the TT Y mirror voltage (x: float; -5.0 to +5.0 Volts) this is a temporary setting
lxmov xsets the laser FSM X mirror voltage (x: float; -5.0 to +5.0 Volts) this is a temporary setting
lymov xsets the laser FSM Y mirror voltage (x: float; -5.0 to +5.0 Volts) this is a temporary setting
apdclosecloses the APD TT loop
apdopenopens the APD TT loop
apdrate xsets the APD loop rate (x: integer; 50, 100, 200, 300, 400, 500 Hz)
apdgain xsets the APD TT gain to x (x: float; 0.0 to 1.0)
apdbackdetermines background values for the APDs and stores them in the parms file
apdzbackzeroes the background values for the APDs and stores them in the parms file
DIAGNOSTIC DATA HANDLER
telem xstarts sending telemtery data to the host, depending on which bits in the 'x' are set:
  • raw image   = 0x01
  • centroids   = 0x02
  • intensity   = 0x04
  • DM voltages = 0x08
  • tt data     = 0x10

trate xrate at which telemetry data should be sent to the host (x: integer; 1 to 50 times per second)
diag xgathers diagnostic data into automatically named files, depending on which bits in 'x' are set:
  • raw image   = 0x01 (100 frames)
  • centroids   = 0x02 (2048 frames)
  • intensity   = 0x04 (2048 frames)
  • DM voltages = 0x08 (1024 frames)
  • tt data     = 0x10 (1024 frames)

imagessame as diag 0x01
datasame as diag 0x0E used by tcl
apddatasame as diag 0x10
ponturns psf data accumulation on
poff xturns psf data accumulation off, appending the integer value, x, to the filename (e.g., a value of 3 for x will give the filename "psfdata_0003.fits" stored in "/home/winderbean/AO/Data/psfdata/yymmdd")

Command notes:

  1. The 'parms' directory, where all parameter files are stored, is /home/winkerbean/AO/Data/Parms/.
  2. yymmdd, in filenames, refers to year, month, and day.
  3. xx in filenames refers to a sequential number from 00 to 99.
  4. The 'automatically named files' referred to in the diag command are stored in the /home/winkerbean/AO/Data/RunData/ directory and are:
    • yymmdd/rawImage_xx
    • yymmdd/cent_xx
    • yymmdd/inten_xx
    • yymmdd/mirror_xx
    • yymmdd/tt_xx
  5. Ann integer parameter should have a minus sign if it is negative and no sign if it is positive, followed by 1 or more decimal digits.
  6. A float parameter sould have a minus sign if it is negative and no sign if it is positive, should have at least 1 decimal digit, and may or may not have a decimal point.

Control System to Host Communications

Data going from the Control System to the Host takes the form of text messages or telemetry data. Both of these types of messages have the same overall format:

bytes 0-2message start sequence"~S~"
byte 3message identifier '0' = text message
'1' = raw image data
'2' = centroid data
'3' = intensity data
'4' = DM voltage data
'5' = tip/tilt data
bytes 4-xmessagesee Notes
bytes x+1 - x+4message end sequence"~E~\n"

Notes:

  1. All numerical data are single-space delimited.
  2. Integer data has a minus sign if it is negative and no sign if it is positive followed by 1 or more decimal digits.
  3. Float data has a minus sign if it is negative ad no sign if it is positive, has at least 1 decimal digit, may or may not have a decimal point, and may be in scientific notation (e.g., "1.23e-08").

Message Descriptions

The text messages are 'Error', 'Warning', or 'Notification' messages; for example: These messages should be displayed for the user (preferably in a scrollable window) and logged to the log file. These messages are generally self-explanatory.

Error messages indicate that an event has occurred that puts the performance of the AO system into questions. These are usually not fatal in the sense that the system has not 'crashed'. But the user should be aware of the reported error and make a judgment, based on the performance of the system, as to whether the system can continue to be used without corrective action. Repeated errors indicate a more serious problem.

Warning messages indicate that an event has occurred that the user should be aware of. The cause of isolated warning messages should not adversely affect the performance of the system. If warning messages occur repeatedly, they should be treated in the same way that error messages are treated.

Notification message simply notify the user of an event in normal operation.

Raw Image Data

The raw image data is sent in 64 messages, one per pixel row. Each message consists of 64 single-space delimited integers. Together, the 64 messages represent the 64 by 64 camera pixels in ADC counts. The data in each message is prefaced by either an "Sx Ry", where x indicates the sub-aperture row (0 through 7) and y respresents the pixel row in the sub-aperture row (0 through 5), or a "URz", where z represents the unused pixel row (0 through 15).

Centroid Data

The centroid data messages consist of 80 single-space delimited floats, representing the 40 X centroids followed by the 40 Y centroids in pixel units.

DM Voltage Data

The DM voltage data messages consist of 61 single-spaced delimited floats, representing the 61 actuator errors in Volts.

Tip/Tilt Data

The tip/tilt data messages consist of 20 single-space delimited floats, representing the following:
  1. X tip/tilt error, in pixel units
  2. Y tip/tilt error, in pixel units
  3. X tip/tilt mirror setting, in Volts
  4. Y tip/tilt mirror setting, in Volts
  5. X telco setting, in Volts
  6. Y telco setting, in Volts
  7. X laser steering setting, in Volts
  8. Y laser steering setting, in Volts
  9. not currently used
  10. telco enable, in Volts (0V = enables, -5V = disabled)
  11. APD A counts
  12. APD B counts
  13. APD C counts
  14. APD D counts
  15. X APD tip/tilt error, in APD units
  16. Y APD tip/tilt error, in APD units
  17. X tip/tilt mirror LVDT reading, in TBD
  18. Y tip/tilt mirror LVDT reading, in TBD
  19. APD over-limit flat (0.0 if all APDs are reading less than or equal to 1,000,000 counts per second, 1.0 if any APD is reading more than 1,000,000 counts per second)
  20. total number of APD counts, for the four APDs, per second

Registration Codes

In fhte following, 'cycling' actuators means giving the actuators a -5Volt to +5 Volt triangle wave with a frequency of 1Hz (except where noted).

Reg CodeFunction
-1cycles each active DM actuator for 5 seconds, in a round-robin fashion (starting with a0)
0 through 60cycles active DM actuators a0 through a60 respectively
70cycles tip/tilt mirror X axis
71cycles tip/tilt mirror Y axis
80cycles laser steering mirror X, no rotation
81cycles laser steering mirror Y, no rotation
82cycles laser steering mirror X, with rotation
83cycles laser steering mirror Y, with rotation
84cycles laser steering mirror X, with rotation, from 0 Volts to +5 Volts
85cycles laser steering mirror Y, with rotation, from 0 Volts to +5 Volts
100 through 460sets laser steering mirror rotation to 0 through 360 degrees (temporarily, this is not stored to disk)

Parameter File Format

The parameter file, /home/winkerbean/AO/Data/Parms/parms, stores all the current parameters for the real-time controller. These parameters are read in any time the software, aostart, is restarted and the file is updated anytime a listed parameter is changed. Each entry in the parms file is described below.


FieldFile Name or Default ValueExample: 2003 Dec 16
1current cflat filenameyymmdd/cflat_xx031215/cflat_06
2current refcentb filenameyymmdd/refcentb_xx031210/refcentb_00
3current refcentc filenameyymmdd/refcentc_xx031210/refcentc_00
4current refcentq filenameyymmdd/refcentq_xx031210/refcentq_00
5current centoffs filenameyymmdd/centoffs_xxt5
6current cm filenameyymmdd/cm_xxCMSep03_00wls3.sdt
7current flat filenameyymmdd/flat_xx031120/flat_01
8current sharp filenameyymmdd/sharp_xx031215/sharp_00
9# of frames to averages when determining cflat and APD background values100200
10# of frames to averages when determining reference centroids1002000
11# of DM voltages to average when determining a system matrix1002000
12#of DM voltages to average when determining flat and sharp mirror values100200
130 sets to ngs mode, 1 sets to lgs mode00
14camera frame rate, in frames per second, 55, 100, 200, 250, 350, 500, 750, or 1000100500
15camera gain, 1 or 212
16camera CRT gain, 0, 1, 2, 3, or 4 04
17indicates which centroid algorithm is currently being used, 0 = 4x4 binned, 1 = center-of-mass, 2 = quad-cell22
18centroider raw-data threshold, in ADC counts00
19AO loop gain (proportional gain), 0.0 o 1.00.351
20AO loop integrator gain, 0.0 to 1.00.950.998
21AO loop compensator weight 1, -1.0 to 0.01.01
22AO loop compensator weight 2, -1.0 to 0.01.01
23tip/tilt loop gain, 0.0 to 1.01.01
24APD loop rate (50, 100, 200, 300, 400, 500 Hz)100500
25APD loop gain, 0.0 to 1.00.0030.01
26APD A background values (in APD counts)00
27APD B background values (in APD counts)00
28APD C background values (in APD counts)00
29APD D background values (in APD counts)00
30next sequential file number (for data files)069
31serial number for DAC board farthest to the left when looking at the front of the lgs7 chassis, that DM channels 0 to 31 are plugged into-118362
32serial number for DAC board farthest to the left when looking at the front of the lgs7 chassis, that DM channels 32 to 63 are plugged into-118366
33serial number for DAC board farthest to the left when looking at the front of the lgs7 chassis, that DM channels 64 to 95 are plugged into-118364
34serial number for DAC board farthest to the left when looking at the front of the lgs7 chassis, that DM channels 96 to 127 are plugged into-118361
35serial number for DAC board farthest to the left when looking at the front of the lgs7 chassis, that TT channels are plugged into-118333

Important: If the format of the parameter file changes, the Tcl program parmsRead.tcl will have to also be updated to reflect this change (otherwise the LickAO and CentDiag software will be unable to properly read the current parameters).

Laser-offload (loffload)

There is a program called loffload (laser-offload) on lgs7 that can be executed for the purpose of displaying laser offload data. The program can be executed by the root user or by the lgs user usint sudo (super-user-do). Super user privileges are necessary because the program accesses shared kernel memory.

If runnig the program as the lgs user, do the following:

  1. Establish a remote session, logging on as lgs, and using the lgs password.
  2. At the prompt, enter: sudo loffload
  3. Data will star being displayed, as described below.
To terminate the program, enter a control-C.

If the AO code is quit, loffload will be automatically terminated and will have to be restarted after hte AO code is restarted.

The data displayed by loffload will be updated once per second and will look similar to the following:

Avg TT Volts X: 0.113277 Avg TT Volts Y: -0.370412

The data represent the voltage being applied to the X and Y axes of the laser uplink mirror, averaged over 1 second (using a rolling average).

Note that, although loffload is intended to be used in lgs mode, it can also be used in ngs mode, in which case, the data will represent the voltage being applied to the X and Y axes of the tip/tilt mirror (on the optical table), averaged over 1 second (using a rolling average).

Note that CentDiag now uses this information and will create an audio alert ,via the soundserver software for IRCAL, when the laser fast steering mirror voltage is above a threshold value (currently 1.5 Volts) for over a certain time period (currently 60 seconds) when the uplink TT loop is closed. This signals to the laser operator that a manual adjustment of the laser pointing is needed.


AOIDL

IDL program to evaluate rotation of WFS, estimate R0, and plot open and closed loop power spectra. More to come....


LGSairmass

Program to help estimate what the WFS focus position should be for a given airmass in LGS mode. More to come....


Renishaw Pointing and Centering

GUI for trouble shooting pointing and centering motor move errors and mistakes. Simulates code used for positioning motors in LickAO. More to come...


Elinor Gates
Last modified: Wed Apr 30 13:18:41 PDT 2008