LinuxCNC S-Curve Accelerations

  • endian
  • endian's Avatar
  • Away
  • Elite Member
  • Elite Member
More
30 Mar 2026 16:09 - 30 Mar 2026 17:59 #344958 by endian
Replied by endian on topic LinuxCNC S-Curve Accelerations

Yes Rod .. it is solution but it is creating constant delay between control position -> DFIR -> current position of tool ....
 
It will not add any delay as it should be applied as the acceleration is calculated or read per servo cycle. Just not sure how you need to use it. 
the size of the buffer is configurable.
Any other published moving average solution wanted to use loops which are a source of delay so I devised this..
One of the cleverest algorithms I have ever coded...
 
 

I think the best way to apply that... its consulate with Luca or Yang Yang if they are allready not using something like that now...  I'm not that familiar with their code till now ... it toooo way complicated for me

my next observation is - high value of G64 tolerance around 0.1(650us spikes) is spiking more than 0.001(250us spikes)

best setup till now ... most influential spiking thingy is the 
OPTIMIZATION_DEPTH... this creates real mess
ARC_BLEND_ENABLE = 1
ARC_BLEND_FALLBACK_ENABLE = 1
ARC_BLEND_OPTIMIZATION_DEPTH = 8
ARC_BLEND_RAMP_FREQ = 64
ARC_BLEND_GAP_CYCLES = 64
TC_QUEUE_SIZE = 200
Last edit: 30 Mar 2026 17:59 by endian. Reason: setup add
The following user(s) said Thank You: rodw

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

More
30 Mar 2026 22:59 #344976 by NWE
Replied by NWE on topic LinuxCNC S-Curve Accelerations

Why can't you use more than one thread instead of a FGPA?

 

Thanks, I've been wondering too. I've been dreaming about kinematics using multiple realtime threads. Does anyone know whether/why it would not do?

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

More
31 Mar 2026 00:40 #344979 by ewlsey
Replied by ewlsey on topic LinuxCNC S-Curve Accelerations
Go easy on me. I tried to read through this whole thread, but there's a lot to digest. 

How does the current linuxcnc approach compare to how S curve acceleration is being done in GRBLHAL? 

I've tried to read the linuxcnc servo loop code, but it's pretty well impenetrable. 

However, GRBLHAL is very cleanly written and well commented. From what I can see, it has many features discussed here.

It has a backwards (and forwards) buffered trajectory planner with prescribed tangential acceleration. It has buffered segment interpolation. Both run outside the realtime loop, but the segment buffer is fast enough for feed overrides and holds to feel instantaneous. 

I know it's not a "real" control, but it's pretty amazing they could get all that to work (along with g-code interpreter, etc) on an 8 bit AVR microcontroller. 

The current HAL version offers jerk limited acceleration, though I have to say its utility is a bit questionable for industrial machines. I believe the GRBL equivalent of the "servo loop" only runs at 100Hz, so you would need really low jerk values to see an effect. But, the framework seems sound.

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

More
31 Mar 2026 01:06 #344980 by NWE
Replied by NWE on topic LinuxCNC S-Curve Accelerations

Go easy on me. I tried to read through this whole thread, but there's a lot to digest. 

--snip--

I know it's not a "real" control, but it's pretty amazing they could get all that to work (along with g-code interpreter, etc) on an 8 bit AVR microcontroller. 

 

Just now I discovered:
GRBLHAL = 32 bit
GRBL = 8 bit
Thanks for bringing this up. A long time ago I read all about GRBL 8-bit and sort of gave up on it. Now I notice the main project is 32 bit. Now that seems worthwhile. Cheap 32-bit MCUs today pack some punch.

That said, I'll leave the S-curve talk for the pros.

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

Time to create page: 0.107 seconds
Powered by Kunena Forum