Full Lightburn Control Guide

For manually editing in your material height, open the .nc file in any text editor and change this line to your material thickness.

; Scan @ 1999.998 mm/min, 100% power
M9
M5
G0 X153.331Y215.34
G0 Z0 << This Z is your material thickness.
; Layer 
G91
M3

You don’t need the second M03 or I, the power changes should be fully inline, just an S on the movements. Try the following.

M03 S0
G1 X0 Y100
G1 X50 S2.5
G1 X100 S5
G1 X0 S0
M5

Which should move to toolhead to the left and bed to the middle (for reflection protection), then move 50mm and turn the laser on to 1%, then ramp up to 2% as it moves to 100mm, then back off as it moves back. If the laser doesn’t come on or change, then it’s not working anymore. However; it MAY come on, but not respect S0 to turn back off, this was the main issue moving forward on 1.15. Which made transient lines through your engrave.

Okay just tried that out, it did indeed change I must’ve messed something up when I tried out the S inline.

So then the question becomes, is there a way to configure Lightburn with Marlin to use the S values on G Codes and exclude the M commands? If not I guess I can configure GRBL according to your guide? Either way I think I’ll open a request with Lightburn to add support for this in some way.

If indeed I get transient lines, a quick hack for photos at least could be to add a 1 px white border and account for it in the design (and set grayscale min to something that won’t burn either.

Yes, just use GRBL M3 like my guide says. If you get transient lines, you could open the gcode and do a replace all for S0 with like S1 which is is low enough not to burn. In Notepad++ it’s easy enough with Ctrl-H.

Yup, I’d honestly probably just write a quick bash script or something to make my life easy. Would be nice if Ligthburn had a gcode post-processor like Prusaslicer, that’d solve all the issues here.

Just make sure to have an M5 in the footer to ensure the laser is actually off. :slight_smile:

Actually, I think if I setup a custom Marlin device, instead of using the Snapmaker profile in Lightburn, it looks like that profile can do inline power control.

Thanks @Skreelink and @Burgerboy, I tried loading a project in lightburn and was still having the issue. I removed the materials from the bed to let the whole process run and see what was happening and it appears the startup commands are sending it down before it comes back up and resets to the correct height and starts running. I believe it was the Z0 in this user start up that was causing my issue. I have gotten around it by pausing the process and positioning the work piece right before it starts burning. Any ways around the user start script Z0 that wont mess things up?
image

The G92 Z0 line is setting the Z origin. Basically what it’s doing when it comes down, then back up, then back down is the G0 Z28 line is the focus of your laser, so it comes down to that. Then G92 Z0 sets that height as Z origin zero. Afterwards, G0 Z300 moves the toolhead back up out of the way so it can move without colliding with anything. Then when the program starts, the first G0 ZX is the material height and since we set the focal length as zero earlier, it’ll move the required height to focus onto your material thickness. Keep in mind you need to be in Absolute coordinate mode.

Okay for what it’s worth, using the Marlin profile does work, I just needed to adjust the Baud rate and restart to be able to connect. Grayscale looks much better, but as you mentioned there is over-scan problems. I’ve not read the GRBL setup in detail to understand what other advantages it may provide, but I’m wondering if it’s better to setup a custom Marlin profile over a GRBL one!

Test and figure out what works best for you. Consider my guides as a starting point and do experiments to find other solutions and things. There’s never a single answer, so if marlin works for you, use that. I use GRBL as (as the time I was experimenting) the gcode was leaner and less buggy than Marlin generated gcode. Such as all the extra Is that are unneeded and just increase the filesize.

1 Like

Thanks, I tried to load it as pdf but for some reason it’s not a supported format (probably malicious macros) didn’t think of the Github

1 Like

I don’t seem to have this Focus Height or Material (mm) setting on my Cuts/Layers tab.
I


really don’t need it since I manually focus each job, just curious why it’s not there.

In your device settings, disable Relative z moves only.

Screenshot 2023-07-20 160044

1 Like

Oops…again, it is there now.

Change from Fill to Cut and the thickness setting will ungrey and become available

1 Like

It ungrey’s when the tool layer is not selected.

The tool layer needs to be cut rather than fill and the layer selected. You should then be able to select the material size then. Sorry I’m not at my PC so can verify it but I’m pretty sure this is how I got around it

1 Like

It sounds like inline control has been enabled in the stock firmware,

Where is it documented that it is supported by the stock(official) firmware?
Before, when I made a request to support inline control, I received a response saying that they were considering it. I was expecting it to be implemented in conjunction with the release of the new laser module.

1 Like

Not sure, just saw posts in this thread. Can confirm it works on my machine but inline S0 doesn’t turn off the laser (as also mentioned in this thread).

Maybe with new modules they will implement that, stock marlin has this, but I guess they branched out too long ago.