Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BCU-Vercors
ID26
id26
Commits
e4f67a45
Commit
e4f67a45
authored
Nov 02, 2021
by
bliss administrator
Browse files
ExternalInput for regulation SoftLoop out of Moco Diodes
parent
710c59ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
id26/controllers/
chi2_diode_devic
e.py
→
id26/controllers/
softloop_moco_diod
e.py
View file @
e4f67a45
...
...
@@ -13,7 +13,7 @@ from bliss.common.regulation import SoftLoop
from
bliss.common.logtools
import
log_debug
class
Chi2
DiodeInput
(
ExternalInput
):
class
Moco
DiodeInput
(
ExternalInput
):
""" """
def
__init__
(
self
,
name
,
config
):
...
...
@@ -26,14 +26,14 @@ class Chi2DiodeInput(ExternalInput):
self
.
signal_max
=
config
.
get
(
'signal_max'
,
np
.
infty
)
self
.
_last_value
=
0
def
_get_
chi2
_counts
(
self
):
count_
chi2
=
self
.
device
.
comm
(
'?fbeam'
)
count_finm
=
float
(
count_
chi2
.
split
()[
0
])
count_foutm
=
float
(
count_
chi2
.
split
()[
1
])
def
_get_
moco
_counts
(
self
):
count_
moco
=
self
.
device
.
comm
(
'?fbeam'
)
count_finm
=
float
(
count_
moco
.
split
()[
0
])
count_foutm
=
float
(
count_
moco
.
split
()[
1
])
return
count_finm
,
count_foutm
def
allow_regulation
(
self
):
count_finm
,
count_foutm
=
self
.
_get_
chi2
_counts
()
count_finm
,
count_foutm
=
self
.
_get_
moco
_counts
()
d1
=
count_finm
-
self
.
offset_finm
d2
=
count_foutm
-
self
.
offset_foutm
...
...
@@ -49,7 +49,7 @@ class Chi2DiodeInput(ExternalInput):
def
read
(
self
):
""" """
count_finm
,
count_foutm
=
self
.
_get_
chi2
_counts
()
count_finm
,
count_foutm
=
self
.
_get_
moco
_counts
()
d1
=
count_finm
-
self
.
offset_finm
d2
=
count_foutm
-
self
.
offset_foutm
...
...
@@ -64,7 +64,7 @@ class Chi2DiodeInput(ExternalInput):
def
state
(
self
):
""" returns the input device state """
log_debug
(
self
,
"
Chi2
DiodeInput:state"
)
log_debug
(
self
,
"
Moco
DiodeInput:state"
)
return
"READY"
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment