RTC supervisor rtc
¶
-
class
rtc.
rtc
(mode)¶ RTC means “Real-Time Controller.”
This class implements the python interface to the real-time engine.
The work flow logic:
- initialize the supervisor. - it reads in the parameters and puts the rtc in go state, open loop
- a call to open_loop saves the closed loop gain and opens the loop by setting the gain to zero
- another call to open_loop while in the open state does not destroy the saved closed loop gain
- a call to close_loop sets the loop gain to the saved gain. if this gain is not zero, the loop is closed
- a call to set_gain closes the loop if the gain is non-zero
- a call to set_gain with zero gain opens the loop, but it does not save the last gain
- there is a default gain. restore it with a call to set_gain(‘default’).
- the default gain is viewable as instance variable defaultGain
- if you want to change the gain without closing the loop, modify savedGain
- you can also modify the defaultGain
Example start up and run code:
u = rtc('16x') u.open_loop() u.set_gain(10.) # this also closes the loop u.set_gain(5.) # this can be done on the fly
Example system modification cycle:
# execute codes to generate and store new matrices (using module wfs, etc.) w = wfs('16x') w.Hmatrix() w.save() # load the new parameters into rtc and go u.load() u.close_loop()
-
close_loop
()¶ Close the AO loop
-
go
()¶ Start or resume the controller engine.
-
load
()¶ Load tells the interface to read the controller definition files, associated with self.mode, into the real-time controller c-extension’s memory.
As a convenience, the definitions are also assigned to instance variables within the rtc object as well.
-
manyStep
(nSteps)¶ Run the rtc simulator many steps.
-
oneStep
()¶ The interface has its own RTC simulator. This method runs one step of it. This is handy for diagnostics as the rtc engine should produce results identical to the simulator.
-
open_loop
()¶ Open the AO loop
-
set_gain
(gain, wgain=None)¶ Set the gain of the real-time controller.
-
status
()¶ Report the current AO control system state, including running state of the c-exension module, and the loop status and gain
-
stop
()¶ Stop the controller engine (computations halted)
RTC class data¶
-
rtc.
pdict8x
¶
-
rtc.
pdict16x
¶
-
rtc.
pdict30x
¶ These are the dictionaries that map rtc variable names to their FITS files.
RTC instance data¶
An rtc contains instance variables for every parameter that is loaded from FITS files, plus a few internal ones of its own. Here are some of the important ones:
-
self.
gain
¶ The gain of the control loop. It multiplies controlMatrix.
-
self.
controlMatrix
¶ The control matrix, as loaded from the FITS file.
-
self.
cm
¶ The control matrix after it is multiplied by the gain. This is loaded into rtc2.
-
self.
mode
¶ The string ‘8x’, ‘16x’, or ‘30x’ depending on the wavefront sensing mode.
-
self.
loop
¶ Loop state - either ‘open’ or ‘closed’
To Do¶
There will be more capabilities added as we progress, including:
- supervisor command to change camera frame rate(s)
- supervisor commands to load static deformable mirror shapes
- supervisor command to switch wavefront sensing modes (8x, 16x, 30x)
- supervisor command to change centroider algorithms
- some peek data will be the basis of deriving offloading commands (via KTL) (telescope track...)
- some peek data will be pipelined into user displays (camera data, mirror commands)
- we need to add specific support for LGS mode: tip/tilt camera processing, laser uplink tip/tilt control.
- supervisor interface to a user-level GUI, running on another host machine