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:

  1. Run an SSA calibration
  2. Tune a cavity to resonance (a detune of 0Hz)
  3. Characterize the cavity and calculate the probe Q
  4. 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

Full Procedure

SSA Calibration

  1. Set the drive max to the previously saved drive max found during initial cavity commissioning (or 1 for the the harmonic linearizers)
  2. Recursively run an SSA calibration with decreasing drive max until either the calibration succeeds or it hits one of two fault conditions:
    1. The max forward power is less than 3kW
    2. The desired drive max is less than 0.5

Tune to Resonance

  1. Enable the piezo
  2. Set the piezo to manual
  3. Set the piezo DC voltage offset to 0
  4. Set the piezo bias voltage to 25V
  5. Set the RF drive level to 15%
  6. Set the RF mode to chirp
  7. Find a chirp range that yields a valid detune
    1. If no valid detune found and chirp range exceeds 500000Hz, throw an error
  8. Set TUNE_CONFIG PV to Other (indicating that the cavity is at an intermediate state)
  9. Estimate the (micro)steps to resonance using an empirically found steps per hz from initial cavity commissioning 
    1. Currently 256/1.4 for 1.3GHz cavities and 256/18.3 for 3.9GHz cavities
  10. 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
    1. Throw an error if the total number of steps moved exceeds the original estimate by 10% (this could indicate the motors disengaging)
  11. Set TUNE_CONFIG PV to On Resonance

Cavity Characterization

  1. Set the pulsed drive level to 15%
  2. Run a cavity characterization
    1. Raise an error if the characterization crashed
    2. Raise an error if the loaded Q is not within 2.5e7 and 5.1e7
    3. Raise an error if the cavity scale factor is not within 10 and 125
  3. Push the loaded Q and cavity scale factor
  4. Reset the data decimation  to 255 for both CW and pulsed
  5. Reset the piezo feedback set point to 0
  6. Run the cavity probe Q calculation

Cavity Ramp-Up to ADES

  1. Set the piezo to feedback
  2. Set the RF mode to SELA
  3. If the cavity is off, set the amplitude to 5MV and turn it on
  4. Walk the amplitude in steps of 0.5MV up to 10MV and steps of 0.1MV above 10MV
    1. Raise an error if the quench interlock is latched
  5. Set the RF mode to SELAP

Using the Program

Unless you understand the necessary ordering of steps, always keep all options at the top selected (this is the default). Running the subscripts out of order can have unintended consequences.

This program is designed to simplify the turn on script into a "one button turn-on." You can set up an individual cavity or an entire cryomodule at once and it will display the status under each cavity being ramped. Progress is typically indicated by blue text, success by green text, and error by red text. All errors should be logged in the SRF log and reported to the SRF on call person.

The desired amplitude spin box is connected to the live ADES signal, so changing that value directly changes ADES. 

The related display button will open the relevant cavity overview page:

Aborting

Aborts are achieved by sending an abort request and waiting for the program to hit a safe point at which to exit. This necessarily means that there is sometimes a delay while certain longer steps await completion, but this was explicitly designed not to leave cavities in an arbitrary broken state. If you find an abort that never triggers, please submit a GitHub issue or shoot a message to #sc-linac-physics.

Known Issues

  • There seem to be EPICS connectivity issues when run from inside threads, and this is an active area of debugging. If you see the program hang on a given PV please submit a GitHub issue or shoot a message to #sc-linac-physics
  • Multithreading on the OPIs seems to cause significant slowdown after about 32 cavities. If you run into this, restarting the program is a quick, if not elegant, fix. Some people choose to manage multiple instances at once to bypass this but that is a personal preference. 

Demos

Note that these demos were all recorded using simulated data on a personal machine; the production version has slight aesthetic differences.

Full Cryomodule Setup

Navigate to the desired cryomodule by selecting the appropriate linac and CM tabs, then press the cryomodule setup button

Single Cavity Setup

Similar to full cryomodule but click the individual cavity setup button

Using Diagnostically

If a cavity is behaving strangely and you're not sure how to fix it, it's possible that just running auto setup on it will get it back to a good state. If you use the program in this way, please make an entry in the SRF elog and include screenshots of the Detune and RF Controller screens. Note if any of the values on these screens are either yellow or red.

These screens can be found in many ways including but not limited to:

  • LCLS Home (or SRF Home) > RF > LxB > CM xx Cavities > More...
  • LCLS Home (or SRF Home) > RF > LxB > CM xx Cavities > Unit Test... > More...
  • SRF Home > All CM Unit Tests > CM xx > More...