Skip to content
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

Mnt prep for demo #23

Draft
wants to merge 25 commits into
base: deprecated-master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
21c7868
MNT: avoid bare except
tacaswell Feb 26, 2021
669832d
MNT: lift missing value from _py file
tacaswell Feb 26, 2021
ad96016
MNT: add missing import to keep the linter happy
tacaswell Feb 26, 2021
172036d
MNT: put back in an RE API compatibly wrapper of xrun
tacaswell Feb 26, 2021
da32e93
MNT: files for queueserver startup
tacaswell Feb 26, 2021
ace7731
ENH: add plan that looks up sample metadata from xpdacq
tacaswell Feb 27, 2021
fbabb22
ENH: update and curate published plans
tacaswell Feb 27, 2021
0ae9e28
rapid development of sorensen power supply
tacaswell Mar 1, 2021
64dfab5
ENH: add caproto IOC for ramp plan
tacaswell Mar 1, 2021
b50c7d4
tweak controlled ramp plan
tacaswell Mar 2, 2021
cf77222
MNT: make writing the CSV optional
tacaswell Mar 2, 2021
bb6a421
FIX: the grid objects are in globals not locals
tacaswell Mar 2, 2021
4b937bf
BUG: add ability to optionally write out a CSV of temperatures
tacaswell Mar 2, 2021
5daa121
Collection of on-the-fly changes to thermo control
tacaswell Mar 10, 2021
db73d88
formatting + changes db insertion
tacaswell Mar 10, 2021
ff3ac6b
add flag to IOC to control xrd collection
tacaswell Mar 10, 2021
21860b9
HACK: overnight script to stop experiment after it melts
tacaswell Mar 10, 2021
2934cd8
ignore vscode files
tacaswell Mar 10, 2021
7473d51
remove suspenders
tacaswell Apr 7, 2021
b3fff96
Add plans for demo
tacaswell Apr 7, 2021
d8ebcde
Regenerate list of known plans + use existing filtering
tacaswell Apr 7, 2021
bc08329
STY: fix indentation of comments
tacaswell Apr 7, 2021
e30ad53
ENH: skeletons of the plans we need for the demo
tacaswell Apr 7, 2021
daa3f2c
FIX: make positions actually optional
tacaswell Apr 7, 2021
755714f
MNT: simplify signature of sample_aware_count
tacaswell Apr 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,5 @@ db/
static/
history.sqlite
Link\ to\ startup

.vscode/
35 changes: 35 additions & 0 deletions scripts/ramp_ioc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env python3
from textwrap import dedent

from caproto.server import PVGroup, ioc_arg_parser, pvproperty, run


class SimpleIOC(PVGroup):
"""
An IOC with three uncoupled read/writable PVs

Scalar PVs
----------
A (int)
B (float)

Vectors PVs
-----------
C (vector of int)
"""

done = pvproperty(
value=0,
doc="An integer to track if the ramp should be done.",
name="RampDone-Cmd",
)
delta = pvproperty(value=0.1, doc="The delta of the ramp rate.", name="RampDelta")
take = pvproperty(value=0, doc="If XRD data should be taken", name="TakeXRD-Cmd",)


if __name__ == "__main__":
ioc_options, run_options = ioc_arg_parser(
default_prefix="OvenRampControl:", desc=dedent(SimpleIOC.__doc__)
)
ioc = SimpleIOC(**ioc_options)
run(ioc.pvdb, **run_options)
48 changes: 48 additions & 0 deletions scripts/robo_dan.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
from ophyd import Device, Component as Cpt, EpicsSignal
import time
import datetime


class RampControl(Device):
delta = Cpt(EpicsSignal, "RampDelta")
done = Cpt(EpicsSignal, "RampDone-Cmd")
take_xrd = Cpt(EpicsSignal, "TakeXRD-Cmd")


temperature = EpicsSignal("XF:28ID1-ES{LS336:1-Chan:C}T-I")
ramp_control = RampControl("OvenRampControl:", name="ramp_control")
power_rbv = EpicsSignal("XF:28ID1-ES{LS336:1-Out:3}Out:Man-RB")
power_sp = EpicsSignal("XF:28ID1-ES{LS336:1-Out:3}Out:Man-SP")

print(f"{datetime.datetime.now()} Good morning! Robo-dan going to work!")

while True:
T = temperature.get()
if T is not None and T > 1025:
break
time.sleep(60)
print(f"{datetime.datetime.now()} temperature at {T:.2f}, keep going!")

print(f"{datetime.datetime.now()} temperature at {T}, Done!!")

ramp_control.delta.put(0)
print(f"{datetime.datetime.now()} holding for 5 minutes")
time.sleep(60 * 5)

print(f"{datetime.datetime.now()} starting cooling")
ramp_control.delta.put(-2.5)

while True:
p = power_rbv.get()
print(f"{datetime.datetime.now()} power currently at {p}, still cooling")
if p < 1:
break
time.sleep(3 * 60)

time.sleep(5 * 60)
print(f"{datetime.datetime.now()} power low, declare done")
ramp_control.done.put(1)

time.sleep(5 * 60)
print(f"{datetime.datetime.now()} putting power to 0 just in case")
power_sp.put(0)
Loading