G0 movement after previous same G1 position in gcode output

Hi all
My problem is, that my gcode output has a lot of G0 to the same position as it already is, what makes the edges burned out and slowly, like the code below:

G1 X41.448 Y456.597
G1 X40.24 Y456.611
M106 S0
G0 X40.24 Y456.611 F0
M106 S80
G1 X10.239F300
M106 S0
G0 X10.239 Y456.611 F0
M106 S80
G1 Y506.614F300
M106 S0
G0 X10.239 Y506.614 F0
M106 S80
G1 X24.684F300
M106 S0
G0 X24.684 Y506.614 F0
M106 S80
G1 Y504.064F300
M106 S0

I’m using a Mach3 (doing also CNC on it) controller with
LightBurn 1.4.03 and Marlin device profile, absolute coords.

Before processing in Mach3, i do some replaces that suites my setup like
M106 → M4 (Enable Laser)
S0 → S1 (mit S0 kommt dannach kein Sx mehr, PWM bleibt aus)

I just reset Lightburn and set everything new. What option is doing this?
Thanks for helping.

If the project is small, I’ll take a look at the GCode that is being generated and attempt to understand the behavior.

If you’re willing, select File, then Save GCode, then upload that file in a reply here. I’ll re-import it and see what is happening. Without the header, it’s not likely to import to my computer correctly.

The G0 commands move to the start of the next vector with the laser off and the G1 commands cut / mark to the end of the vector with the laser on.

The F0 words in the G0 commands specify a zero feedrate, which seems odd. I think that speed should be much higher; it’s set by the Fast Whitespace speed, so make sure you don’t have an inadvertent zero in there.

Most of those sequences look fine, with distances of a few millimeters. However, some of the coordinate positions differ very slightly, so the design may contain many tiny segments instead of longer lines.

I think the laser is doing what your design calls for, but that design might not be what you think it is.

Uploading the *lbrn2 file (as well as the G-Code file for @johnjohn will give other folks a chance to look at the design and see what’s going on.

1 Like

Thank you.
Here is the code. This should be a single cut.

Radiatorabdeckung3.gc (6,3 KB)

I did set “Fast Whitespace speed” before resetting the software, but this did not remove the G0.
In the attached file I set it again.

Setting the Fast Whitespace Scan speed changes the speed of the G0 motions, which is necessary because Marlin does not follow the standard G-Code definition of G0 moving as fast as possible to the destination coordinates.

Perhaps you misunderstand how G-Code works.

By definition, each vector in the layout has a starting point and and an ending point.

In cases where the vectors are contiguous, you’ll find successive G1 commands, such as these along the first curved part of the layout:

G1 X264.207 Y54.008F300
G1 X265.415 Y54.051
G1 X266.621 Y54.124
G1 X267.825 Y54.226
G1 X269.026 Y54.357

Notice that those distances are very small, but that’s what the layout calls for.

However, if the vectors are not contiguous, then a G0 command moves from the end of one vector to the start of the next, with the laser turned off. For example, these are the straight-line moves at the start of the layout:

G0 X232.998 Y3.991 F4000
; Layer Schneiden
M106 S80
G1  Y53.992F300
M106 S0 
G0 X232.998 Y53.992 F4000
M106 S80
G1 X262.999F300
M106 S0 
G0 X262.999 Y53.992 F4000
M106 S80
G1 X264.207 Y54.008F300

The second G0 command appears to move to the same coordinate as the endpoint of the previous G1 command, which will produce no motion with the laser turned off.

You didn’t upload the *lbrn2 file producing that G-Code, so I can’t verify this, but I think you’ll find those straight-line segments are not joined, so LightBurn must consider them to be separate segments that require intervening G0 positioning commands.

If you apply Edit → Auto-join selected shapes and perhaps Edit → Close selected paths with tolerance, that may align the vectors properly.

However, none of that matters, because zero-distance G0 commands turn the laser off, so they cannot burn the material.

Have you run a Material Test to verify the speeds and powers you are using?

1 Like

Wow, you were right. The lines weren’t joined and that auto-join fixed it.
I now have a single line instead of a few that were joined to a group.

I did a Material Test a while ago, with old settings. I’ll do a new one.

Thank you so much and have a good weekend.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.