Repository navigation
Magnets: several power supplies affecting the same multipole #477
Description
Hello,
We need this concept of design and correction strength to handle magnets using 2 power supplies that affect the same multipole.
This feature can also be useful for other topics such as optic correction, optic change, specific ID tuning, etc...
The actual strength of the magnet is: design_strength + correction_strength.
Proposal:
At the loading time, a designStrengthA&B field is created in pyAML which is a copy of PolynomA&B (simulator) or device DesignStrength (control system). We expect that the DesignStrength varies only for new setup like low alpha, min beta, low halo....
A correctionPolynomA&B is created and initialized to 0 if not already exists.
2 functions at the holder level to load and save correction strengths should be added.
If you don't want to use correction strength, the actual behavior must be preserved.
Internally pyAML will compute AT PolynomA & B or control system strength.
The access to design strength in pyaml is not mandatory and can be computed using strength - correction_strength.
However the control system magnet devices should provide access to a DesignStrength RO attribute or implement Strength and CorrectionStrength attribute (for identity magnet model). At ESRF our magnet devices provide Strength and CorrectionStrength attributes as shown below:
Other magnet models can be written to handle design and correction strength as needed.
Exemple:
from pyaml.accelerator import Accelerator
sr = Accelerator.load("tests/config/EBSOrbit.yaml")
QF6B_C04 = sr.design.magnet.get("QF6B-C04")
QF6B_C04.strength.get() # Return 1.7791564394080177
QF6B_C04.strength.set(1.7) # Set internally correctionPolynomB[1] to -0.0791564394080177
QF6B_C04.strength.get() # Return 1.7
QF6B_C04.correction_strength.get() # Return -0.0791564394080177
QF6B_C04.correction_strength.set(0.2) # Set correctionPolynomB[1] to 0.2
QF6B_C04.strength.get() # return 1.9791564394080177
sr.design.magnet.save_correction() # Save correction strength
# Example for magnet identity model
QF6B_C04 = sr.live.magnet.get("QF6B-C04")
QF6B_C04.strength.get() # Return 1.7791564394080177 (Read Strength, correction is 0)
QF6B_C04.strength.set(1.7) # Set Strength
QF6B_C04.strength.get() # Return 1.7
QF6B_C04.correction_strength.get() # Return Strength - DesignStrength
QF6B_C04.correction_strength.set(0.2) # Set Strength to DesignStrength + 0.2
QF6B_C04.strength.get() # return 1.9791564394080177Originally posted by @JeanLucPons in python-accelerator-middle-layer/governance#58
Activity
[-]Magnets: 2 power supplies affecting the same multipole[/-][+]Magnets: several power supplies affecting the same multipole[/+]