Other Software
Real-time Controller:- Communications and Commands
- Data Format
- Registration Codes
- Parameter File Format
- Laser-offload (loffload)
- Software Structure Schematic
- Timing Schematic
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.
COMMAND | DESCRIPTION | NOTES |
---|---|---|
MISCELLANEOUS | ||
gsmode x | selects natural guide star (ngs) mode or laser guide star (lgs). (x: integer; 0 selects ngs mode, 1 selectes lgs mode) | |
abort | aborts long commands (such as recent or cm) | |
quit | quits the control system program | |
restart | restarts the control system from scratch (i.e., reboots) | |
shutdown | shuts down Linus (in preparation for powering down) | |
parms | reads all parameter files into memory | same as cparms |
CAMERA INTERFACE | ||
rate x | sets the frame rate of the camera (x: integer; 55, 100, 200, 250, 350, 500, 750, or 1000 frames per second) | used by tcl |
cgain x | set the camera gain (x: integer; 1 or 2) | |
crtgain x | sets 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) | |
srate | reads the frame rate from the camera and reports it to the host. | |
scgain | reads the gain from the camera and reports it to the host | |
scrtgain | reads the CRT gain from the camera and reports it to the host | |
centbin | changes to 4x4 binned by 2 quad cell centroider algorithm (to make a quad cell with larger pixels) | |
centcm | changes to center-of-mass centroider algorithm | |
centquad | changes to quad cell centroider algorithm | |
thresh x | sets 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) | |
cflat | determines 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 | |
refcent | determines 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 ... x80 | makes 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) | |
saveoffs | stores 80 current centroid offsets to disk; the file that the data is stored in is yymmdd/centoffs_xx | |
cparms | reads all parameter files into memory | same as parms |
sparms | makes current reference centroids all zeroes (but does not store to disk> | |
RECONSTRUCTION | ||
cm | creates a system matrix and saves it to disk (in preparation for computing a control matrix, cm, offline) | |
fillcm filename | loads 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 | ||
close | closes the AO loop | used by tcl |
open | opens the AO loop, leaving the DM in its latest closed-loop state | used by tcl |
estop | emergency stop - opens both the AO and TT loops | |
gain x | sets 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 x | sets 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 x | sets 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 x | sets 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 |
mflat | averages 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 | |
msharp | averages 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 x | repeatedly 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) | |
regok | stops the cycling of all actuators started with reg | |
TIP/TILT CONTROLLER | ||
ttclose | closes the TT loop | used by tcl |
ttopen | opens the TT loop | used by tcl |
ttgain x | sets the TT gain to x (x: float; 0.0 to 1.0) | used by tcl |
ttxmov x | sets the TT X mirror voltage (x: float; -5.0 to +5.0 Volts) | this is a temporary setting |
ttymov x | sets the TT Y mirror voltage (x: float; -5.0 to +5.0 Volts) | this is a temporary setting |
lxmov x | sets the laser FSM X mirror voltage (x: float; -5.0 to +5.0 Volts) | this is a temporary setting |
lymov x | sets the laser FSM Y mirror voltage (x: float; -5.0 to +5.0 Volts) | this is a temporary setting |
apdclose | closes the APD TT loop | |
apdopen | opens the APD TT loop | |
apdrate x | sets the APD loop rate (x: integer; 50, 100, 200, 300, 400, 500 Hz) | |
apdgain x | sets the APD TT gain to x (x: float; 0.0 to 1.0) | |
apdback | determines background values for the APDs and stores them in the parms file | |
apdzback | zeroes the background values for the APDs and stores them in the parms file | |
DIAGNOSTIC DATA HANDLER | ||
telem x | starts sending telemtery data to the host, depending on which bits
in the 'x' are set:
| |
trate x | rate at which telemetry data should be sent to the host (x: integer; 1 to 50 times per second) | |
diag x | gathers diagnostic data into automatically named files,
depending on which bits in 'x' are set:
| |
images | same as diag 0x01 | |
data | same as diag 0x0E | used by tcl |
apddata | same as diag 0x10 | |
pon | turns psf data accumulation on | |
poff x | turns 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:
- The 'parms' directory, where all parameter files are stored, is /home/winkerbean/AO/Data/Parms/.
- yymmdd, in filenames, refers to year, month, and day.
- xx in filenames refers to a sequential number from 00 to 99.
- 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
- 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.
- 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-2 | message start sequence | "~S~" |
byte 3 | message identifier |
'0' = text message '1' = raw image data '2' = centroid data '3' = intensity data '4' = DM voltage data '5' = tip/tilt data |
bytes 4-x | message | see Notes |
bytes x+1 - x+4 | message end sequence | "~E~\n" |
Notes:
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.
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.
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:
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 Code | Function |
---|---|
-1 | cycles each active DM actuator for 5 seconds, in a round-robin fashion (starting with a0) |
0 through 60 | cycles active DM actuators a0 through a60 respectively |
70 | cycles tip/tilt mirror X axis |
71 | cycles tip/tilt mirror Y axis |
80 | cycles laser steering mirror X, no rotation |
81 | cycles laser steering mirror Y, no rotation |
82 | cycles laser steering mirror X, with rotation |
83 | cycles laser steering mirror Y, with rotation |
84 | cycles laser steering mirror X, with rotation, from 0 Volts to +5 Volts |
85 | cycles laser steering mirror Y, with rotation, from 0 Volts to +5 Volts |
100 through 460 | sets 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.
Field | File Name or Default Value | Example: 2003 Dec 16 | |
---|---|---|---|
1 | current cflat filename | yymmdd/cflat_xx | 031215/cflat_06 |
2 | current refcentb filename | yymmdd/refcentb_xx | 031210/refcentb_00 |
3 | current refcentc filename | yymmdd/refcentc_xx | 031210/refcentc_00 |
4 | current refcentq filename | yymmdd/refcentq_xx | 031210/refcentq_00 |
5 | current centoffs filename | yymmdd/centoffs_xx | t5 |
6 | current cm filename | yymmdd/cm_xx | CMSep03_00wls3.sdt |
7 | current flat filename | yymmdd/flat_xx | 031120/flat_01 |
8 | current sharp filename | yymmdd/sharp_xx | 031215/sharp_00 |
9 | # of frames to averages when determining cflat and APD background values | 100 | 200 |
10 | # of frames to averages when determining reference centroids | 100 | 2000 |
11 | # of DM voltages to average when determining a system matrix | 100 | 2000 |
12 | #of DM voltages to average when determining flat and sharp mirror values | 100 | 200 |
13 | 0 sets to ngs mode, 1 sets to lgs mode | 0 | 0 |
14 | camera frame rate, in frames per second, 55, 100, 200, 250, 350, 500, 750, or 1000 | 100 | 500 |
15 | camera gain, 1 or 2 | 1 | 2 |
16 | camera CRT gain, 0, 1, 2, 3, or 4 | 0 | 4 |
17 | indicates which centroid algorithm is currently being used, 0 = 4x4 binned, 1 = center-of-mass, 2 = quad-cell | 2 | 2 |
18 | centroider raw-data threshold, in ADC counts | 0 | 0 |
19 | AO loop gain (proportional gain), 0.0 o 1.0 | 0.35 | 1 |
20 | AO loop integrator gain, 0.0 to 1.0 | 0.95 | 0.998 |
21 | AO loop compensator weight 1, -1.0 to 0.0 | 1.0 | 1 |
22 | AO loop compensator weight 2, -1.0 to 0.0 | 1.0 | 1 |
23 | tip/tilt loop gain, 0.0 to 1.0 | 1.0 | 1 |
24 | APD loop rate (50, 100, 200, 300, 400, 500 Hz) | 100 | 500 |
25 | APD loop gain, 0.0 to 1.0 | 0.003 | 0.01 |
26 | APD A background values (in APD counts) | 0 | 0 |
27 | APD B background values (in APD counts) | 0 | 0 |
28 | APD C background values (in APD counts) | 0 | 0 |
29 | APD D background values (in APD counts) | 0 | 0 |
30 | next sequential file number (for data files) | 0 | 69 |
31 | serial 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 | -1 | 18362 |
32 | serial 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 | -1 | 18366 |
33 | serial 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 | -1 | 18364 |
34 | serial 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 | -1 | 18361 |
35 | serial number for DAC board farthest to the left when looking at the front of the lgs7 chassis, that TT channels are plugged into | -1 | 18333 |
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).
If runnig the program as the lgs user, do the following:
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.
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.
To terminate the program, enter a control-C.
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