No sets possible while someone else is acquiring data from FGCs
Track delay is 2 periods (4ms), since 1 regulation period is ms for SPS Main Dipolesand 4 ms for SPS Main Quadrupoles Measurement delay is 950 us filter delay + 50us = 1 ms Ref advance is 1 ms. Function played ahead of time (<ms) to get ahead of regulation .

The measured current is ever so slightly delayed after programmed current. Here the during the ramp up, the measured current is about 0.4 A less than the programmed current at each time step during the ramp up.
This translates to a error at ramp-up, and at ramp-down, when computing the field-response from the corresponding current change.
With a ramp-up rate at 2000 A/s, a maximum delta of 0.3 A at ramp up, the corresponding phase-shift is roughly 0.15 ms. Adding this phase-shift to the programmed current (i.e. shifting all program time stamps besides the first and last point by the phase) yields the following:

Where the only remaining effect is the ripples caused by the regulation.

Shifting programmed current by 0.15ms results in a significantly better prediction for MD3, and the following SFTPRO, especially during the ramps. However it is noticable that the training set does not contain ZERO cycles prior to SFTPRO, as the ramp-up is not accurately modeled. Here, the ramp-down is poorly modeled, however this could also be explained by the start of a new prediction horizon.
Real-time control channel
For 2024-10-14 - FGC Real-time channel correction, speak to Diogo Alves.
Regulation period
Each magnetic circuit real-time control channel with different regulation times. Regulation time is:
- 20 ms (50 Hz) for SPS Main Dipoles
- 40 ms for SPS Main Quadrupoles
which means that UDP packets containing needs to be sent every regulation period to the FGC gateway.
Hysteresis compensation
The propagation of the to be applied to the power converters follows the following diagram:
Even though the diagram mentions the SPS MBIs, the idea applies to all FGC v3 power converters for SPS.
Dynamic Economy
Dynamic economy is regulated by a single parameter in LSA (except on/off), and is triggered when beam is not detected at injection, or beam is dumped during injection. The corresponding (asynchronous) timing event for SPS is XTIM.SX.APECO-CT/Acquisition.
FGC_63/REF.ECONOMY.DYN_END_TIME#value, which controls when the dynamic economy cycle connects with the programmed cycle.
initial_ref is the current at the start of the function (usually 155A for SPS Main Dipoles)
The code on the parameters used for the dynamic economy cycle are available:
https://gitlab.cern.ch/ccs/fgc/-/blob/master/sw/lib/cclibs/libref/src/refEvent.c?ref_type=heads#L163
PLP Parabola Linear ExPonential
cc_float const acceleration = *ref_mgr->ref_defaults[ref_mgr->pc_on_cache.load_select][REG_CURRENT].acceleration;
cc_float const linear_rate = 0.97F * (regMgrParValue(reg_mgr,LIMITS_V_POS) - ref1 * reg_mgr->load_pars.ohms) * reg_mgr->load_pars.inv_henrys;
cc_float const initial_ref = ref_armed->fg_pars.meta.range.initial_ref;
25kV LIMIT_V_POS get load_pars.ohms, inv_henrys from FGC
Reconstructing dynamic economy programs has been implemented in hysteresis-compensation-utilities: https://gitlab.cern.ch/dsb/hysteresis/hysteresis-compensation-utilities/-/blob/master/hystcomp_utils/dyneco/_dyneco.py?ref_type=heads
And deployed on UCAP-NODE-SPS-HYSTCOMP-TEST/SPS.MBI.DYNECO, which triggers on the asynchronous event SX.APECO-CTML/Acquisition which sends acqC when dynamic economy is triggered.
- Verify DYNECO program correctness in UCAP converter, especially time axis [priority:: high]
[completion:: 2024-10-14]
SFTPRO1 seems OK. Ramps down from injection plateau and ends at C10800. Other cycles still need to be checked.
Parameters
https://gitlab.cern.ch/ccs/fgc/-/blob/master/sw/lib/cclibs/libfg/doc/resources/PLEP.pdf
| Top of initial parabola | |
| End of initial parabola | |
| End of linear | |
| End of exponential | |
| Time of top of parabola | |
| Time of end of parabola | |
| Time of end of linear | |
| Time of end of exp | |
| Time of end of PLEP | |
| Linear rate of change |
Condition equations
P - P
We are at. P-P if
With
and and .
P - L - P
For the parabolic part:
Full Economy
FULLECO is a machine mode (MMODE), which sets the current of the main magnets on idle value (155 A for SPS Main Dipoles). The mode is signalled using the XTIM.SX.FCY-MMODE-CT/Acquisition timing signal, which fires 1150 ms before cycle start. This is due to the GMT backend of the timing system being unable to accurately determine the cycle more than 1 cycle ahead in time, in case the currently played cycle is 1 BP.