Introduction
The need for automating SRF cavity run up arose from the human error involved in manually implementing a long list of clearly defined steps.
The basic procedure is:
- Run an SSA calibration
- Tune a cavity to resonance (a detune of 0Hz)
- Characterize the cavity and calculate the probe Q
- Ramp the RF to the desired amplitude (ADES)
Full source code can be found here. It can be run natively on unix systems using the Local PyDM/Simulacrum Setup instructions
Pseudocode Walkthrough
SSA Calibration
Using a previously saved drive max found during initial cryomodule commissioning as a starting point (or 1 for the harmonic linearizers), we recursively run an SSA calibration with decreasing drive max until either the calibration succeeds or it hits one of two fault conditions:
- The max forward power is less than 3kW
- The desired drive max is less than 0.5
Auto Tune
- Enable the piezo
- Set the piezo to manual
- Set the piezo DC voltage offset to 0
- Set the piezo bias voltage to 25V
- Set the RF drive level to 15%
- Set the RF mode to chirp
- Find a chirp range that yields a valid detune
- If no valid detune found and chirp range exceeds 500000Hz, throw an error
- Set TUNE_CONFIG PV to Other (indicating that the cavity is at an intermediate state)
- Estimate the (micro)steps to resonance using an empirically found steps per hz from initial cavity commissioning
- Currently 256/1.4 for 1.3GHz cavities and 256/18.3 for 3.9GHz cavities
- While the detune is outside of the piezo capture range (50Hz), recalculate the steps to resonance and send 90% of that value to the stepper motor
- Throw an error if the total number of steps moved exceeds the original estimate by 10% (this could indicate the motors disengaging)
- Set TUNE_CONFIG PV to On Resonance