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

Can't move motor after set_lim() #275

Closed
prjemian opened this issue Jan 31, 2020 · 2 comments · Fixed by #276
Closed

Can't move motor after set_lim() #275

prjemian opened this issue Jan 31, 2020 · 2 comments · Fixed by #276
Assignees
Milestone

Comments

@prjemian
Copy link
Contributor

Can't move a EpicsMotorLimitsMixin motor after calling set_lim() due to move target is out of limits. this is a blocker for the USAXS instrument now.

@prjemian prjemian added this to the 1.1.17 milestone Jan 31, 2020
@prjemian prjemian self-assigned this Jan 31, 2020
@prjemian
Copy link
Contributor Author

It seems complicated. The call to set_lim() is working, setting the .LLM and .HLM fields in the motor record. But the ophyd object for motor.user_setpoint.limits (a tuple) is not updated. This tuple is set on initial connection with the motor record but is not updated from any code I can find.

Is it fair to just replace the tuple with the new values?

@prjemian
Copy link
Contributor Author

class ChangeableLimitsMotor(APS_devices.EpicsMotorLimitsMixin, EpicsMotor):
    ""
m1 = ChangeableLimitsMotor('sky:m1', name='m1', labels=("motor",))

In [2]: m1.limits                                                                                                                           
Out[2]: (-32000.0, 32000.0)
In [4]: m1.user_setpoint.limits                                                                                                             
Out[4]: (-32000.0, 32000.0)
In [5]: m1.user_setpoint.limits??                                                                                                           
Type:        property
String form: <property object at 0x7fb31c267e90>
Source:     
# m1.user_setpoint.limits.fget
@property
def limits(self):
    '''The PV control limits (low, high), such that low <= value <= high'''
    # This overrides the base Signal limits
    return (self._metadata['lower_ctrl_limit'],
            self._metadata['upper_ctrl_limit'])

In [6]: m1.user_setpoint._metadata['lower_ctrl_limit']                                                                                      
Out[6]: -32000.0

Need to update the dictionary values for lower_ctrl_limit and upper_ctrl_limit.

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

Successfully merging a pull request may close this issue.

1 participant