Skip to content
Snippets Groups Projects
Commit cc3b3c36 authored by Alexis GAMELIN's avatar Alexis GAMELIN
Browse files

Docstring improvements

Improve ProportionalIntegralLoop & DirectFeedback docstrings.
parent 99603eed
No related branches found
No related tags found
No related merge requests found
...@@ -1106,28 +1106,30 @@ class ProportionalIntegralLoop(): ...@@ -1106,28 +1106,30 @@ class ProportionalIntegralLoop():
cav_res : CavityResonator object cav_res : CavityResonator object
CavityResonator in which the loop will be added. CavityResonator in which the loop will be added.
gain : float list gain : float list
Proportional gain (Pgain) and integral gain (Igain) of the feedback system. Proportional gain (Pgain) and integral gain (Igain) of the feedback
system in the form of a list [Pgain, Igain].
For IQ feedback, same gain set is used for I and Q. For IQ feedback, same gain set is used for I and Q.
In case of normal conducting cavity (QL~1e4), In case of normal conducting cavity (QL~1e4), the Pgain of ~1.0 and
the Pgain of ~1.0 and Igain of ~1e4(5) are usually used. Igain of ~1e4(5) are usually used.
In case of super conducting cavity (QL > 1e6), In case of super conducting cavity (QL > 1e6), the Pgain of ~100
the Pgain of ~100 can be used. can be used.
In a "bad" parameter set, unstable oscillation of Vc is caused. In a "bad" parameter set, unstable oscillation of the cavity voltage
So, parameter scan of Vcloop should be made. can be caused. So, a parameter scan of the gain should be made.
sample_num : int sample_num : int
Sample number to monitor Vc Number of bunch over which the mean cavity voltage is computed.
The averaged Vc value in sample_num is monitored.
Units are in bucket numbers. Units are in bucket numbers.
every : int every : int
Interval to monitor and change Vc Time interval between two cavity voltage monitoring and feedback.
Units are in bucket numbers. Units are in bucket numbers.
delay : int delay : int
Loop delay of the PI feedback system. Loop delay of the PI feedback system.
Units are in bucket numbers. Units are in bucket numbers.
FF : bool, optional FF : bool, optional
Boolean switch to use feedforward constant. Boolean switch to use feedforward constant.
True is recommended to prevent a Vc drop in the beginning of the tracking. True is recommended to prevent a cavity voltage drop in the beginning
In case of small Pgain (QL ~ 1e4), Vc drop may cause beam loss due to static Robinson. of the tracking.
In case of small Pgain (QL ~ 1e4), cavity voltage drop may cause
beam loss due to static Robinson.
Default is True. Default is True.
Methods Methods
...@@ -1149,14 +1151,14 @@ class ProportionalIntegralLoop(): ...@@ -1149,14 +1151,14 @@ class ProportionalIntegralLoop():
----- -----
Assumption : delay >> every ~ sample_num Assumption : delay >> every ~ sample_num
Adjusting ig(Vg) parameter to keep the Vc constant (to target(Vref) values). Adjusting ig(Vg) parameter to keep the cavity voltage constant (to target values).
The "track" method is The "track" method is
1) Monitoring the Vc phasor 1) Monitoring the cavity voltage phasor
Mean Vc value between specified bunch number (sample_num) is monitored Mean cavity voltage value between specified bunch number (sample_num) is monitored
with specified interval period (every). with specified interval period (every).
2) Changing the ig phasor 2) Changing the ig phasor
The ig phasor is changed according the difference of the specified The ig phasor is changed according the difference of the specified
reference values (Vref) with specified gain (gain). reference values with specified gain (gain).
By using ig instead of Vg, the cavity response can be taken account. By using ig instead of Vg, the cavity response can be taken account.
3) ig changes are reflected to Vg after the specifed delay (delay) of the system 3) ig changes are reflected to Vg after the specifed delay (delay) of the system
...@@ -1196,7 +1198,7 @@ class ProportionalIntegralLoop(): ...@@ -1196,7 +1198,7 @@ class ProportionalIntegralLoop():
self.every = 1 self.every = 1
record_size = int(np.ceil(self.delay/self.every)) record_size = int(np.ceil(self.delay/self.every))
if record_size < 1: if record_size < 1:
raise ValueError("Bad parameter set : delay or sample_every") raise ValueError("Bad parameter set : delay or every")
self.sample_num = int(sample_num) self.sample_num = int(sample_num)
# init lists for FB process # init lists for FB process
...@@ -1385,7 +1387,7 @@ class DirectFeedback(ProportionalIntegralLoop): ...@@ -1385,7 +1387,7 @@ class DirectFeedback(ProportionalIntegralLoop):
record_size = int(np.ceil(self.DFB_delay/self.DFB_every)) record_size = int(np.ceil(self.DFB_delay/self.DFB_every))
if record_size < 1: if record_size < 1:
raise ValueError("Bad parameter set : delay or sample_every") raise ValueError("Bad parameter set : DFB_delay or DFB_every")
self.DFB_parameter_set(DFB_gain, DFB_phase_shift) self.DFB_parameter_set(DFB_gain, DFB_phase_shift)
if np.sum(np.abs(self.cav_res.beam_phasor)) == 0: if np.sum(np.abs(self.cav_res.beam_phasor)) == 0:
...@@ -1478,8 +1480,7 @@ class DirectFeedback(ProportionalIntegralLoop): ...@@ -1478,8 +1480,7 @@ class DirectFeedback(ProportionalIntegralLoop):
self.DFB_ig_phasor = self.Vg2Ig(vg_drf) self.DFB_ig_phasor = self.Vg2Ig(vg_drf)
self.ig_phasor = self.ig_phasor_record - self.DFB_ig_phasor self.ig_phasor = self.ig_phasor_record - self.DFB_ig_phasor
if self.FF: self.init_FFconst()
self.FFconst = np.mean(self.ig_phasor)
def track(self): def track(self):
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment