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

Implementation of pmac trajectory #440

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1d2b419
Initial trajectory implementation
tomtrafford Jul 5, 2024
3cbe52a
Added Pmac Motor
tomtrafford Jul 8, 2024
8a84da8
Correct PV datatypes
tomtrafford Jul 8, 2024
da9ebc3
Complete profile build PV interactions and convert time array to PMAC…
tomtrafford Jul 8, 2024
8323a68
Implement complete method and setting of CS
tomtrafford Jul 8, 2024
6287085
Corrected run up
tomtrafford Jul 8, 2024
0ba74bf
Make test represent current functionality
tomtrafford Jul 8, 2024
032f22e
Motors passed in as part of scanSpec stack and fix Complete()
tomtrafford Jul 11, 2024
92d9a52
Get CS info from motor link field. Only works for compound motors
tomtrafford Jul 12, 2024
9b628a6
Add scan trail off
tomtrafford Jul 12, 2024
c5b81c5
Remove pmacCSmotor
tomtrafford Jul 12, 2024
3b46072
Changed IO assignment to DeviceVector
tomtrafford Jul 18, 2024
a24cb9b
Calculate trajectory timeout
tomtrafford Jul 24, 2024
f039c1f
Move bundled motion profile into seperate local
tomtrafford Jul 24, 2024
7d65121
Add signal for pmac to use Velocity array
tomtrafford Jul 25, 2024
afa7705
Change flyer to be implemented as a TriggerLogic in a StandardFlyer
tomtrafford Aug 7, 2024
eb64d00
Use Numpy operations for trajectory arrays
tomtrafford Aug 8, 2024
7bd96ec
Added support for gaps in trajectory
tomtrafford Aug 9, 2024
534faa4
Add stop method
tomtrafford Aug 16, 2024
69a8d35
Correct imports after project restructure
tomtrafford Sep 12, 2024
13cc0ad
Use Str to set enum
tomtrafford Sep 30, 2024
f891069
Formatting correctings for linting test
tomtrafford Oct 3, 2024
8c11eef
Implement trajectory scanning on raw Motors
tomtrafford Oct 10, 2024
62313de
Add PmacMotor class
tomtrafford Oct 11, 2024
8e554d6
Formatting changes
tomtrafford Oct 15, 2024
78e1d1b
Add super on pmac init
tomtrafford Oct 31, 2024
817e110
Correct Array datatype
tomtrafford Nov 4, 2024
71d53a8
Added User array to control GPIO during motion program
tomtrafford Nov 19, 2024
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 pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ dependencies = [
"colorlog",
"pydantic>=2.0",
"pydantic-numpy",
"scanspec>=0.7.2",
"velocity-profile",
]
dynamic = ["version"]
license.file = "LICENSE"
Expand Down
2 changes: 1 addition & 1 deletion src/ophyd_async/epics/motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __init__(self, prefix: str, name="") -> None:
self.motor_done_move = epics_signal_r(int, prefix + ".DMOV")
self.low_limit_travel = epics_signal_rw(float, prefix + ".LLM")
self.high_limit_travel = epics_signal_rw(float, prefix + ".HLM")

self.output_link = epics_signal_r(str, prefix + ".OUT")
self.motor_stop = epics_signal_x(prefix + ".STOP")
# Whether set() should complete successfully or not
self._set_success = True
Expand Down
4 changes: 4 additions & 0 deletions src/ophyd_async/epics/pmac/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from ._pmac_io import Pmac, PmacMotor
from ._pmac_trajectory import PmacTrajectoryTriggerLogic, PmacTrajInfo

__all__ = ["Pmac", "PmacMotor", "PmacTrajectoryTriggerLogic", "PmacTrajInfo"]
57 changes: 57 additions & 0 deletions src/ophyd_async/epics/pmac/_pmac_io.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import numpy as np

from ophyd_async.core import Array1D, DeviceVector, StandardReadable
from ophyd_async.epics import motor
from ophyd_async.epics.core import epics_signal_r, epics_signal_rw


class Pmac(StandardReadable):
"""Device that moves a PMAC Motor record"""

def __init__(self, prefix: str, name: str = "") -> None:
self.time_array = epics_signal_rw(
Array1D[np.float64], prefix + ":ProfileTimeArray"
)
self.user_array = epics_signal_rw(Array1D[np.int32], prefix + ":UserArray")
cs_letters = "ABCUVWXYZ"
# 1 indexed CS axes so we can index into them from the compound motor input link
self.positions = DeviceVector(
{
i + 1: epics_signal_rw(
Array1D[np.float64], f"{prefix}:{letter}:Positions"
)
for i, letter in enumerate(cs_letters)
}
)
self.use_axis = DeviceVector(
{
i + 1: epics_signal_rw(bool, f"{prefix}:{letter}:UseAxis")
for i, letter in enumerate(cs_letters)
}
)
self.velocities = DeviceVector(
{
i + 1: epics_signal_rw(
Array1D[np.float64], f"{prefix}:{letter}:Velocities"
)
for i, letter in enumerate(cs_letters)
}
)
self.points_to_build = epics_signal_rw(int, prefix + ":ProfilePointsToBuild")
self.build_profile = epics_signal_rw(bool, prefix + ":ProfileBuild")
self.execute_profile = epics_signal_rw(bool, prefix + ":ProfileExecute")
self.scan_percent = epics_signal_r(float, prefix + ":TscanPercent_RBV")
self.profile_abort = epics_signal_rw(bool, prefix + ":ProfileAbort")
self.profile_cs_name = epics_signal_rw(str, prefix + ":ProfileCsName")
self.profile_calc_vel = epics_signal_rw(bool, prefix + ":ProfileCalcVel")

super().__init__(name=name)


class PmacMotor(motor.Motor):
"""Device that moves a PMAC Motor record"""

def __init__(self, prefix: str, name: str = "") -> None:
self.cs_axis = epics_signal_r(str, f"{prefix}:CsAxis_RBV")
self.cs_port = epics_signal_r(str, f"{prefix}:CsPort_RBV")
super().__init__(prefix=prefix, name=name)
Loading
Loading