Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mbtrack2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PA
Collective Effects
mbtrack2
Commits
cc3b3c36
Commit
cc3b3c36
authored
Oct 17, 2023
by
Alexis GAMELIN
Browse files
Options
Downloads
Patches
Plain Diff
Docstring improvements
Improve ProportionalIntegralLoop & DirectFeedback docstrings.
parent
99603eed
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mbtrack2/tracking/rf.py
+21
-20
21 additions, 20 deletions
mbtrack2/tracking/rf.py
with
21 additions
and
20 deletions
mbtrack2/tracking/rf.py
+
21
−
20
View file @
cc3b3c36
...
@@ -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
I
nterval
to
monitor and
change Vc
Time i
nterval
between two cavity voltage
monitor
ing
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
V
c constant (to target
(Vref)
values).
Adjusting ig(Vg) parameter to keep the c
avity voltage
constant (to target values).
The
"
track
"
method is
The
"
track
"
method is
1) Monitoring the
V
c phasor
1) Monitoring the c
avity voltage
phasor
Mean
V
c value between specified bunch number (sample_num) is monitored
Mean c
avity 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
):
"""
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment