Repository navigation
canon: refuse a move whose joints leave their travel along it - #4954
Open
grandixximo wants to merge 2 commits into
Open
grandixximo wants to merge 2 commits into
grandixximo wants to merge 2 commits into
Conversation
The conventions chapter said the two poses that reach one tool axis differ in the sign of the secondary rotary. That holds for two head rotaries only; on two table rotaries it is the one carrying the other, and on a head and a table it is the head, as G53.1 P now uses.
BsAtHome
reviewed
Dec 3, 2026
BsAtHome
left a comment
Contributor
There was a problem hiding this comment.
Not looked at the actual calculation(s). Just glanced the code and noticed this.
Comment on lines
+285
to
+286
| extern int CANON_MOVE_REFUSED(char *message, int max); | ||
| /* Called from emctask after the interpreter has read or executed a line: |
Contributor
There was a problem hiding this comment.
The argument name max is very misleading. What you are doing (had to look at the implementation) is that max is the messagesize. That is also normally of type size_t.
Contributor
Author
There was a problem hiding this comment.
Right, it is the buffer size. Renamed to messagesize and made it size_t.
Motion checks the joints against [JOINT_n] MIN_LIMIT and MAX_LIMIT at the end of a move, so a move whose ends are both inside the travel can still pass a limit between them: a turn of a tilted head under the tool centre point swings the carriage round the tip, and an arc bulges past the travel its ends stay inside. Motion then stops on the soft limit partway through the move, the joint past its limit, to be jogged off it in joint mode. Rimas2200 bounded the joints along a move module by module in the first version of LinuxCNC#4619; this follows them on the sampling canon already does, for every module evaluated outside realtime. The identity samples nothing, as before: its joints are the axes, and its arcs are what LinuxCNC#4619 bounds. motion_planning/segment_cap.cc follows each joint against its travel on the samples segmentCap() takes for the joint velocity and acceleration cap: a sample past a limit, or between two samples the peak of the cubic through their positions and rates, read again through the inverse at that peak. A peak near the limit that the inverse does not confirm splits the stretch there, a bounded number of times. Only a point the inverse itself puts past a limit refuses the move. A side of the travel the joint starts the segment past is not followed, the move may be bringing it back, and neither is anything beyond a sample the module cannot invert or a joint moving between two points further than its rates allow, as where the inverse changes branch. The limits are the ones motion holds, ini pins included, on the joints that are homed. Canon drops the refused move and every move after it until task has taken the refusal, since a move sent after a dropped one would start from where that one began. Task reads it after the interpreter reads or executes a line and fails the line the way an interpreter error does, saying which joint would pass which limit, by how much and where along the move. A line stepped over on the way to the start line of a run lets its refusal go with the rest of its output: its moves are thrown away, and were sampled from wherever the machine stands. RIGID_TAP flushes the chained segments before it is sampled, so that the tap is read from where it starts. kinslimits takes --min and --max and prints where a joint leaves its travel. tests/kins-limits/travel swings a carriage 0.05 past its Y travel at a peak between two samples, 0.05 inside it and well past it, asks for the refused swing twice and runs moves inside the travel after it, refuses a move for its end, runs an arc under the travel and refuses it over the top, fails a program on the line of the swing with no joint past its limit, and runs the same program from the line after the swing, which only steps over it. Without the reading between samples the 0.05 swing runs onto the soft limit; without the exemption for stepped over lines the run from that line fails.
grandixximo
force-pushed
the
kins-travel
branch
from
December 3, 2026 08:39
f137bbd to
291ba60
Compare
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.
Motion checks the joints against MIN_LIMIT and MAX_LIMIT only at the end of a move, so a move whose ends are both inside the travel can still pass a limit between them. A tilted head turning under the tool centre point swings the carriage round the tip, and an arc bulges past the travel its ends stay inside. Motion then stops on the soft limit partway through, with the joint past its limit, to be jogged off in joint mode.
Rimas2200 bounded the joints along a move module by module in the first version of #4619. This follows the same idea on the sampling canon already does for the joint velocity and acceleration cap, for every module evaluated outside realtime:
The second commit fixes the conventions chapter: the two poses that reach one tool axis differ in the rotary nearest the tool, not always the secondary one.
tests/kins-limits/travel (new, for the new check) swings a carriage 0.05 past its Y travel between two samples, refuses it, then runs moves inside the travel; runs an arc under the travel and refuses it over the top; fails a program on the swing's line; and runs the same program from the line after it. Without the reading between samples the 0.05 swing runs onto the soft limit; without the run-from-line exemption the run from that line fails.