Why does the motion planner not make use of b-splines?

Post anything you want to discuss with others about the software.

Why does the motion planner not make use of b-splines?

Postby aethersis » Wed Jun 25, 2025 12:15 pm

I've been wondering about this since years - basically every motion controller I've ever heard of or used utilizes linear interpolation for motion planning in constant velocity mode. This is certainly much easier to implement than splines, but introduces a significantly larger error and puts a higher load on the machine (it will shake more) and requires higher accelerations. Is there any practical reason why this is not commonly used? From the computing standpoint, it's no rocket science and it's not extremely resource intensive either - at least not for a modern computer.
aethersis
 
Posts: 17
Joined: Sat Jan 20, 2024 9:44 am

Re: Why does the motion planner not make use of b-splines?

Postby cncdrive » Wed Jun 25, 2025 1:29 pm

Yes, it is hard to implement this to work properly.
It requires a totally different approach in the motion planner than how it works.
It would likely not produce much performance increase with avarage CNC applications, because usually the path size compared to the possible error is large.
What we think could improve the motion planning significantly in terms of smoothness is S-curve motion profiling.
S-curve or jerk limited motion profiling means that the first derivative of the acceleration is controlled and/or limited, so then instead of a trapezoidal acceleration/decceleration profile this would become a smoother S-curve profile.
However this could improve the smoothness of the motion path it would longer the execution time.
In general we think that having this option would be good, so we will certainly implement it, planned to implement it for a long time, but always got other things to implement so far, so it was not done yet.

And we already tried to implement 3D cubic bezier curves, I'm attaching a printscreen of how it looks.
I wrote an algorithm which did this, it is pretty complex. :)
Attachments
Bezier.png
cncdrive
Site Admin
 
Posts: 5197
Joined: Tue Aug 12, 2014 11:17 pm

Re: Why does the motion planner not make use of b-splines?

Postby aethersis » Wed Jun 25, 2025 1:56 pm

Thank you for the awesome answer! I had exactly something like this in mind and I'm aware of both approaches. It indeed seems much easier to control the jerk rather than alter the motion planning so significantly. Honestly, adding the 3rd derivative for jerk (s-curve acceleration control) would be an awesome feature.
By the way - I recently bought a Stepperonline CL57T (which seems to be a rebranded Leadshine CS-D507S and they both seem to have a time based filter which basically lets you do something very similar. See 6.2.3 Smoothing Filter Time Configuration (SW9-SW10)
in the user manual.
I wonder - how does a stepper driver equipped with this functionality differ from having this implemented in the motion controller? When jerk control (that sounds weird xD) is added to the motion controller, is it somehow taken into account in the motion planner too?
aethersis
 
Posts: 17
Joined: Sat Jan 20, 2024 9:44 am

Re: Why does the motion planner not make use of b-splines?

Postby ger21 » Wed Jun 25, 2025 2:03 pm

However this could improve the smoothness of the motion path it would longer the execution time.

But it will usually allow you to run faster, so it balances out. Provided you're machine has enough power.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2810
Joined: Sat Sep 03, 2016 2:17 am

Re: Why does the motion planner not make use of b-splines?

Postby cncdrive » Wed Jun 25, 2025 3:39 pm

Gerry, it depends on the actual type of job in my opinion.
The current implementation of the UCCNC motion planner also optimizing the path, smoothing it, rounding edges etc. just not with cubic beziers, it is as simpler algorithm.

Aethersis: A stepper drive cannot do jerk control because it does not see ahead of time on the path and jerk control requires the knowledge of the path in advance.
So, jerk control implementation is only possible in the path planning/motion control part of the system.
cncdrive
Site Admin
 
Posts: 5197
Joined: Tue Aug 12, 2014 11:17 pm

Re: Why does the motion planner not make use of b-splines?

Postby aethersis » Sun Jun 29, 2025 10:02 am

I see, but there's certainly some sort of smoothing option on the motion controller I have. I guess it's a a kind of a low pass filter that doesn't take the actual motion into account and introduces some lag. Has anyone looked into it? I wonder how much of an impact this has on the overal precission and noise. I'm pretty sure it doesn't work the same way like a motion planner that takes jerk into account, but maybe in some cases this can still help make the motion less shaky?
aethersis
 
Posts: 17
Joined: Sat Jan 20, 2024 9:44 am

Re: Why does the motion planner not make use of b-splines?

Postby Battwell » Sun Jun 29, 2025 12:25 pm

you cannot do it in the drives if interpolating with other axis.. or they will accelerate at different speeds causing error in acceleration/ deceleration phase of motion.
filters in drives are nice for single axis movement like a saw fence positioner.
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 886
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: Why does the motion planner not make use of b-splines?

Postby aethersis » Sun Jun 29, 2025 12:55 pm

The manual mentions that you can use it for multiple axes, but in that case all the settings for each axis must be the same. Would that make sense then?
aethersis
 
Posts: 17
Joined: Sat Jan 20, 2024 9:44 am

Re: Why does the motion planner not make use of b-splines?

Postby cncdrive » Sun Jun 29, 2025 7:45 pm

I think you have some missunderstanding about how motion control works.
You should separate 2 parts:
1.) Path planning.
2.) Trajectory planning.

Path planning means that you have a programmed path (g-code movements) and the motion controller using someking of algorithm to smooth, optimize that path.
Path optimization is done with someking of constraint, in this case we using a path deviation control which means the TCP cannot move out of the original path more then the set deviation. (path deviation is a distance).

Trajectory planning means how the TCP accelerates and deccelerates on the path.
Jerk control means that the first derivative of the acceleration is controlled, in other words the acceleration change rate is limited to a set value, so the axis cannot accelerate/deccelerate with a higher rate than the set J value.

In a motion contoller like the UC devices both path planning and trajectory planning is calculated.

In the stepper drives non of these can be calculated or controlled, because to plan any of these requires the drive to know a part of the path in advance.
Also the device which calculates them has to know the states of all axes as they have to be syncronised.
cncdrive
Site Admin
 
Posts: 5197
Joined: Tue Aug 12, 2014 11:17 pm


Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: Bing [Bot] and 5 guests