Repository navigation
task: MDI is not finished while motion has yet to act on the move - #4890
Open
grandixximo wants to merge 1 commit into
Open
grandixximo wants to merge 1 commit into
grandixximo wants to merge 1 commit into
Conversation
mdi_execute_hook() set the interpreter idle once nothing was left to issue and the motion queue read empty. Motion acknowledges a move in its command handler, but the queue depth is published by the controller, which runs later. A status copy read in between, or kept after a failed read, still shows an empty queue, so task reported the MDI command finished one cycle after sending the move. A client waiting for interp_state to go idle then read the position mid-move; seen on CI in tests/interp/g28.2/invalid-pword. Use motion.status instead, which already reads EXEC until the controller has run after the last command. tests/stale-motion-status now sends MDI moves after the program and fails if the interpreter reads idle before a move is done. The late-controller variant fails on every move without the fix.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A CI run failed in
tests/interp/g28.2/invalid-pword: after an MDIG0 X2the test waited forinterp_stateto go idle and read X at 1.068, mid-move.Task set the interpreter idle too soon.
mdi_execute_hook()takes an MDI command as finished once nothing is left to issue andmotion.traj.queueis 0. Motion acknowledges a move in its command handler, but the queue depth is published by the controller, which runs later. A status copy read in between, or kept after a failed read, still shows an empty queue, so task reported idle one cycle after sending the move. The move itself ran to the end.The fix checks
motion.status == RCS_STATUS::DONEinstead. Since #4666 that reads EXEC until the controller has run after the last command. It also means idle now waits for in-position, as the top-level DONE status already does.I extended
tests/stale-motion-statusinstead of adding a test: after the program it sends four MDI moves and fails if the interpreter reads idle before a move is at its target. The late-controller variant, where the controller runs a whole 50 ms servo period after the handler, fails on all four moves without the fix and passes with it. slow-controller passes both ways.