Skip to content

Commit

Permalink
Adding vacuum and baffle PVs to the 'ARI M1' mirror caproto IOC
Browse files Browse the repository at this point in the history
  • Loading branch information
awalter-bnl committed Apr 8, 2024
1 parent f26f626 commit 27cd328
Show file tree
Hide file tree
Showing 14 changed files with 120 additions and 12 deletions.
Binary file added .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/ARI_SXN_SimBeamline.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified src/.DS_Store
Binary file not shown.
Binary file added src/ari_sxn_simbeamline/.DS_Store
Binary file not shown.
86 changes: 76 additions & 10 deletions src/ari_sxn_simbeamline/Caproto_servers/Mirror_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,66 @@
Caproto IOC servers
"""
from caproto.ioc_examples.fake_motor_record import FakeMotor
from caproto.server import PVGroup, SubGroup, ioc_arg_parser, run
from caproto.server import PVGroup, SubGroup, pvproperty, ioc_arg_parser, run
from textwrap import dedent


class FourBladeCurrent(PVGroup):
"""
A PVGroup that generates the PVs associated with the 4 blade electrometer.
This class should be used to define the PVs for the 4 blade electrometers used
in the ARI and SXN beamlines for the Baffle slits.
TODO:
1. Work out how we want to update the returned current values based on the position
of the blades and the upstream mirrors.
"""

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) # call the PVGroup __init__ function

# Add the current PVs
top = pvproperty(value=3E-6, name=':top', read_only=True)
bottom = pvproperty(value=3E-6, name=':bottom', read_only=True)
inboard = pvproperty(value=3E-6, name=':inboard', read_only=True)
outboard = pvproperty(value=3E-6, name=':outboard', read_only=True)


class BaffleSlit(PVGroup):
"""
A PVGroup that generates the PVs associated with the ARI M1 mirror system.
This class should be used to define the Baffle Slit system PVs for the baffle slits
used in the ARI and SXN beamlines. It will consist of PVs for each of the associated
motors for each baffle as well as the photo-current PVs from each of the blades.
TODO:
1. Work out how we want to define the area detector PVs, including how we 'update'
the photo-current PVs based from each of the blades when the mirror and/or baffles
are moved.
"""

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) # call the PVGroup __init__ function

# Add the baffle motor PVs.
top = SubGroup(FakeMotor, velocity=0.1, precision=6E-3, acceleration=1.0,
resolution=6E-3, user_limits=(-1, 20), tick_rate_hz=10.,
prefix=':top')
bottom = SubGroup(FakeMotor, velocity=0.1, precision=6E-3, acceleration=1.0,
resolution=6E-3, user_limits=(-20, 1), tick_rate_hz=10.,
prefix=':bottom')
inboard = SubGroup(FakeMotor, velocity=0.1, precision=6E-3, acceleration=1.0,
resolution=6E-3, user_limits=(-20, 1), tick_rate_hz=10.,
prefix=':inboard')
outboard = SubGroup(FakeMotor, velocity=0.1, precision=6E-3, acceleration=1.0,
resolution=6E-3, user_limits=(-1, 20), tick_rate_hz=10.,
prefix=':outboard')

current = SubGroup(FourBladeCurrent, prefix=':current')


class AriM1Mirror(PVGroup):
"""
A PVGroup that generates the PVs associated with the ARI M1 mirror system.
Expand All @@ -21,40 +77,50 @@ class AriM1Mirror(PVGroup):
- This may help create a cohesive connection between them but also blurs
the lines between vacuum sections and physical devices.
2. Add the vacuum component (gauges, pumps, valves, ....).
- This may require defining vacuum component PVGroups.
- Temporary read only PVs have been created but I need to see what other PVs
are associated with this hardware that we may want to simulate.
Parameters
----------
*args : list
The arguments passed to the PVGroup parent class
The arguments passed to the PVGroup parent class.
**kwargs : list, optional
The Keyword arguments passed to the PVGroup parent class
The Keyword arguments passed to the PVGroup parent class.
"""

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) # call the PVGroup __init__ function

# Add the mirror motor PVs.
Ry_coarse = SubGroup(FakeMotor, velocity=0.1, precision=6E-5, acceleration=1.0,
resolution=6E-5, user_limits=(-3.15, -1.15), tick_rate_hz=10.,
prefix='Ry_coarse')
prefix=':Ry_coarse')
Ry_fine = SubGroup(FakeMotor, velocity=0.1, precision=6E-7, acceleration=1.0,
resolution=6E-7, user_limits=(-0.03, 0.03), tick_rate_hz=10.,
prefix='Ry_fine')
prefix=':Ry_fine')
Rz = SubGroup(FakeMotor, velocity=0.1, precision=6E-5, acceleration=1.0,
resolution=6E-5, user_limits=(-2.3, 2.3), tick_rate_hz=10.,
prefix='Rz')
prefix=':Rz')
x = SubGroup(FakeMotor, velocity=0.0001, precision=5., acceleration=1.0,
resolution=5., user_limits=(-10000., 10000.), tick_rate_hz=1E-3,
prefix='x')
prefix=':x')
y = SubGroup(FakeMotor, velocity=0.1, precision=5., acceleration=1.0,
resolution=5., user_limits=(-10000., 10000.), tick_rate_hz=10.,
prefix='y')
prefix=':y')

# Add the mirror chamber vacuum PVs.
ccg = pvproperty(value=3E-10, name=':ccg', read_only=True)
tcg = pvproperty(value=1E-4, name=':tcg', read_only=True)
ip = pvproperty(value=4E-10, name=':ip', read_only=True)

# Add the baffle slit PVs.
baffle = SubGroup(BaffleSlit, prefix=':baffle')


# Add some code to start a version of the server if this file is 'run'.
if __name__ == "__main__":
ioc_options, run_options = ioc_arg_parser(
default_prefix="ARI:M1:",
default_prefix="ARI_M1",
desc=dedent(AriM1Mirror.__doc__))
ioc = AriM1Mirror(**ioc_options)
run(ioc.pvdb, **run_options)
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions src/ari_sxn_simbeamline/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE

__version__ = version = '0.1.dev3+gddc9ce4'
__version_tuple__ = version_tuple = (0, 1, 'dev3', 'gddc9ce4')
__version__ = version = '0.1.dev4+g5b78bf3'
__version_tuple__ = version_tuple = (0, 1, 'dev4', 'g5b78bf3')

0 comments on commit 27cd328

Please sign in to comment.