GRBL Travel Speed

Does anyone know the formula(s) that FluidNC uses to determine motor speeds when approaching and departing from gcode vertices? My time estimates for long plots can be way off and I’m trying to come up with a formula that accounts for the deceleration and acceleration, which seem to be very significant for certain plots where the tool head makes a lot of large (90-180 degree) directional changes between points.

I haven’t tried to digest this yet but starting with the comment on line 58. It seems to calculate start and end speeds of each move using the acceleration and re-evaluate every move when a new move is added. This seems like a hard problem to solve.

Thanks. I’m in the middle of trying out some AI generated code that I hope will get me in the ballpark.

In the meantime, I’m trying to figure out the fluidNC units for accel. The default in my config.yaml is 200 mm/sec^2. The Copilot generated code specifies it wants mm/min^2 and its example uses 300 mm/min^2. I think 200mm/sec^2 converts to 720,000 mm/min^2. Seems kind of big. Maybe it’s a typo by Copilot?

That checks out.

:worried: :worried:

I thought I had a handle on this until I read the comments in your reference. Now I’m really confused.

:rofl: :rofl:

1 Like

Yea, the planner is literally the most complicated part of GRBL/FluidNC. I don’t pretend to understand it other than at a 10,000 foot level.

When I saw this thread, I had 2 thoughts:

  1. Good. I have no idea how long my plots are going to take.

  2. It’s probably easier to just crank up the acceleration. If the feedrate stays low, I’m not sure how much that affects the experience of the plot. At high feedrates, acceleration has a pretty significant impact.

Yeah, I don’t think we need to get in the weeds here. I think if we look at the difference between the entry and exit vector at each point in the gcode and apply a simple decel/accel formula we should be close. For instance, if the difference is 0, then there is no change in velocity as it traverses the point. If it is 90 degrees or more, then the velocity slows to 0 based on the acceleration set in the config.yaml and accelerates back to the F speed accordingly. And, maybe apply a cosine relationship to the velocity for 0 to 90 degree changes.

i.e. velocity at the point = Fspeed * cos(angular change)