Meeting overview

Progress with hysteresis compensation (WP4)

Slides:

Contents

Overview

Key points:

  • Hysteresis compensation operational for SPS 400 GeV flattop under most (but most importantly all operational physics) conditions for dipoles.
  • Compensation strategy is working correctly for main dipoles and expected to work for higher order magnets
  • Current implementation is limited by modeling accuracy at below 5e-5 T, which in turn seems limited by magnetic measurements

Hysteresis Compensation TL;DR

Basic overview of compensation

  1. Measure magnetic field response from excitation current
  2. Model using machine learning as time series, mapping measured .
  3. Predict the field for the next cycle in the machine using programmed current, and compute a w.r.t. a reference field.
  4. Trim the in the control system to keep “real field” the same as reference.

Diagram showing hysteresis compensation overall strategy

Hysteresis in the SPS main dipoles

  • How much does the field deviate due to hysteresis
  • How accurately do we need to compensate the magnetic field?
  • How much does a small correspond to in relative ?

Show I vs B residual Plots showing B vs dB/B

Know

Overall ideal initial approach:

  • For dipoles - exclusively use B-Train, this gives us “infinite data”

  • For higher order magnets, do lab measurements

  • Measure operational configurations this should allow us to compensate physics supercycles easy

  • Dipoles: highly problematic with B-Train and lab measurements

    • B-Train marker often misconfigured, many glitches and loose cables that have since then been fixed.
    • B-Train technically provides unlimited data, but low variety
      • B-Trainintegration constant (marker) is not applied until field passes 1100G, which is after injection plateau of SFTPRO1 - the field is uncertain in 2e-5T (whatever relative change that is) - which is more than operational tolerances at flat bottom. Field drifts significantly at flat parts (especially long injection plateaus, in the range 1e-4 T)
    • Dipole measurements campaign 2 prove challenging since power converter is unable to sustain for SFTPRO1, so we are unable to measure supercycles with SFTPRO1.
  • Quadrupoles: measurement campaign 1 (2023) cancelled due to significant measurement (integration) drift from existing induction coils, and missing vacuum chamber. New PCB induction coils have been acquired. Measurements to resume imminently.

  • Sextupoles & octupoles: calibration done, measurement bench prepared. New PCB induction coils for measurements, with hall sensor mount points. Low priority compared to dipoles and quadrupoles.

Difficulties:

  • Power converter current response is not well calibrated (up to 0.3 % error, or 14 A at 5800 A).
  • Power converter is not filtered (compared to FGCs), 50 Hz harmonics amplitude are around , in reality changes made by operators in the machine go to around 0.1 A.
    • Fortunately, the inductive load of the magnet filter them out.
  • Measurement steps are in 0.2 A - not accurate enough to capture small changes
  • Which cycles should we play / measure?
    • Still not figured out since we are still dealing with challenges in the measurement setup, but initial plan is still to measure physics

Learn

  • Use measured to learn hysteresis and dynamic effects, with neural networks
    • We don’t learn only and , but also temporal information since it is a time series - samples are assumed to be equidistant.
    • Subtract calibration function (anhysteretic magnetization) to model only hysteresis.
  • Downsample signal to 50 Hz since 1 kHz or 10 kHz provides too many samples
  • Attempted architectures:
    • PhyLSTM (physics informed)
      • Does not take into account remanent field in the far past
    • Temporal Fusion Transformer (pure data driven - attention based)
      • Multivariate architecture - we can include as much information as we want

Modeling constraints:

  • Known information is limited to and , even though additional information like coil voltage and temperature are known in the lab, since only is known at inference time.
  • Model must take in the past field as well as the past current to take into account the remanent field)
  • Model must use programmed current at inference time, but measured current at learning
  • Model must make predictions within 700 ms
  • Model must be able to predict accurately below 1e-4 T (about 3% accuracy)

Show flow of information for network (what goes in and comes out)

Predict

  • From timing system know which cycle is coming next, with 2500 ms forewarning
  • Previous “state” is provided as input to network together with future programmed current, gives future field
  • Initial “past field” is provided by B-Train for SPS Main Dipoles, but must be bootstrapped for higher order magnets during pre-cycle, then predictions continue autoregressively

N.B.

  • Predictions are running on GPU using a GUI, and trims LSA directly

Simultaneusly: predictions are running on GPU on UCAP, future will allow UCAP to trim using actors

Show timeline of predictions and timing

Main challenges:

  • We still require a pre-cycle (for now) to start predictions in a known state. It is currently unknown how long we can predict autoregressively. Initial tests suggest error does not tend to accumulate.
  • Timing system currently does not deliver correctly the next cycle if the current and next cycle are 1.2 BP - to be fixed by YETS 2025 with upgrade to White Rabbit.

Correct

  • With first prediction, save reference prediction
  • From second prediction, calculate w.r.t. reference
  • Apply the .

Applying

  • Now: we use LHC Software Architecture to calculate from , and then to corresponding , which is propagated to the FGCs. Benefits:
    • Up to 5000 points, we don’t have to worry about talking to the FGC.
  • Trim needs to be applied at least 1.7s before cycle start, and are not applied if someone from EPC is acquiring from the PC.
  • Soon: use FGC Real-time channel to apply corrections. For dipoles we regulate at 50 Hz, for quadrupoles at 25 Hz - this is more than sufficient for our networks.

Show control hierarchy and how the change is applied

Show modularity of system

Significant Results

Plot of spill improvements during MD Plot of RMS spill improvements during MD

Future steps

  • Various parts of the infrastructure can be improved independently with current abstractions.
    • Improved measurements will yield more accurate and more robust models.
  • Further measurements of Quadrupoles

Conclusion

Key points:

  • Hysteresis compensation operational for SPS 400 GeV flattop under most (but most importantly all operational physics) conditions for dipoles.
    • Compensation on dipoles only significantly improve spill macrostructure
  • Compensation strategy is working correctly for main dipoles and expected to work for higher order magnets
  • 14 & 26 GeV compensation require better measurements, but are coming.
  • Quadrupole compensation to be tested during BC 2025.
  • Measurement and modeling accuracy to be solved over the YETS.
  • Different models, are in theory plug-and-playable with the current setup.

Outcome

Action

  • Make talk for EPA community meeting [priority:: highest] [due:: 2024-10-24] [completion:: 2024-11-15]
  • Check improvements on SFTPRO flat bottom after Vincenzo marks on MD1 ramp down [priority:: low] [completion:: 2025-08-01]

Length? Focus?