Optimizing Tool Paths or Generated G-code

More
02 Sep 2024 12:44 #309210 by mighty_mick
Hello folks. 
I am processing pieces in my machine. My CAM program is Fusion 360. Sometimes the pieces are being so detailed, so the generated tool paths being so complicated. I've noticed that complicated tool paths are giving the .ngc file with very big sizes. The generated .ngc file is being so big, and i want to interfere the generation of G-code. I think it can be less complicated with optimization. For example, think about the machine is gonna do face operation. There are many repeated lines in g-code(not in appearance, but in logic). As a result, they are doing the same thing. Go to end of peace, come from there, repeat...

I am wondering about is there any way to simplify or optimize generated Gcode? The method is gonna be like identifying repeated operations and putting them to appropriate loops(for, while, do-while...). I've thought it can be possible in Post Processor, because it has access to tool paths directly, and this component is the last component which touches to the machine specific code. To be honest, it can be weird because adding operations like i said may not be time efficient. If you're already gonna generate long lines, it can be longer with this operations. But if it can be done, it would be very nice about storage size. Some files are about 10'000'000 lines, or more. 

As a second choice, i considered an external program as an optimizer. This program gonna get the posted .ngc file as input and examine it's contents. With appropriate operations, it's gonna determine which moves can be done in loop and it is gonna put them in appropriate loops. The main problem in here is that the commands may not look the same but they may be doing the same job. Because of this, this program needs a strong logic to determine repeated moves in the context of CNC machinig.

These are my questions:
1. Have you guys ever thought about this kind of situation? Is there any ready to use tool, or does my idea makes sense?
2. What about doing this process in post processor? Does it make sense?

Thank you for your time.

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

More
04 Sep 2024 12:06 #309352 by andypugh
I don't think that the PP can do it (not as a first step, anyway). It doesn't "know" that it is a repeated step (and even more so doesn't know that it _will_ be a repeated step)

You can increase the minimum segment length which will reduce the file size (and will also often improve the machine speed) and you should allow the PP to generate arcs, where that is a setting as that will both reduce file size and improve fidelity.

In theory an intermediate tool (even applied as an input filter to LinuxCNC) could reduce file size. But at that point it may be too late, what do you gain? You alread have the huge file on the system.

Spotting the repeats (especially repeats with an incrementing variable) would be a rather "entertaining" bit of code to write.
The following user(s) said Thank You: tommylight

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

Moderators: Skullworks
Time to create page: 0.060 seconds
Powered by Kunena Forum