Preview not matching G-Code

Hi there,

Complete n00b here, but I’m hoping this is not me wasting anyone’s time.

I have a RAMPS/MARLIN 1.0 system, so save to SD card. I use the save G-Code option, and have Marlin in the device, although when connected via USB it doesn’t seem to find it.

Anyway, I keep having some issue with the output, so I ran it through a G-Code simulator or two. Every time it keeps spitting out a very different result to the preview. My laters and cut order are all out of whack, which causes me some issues as I have to set laser power manually as I’m on a K40.

Is this a known issue, and if so is there any advice or work around?



Well, that’s not good, but you have to provide a bit more technical explanation for us to offer anything but guesses. Are you saying that you are getting different file output each time without changing things in LightBurn?

Thanks for the reply Rick.

Not every time, as I’m not trying multiple times.

If I have 3 layers, ordered in layer priority, and optimisation on etc., then I will check the preview to see how it’s going to ‘print’, and to make sure it’s as I expect.

If I then take the outputted G-Code from ‘save G-Code’ option, and then run that through either my laser cutter, or through a g-code simulator, then I get a different cut order than what the preview indicated.

I also have other issues with it, like some cuts being shifted from 2-3mm to 2-3" from where they’re meant to be, but I think that’s a MARLIN issue, and I don’t know how to configure it unfortunately, but that’s by-the-by - those errors don’t show up in the simulator, but the preview discrepancy does.

You’ll have to excuse me if I’m not giving the right info - I don’t know what I don’t know at this stage!


Well said, and I am right there with you. Together, we will get this sorted.

I would like to see what you are. When you say, “…ordered in layer priority, and optimisation on etc.,…”, this is where I need specifics.

Is this a complex file with many objects you are trying to order? Is this happening with every file you try? Can you reproduce this with a small number of shapes as well? What order are you trying to achieve and what order are you observing, exactly? Examples might be, “I set ‘Cut inner shapes first’ but the saved GCode has the outer shape cutting first.”

Post a capture of the entire LightBurn screen showing the Layers in the ‘Cuts’ window and the ‘Optimisation Settings’ window as well. We can go from there.

If the file isn’t private, you could post it here - the optimization settings are now saved to the file by default, so it would let us see what you see.

Video of preview:

Lightburn file:
it is well.lbrn (1.1 MB)

G-code:well1.txt (462.6 KB)

I’ve fixed this for the next release.

When cutting in User Origin or Current Position mode, the cut is assumed to start in the ‘Job Origin’ corner, chosen by the user, and path planning is done relative to that point.

When cutting in ‘Absolute Coords’ mode, the machine origin is used instead, but it wasn’t setting this if you were only running a preview. I’ve changed it so it makes this change whether you’re running it or doing a preview, and now the output is consistent.

Who the man? YOU the man!

If you ever need something breaking key me know :wink:

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