Repository navigation
motion: read the 64-bit axis jog-counts without truncating - #4804
Merged
Merged
Conversation
axis.L.jog-counts is a SINT pin, but the wheel jog read it with hal_get_si32() while the previous count and the delta are 64-bit. When the counts crossed 2^31 the delta came out near -2^32 for one cycle: the target fell outside the limits and the jog was dropped, or with jog-vel-mode the axis ran back by its stopping distance. The joint wheel jog already reads its counts with hal_get_sint(). The jogwheel-axis test now jogs across 2^31.
Contributor
|
Well, right then. This is just part of making the code 64-bit clean... You sent a PR before I was able to write comment #4796 (comment) |
Contributor
Author
|
Yes I saw that, sorry, I can close, didn't know you had it ready |
Contributor
Author
|
Close if you'd prefer to send your own |
Contributor
|
No, that is fine. It needs to be done regardless. |
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.
axis.L.jog-countsis a SINT pin, butaxis_handle_jogwheels()read it withhal_get_si32()while the previous count and the delta are 64-bit. When the counts cross 2^31 the delta comes out near -2^32 for one cycle: the target falls outside the limits and the jog is dropped (thebreakalso skips the remaining axes that cycle), or withjog-vel-modethe axis runs back by its stopping distance. The joint wheel jog already reads its counts withhal_get_sint().Found while looking at #4796: with ilowpass now 64-bit, its output can cross 2^31 like any other counts source.
The jogwheel-axis test now presets the counts to 2^31 - 2 with jog-enable off and jogs 4 counts across 2^31. It fails without the fix (x does not move) and passes with it, also under parallel load.