-
Notifications
You must be signed in to change notification settings - Fork 79
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
resolve EpicsMotor stalls sometimes at end of move #783
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,7 +146,17 @@ def move(self, position, wait=True, **kwargs): | |
''' | ||
self._started_moving = False | ||
|
||
def dmov_callback(old_value, value, **kwargs): | ||
self.log.debug('dmov_callback(): new=%d old=%d', value, old_value) | ||
if self._started_moving and value == 1: | ||
|
||
self.motor_done_move.clear_sub(dmov_callback) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only one of these should be required. |
||
self.motor_done_move.unsubscribe(cbid) | ||
status._finished(success=True) | ||
|
||
cbid = self.motor_done_move.subscribe(dmov_callback, run=False) | ||
status = super().move(position, **kwargs) | ||
|
||
self.user_setpoint.put(position, wait=False) | ||
try: | ||
if wait: | ||
|
@@ -240,7 +250,10 @@ def _move_changed(self, timestamp=None, value=None, sub_type=None, | |
self._run_subs(sub_type=self.SUB_START, timestamp=timestamp, | ||
value=value, **kwargs) | ||
|
||
if was_moving and not self._moving: | ||
self.log.debug('_move_changed(): %d moving: %d', | ||
self._started_moving, self._moving) | ||
|
||
if self._started_moving and not self._moving: | ||
success = True | ||
# Check if we are moving towards the low limit switch | ||
if self.direction_of_travel.get() == 0: | ||
|
@@ -267,6 +280,11 @@ def _move_changed(self, timestamp=None, value=None, sub_type=None, | |
self.log.warning('Motor %s raised an alarm during motion ' | ||
'status=%s severity %s', | ||
self.name, status, severity) | ||
|
||
self.log.debug('detected moving DONE=%s, .DMOV=%s, success=%s', | ||
self._started_moving, | ||
self.motor_done_move.get(), | ||
success) | ||
self._done_moving(success=success, timestamp=timestamp, | ||
value=value) | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What is setting
self._started_moving
toTrue
?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.
Good question. This is tangly code.
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.
It's in the
_move_changed()
method: