Source code can be found here and can be run locally using Local PyDM/Simulacrum Setup
GUI Procedure
Piezo Pre-RF Check
- Turn cavity off
- Enable piezo (set ACCL:LXB:XXXX:PZT:ENABLE to 1)
- Set piezo to manual (set ACCL:LXB:XXXX:PZT:MODECTRL to 0)
- Set piezo DC voltage (ACCL:LXB:XXXX:PZT:DAC_SP) to 0
- Star the piezo pre rf test (set ACCL:LXB:XXXX:PZT:TESTSTRT to 1)
- Wait for the piezo pre rf test to finish (wait while ACCL:LXB:XXXX:PZT:TESTSTS is 2)
- Check test result
- If the test was not successful (ACCL:LXB:XXXX:PZT:TESTSTS is not 1)
- Throw an error
- If the test was successful
- Check if chain A passed (ACCL:LXB:XXXX:PZT:CHA_TESTSTAT is 0)
- Check if chain B passed (ACCL:LXB:XXXX:PZT:CHB_TESTSTAT is 0)
- If either chain didn't pass
- Throw an error
- If both chains passed
- Record piezo capacitance A (ACCL:LXB:XXXX:PZT:CHA_C)
- Record piezo capacitance B (ACCL:LXB:XXXX:PZT:CHB_C)
- If the test was not successful (ACCL:LXB:XXXX:PZT:TESTSTS is not 1)
SSA Characterization
- Set the SSA drive max (ACCL:LXB:XXXX:SSA:DRV_MAX_REQ) to:
- 1 If harmonic linearizer
- 0.8 if not harmonic linearizer
- Reset SSA interlocks (set ACCL:LXB:XXXX:SSA:FaultReset to 1)
- Wait for the faults to reset (wait while ACCL:LXB:XXXX:SSA:StatusMsg is 4)
- if ACCL:LXB:XXXX:SSA:StatusMsg is either 1 or 7:
- Raise an error
- if ACCL:LXB:XXXX:SSA:StatusMsg is neither 1 nor 7:
- Turn on SSA (set ACCL:LXB:XXXX:SSA:PowerOn to 1)
- Wait for SSA to turn on (wait until ACCL:LXB:XXXX:SSA:StatusMsg is 3)
- Reset cavity interlocks (set ACCL:LXB:XXXX:INTLK_RESET_ALL to 1) and wait 3s
- If the reset failed (ACCL:LXB:XXXX:RFPERMIT is 0)
- Retry up to 2 more times
- If the reset succeed within 3 total attemps
- Continue to step 5.e.i
- If the reset fails after 3 total attempts
- Throw an error
- If the reset succeeded (ACCL:LXB:XXXX:RFPERMIT is not 0)
- Start the calibration (set ACCL:LXB:XXXX:SSA:CALSTRT to 1)
- Wait for the calibration to stop running (wait while ACCL:LXB:XXXX:SSA:CALSTS is 2)
- If the calibration crashed (if ACCL:LXB:XXXX:SSA:CALSTS is 0)
- Throw an error
- If the calibration succeeded (if ACCL:LXB:XXXX:SSA:CALSTS is not 0)
- If result is not good (if ACCL:LXB:XXXX:SSA:CALSTAT is not 0)
- Throw an error
- If the result is good (if ACCL:LXB:XXXX:SSA:CALSTAT is 0)
- If the max forward power (ACCL:LXB:XXXX:SSA:CALPWR) is below 3000
- Throw an error
- If the max forward power (ACCL:LXB:XXXX:SSA:CALPWR) is above 3000
- If the measured slope (ACCL:LXB:XXXX:SSA:SLOPE_NEW) is not between 0.5 and 1.6
- Throw an error
- If the measured slope (ACCL:LXB:XXXX:SSA:SLOPE_NEW) is between 0.5 and 1.6
- Push the SSA slope (set ACCL:LXB:XXXX:PUSH_SSA_SLOPE.PROC to 1)
- Save the SSA slope (set ACCL:LXB:XXXX:SAVE_SSA_SLOPE.PROC to 1)
- If the measured slope (ACCL:LXB:XXXX:SSA:SLOPE_NEW) is not between 0.5 and 1.6
- If the max forward power (ACCL:LXB:XXXX:SSA:CALPWR) is below 3000
- If result is not good (if ACCL:LXB:XXXX:SSA:CALSTAT is not 0)