Added rocking
This commit is contained in:
@@ -14,7 +14,6 @@ import numpy as np
|
||||
import time
|
||||
|
||||
|
||||
|
||||
class A3200Axis(PVPositioner):
|
||||
"""Ophyd proxy class for the Aerotech Automation 1's core controller functionality"""
|
||||
# Basic PV positioner interface
|
||||
@@ -22,44 +21,61 @@ class A3200Axis(PVPositioner):
|
||||
readback = Component(EpicsSignalRO, "-RBV", auto_monitor=True, kind=Kind.hinted)
|
||||
setpoint = Component(EpicsSignal, "-SETP", kind=Kind.config)
|
||||
|
||||
error = Component(EpicsSignalRO, "-STAT", auto_monitor=True, kind=Kind.config)
|
||||
rmove = Component(EpicsSignal, "-INCP", kind=Kind.config)
|
||||
|
||||
|
||||
# PV that diasables the execution of move commands
|
||||
disable = Component(EpicsSignal, "-DIS", kind=Kind.config)
|
||||
|
||||
|
||||
velo = Component(EpicsSignal, "-SETV", kind=Kind.config)
|
||||
# HW status word
|
||||
error = Component(EpicsSignalRO, "-STAT", auto_monitor=True, kind=Kind.config)
|
||||
# PV to issue native relative movements on the A3200
|
||||
relmove = Component(EpicsSignal, "-INCP", put_complete=True, kind=Kind.config)
|
||||
# PV to home axis
|
||||
home = Component(EpicsSignal, "-HOME", kind=Kind.config)
|
||||
|
||||
# HW status words
|
||||
dshw = Component(EpicsSignalRO, "-DSHW", auto_monitor=True, kind=Kind.hinted)
|
||||
ashw = Component(EpicsSignalRO, "-ASHW", auto_monitor=True, kind=Kind.hinted)
|
||||
fslw = Component(EpicsSignalRO, "-FSLW", auto_monitor=True, kind=Kind.hinted)
|
||||
|
||||
# Rock movement
|
||||
_rock = Component(EpicsSignal, "-ROCK", put_complete=True, kind=Kind.config)
|
||||
_rock_dist = Component(EpicsSignal, "-RINCP", put_complete=True, kind=Kind.config)
|
||||
_rock_velo = Component(EpicsSignal, "-RSETV", put_complete=True, kind=Kind.config)
|
||||
_rock_count = Component(EpicsSignal, "-COUNT", put_complete=True, kind=Kind.config)
|
||||
_rock_accel = Component(EpicsSignal, "-RRATE", put_complete=True, kind=Kind.config)
|
||||
|
||||
def rmove(self, distance, wait=True, timeout=None, moved_cb=None) -> Status:
|
||||
""" Native relative movement on the A3200 """
|
||||
# Before moving, ensure we can stop (if a stop_signal is configured).
|
||||
if self.stop_signal is not None:
|
||||
self.stop_signal.wait_for_connection()
|
||||
status = super(PVPositioner, self).move(position=distance, timeout=timeout, moved_cb=moved_cb)
|
||||
|
||||
# class A3200AxisRock(Device):
|
||||
# """Ophyd proxy class for the Aerotech Automation 1's core controller functionality"""
|
||||
# error = Component(EpicsSignalRO, "-STAT", auto_monitor=True, kind=Kind.config)
|
||||
# done = Component(EpicsSignalRO, "-DONE", auto_monitor=True, kind=Kind.config)
|
||||
# readback = Component(EpicsSignalRO, "-RBV", auto_monitor=True, kind=Kind.hinted)
|
||||
# setpoint = Component(EpicsSignal, "-SETP", read_pv="-GETP", auto_monitor=True, kind=Kind.config)
|
||||
# rmove = Component(EpicsSignal, "-INCP", kind=Kind.config)
|
||||
has_done = self.done is not None
|
||||
if not has_done:
|
||||
moving_val = 1 - self.done_value
|
||||
self._move_changed(value=self.done_value)
|
||||
self._move_changed(value=moving_val)
|
||||
|
||||
|
||||
# # PV that diasables the execution of move commands
|
||||
# disable = Component(EpicsSignal, "-DIS", kind=Kind.config)
|
||||
|
||||
|
||||
# velo = Component(EpicsSignal, "-SETV", kind=Kind.config)
|
||||
# # HW status word
|
||||
# dshw = Component(EpicsSignalRO, "-DSHW", auto_monitor=True, kind=Kind.hinted)
|
||||
|
||||
# # Rock movement
|
||||
# rock = Component(EpicsSignal, "-ROCK", kind=Kind.config)
|
||||
# rock_velo = Component(EpicsSignal, "-RSETV", kind=Kind.config)
|
||||
# rock_dist = Component(EpicsSignal, "-RINCP", kind=Kind.config)
|
||||
# rock_cont = Component(EpicsSignal, "-COUNT", kind=Kind.config)
|
||||
# rock_accl = Component(EpicsSignal, "-RRATE", kind=Kind.config)
|
||||
try:
|
||||
# Relative movement instead of setpoint
|
||||
self.relmove.put(distance)
|
||||
if wait:
|
||||
status.wait()
|
||||
except KeyboardInterrupt:
|
||||
self.stop()
|
||||
raise
|
||||
|
||||
return status
|
||||
|
||||
def rock(self, distance, counts: int, velocity=None, acceleration=None, wait=True):
|
||||
""" Repeated single axis zigzag scan I guess PSO should be configured for this"""
|
||||
|
||||
self._rock_dist.put(distance)
|
||||
self._rock_count.put(counts)
|
||||
if velocity is not None:
|
||||
self._rock_velo.put(velocity)
|
||||
if acceleration is not None:
|
||||
self._rock_accel.put(acceleration)
|
||||
self._rock.put(1)
|
||||
|
||||
status = super(PVPositioner, self).move(position=distance)
|
||||
if wait:
|
||||
status.wait()
|
||||
return status
|
||||
Reference in New Issue
Block a user