Controls AGW units. Runs full guiding for LUCI, MODS / PEPSI (secondary focus) and PEPSI PFU (tertiary focus). LBTI/LN and LBC have own autoguiders and GCS is not in control. Part of TCS. MODS off-axis control is different from rest of off-axis controllers.
digraph G {
rankdir=LR
node[shape=box, style=filled]
TCS[fillcolor=gray]
GCS[fillcolor=lightblue]
subgraph cluster_oac {
label="oac"
OACServer[fillcolor=gold]
}
subgraph cluster_MODS {
label="MODS"
AGWMODS[fillcolor=gold]
}
subgraph cluster_azcam {
label="azcam"
AZCam[fillcolor=gold]
}
subgraph cluster_HW {
label="Hardware"
node[fillcolor=lightyellow]
GuidingCCD
WFSCCD
AGWAIPUMAC
AGWMODSUMAC
}
TCS->GCS
GCS->OACServer
GCS->AZCam[color="black:white:black"]
OACServer->AGWAIPUMAC
GCS->AGWMODS
AGWMODS->AGWMODSUMAC
AZCam->GuidingCCD
AZCam->WFSCCD
}
GCS consists of two major modules, i.e. the off-axis autoguider and the wavefront sensing system. The autoguiding task of the GCS consists of controlling the AGW and providing the TCS with the information on the position of the guide star.
WaveFront Sensing (WFS) for active optics (5-30 seconds/cycle, not the fast loop for AO)
GCS uses PCS for any xy (focal plane) <-> RADEC transformation. Guiding cameras are using AzCam controlling program. GCS controls AGW probes, calling OAC RPCs.
Caveats
when the connection to AGW unit is lost (usually triggered by powering off AGW), GCS might not function properly. GCS restart is recommended every time you power off AGW.
For OAC controlled off-axis probes, a restart of oacontrol is recommended as well. Sometimes a reboot of the OAC machine must be performed.
TO aren't usually aware of OAC and its subsystems.
If you see problems not detecting stars, please consider running sextractor from the command line. See below for details.
GCS is configured from TCS's gcs/etc/gcs.conf, gcs/configuration/GCS for AGW configuration, and /home/telescope/TCS/Configuration/GCS for instrument configuration. See discussion there.
Running Sextractor from commandline
Current log (not events, TCS [2-][0-9]??????.log file) record command line called when GCS calls sextractor. The line can be obtained by:
%CODE{"sh"}%
[tcs@tcs1 ~]$ grep -i "SXT.*executing" /lbt/data/logs/tcs/current.log
2019-06-12T01:07:40.114528+00:00 tcs2 LBT_GCSL: SXT: analyzeFile: executing: /lbt/tcs_runtime/sextractor-2.8.6/bin/sex /tmp/leftAcquisition.fits -PIXEL_SCALE 0.108310 -c /home/telescope/TCS/Configuration/GCS/left_gcs_sx.sex; grep -v '^#' */ /g' >/tmp/left_gcs_sx.pro
....
%ENDCODE%
Running command line for the correct side and on corect FITS file shall produce star list in /tmp/left_gcs_sx.pro. Problems can be visible on console, if any (current GCS implementation doesn't capture and store sextractor error output).
current authorized AGWs are homed (if controlled by GCS - LUCI, IRTC, PEPSIPOL, PEPSIPFU; not for MODS)
Authorization
newly authorized AGWs are homed (if controlled by GCS - LUCI, IRTC, PEPSIPOL, PEPSIPFU; not for MODS)
Guiding
Request an acquisition image from the guide camera and wait for it to return. (full frame: guidecam_ROI, guidecam_binning)
GCS runs sextractor to find a guide star on the image.
Use brightness, FWHM and other factors to select the proper star in case multiple stars are found (MSCALE, RSCALE, FSCALE, CSCALE).
If guide star is not found - stop (preset fails)
If guide star is found, send acquisition offset to PCS to place star on the guiding hotspot. (guidecam_hotspot_[xy])
Start guiding:
Configure the camera for subframe centred on guiding hotspot
Request a guiding exposure and wait for it to return.
Run sextractor to get guiding star position.
If the guiding star is lost for a significant time, stop guiding
If the image cannot be used for guiding, go to step #6; stop if guiding is not stable within the first N attempts (preset fails)
If that's the first successful guiding image and WFS is requested, starts WFS thread (see below)
Write centroid data (error estimate, FWHM, stellar and background flux) into shared memory
calls PCS:ApplyGuideCorrection to update the position of the telescope optics
adjust exposure time (if the guide star is too faint/too bright), but keep it within configured limits
go to step #6
WFS
WFSingThread.cpp (and friends):
This class runs WFS loop. This is the slow loop used to collimate LBT optics (=active optics). This isn't the fast AO (=adaptive optics) loop.
WFS images are obtained from Shack\x96Hartmann (S-H) sensor. The sensor uses a lenslet array to break the incoming beam (pupil) into sub-apertures, creating an array of spots on the detector. Ideally, the collimated beam shall produce spots on the center of regular (lenslet) grid. The greater the distance of the spot from the grid centre, the worse is the collimation of the incoming beam. Distances are fit with Zernike polynomials, and Zernikes are sent to the PSF subsystem for correction of the optics.
After the following conditions are met:
stable guiding (e.g. guide star found, centred and in the spot (wfs field stop at the position of guiding hotspot)
WFS requested and not paused
Then thread's execute method performs those actions:
Read & parse the configuration file - populates internal variables
Request an image from the WFS camera and wait for it to return (with appropriate timeouts if no image within the expected time).
Check if the image (spots) is too faint or saturated such that it might not be useable.
Adjust exposure time if practical within limits and request another image
Obtain candidate S-H spots (using sextractor) from the image.
Calculate lenslet grid projection on WFS (based on: WFS_hotspot_sext_[xy] WFScam_spacing_[xy], WFS_lenslet_rotation)
Calculate expected shifted pupil position. (based on WFScam_hotspot_[xy] and guide probe position)
Pickup spots for S-H grid calculation (the brightest spots close to ideal lenslet grid centre).
Calculate a distance of all spots from the ideal lenslet projection.
report statistics of spot brightness and FWHM for GCSGUI and telemetry
raw Zernikes are obtained fitting distances and Zernike polynomials (reconstructor: WFS_subDir)
flip some raw Zernikes (Z5, Z8, Z10, etc) if wfs camera is using alternate readout of CCD (WFS_flipX)
raw Zernikes are transformed into primary mirror space (as the sensor might be rotated on the rotator / offs axis pickup arm), so-called calculated Zernikes are produced
Zernikes are corrected for field aberrations expected in the optical design.
Calculated Zernikes are scaled (*) by pre-configured factors.
After mirrors are stable in position/shape, loop carry over (go to step 1.)
If any of the beforementioned conditions is broken during loop execution, a new image is taken or pause is commanded and the WFS loop is broken. As WFS
configuration is re-read during each iteration, changes to the configuration file are propagated automatically (no GCS restart is needed).
GUI Window
Sextractor tests
From JMH:
The GCS uses the external program sextractor (a.k.a. Source Extractor) to measure the positions of the guide stars. It does some tricky gaussian matching algorithm. I've tested it against IRAF and simple centre-of-gravity algorithms, and it gets the correct answer. The x,y positions are recorded in the tcslog (grep for "GS centroiding analysis").
The accuracy with which you can measure the position of a star image depends on many factors:
brightness (brighter is better until you saturate)
read noise (lower noise is better)
pixel sampling (smaller is better until more read noise kicks in)
FWHM (smaller images are better)
When the seeing gets worse you lose twice because there is more natural image motion, and because the FWHM is larger and the centroid is less accurate. For typical guide stars in typical seeing, the centroiding accuracy is something smaller than 1/20 arcsec.