Cubic Interpolator
- ewlsey
- Online
- New Member
-
Less
More
- Posts: 7
- Thank you received: 3
06 Apr 2026 15:17 #345227
by ewlsey
Cubic Interpolator was created by ewlsey
Can someone help me understand how the cubic interpolator works? There doesn't seem to be any documentation explaining what it does. The only things I can find are for the old exact stop trajectory planner.
As far as I can tell control.c queries the trajectory planner, runs that data through the kinematics, then creates joint->coarse_pos data and adds it to cubic.c, which is the interpolator. It seems to repeat that until the interpolator is full.
Then it runs cubicInterpolate() which I guess takes joint->coarse_pos and interpolates it into joint->pos_cmd.
What are the course positions and where do they come from? Are they the beginning and end of a g code move or smaller segments created by the trajectory planner?
What is the interpolator doing? It seems to be trying to create a cubic spline, but what are the way points and were do they come from? How many points does it need?
On that note, is there something I'm missing that runs faster than the 1ms servo loop that needs position and velocity data from an interpolator?
Hopefully someone knows. The control.c program is full of comments to the effect of "this is how I think it works".
As far as I can tell control.c queries the trajectory planner, runs that data through the kinematics, then creates joint->coarse_pos data and adds it to cubic.c, which is the interpolator. It seems to repeat that until the interpolator is full.
Then it runs cubicInterpolate() which I guess takes joint->coarse_pos and interpolates it into joint->pos_cmd.
What are the course positions and where do they come from? Are they the beginning and end of a g code move or smaller segments created by the trajectory planner?
What is the interpolator doing? It seems to be trying to create a cubic spline, but what are the way points and were do they come from? How many points does it need?
On that note, is there something I'm missing that runs faster than the 1ms servo loop that needs position and velocity data from an interpolator?
Hopefully someone knows. The control.c program is full of comments to the effect of "this is how I think it works".
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 19840
- Thank you received: 4626
06 Apr 2026 16:54 #345230
by andypugh
Replied by andypugh on topic Cubic Interpolator
This recent commit has me suspecting that it is in some way related to non-trivial kinematics.
github.com/LinuxCNC/linuxcnc/pull/3890
github.com/LinuxCNC/linuxcnc/pull/3890
Please Log in or Create an account to join the conversation.
- ewlsey
- Online
- New Member
-
Less
More
- Posts: 7
- Thank you received: 3
06 Apr 2026 17:51 #345241
by ewlsey
Replied by ewlsey on topic Cubic Interpolator
OK. I'm having a really hard time understanding the code base. The files don't seem to have any comments explaining what they actually do, what leads to them, or where they lead to.
If the cubic.c is only for non-trivial kinematics, how does the interpolation work for normal cartesian machines?
I was assuming that every servo period it pulls a target position and velocity from the trajectory planner creating 1ms stair steps of constant velocity, but I really can't tell.
If the cubic.c is only for non-trivial kinematics, how does the interpolation work for normal cartesian machines?
I was assuming that every servo period it pulls a target position and velocity from the trajectory planner creating 1ms stair steps of constant velocity, but I really can't tell.
Please Log in or Create an account to join the conversation.
Time to create page: 0.295 seconds