LinuxCNC S-Curve Accelerations

More
28 Sep 2023 23:18 #281823 by andypugh

If I understood correctly, someone else tried the S-curve first and didn't make it to the end. Then you created a HAL component that allowed you to do S-curve movements and now you're making your own interpreter. It is so?

I think that technically he is working on a modified trajectory planner, and probably keeping the existing interpreter. 

I am curious about the current status. 
The following user(s) said Thank You: tommylight, zz912, Darium, Beef

Please Log in or Create an account to join the conversation.

More
03 Oct 2023 09:11 #282143 by Grotius
Hi all,

Andy is right. i was working on a modified trajectory planner.

It took me a lot of time to figur things out.
Last year i had it partially working, but i was not satisfied. And i stopped with working on it.
Mayor issue was that lcnc is running out of cyclus time. The different algo's take to much.

@ZZ912,
It's not a private project, code is on github.

@Beef,
How is your project status?
The following user(s) said Thank You: zz912, Darium, Beef

Please Log in or Create an account to join the conversation.

More
03 Oct 2023 09:48 #282146 by chris@cnc
I have another idea to make this a little easier. How about a custom Kinematic comp. I've been thinking about it for a long time but I can't implement it. The timers for the s-curve bell should be adjustable in the ini. and then just forward it in the comp.
E.g. "pos->tran.x = (j[0] s-curve algo);"

Please Log in or Create an account to join the conversation.

More
03 Oct 2023 12:10 #282155 by Aciera

I have another idea to make this a little easier. How about a custom Kinematic comp.

Hm, not sure but basically you would be using a toolpath that has been generated on condition that the first derivative (velocity) is continuous and then you are just filtering the acceleration to make a new path that also satisfies the condition of having the second derivative continuous. Also you would be doing this in real time with zero look ahead. I don't think that is possible without considerable deviation from the part geometry but I'm no expert.
I've always though that this is a question of trajectory planning, which means: Jerk control is built into the _shape_ of the tool path like it is done in road building.
At the end of the day every toolpath run on a real machine is going to be jerk limited because no drive chain can accelerate instantly but if the toolpath has not been calculated with this in mind then there are going to be geometric errors because of this.
 
The following user(s) said Thank You: chris@cnc

Please Log in or Create an account to join the conversation.

More
03 Oct 2023 12:53 #282157 by Aciera

Mayor issue was that lcnc is running out of cyclus time. The different algo's take to much.

Note there is a thread about moving the trajectory planner to non-real time which may be of interest (If I recall correctly the code itself was unfortunately not shared):
forum.linuxcnc.org/38-general-linuxcnc-q...time?start=10#263611

Please Log in or Create an account to join the conversation.

More
03 Oct 2023 17:09 - 03 Oct 2023 17:12 #282177 by Beef
Replied by Beef on topic LinuxCNC S-Curve Accelerations
@Grotius It's great to hear from you!

So I haven't been able to make much progress in the interim - I have competing demands with work and this is still a side-project for me. Not to mention it's a super complex problem to wrap your head around. To be honest I have absolutely no idea how you wrapped your head around it so quickly - I had a lot of respect for your work just reading the forum posts, and now that I see it firsthand I'm even more impressed with what you got working .

I was able to compile your existing code and get it to run but I wanted to be able to incorporate it into the existing LinuxCNC build system and make some changes to use a compiled Ruckig lib instead of the semi-custom library it appears you made.

The reason I want to try and use the compiled lib is that I also reached out to the Ruckig guys to see if they are willing to sell licenses for individuals/hobby use. I don't believe that the lookahead function will work without either some hacky workarounds such as adding extra axes and performing calculations incorporating those, so knowing whether or not this is an option would likely be helpful. I assume they will distribute precompiled binaries or something to that effect, which is why I want to try and rely on a compiled lib.

If they aren't willing to do individual licenses and there isn't a reliable way to make the lookahead function work, I may end up ditching the ruckig lib entirely and trying to incorporate one of the 3d printer S-curve trajectory planners instead to get it working for 3 axis stuff at least.
Last edit: 03 Oct 2023 17:12 by Beef.

Please Log in or Create an account to join the conversation.

More
03 Oct 2023 18:09 #282183 by chris@cnc

basically you would be using a toolpath that has been generated on condition that the first derivative (velocity) is continuous and then you are just filtering the acceleration to make a new path that also satisfies the condition of having the second derivative continuous. Also you would be doing this in real time with zero look ahead. I don't think that is possible without considerable deviation from the part geometry but I'm no expert.

 You are definitely more of an expert than me. And yes, we have an error in the geometry. But it depends very much on the time set. If you draw a straight line to the acceleration curve, the distance is the error. The question now is: do we always need a perfect system? Not in rapid feed and not in jog.
The idea of integrating trajectory planning into an S-curve is as ingenious as it is difficult. And great respect to try solving that. My idea was perhaps to approach the problem in small steps. Maybe then we can see whether the whole thing can be solved differently so that it isn't so complex.

Please Log in or Create an account to join the conversation.

More
03 Oct 2023 18:53 #282191 by Grotius
Hi all again,

The cmake project of my linuxcnc fork : github.com/grotius-cnc/linuxcnc/tree/main/cmake is still compiling.

I started the axis gui, scurve config by executing the runtest in directory : github.com/grotius-cnc/linuxcnc/blob/mai...onents/sc_tp/runtest

This is starting a axis gui, performing the scurve motion along the linuxcnc start screen letters.

An sich this works, but code is not finished.  From here i could give it a fresh new try.










 
The following user(s) said Thank You: pommen, chris@cnc

Please Log in or Create an account to join the conversation.

More
03 Oct 2023 20:01 #282199 by Beef
Replied by Beef on topic LinuxCNC S-Curve Accelerations
@Grotius Thanks for the updates - I had a lot of issues getting it to compile the first time around but it appears this resolves a lot of them.

Do you use Discord or IRC? Since you're back I would rather assist you than to attempt re-structuring this on my own. I'm confident I can get a couple other people involved as well if you're interested in this, and with a few people working together perhaps we can solve this more effectively than each of us individually, especially since you're the one with the most familiarity with both the trajectory planner and with implementing the Ruckig lib that I know of.

Please Log in or Create an account to join the conversation.

More
04 Oct 2023 11:32 - 04 Oct 2023 12:41 #282270 by TheRoslyak
Grotius, I'm really glad to see you back on the forum. I've been eagerly waiting for your return. I've done a lot of work using Hal. It would be great to join forces. I'd like to add you to my projects on GitHub. If you could share your contact details for access, I'd happily grant you permission. There's indeed a significant amount of work done there.
UPD
I've added you to one of the projects. We'll need to discuss and go over the work that's been done and what needs to be accomplished. And, of course, assist each other :)
Last edit: 04 Oct 2023 12:41 by TheRoslyak.

Please Log in or Create an account to join the conversation.

Time to create page: 0.218 seconds
Powered by Kunena Forum