Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

added acceleration PV to Motor device #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions src/ophyd_epics_devices/motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def __init__(self, prefix: str, name="") -> None:
self.setpoint = EpicsSignalRW(float, ".VAL")
self.readback = EpicsSignalR(float, ".RBV")
self.velocity = EpicsSignalRW(float, ".VELO")
self.acceleration = EpicsSignalR(float, ".ACCL")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest acceleration time, so it's clear this is not acceleration rate...

Suggested change
self.acceleration = EpicsSignalR(float, ".ACCL")
self.acceleration_time = EpicsSignalR(float, ".ACCL")

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .ACCL field in EPICS is always acceleration time (the time to change the velocity from before to after). Always a stumbling block for experienced control engineers new to EPICS. I believe a change to acceleration_time here introduces some ambiguity which makes this component seem like a special case, somehow different from .ACCL.

Also, it is not typical for a user to want to change .ACCL field of every motor from ophyd. I suggest that for those motors which need this additional feature (or others), subclass locally and add the additional component:

class MyEpicsMotor(EpicsMotor):
    steps_per_revolution = Component(EpicsSignal, ".SREV", kind="omitted")

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, please do not add support for the motor .ACCL field to every motor.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the comment on SREV but I would argue that ACCL is quite fundamental, for instance the use case here is to work out how long it will take a motor to ramp up to velocity so we can work out where the "move to start" position should be for a flyer. Not sure if it should be an EpicsSignalR or an EpicsSignalRW though...

Also, it was there in the existing Ophyd EpicsMotor:
https://github.com/bluesky/ophyd/blob/5a0f1f3e8c2f453eb5a3262c610714bee67f84db/ophyd/epics_motor.py#L54

I agree with the comment about naming, acceleration is a better name.

self.units = EpicsSignalR(str, ".EGU")
self.precision = EpicsSignalR(int, ".PREC")
# Signals that collide with standard methods should have a trailing underscore
Expand Down