-
Notifications
You must be signed in to change notification settings - Fork 25
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
Breaking Change: Rename and add motor fields #174
Conversation
self.precision = epics_signal_r(int, prefix + ".PREC") | ||
# Signals that collide with standard methods should have a trailing underscore | ||
self.stop_ = epics_signal_x(prefix + ".STOP") | ||
self.max_resolution = epics_signal_r(float, prefix + ".MRES") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling MRES
"max resolution" seems misleading - I'd rather call it motor_step_size
. The resolution of the encoder position readback might be higher.
Do we also want ERES
for encoder_step_size
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, was a poor copy/paste, thanks.
I'm keen not to pre-emptively put in too much before we know we need it and Hyperion has yet to need ERES
. I guess we could if we were trying to be more clever about tolerances on how close we are to things but we're not currently...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ERES
defaults to MRES
, so is actually the right thing to look at to work out encoder resolutions, RDBD
is better to look for tolerances, as the motor record will treat this value as "how close to the readback do I need to be to be done", and I think it will ignore move requests within this deadband...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is RDBD
guaranteed to be set to non-zero?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea about guarantee, but a spot check of 3 motors showed that it seems to default to MRES
unless overridden to be bigger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll change this to be RDBD
and make an issue in dodal
to switch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've called it tolerance
rather than RDBD
as I think this makes more sense to a user of the device but happy to be argued with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make it deadband
instead? Sounds like tolerance to me, and closer to the EPICS name...
110666c
to
eba79f1
Compare
After discussion with @coretl about naming. We would like to match the # position
user_readback = Cpt(EpicsSignalRO, ".RBV", kind="hinted", auto_monitor=True)
user_setpoint = Cpt(EpicsSignal, ".VAL", limits=True, auto_monitor=True)
# calibration dial <-> user
user_offset = Cpt(EpicsSignal, ".OFF", kind="config", auto_monitor=True)
user_offset_dir = Cpt(EpicsSignal, ".DIR", kind="config", auto_monitor=True)
offset_freeze_switch = Cpt(EpicsSignal, ".FOFF", kind="omitted", auto_monitor=True)
set_use_switch = Cpt(EpicsSignal, ".SET", kind="omitted", auto_monitor=True)
# configuration
velocity = Cpt(EpicsSignal, ".VELO", kind="config", auto_monitor=True)
acceleration = Cpt(EpicsSignal, ".ACCL", kind="config", auto_monitor=True)
motor_egu = Cpt(EpicsSignal, ".EGU", kind="config", auto_monitor=True)
# motor status
motor_is_moving = Cpt(EpicsSignalRO, ".MOVN", kind="omitted", auto_monitor=True)
motor_done_move = Cpt(EpicsSignalRO, ".DMOV", kind="omitted", auto_monitor=True)
high_limit_switch = Cpt(EpicsSignalRO, ".HLS", kind="omitted", auto_monitor=True)
low_limit_switch = Cpt(EpicsSignalRO, ".LLS", kind="omitted", auto_monitor=True)
high_limit_travel = Cpt(EpicsSignal, ".HLM", kind="omitted", auto_monitor=True)
low_limit_travel = Cpt(EpicsSignal, ".LLM", kind="omitted", auto_monitor=True)
direction_of_travel = Cpt(EpicsSignal, ".TDIR", kind="omitted", auto_monitor=True)
# commands
motor_stop = Cpt(EpicsSignal, ".STOP", kind="omitted")
home_forward = Cpt(EpicsSignal, ".HOMF", kind="omitted")
home_reverse = Cpt(EpicsSignal, ".HOMR", kind="omitted") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slight preference to call it acceleration_time
over seconds_to_velocity
or acceleration
I think where the names are unclear/wrong (e.g. acceleration), this is our chance to change them... |
Co-authored-by: Tom C (DLS) <[email protected]>
I think there is a balance where maintaining backwards compatibility is useful. I agree with the acceleration example though. |
Was typing |
No, apologies, feel free to fix |
Fixes #42
Makes it easier to convert motors from
ophyd
toophyd-async
and will stop us having to do stuff like https://github.com/DiamondLightSource/dodal/blob/871e0526fa496e9b068eedd7d19c23027449cc26/src/dodal/devices/util/motor_utils.py#L5Note that given the change in names it will break any current uses of the
ophyd_async
motorTo test: