Snapmaker / Luban

An easy-to-use 3-in-1 software tailor-made for Snapmaker machines.
https://snapmaker.com/snapmaker-luban
GNU Affero General Public License v3.0
444 stars 117 forks source link

Bug: Excessive jogging in CNC with disjoint paths #2494

Open dgatwood opened 1 month ago

dgatwood commented 1 month ago

🐞 bug report

Affected Version(s)

All

Is this a regression? (optional)

No

To Reproduce

  1. Create a CNC program that carves several paths that don't overlap, e.g. etching text into something.
  2. Run the program.

Expected behavior

I expect Luban to realize that the paths are entirely disjoint, and generate Gcode that etches one letter followed by the next to minimize the amount of unnecessary jogging. Instead, Luban generates Gcode that etches everything all at once.

This is unfortunate, for several reasons:

The two-cut program that I'm running right now was going to take two hours and 16 minutes, if memory serves. I split it into two separate programs, one per cut, and it is now going to take an hour and forty-two minutes.

For a three-axis model, there is absolutely no reason to carve every independent path at a given layer simultaneously unless you're doing something terrifying like setting the Z origin below the top of the original physical material. After all, the CNC cutter can always just go higher than the physical material, jog, and start over.

It could theoretically save time to do so if and only if the paths are non-disjoint, because you could avoid even cutting parts of a path where the material is already completely gone, but Luban also does not do that optimization as far as I can tell, making this point moot.

In an ideal world, Luban would identify disjoint paths and cut them independently, then identify overlapping paths and cut them together, avoiding re-cutting areas that were already carved out by another path. That said, I'd settle for Luban just identifying disjoint paths and cutting them independently so that it doesn't waste quite as much time jogging back and forth above the material when it could be cutting.

🌍 Your Environment

Platform:

xiwai2 commented 1 month ago

Hello, the tool path in Luban can set the idle running speed and idle running height. You can reduce the engraving time by setting these two parameters. 20241009-164038

dgatwood commented 1 month ago

Speeding up the jogging kind of misses the point, though, which is that there is no reason to do the jogging in the first place. And even at the maximum speed and minimum height (which I was using when I got those numbers), it still adds up to a lot of wasted time.

xiwai2 commented 1 month ago

Hello, can you provide us with a Gcode that you think has too many jogs to check the problem? Thank you