Skip to content

canon: refuse a move whose joints leave their travel along it - #4954

Open
grandixximo wants to merge 2 commits into
LinuxCNC:masterfrom
grandixximo:kins-travel
Open

grandixximo wants to merge 2 commits into
LinuxCNC:masterfrom
grandixximo:kins-travel

Conversation

@grandixximo

Copy link
Copy Markdown
Contributor

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:

  • each joint is followed against its travel at the samples, and between two samples at the peak of the cubic through them, read again through the inverse;
  • only a point the inverse itself puts past a limit refuses the move, and the error names the joint, the limit, by how much and where along the move;
  • the refused line fails the way an interpreter error does, and moves after it are dropped so nothing runs from the wrong start;
  • a line stepped over on the way to a run-from-line start does not fail the run;
  • the identity kinematics samples nothing, as before; its arcs are what motion: check circular moves against axis soft limits #4619 bounds.

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.

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 BsAtHome left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not looked at the actual calculation(s). Just glanced the code and noticed this.

Comment thread include/nml_intf/canon.hh Outdated
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:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants