IRTF AO NOTES : FEEDBACK STATE M. Chun 3 December 2002 System enters feedback loop from state machine if state is FEEDBACK. In the FEEDBACK state we do the primary (DM) servo and the TT off loading. ROUTINE FLOW: 1. Enter feedback loop 2. Check MM stroke>0. If not returns error=-1 else continue 3. Check if loop is paused. If so, then refresh pout and ttout else continue 4. PRIMARY (DM) LOOP - PR_SERVO_PR : Just DM servo. No TT servo - Calculate delta drive : dd = sign * DMcntrlMat # Signals - Calc pout (Integrator): pout = pout + dd * prgain - Send primary volts to DM - PR_SERVO_TT : Remove TT from DM volts - Calculate delta drive : dd = sign * DMcntrlMat # Signals - Calc tempout (Integrator): tempout = pout + dd * prgain - Calc Tip/Tilt on DM : ttdd = TTDMcntrlMat # tempout - Calc DM voltages that correspond to this Tip/Tilt pr_out_tt = dmimat # ttdd - Take out Tip/Tilt from DM: tempout=tempout-pr_out_tt*prgain2 - Send primary volts to DM 5. Check type of TT Servo to do if any - TTDM: Use DM voltages as signal for leaking off Tip/Tilt - Calculate TT delta drive : ttdd = sign * TTDMCntrlMat # pout - Calc TT Servo (Integrator): ttout = ttout + ttdd * ttgain - Send tip/tilt actuator voltages - TTSA: Use Sensor signals as source of tip/tilt error - Not looked at yet 6. RETURN NOTES: I think the order of calculating the new DM signals, subtracting the DM tip/tilt, and updating the Tip/tilt actuators is important here and needs to be adjusted. Right now we do (i) Update DM, (ii) Remove tip/tilt on DM, (iii) Calculate the TT signals. If prgain2 = 1, then we attempt to remove all Tip/Tilt before we calculate the TT actuators signals. In TTDM mode, we won't have any tip/tilt in the primary out values. The end result is that we remove TT from the DM but don't send anything to the TT actuators. Order should be : If no TTservo then as above for PR_SERVO_PR If doing TTservo in TTDM mode then: - Calculate delta drive : dd = sign * DMcntrlMat # Signals - Calc tempout (Integrator): tempout = pout + dd * prgain - Calculate TT delta drive : ttdd = sign * TTDMCntrlMat # tempout (Note that we were doing this setp twice in above) - Calc TT Servo (Integrator): ttout = ttout + tt_dd * ttgain - Calc DM voltages that correspond to this Tip/Tilt pr_out_tt = dmimat # ttdd*ttgain - Take out Tip/Tilt from DM: tempout=tempout-pr_out_tt*prgain2 - Send primary volts to DM - Send tip/tilt actuator voltages (Save this to the end to update both the DM and TT actuators at the same time).