1. Check control that a valid matrix is loaded
2. Check that the membrane stroke is not equal to zero
3. Calculate the high order error signal from the sensors and store the resulting error signal (-> delta_drive). Presummably the appropriate memory has already been loaded with the new wavefront sensor signals as there isn't a line in the code which seems to do this. I guess whatever loads the signals into memory prompts the call to feedback().
4. Do the control servo loop. For Hokupa'a this is a simple integrator
new_voltages = old_voltages + gain * delta_drive5. Check the range of the actuators. The code for Hokupaa-36 simply pins any actuator values greater than the specified maximum/minimum (+/-1). It could try to find an overall offset for the DM to use as much dynamic range as possible
6. Output the voltages to the DM drive electronics.
7. Do tip/tilt loopa. Calculate the two T/T signals from the DM drive signals8. Calculate the miror modes from the drive signals
b. Do control servo loop for T/T actuators with TTgain
c. Check range
d. Output voltages to T/T actuators
9. Subtract from the DM drive signals any contribution from any mode which has a near-zero eigenvalue.
mode_coefficients = [U] [act]The contribution from the null modes is then simply the sum over all the null modes of the mode_coefficients times the mirror modes.
null_contribution += null_contribution + mode_coef(i)*mirror_mode(i)This null contribution should be subtracted from the DM actuators voltages.
Note: There is a version of the Hokupa'a code to do this that seems to have a problem in it. (This is to be confirmed). Malcolm uses the second matrix [V] instead of the eigenfunctions array [U].