-
Notifications
You must be signed in to change notification settings - Fork 2
Improve BO inj. optimzation class: posang & wait method #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
vellosok75
wants to merge
9
commits into
master
Choose a base branch
from
inj-bopt
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9186c2e
COMMISS.MNT: change limits klys and SHB limits
vellosok75 2fa8799
COMMISS.INJBO.ENH: use SP vals when reading positions for posang & LI…
vellosok75 10377c8
COMMISS.INJBO.ENH: use PS `set_current` method
vellosok75 c8fb6fb
COMMISS.INJOPT.ENH: add TB ch, cvs and injsept (alternative to posang…
vellosok75 d8cae96
COMMISS.INJBO.ENH: avoid PVs waiting time serialization
vellosok75 2d89b58
COMMISS.INJBOOPT.ENH: standardize getting positions from RB values in…
vellosok75 9f606f4
COMMISS.INJBOOPT.ENH: use relative tol in `wait_pos`
vellosok75 3993267
Merge branch 'master' into inj-bopt
vellosok75 2c1616c
COMMISS.INJBOOPT.BUG: fix typo in getting kly2 phase
vellosok75 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -59,6 +59,11 @@ class OptimizeInjBOParams(_RCDSParams): | |||||
| 'angy', | ||||||
| 'kckr', | ||||||
|
|
||||||
| "tb_ch1", | ||||||
| "tb_injsept", | ||||||
| "tb_cv1", | ||||||
| "tb_cv2", | ||||||
|
|
||||||
| 'shb_amp', | ||||||
| 'kly1_amp', | ||||||
| 'kly2_amp', | ||||||
|
|
@@ -114,12 +119,17 @@ class OptimizeInjBOParams(_RCDSParams): | |||||
| +1.0, # 'angy', | ||||||
| -19.0, # 'kckr', | ||||||
|
|
||||||
| +10.0, # tb_ch1 | ||||||
| 0.0, # tb_injsept | ||||||
| +10.0, # tb_cv1 | ||||||
| +10.0, # tb_cv2 | ||||||
|
|
||||||
| 40, # 'shb_amp', | ||||||
| 91, # 'kly1_amp', | ||||||
| 76, # 'kly2_amp', | ||||||
| 180, # 'shb_phs', | ||||||
| 180, # 'kly1_phs', | ||||||
| 180, # 'kly2_phs', | ||||||
| -150, # 'kly1_phs', | ||||||
| 0, # 'kly2_phs', | ||||||
|
|
||||||
| 80, # 'borf_amp', | ||||||
| 160, # 'borf_phs', | ||||||
|
|
@@ -169,12 +179,17 @@ class OptimizeInjBOParams(_RCDSParams): | |||||
| -1.0, # 'angy', | ||||||
| -25.0, # 'kckr', | ||||||
|
|
||||||
| -10.0, # tb_ch1 | ||||||
| -776.69, # tb_injsept | ||||||
| -10.0, # tb_cv1 | ||||||
| -10.0, # tb_cv2 | ||||||
|
|
||||||
| 20, # 'shb_amp', | ||||||
| 85, # 'kly1_amp', | ||||||
| 70, # 'kly2_amp', | ||||||
| -180, # 'shb_phs', | ||||||
| 160, # 'shb_phs', | ||||||
| -180, # 'kly1_phs', | ||||||
| -180, # 'kly2_phs', | ||||||
| -20, # 'kly2_phs', | ||||||
|
|
||||||
| 30, # 'borf_amp', | ||||||
| 90, # 'borf_phs', | ||||||
|
|
@@ -406,6 +421,15 @@ def get_current_position(self): | |||||
| elif fun('kckr'): | ||||||
| pos.append(self.devices['injkckr'].strength) | ||||||
|
|
||||||
| elif fun('tb_ch1'): | ||||||
| pos.append(self.devices['tb_ch1'].current) | ||||||
| elif fun('tb_injsept'): | ||||||
| pos.append(self.devices['tb_injsept'].strength) | ||||||
| elif fun('tb_cv1'): | ||||||
| pos.append(self.devices['tb_cv1'].current) | ||||||
| elif fun('tb_cv2'): | ||||||
| pos.append(self.devices['tb_cv2'].current) | ||||||
|
|
||||||
| elif fun('shb_amp'): | ||||||
| pos.append(self.devices['li_llrf'].dev_shb.amplitude) | ||||||
| elif fun('kly1_amp'): | ||||||
|
|
@@ -518,6 +542,15 @@ def set_position_to_machine(self, pos): | |||||
| elif fun('kckr'): | ||||||
| self.devices['injkckr'].strength = p | ||||||
|
|
||||||
| elif fun('tb_ch1'): | ||||||
| self.devices['tb_ch1'].current = p | ||||||
| elif fun('tb_injsept'): | ||||||
| self.devices['tb_injsept'].strength = p | ||||||
| elif fun('tb_cv1'): | ||||||
| self.devices['tb_cv1'].current = p | ||||||
| elif fun('tb_cv2'): | ||||||
| self.devices['tb_cv2'].current = p | ||||||
|
|
||||||
| elif fun('shb_amp'): | ||||||
| self.devices['li_llrf'].dev_shb.amplitude = p | ||||||
| elif fun('kly1_amp'): | ||||||
|
|
@@ -538,6 +571,8 @@ def set_position_to_machine(self, pos): | |||||
| else: | ||||||
| raise ValueError('Wrong specification of knob.') | ||||||
|
|
||||||
| self.wait_set_pos(pos, timeout=10, rtol=0.05, atol=0.1) | ||||||
|
|
||||||
| def _create_devices(self): | ||||||
| # knobs devices | ||||||
| # lenses | ||||||
|
|
@@ -582,6 +617,11 @@ def _create_devices(self): | |||||
| self.devices['pos_ang'] = PosAng(PosAng.DEVICES.TB) | ||||||
| self.devices['injkckr'] = PowerSupplyPU( | ||||||
| PowerSupplyPU.DEVICES.BO_INJ_KCKR) | ||||||
| # TB PosAng knobs (alternative to PosAng) | ||||||
| self.devices["tb_ch1"] = PowerSupply("TB-04:PS-CH-1") | ||||||
| self.devices["tb_injsept"] = PowerSupplyPU("TB-04:PU-InjSept") | ||||||
| self.devices["tb_cv1"] = PowerSupply("TB-04:PS-CV-1") | ||||||
| self.devices["tb_cv2"] = PowerSupply("TB-04:PS-CV-2") | ||||||
| # LI LLRF | ||||||
| self.devices['li_llrf'] = LILLRF() | ||||||
| # BO LLRF | ||||||
|
|
@@ -605,3 +645,26 @@ def _initialization(self): | |||||
| self.data['currents'] = [] | ||||||
| self.prepare_evg() | ||||||
| return True | ||||||
|
|
||||||
| def wait_set_pos(self, pos, tol=0.05, timeout=10): | ||||||
| """Wait positions RB reach the the desired SP vals. | ||||||
|
|
||||||
|
Comment on lines
+650
to
+651
|
||||||
| """Wait positions RB reach the the desired SP vals. | |
| """Wait positions RB reach the desired SP vals. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected keyword arguments 'rtol' and 'atol' passed to wait_set_pos; update the method call or the signature to match.