Beyond Precycles: Transformers for Deterministic Magnetic Field Control in Particle Accelerators
Abstract
Accurate control of accelerator magnet fields is limited by hysteresis and other rate-dependent dynamics that are not captured by static current-to-field maps, which constrains beam quality and operational flexibility.We present a data-driven approach using transformer-based models for high-precision prediction and control of magnetic fields in the CERN Super Proton Synchrotron (SPS).The model, pretrained on simulated sequences and fine-tuned on magnetic measurements, achieves prediction accuracy near the sensor noise floor of \SI{2e-5}{\tesla} across operational conditions, including sequences not explicitly observed during training.It has been successfully tested across all standard sequences in accelerator operation, as well as on magnetic sequences run without the usual energy-intensive magnetic precycles, significantly improving beam reproducibility, enabling automated feedforward control of the main dipole magnets, and reducing energy usage.Our results suggest that machine learning models could complement or replace traditional tabular approaches to accelerator magnet control, providing a practical route for feedback-free, high-precision control in accelerator operation.