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

Conversation

rosesyrett
Copy link
Collaborator

Simple PR to add acceleration to the Motor device, so that it can be accessed and read like the other PVs (.e.g .VELO).

@rosesyrett rosesyrett requested a review from coretl February 3, 2023 13:04
@codecov
Copy link

codecov bot commented Feb 3, 2023

Codecov Report

Base: 47.10% // Head: 47.32% // Increases project coverage by +0.21% 🎉

Coverage data is based on head (0d4f39d) compared to base (3f87aa5).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #9      +/-   ##
==========================================
+ Coverage   47.10%   47.32%   +0.21%     
==========================================
  Files           4        4              
  Lines         242      243       +1     
==========================================
+ Hits          114      115       +1     
  Misses        128      128              
Impacted Files Coverage Δ
src/ophyd_epics_devices/motor.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants