- Posts: 2419
- Thank you received: 2349
LinuxCNC S-Curve Accelerations
- Grotius
- Offline
- Platinum Member
-
Less
More
3 years 8 months ago #265340
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
Hi Andy,
I have seen this video a few month's ago. It's interesting. Ultimate she want's to design her own spline algo.
Where you able to write some code in c or c++ for the spline example's in the video?
I have a github 3d spline repo containing a cubic spline with vel, acc profile. Maybe this is usable for background info.
This spline works excellent in opencascade, however i have no clue how to use the vel and acc of this spline output?
Today i made a github repository for the current scurve code. github scurve
Currently trying to code a 10 joint planner. 1 joint for interpolating the path, 9 joints for each motor xyzabcuvw.
If this works a bit. I will take a look at mr. Garret's comments for integrating.
I have seen this video a few month's ago. It's interesting. Ultimate she want's to design her own spline algo.
Where you able to write some code in c or c++ for the spline example's in the video?
I have a github 3d spline repo containing a cubic spline with vel, acc profile. Maybe this is usable for background info.
This spline works excellent in opencascade, however i have no clue how to use the vel and acc of this spline output?
Today i made a github repository for the current scurve code. github scurve
Currently trying to code a 10 joint planner. 1 joint for interpolating the path, 9 joints for each motor xyzabcuvw.
If this works a bit. I will take a look at mr. Garret's comments for integrating.
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
Less
More
- Posts: 2419
- Thank you received: 2349
3 years 8 months ago #265376
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
Hi,
I got the planner running. It has 2 buttons on the right side of the picture. The left side is unused in this example.
The path has 3 xyz waypoints, using acs (acc at start) ace (dcc at end), vo, ve.
sc_block b0;
b0.id=LINE;
b0.vo=0;
b0.ve=5;
b0.acs=0;
b0.ace=-1;
b0.start_pnt.x=0;
b0.start_pnt.y=0;
b0.start_pnt.z=0;
b0.end_pnt.x=200;
b0.end_pnt.y=0;
b0.end_pnt.z=0;
sc_block b1;
b1.id=LINE;
b1.vo=5;
b1.ve=5;
b1.acs=-1;
b1.ace=1;
b1.start_pnt.x=200;
b1.start_pnt.y=0;
b1.start_pnt.z=0;
b1.end_pnt.x=200;
b1.end_pnt.y=300;
b1.end_pnt.z=0;
sc_block b2;
b2.id=LINE;
b2.vo=5;
b2.ve=0;
b2.acs=1;
b2.ace=0;
b2.start_pnt.x=200;
b2.start_pnt.y=300;
b2.start_pnt.z=0;
b2.end_pnt.x=200;
b2.end_pnt.y=300;
b2.end_pnt.z=400;
The waypoints are at the blue vertical lines.
Hmm interesting. It's interpolating over xyz now.
Next i will add scurve xyz joints to try to follow the interpolated path. Then we try to trigger a following error by
setting on of the joint's vm a little lower.
I got the planner running. It has 2 buttons on the right side of the picture. The left side is unused in this example.
The path has 3 xyz waypoints, using acs (acc at start) ace (dcc at end), vo, ve.
Warning: Spoiler!
sc_block b0;
b0.id=LINE;
b0.vo=0;
b0.ve=5;
b0.acs=0;
b0.ace=-1;
b0.start_pnt.x=0;
b0.start_pnt.y=0;
b0.start_pnt.z=0;
b0.end_pnt.x=200;
b0.end_pnt.y=0;
b0.end_pnt.z=0;
sc_block b1;
b1.id=LINE;
b1.vo=5;
b1.ve=5;
b1.acs=-1;
b1.ace=1;
b1.start_pnt.x=200;
b1.start_pnt.y=0;
b1.start_pnt.z=0;
b1.end_pnt.x=200;
b1.end_pnt.y=300;
b1.end_pnt.z=0;
sc_block b2;
b2.id=LINE;
b2.vo=5;
b2.ve=0;
b2.acs=1;
b2.ace=0;
b2.start_pnt.x=200;
b2.start_pnt.y=300;
b2.start_pnt.z=0;
b2.end_pnt.x=200;
b2.end_pnt.y=300;
b2.end_pnt.z=400;
The waypoints are at the blue vertical lines.
Hmm interesting. It's interpolating over xyz now.
Next i will add scurve xyz joints to try to follow the interpolated path. Then we try to trigger a following error by
setting on of the joint's vm a little lower.
The following user(s) said Thank You: rodw
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
Less
More
- Posts: 2419
- Thank you received: 2349
3 years 8 months ago - 3 years 8 months ago #265521
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
Hi,
A little update.
Last post:
Next i will add scurve xyz joints to try to follow the interpolated path.
This is not happened yet. I have been thinking a while about this.
In the past i used a stepgen for this, this worked fine for my steppers.
But the stepgen is based on a linear vel system. I was thinking maybe
make a :
- scurve stepgen
- scurve pid
In the mean time, the planner is able to interpolate 3d lines and 3d arcs.
//! Planner, create traject points.
planner->sc_clear_blocks();
sc_block b;
b.id=LINE;
b.vo=0;
b.ve=0;
b.acs=0;
b.ace=0;
b.start_pnt.x=0;
b.start_pnt.y=0;
b.start_pnt.z=0;
b.end_pnt.x=100;
b.end_pnt.y=0;
b.end_pnt.z=0;
b.start_dir.a=0;
b.start_dir.b=0;
b.start_dir.c=0;
b.end_dir.a=25;
b.end_dir.b=25;
b.end_dir.c=25;
b.start_ext.u=10;
b.start_ext.v=10;
b.start_ext.w=10;
b.end_ext.u=110;
b.end_ext.v=110;
b.end_ext.w=110;
planner->sc_push_block(b);
b.id=ARC;
b.vo=0;
b.ve=0;
b.acs=0;
b.ace=0;
b.start_pnt.x=100;
b.start_pnt.y=0;
b.start_pnt.z=0;
b.arc_waypoint.x=150;
b.arc_waypoint.y=50;
b.arc_waypoint.z=50;
b.end_pnt.x=200;
b.end_pnt.y=0;
b.end_pnt.z=100;
b.start_dir.a=0;
b.start_dir.b=0;
b.start_dir.c=0;
b.end_dir.a=25;
b.end_dir.b=25;
b.end_dir.c=25;
b.start_ext.u=10;
b.start_ext.v=10;
b.start_ext.w=10;
b.end_ext.u=110;
b.end_ext.v=110;
b.end_ext.w=110;
planner->sc_push_block(b);
To hook op lcnc, The connection to gcode input can be made now.
A converter from G2,G3 IJK to arc a waypoint is needed for the scurve planner.
This is needed because the planner uses 3d arcs, and lcnc uses planes.
Next thing on the list is try to code motion reverse, negative and positive adaptive feed.
And mdi input like goto zero etc.
The code is updated, but excedentally i deleted the readme... updated code
A little update.
Last post:
Next i will add scurve xyz joints to try to follow the interpolated path.
This is not happened yet. I have been thinking a while about this.
In the past i used a stepgen for this, this worked fine for my steppers.
But the stepgen is based on a linear vel system. I was thinking maybe
make a :
- scurve stepgen
- scurve pid
In the mean time, the planner is able to interpolate 3d lines and 3d arcs.
Warning: Spoiler!
//! Planner, create traject points.
planner->sc_clear_blocks();
sc_block b;
b.id=LINE;
b.vo=0;
b.ve=0;
b.acs=0;
b.ace=0;
b.start_pnt.x=0;
b.start_pnt.y=0;
b.start_pnt.z=0;
b.end_pnt.x=100;
b.end_pnt.y=0;
b.end_pnt.z=0;
b.start_dir.a=0;
b.start_dir.b=0;
b.start_dir.c=0;
b.end_dir.a=25;
b.end_dir.b=25;
b.end_dir.c=25;
b.start_ext.u=10;
b.start_ext.v=10;
b.start_ext.w=10;
b.end_ext.u=110;
b.end_ext.v=110;
b.end_ext.w=110;
planner->sc_push_block(b);
b.id=ARC;
b.vo=0;
b.ve=0;
b.acs=0;
b.ace=0;
b.start_pnt.x=100;
b.start_pnt.y=0;
b.start_pnt.z=0;
b.arc_waypoint.x=150;
b.arc_waypoint.y=50;
b.arc_waypoint.z=50;
b.end_pnt.x=200;
b.end_pnt.y=0;
b.end_pnt.z=100;
b.start_dir.a=0;
b.start_dir.b=0;
b.start_dir.c=0;
b.end_dir.a=25;
b.end_dir.b=25;
b.end_dir.c=25;
b.start_ext.u=10;
b.start_ext.v=10;
b.start_ext.w=10;
b.end_ext.u=110;
b.end_ext.v=110;
b.end_ext.w=110;
planner->sc_push_block(b);
To hook op lcnc, The connection to gcode input can be made now.
A converter from G2,G3 IJK to arc a waypoint is needed for the scurve planner.
This is needed because the planner uses 3d arcs, and lcnc uses planes.
Next thing on the list is try to code motion reverse, negative and positive adaptive feed.
And mdi input like goto zero etc.
The code is updated, but excedentally i deleted the readme... updated code
Last edit: 3 years 8 months ago by Grotius. Reason: removed empty spaces.
The following user(s) said Thank You: Darium
Please Log in or Create an account to join the conversation.
- automata
- Offline
- Premium Member
-
Less
More
- Posts: 105
- Thank you received: 93
3 years 7 months ago #265955
by automata
Replied by automata on topic LinuxCNC S-Curve Accelerations
Hi,
Any update on the topic? I am eagerly watching this topic and can help with development and testing if needed.
-automata
Any update on the topic? I am eagerly watching this topic and can help with development and testing if needed.
-automata
The following user(s) said Thank You: tommylight, Grotius, Darium
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
Less
More
- Posts: 2419
- Thank you received: 2349
3 years 7 months ago #265976
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
Hi Automata,
Last day's i reviewed the engine code. Fixed a few tiny typo's.
An sich i am quite happy with the engine code so far, i have to finish the function : process_curve(..)
This function processes the scurve scenario's.
I made the project structure a little different. It's now divided in dir's with their purpose.
Now working on a planner to look if
but you can play with it already.
Yesterday i thought how to get rid of the vm sampling, to get a better interupt performance.
I made a line-line intersection of 2 scurves to get a new vm value.
Hmm, this was not going to work. This works only for full curves. Otherwise this would be perfect.
To get rid of the vm sampling, we could try to draw a spline to a few scurve points, to get a new vm value.
But then you have to find the spline y limit. This also is time consuming. If this should take 0.01 ms it's ok.
What you could check is mr. Garrets notes in this thread. Test if his notes setup works.
Check if you can do improvements or anything to the code. Maybe make a test dir in the sc_project.
You could make a hal interface, then scurvelib can be used stand alone. We need a nice readme file for github etc.
You could check this cubic spline lib. It has mutiple files. And is a 3d spline with acc and vel profile.
I don't know how to use the acc and vel results. However, the spline works perfect with opencascade.
Maybe this spline is usable for building scurve's.
Last day's i reviewed the engine code. Fixed a few tiny typo's.
An sich i am quite happy with the engine code so far, i have to finish the function : process_curve(..)
This function processes the scurve scenario's.
I made the project structure a little different. It's now divided in dir's with their purpose.
Now working on a planner to look if
- pause
- resume
- vm interupt
- waypoints
- motion reverse
but you can play with it already.
Yesterday i thought how to get rid of the vm sampling, to get a better interupt performance.
I made a line-line intersection of 2 scurves to get a new vm value.
Hmm, this was not going to work. This works only for full curves. Otherwise this would be perfect.
To get rid of the vm sampling, we could try to draw a spline to a few scurve points, to get a new vm value.
But then you have to find the spline y limit. This also is time consuming. If this should take 0.01 ms it's ok.
What you could check is mr. Garrets notes in this thread. Test if his notes setup works.
Check if you can do improvements or anything to the code. Maybe make a test dir in the sc_project.
You could make a hal interface, then scurvelib can be used stand alone. We need a nice readme file for github etc.
You could check this cubic spline lib. It has mutiple files. And is a 3d spline with acc and vel profile.
I don't know how to use the acc and vel results. However, the spline works perfect with opencascade.
Maybe this spline is usable for building scurve's.
The following user(s) said Thank You: Darium
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
Less
More
- Posts: 2419
- Thank you received: 2349
3 years 7 months ago #266085
by Grotius
Replied by Grotius on topic LinuxCNC S-Curve Accelerations
Hi,
A little update.
Currently finalizing the planner code. A few pause, pause-resume things to solve. Most of it is working now.
I think we get this working soon.
A little update.
Currently finalizing the planner code. A few pause, pause-resume things to solve. Most of it is working now.
I think we get this working soon.
The following user(s) said Thank You: wellingtoncsouza, Darium
Please Log in or Create an account to join the conversation.
Time to create page: 2.387 seconds