Move Trajectory planner from real time to non-real time
- troy
- Offline
- Junior Member
-
Less
More
- Posts: 20
- Thank you received: 4
21 Jul 2022 06:41 - 09 Feb 2026 02:30 #247912
by troy
Replied by troy on topic Move Trajectory planner from real time to non-real time
none
Last edit: 09 Feb 2026 02:30 by troy.
The following user(s) said Thank You: silopolis
Please Log in or Create an account to join the conversation.
- troy
- Offline
- Junior Member
-
Less
More
- Posts: 20
- Thank you received: 4
21 Jul 2022 06:47 - 09 Feb 2026 02:31 #247913
by troy
Replied by troy on topic Move Trajectory planner from real time to non-real time
none
Last edit: 09 Feb 2026 02:31 by troy.
Please Log in or Create an account to join the conversation.
- rmu
-
- Offline
- Elite Member
-
Less
More
- Posts: 279
- Thank you received: 101
25 Jul 2022 10:54 #248240
by rmu
Replied by rmu on topic Move Trajectory planner from real time to non-real time
eoffsets = external offsets I think, something like torch height compensation calculated from actual measured arc voltage in real time.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- rellenberg
- Offline
- Junior Member
-
Less
More
- Posts: 37
- Thank you received: 10
26 Jul 2022 15:30 #248339
by rellenberg
Replied by rellenberg on topic Move Trajectory planner from real time to non-real time
Trajectory planning specifically (kinematics, blending, path smoothing) doesn't have to be in realtime, but there are a few reasons it was done that way:
- Blending used to be done at runtime (before we added lookahead), so there wasn't really a need for complex lookahead / optimization. Trajectory "planning" was mostly just creating the motion structures (line, circle, tapping) and adding them to the queue.
- Motion commands other than lines / arcs can affect future motions (blend mode, spindle sync), so they have to be executed in order. Many motion commands directly act on (realtime) motion state, so it made sense to handle incoming commands in the realtime side.
- When we did add lookahead, it was easier to graft it on to the existing realtime TP (especially for me as a relative novice to LinuxCNC architecture).
- Treat "immediate" motion commands (pause, resume, config changes, etc.) the same as today (command handler in command.c)
- For actual moves and move-related commands (blending, spindle-sync), create a queue for optimization / lookahead in the user half of the user-motion interface.
- Add a motion command that pops an optimized move out of the user-space queue and sends it (fully-formed) to the motion command handler.
- Move geometry processing out of realtime TP (tpAddLine, tpAddCircle, path blending) to this new layer.
- (optional) move geometry processing out of emccanon if possible (circle / line math, naive CAM detection, etc.)
The following user(s) said Thank You: Bari, arvidb, rmu, troy
Please Log in or Create an account to join the conversation.
- arvidb
-
- Offline
- Platinum Member
-
Less
More
- Posts: 459
- Thank you received: 158
26 Jul 2022 15:59 #248342
by arvidb
Replied by arvidb on topic Move Trajectory planner from real time to non-real time
Would it be acceptable to pre-calculate an exact path based on maximum feed override (and other settings), and then follow this at whatever feed is set at the moment? Rather than doing real time blending/lookahead.
To me having the freedom to override feed without changing the shape of the finished part might even be preferable to always having the tightest possible corners etc. This might also allow exact calculation of remaining machining time (though this is complicated by the fact that different parts of the path will have different maximum velocities, so it's not just a simple scaling).
One issue that would need to be handled is large files - the pre-calculation of the path would have to be done in a background thread. (But this must already be the case for the preview in e.g. Axis?)
Anyway, I'm mostly wondering what you guys think about this, is there some obvious dealbreaker with doing things this way?
To me having the freedom to override feed without changing the shape of the finished part might even be preferable to always having the tightest possible corners etc. This might also allow exact calculation of remaining machining time (though this is complicated by the fact that different parts of the path will have different maximum velocities, so it's not just a simple scaling).
One issue that would need to be handled is large files - the pre-calculation of the path would have to be done in a background thread. (But this must already be the case for the preview in e.g. Axis?)
Anyway, I'm mostly wondering what you guys think about this, is there some obvious dealbreaker with doing things this way?
The following user(s) said Thank You: troy
Please Log in or Create an account to join the conversation.
- rellenberg
- Offline
- Junior Member
-
Less
More
- Posts: 37
- Thank you received: 10
26 Jul 2022 17:30 #248354
by rellenberg
Replied by rellenberg on topic Move Trajectory planner from real time to non-real time
That's more or less the approach the TP currently uses. Lookahead runs whenever a new G-code line is processed, and creates blends to fit the maximum velocity reachable with feed override. Lookahead establishes the limits, and the TP can run arbitrarily slower depending on feed override settings. You'd probably want a similar pattern when moving to userspace: do the hard work of finding the blend sizes and vel / accel limits in userspace, and the trajectory execution (that stays within those limits) in realtime.
The following user(s) said Thank You: arvidb
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Offline
- Platinum Member
-
Less
More
- Posts: 4698
- Thank you received: 1441
26 Jul 2022 19:00 #248359
by Todd Zuercher
Replied by Todd Zuercher on topic Move Trajectory planner from real time to non-real time
A funny TP blending quirk I've noticed. If for example you have a machine config with a max feed rate of F200 and you load a g-code file with a programmed feed rate of F1000 the TP will calculate the blends for the F1000 feed rate even though the actual milling will only be at F200 because of the machine's config limit. Changing the g-code's programmed feed to the machine's F200 will result in much smaller blend radii (assuming no path tolerance) than the original F1000 even though the actual feed rates performed would be the same. In other words the TP does not account for a machine's velocity limitations in it's blend calculations.
The following user(s) said Thank You: Bari, arvidb
Please Log in or Create an account to join the conversation.
- troy
- Offline
- Junior Member
-
Less
More
- Posts: 20
- Thank you received: 4
03 Feb 2023 16:51 - 09 Feb 2026 02:25 #263611
by troy
Replied by troy on topic Move Trajectory planner from real time to non-real time
none
Last edit: 09 Feb 2026 02:25 by troy.
The following user(s) said Thank You: Bari
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 19797
- Thank you received: 4607
03 Feb 2023 19:53 #263616
by andypugh
Replied by andypugh on topic Move Trajectory planner from real time to non-real time
This sounds very interesting, I do hope that you can find a way to make it possible to merge into mainline LinuxCNC.
The following user(s) said Thank You: troy
Please Log in or Create an account to join the conversation.
- troy
- Offline
- Junior Member
-
Less
More
- Posts: 20
- Thank you received: 4
06 Feb 2023 05:57 - 09 Feb 2026 02:26 #263794
by troy
Replied by troy on topic Move Trajectory planner from real time to non-real time
none
Last edit: 09 Feb 2026 02:26 by troy.
Please Log in or Create an account to join the conversation.
Time to create page: 0.139 seconds