Speaker
Description
High availability of superconducting linacs demands that the control system not only
detect cavity faults but also rapidly reconfigure the remaining RF cavities so that beam
operation can continue with minimal performance loss. This paper presents PEE, a
control-system-level application deployed on Pyapas, a Python-based control system
framework, that closes the loop from fault detection to setpoint deployment for a
44-cavity superconducting linac (20 spoke + 24 elliptical cavities).
The architecture separates monitoring, decision, optimization, and actuation into
loosely coupled Python modules coordinated by a Tkinter-based operator console.
A configurable PV monitoring engine (driven by a JSON configuration) periodically
polls machine process variables — beam energy, beam current, BPM averages, and
per-cavity field readbacks — through the Pyapas channel interface, and evaluates
relative/absolute thresholds to raise graded alarms (critical/warning). Alarm
aggregation rules and a trigger engine decide when a compensation cycle is
launched, with a cooldown timer to prevent oscillation. Faulted cavities are
identified by scanning each cavity's field readback PV against its nominal
setpoint; the surviving field fraction is passed directly to the compensation
engine as a measured quantity rather than an operator guess.
Optimization is delegated to an external beam-dynamics code (TraceWin) orchestrated
as a batch client: a genetic algorithm evolves candidate amplitude/phase setpoints,
each individual being evaluated by running the external simulator and scoring the
resulting envelope against the nominal reference (RMSE), with result caching to
avoid duplicate evaluations. The winning setpoint table is staged in the control
system and exposed to the operator for review before a one-click action writes all
44 cavity amplitude and phase setpoint PVs through the Pyapas channel interface,
keeping a human in the loop for machine-protection reasons.
The system degrades gracefully: when the Pyapas runtime or the machine connection
is unavailable, it automatically falls back to a simulation mode, allowing the
full monitoring → decision → optimization → (simulated) deployment chain to be
tested offline — a feature used for commissioning dry-runs and algorithm
regression testing.
We report the design of the PV configuration layer (which decouples the application
from concrete PV naming conventions), the threading and timeout handling between
the monitoring loop and long-running optimization jobs, the operator-confirmation
workflow, and operational experience with fault scenarios including single-cavity
quench and field-emission degradation.