Full Lightburn Control Guide

Inline power should be enabled, yes. You only need parts of the guide if you’re using my repeatable setup and not manually setting your work origin, or controlling via Lightburn. The firmware alone should enable inline, so without the gcode head/footer, it should still run as expected, just dithering won’t stop/go stutter and you can do actual grayscale that varies the power.

Me again.

Despitte checking and rechecking my settings this problem still persists no matter what project or material height I select the laser head remains firmly at the top of the Z axis.
I’ve attached images of my device settings.

Any further suggestions will be tested.


Thanks
Graeme

I assume you’re running via Lightburn over USB, correct? Does it home, come down, back up, then begin the project at the top?

If possible, could you make a video starting it in lightburn and letting me see what it’s doing? The settings all look good from here.

EDIT: You can also try changing the transfer mode from buffered to synchronous to see if that helps.

This ist exactly was mine does, after I stopped a Job, did not let it finish, and startet it again.

Maybe Its because when you hit stop, the end gcode ist not executed. But i have not investigated this further.

OK heres the video of the machine lasering a small sqaure with the default lightburn settings.
Srry about the quality but I could’nt get it sharper, due to the file size limits.

And the Gcode

Starting stream
leveling OFF
X:-19.00 Y:347.00 Z:334.00 E:0.00 Count X:0 Y:142800 Z:133600 B:0
Select workspace 0
X:-172.70 Y:274.50 Z:-2.90 E:0.00 Count X:0 Y:142800 Z:13400 B:0
echo:Settings Stored (1077 bytes; crc 23113)
X:-172.70 Y:274.50 Z:0.00 E:0.00 Count X:0 Y:142800 Z:13400 B:0
Select workspace 0
X:-151.70 Y:-72.50 Z:300.00 E:0.00 Count X:8400 Y:4000 Z:133400 B:0
echo:Settings Stored (1077 bytes; crc 4205)
X:0.00 Y:0.00 Z:300.00 E:0.00 Count X:8400 Y:4000 Z:133400 B:0
Layer C00
echo:Unknown command: “M9”
echo:Unknown command: “M9”
leveling OFF
X:-19.00 Y:347.00 Z:334.00 E:0.00 Count X:0 Y:142800 Z:133600 B:0
echo:Unknown command: “M2”
Stream completed in 0:44

I use lightburn trhough a USB cable. The machine works perfectly with Luban.

REgards
Graeme

The header seems to be working as expected, but it’s not moving down for the material thickness. After the header, lightburn should put a Z move down to the material thickness. Odd… Can you export and upload the gcode file? What you pasted looks right from what I can see it reporting the coords as it modified them.

MAteriall thisckness is 3.5mm

Starting stream

leveling OFF

X:-19.00 Y:347.00 Z:334.00 E:0.00 Count X:0 Y:142800 Z:133600 B:0

Select workspace 0

X:-21.00 Y:347.00 Z:0.00 E:0.00 Count X:0 Y:142800 Z:13400 B:0

X:-21.00 Y:347.00 Z:0.00 E:0.00 Count X:0 Y:142800 Z:13400 B:0

Select workspace 0

X:0.00 Y:0.00 Z:300.00 E:0.00 Count X:8400 Y:4000 Z:133400 B:0

X:0.00 Y:0.00 Z:300.00 E:0.00 Count X:8400 Y:4000 Z:133400 B:0

Layer C00

echo:Unknown command: “M9”

echo:Unknown command: “M9”

leveling OFF

X:-19.00 Y:347.00 Z:334.00 E:0.00 Count X:0 Y:142800 Z:133600 B:0

echo:Unknown command: “M2”

Stream completed in 0:44

Please upload the gcode file itself. In lightburn, click the save gcode button.

I’ve just started investigating Lightburn after getting some bad results etching glass with Luban. I have updated the firmware for the 10W laser per your guide, and I’ve mostly changed the Start/End Gcode scripts per your suggestions.

I also encountered the same experience of having the laser positioned way above the work piece as shown in Graeme’s video. If I remove the G28 (home) and some of the other commands that are specific to your origin then my Snapmaker operates as expected. I have a couple of questions for you.

  1. If I use the GRBL-M3 controller profile as you suggest, then the LightBurn “Home” button on the laser tab no longer works - i get an “Unknown command: $H” message. There are many other unknown commands displayed in the console window too: “M2”, “$I”, “?”. If I use the Lightburn-provided “SnapMaker” profile, then “Home” works properly and I don’t get any “unknown” messages. What makes the GRBL-M3 profile better than the supplied SnapMaker profile?

  2. If the upgraded Laser firmware enables better gradient and dithering capabilities, then will Luban automatically take advantage of these new unlocked features, or are additional commands required in the g-code files when engraving?

  3. Are you aware of any good tutorials/videos of using SnapMaker with Lightburn? I feel like I’m walking on eggshells every time I use the laser. The E-Stop button was worth the price and gets used a lot with this machine.

That’s because Lightburn is trying to use $h to home, which is the command in GRBL. This does not work on the Snapmaker, as it runs Marlin. If you want to home the machine via Lightburn, either type G28 in the console, or make a macro button and name it home that contains G28.

The reason for the GRBL-M3 profile is to take advantage of the firmware modifications. Since all the movement code is understood properly by Marlin for all the inline functions. The $ codes are all GRBL lines to ask info from the machine such as size, buffer, etc. Since the Snapmaker doesn’t understand these, they’re simply ignored with an unknown command response. No harm, no foul.

An additional reason is if you use the “Snapmaker” profile, then it outputs gcode in the same way Luban does, and I’ve outlined the differences below.

No, Luban does not know anything about the firmware. The results using Luban will be exactly the same, as all it does is generate the gcode and send it to the machine. It’s a fundamental difference in how Luban and Lightburn generate dithered code.

Snapmaker’s code for grayscale looks like this;

M3 P55 S140
M3
G4 P5
M5
G1 X-95.94 Y95.76
M3
G4 P5
M5
G1 X-95.94 Y95.58
M3
G4 P5
M5
G1 X-95.94 Y95.40
M3
G4 P5
M5
G1 X-95.94 Y95.22
M3
G4 P5
M5

It sets the power via M3 P55 S140 (P is a %, so 55%, and redundantly puts S as well… which 140 is 55% of 255). Then it simply turns the laser off (M5), moves your density size on Y (0.18mm here), then turns the laser on (M3) and then waits (G4) the default 5ms (P5). Afterwards, it repeats for the next dot. This move/stop/wait/repeat cycle is why it takes FOREVER on stock firmware/using Luban’s method.

Here’s an example of Lightburn’s methods;
1 - Dither

M3
G1 X0.589Y-0.589F2000S0
G1 X0.128Y-0.128S204
G1 X0.254Y-0.254S0
G1 X0.128Y-0.128S204
G1 X0.589Y-0.589S0
G1 X0.594Y-0.339S0
G1 X-0.589Y0.589S0
G1 X-0.127Y0.127S204
G1 X-0.51Y0.51S0
G1 X-0.127Y0.127S204
G1 X-0.255Y0.255S0

The laser is simply turned on, no power given (that’s why I have an extra M3 S0 in the header to ENSURE the laser power is set at 0). Then while moving turns the laser on and off as needed for the dots. This change in power is denoted by the S# at the end of each line (S204 is 80% power). Thus it does clean, smooth sweeps back and forth with the laser pulsing on and off.

2 - Grayscale

M3
G1 X0.589Y-0.59F2000S0
G1 X0.128Y-0.127S33.8
G1 X0.127Y-0.127S32.3
G1 X0.589Y-0.59S0
G1 X0.467Y-0.212S0
G1 X-0.589Y0.589S0
G1 X-0.127Y0.128S30.1
G1 X-0.128Y0.127S33.1
G1 X-0.127Y0.128S34.6
G1 X-0.128Y0.127S36.1
G1 X-0.589Y0.589S0

Similar start to the dithering, but look at the S# parts, see how they vary? This is because it’s actually changing the power levels to increase/decrease the amount of burn/darkening of the material. You can set the min/max to represent white/black and then it calculates grayscale between those amounts (i.e. for maple plywood, I use *5% ~ 60%, so 5% power for pure white, 60% power for full black)

With stock firmware (inline disabled) if you tried to run either method Lightburn uses for GRBL, it would cause it to stop at every power change, making it stutter and over/underburn your engrave. The firmware I uploaded enables the inline feature so it moves back and forth smoothly, turning the laser on and off as it needs without stutter.

I am not, sorry. I’ve been learning Lightburn as I go and using my knowledge of running CNCs and writing gcode by hand to bend it to my will. Personally, while I’m glad to have the E-Stop, it’s rare that I ever actually need it. Usually only when I’m doing experiments/tests and I know there’s a chance, or on purpose if that’s what the test is. With how I’ve laid out above, I’ve got it to pretty much just click-n-go without worry. I’ve never had it fail unless I messed up (say, forgetting to input my material height).

As a general side-note for everyone. Keep in mind, I wrote this with the intent of it being an extension of my laser origin guide. While the parts of the guide here CAN be used if you intend to use the touchscreen/Luban and not using a hard set origin (such as eyeballing it into the corner). If you intend to run the code “as intended” (Snapmaker’s way) then you only need the safety M3 S0 in the header, and the M5 in the footer. All the rest is relevant ONLY to set your repeatable origin and material height. Or basically, the full automation parts. Just make your project in Lightburn, click save gcode, then load it into Luban.

2 Likes

Skreelink,
You certainly have a gift for explaining the inner workings of this software. Thanks so much for taking the time for teaching me and many others.

I experimented with both profiles, and GRBL-M3 is clearly the winner. It really sped up the whole process and the results were fantastic.

Lightburn is a major step above Luban. I struggled so long to get decent glass etchings with Luban and was ready to give up when I decided to give Lightburn a try. Its grayscale renderings are fantastic and so smooth once it’s all configured.

1 Like

Here’s my Gcode for a simple box.

; LightBurn 1.2.04
; GRBL-M3 (1.1e or earlier) device profile, user origin
; Bounds: X20 Y20 to X70 Y60

;USER START SCRIPT
M106 P0 S255
G28 ; Safety home,
G53 ; Changes to Machine Coords.
G0 Z33.5 F6000 ; Z value LASER HEIGHT touchscreen.
G54 ; Work Coords
G92 Z0 ; This sets Z Work Origin to 0, making your laser height as 0.
G0 Z300 ; Moves the toolhead back up out of the way.
G53 ; machine coords!
G0 X2 Y0 F6000 ; IMPORTANT, this is the offset you found following my laser guide!
G54 ; work coords.
G92 X0 Y0 ; set 0,0 on X,Y
M3 S0 ; brings the laser online at 0 power
;USER START SCRIPT

G00 G17 G40 G21 G54
G90
G0 X0 Y0
G91
; Cut @ 6000 mm/min, 20% power
M9
M5
G0 X0Y0
; Layer C00
M3
G1 Y40S51F6000
G1 X50
G1 Y-40
G1 X-50
M5
M9
G1 S0
G90
; return to user-defined finish pos
G0 X0 Y350

;USER END SCRIPT
M5 ; Safety line, ensures the laser is offline and off.
G0 Z330 F6000 ; rapid toss the toolhead out of the way.
G0 Y350 ; rapid the bed forward.
G28 ; Safety home
;USER END SCRIPT
M2

Hope this helps.

Regards
Graeme

In this block there should be a G0 Z# to move the laser down to the material height. Double check to make sure you have Enable Z axis checked, and Relative Z moves only unchecked. Then input a material height in the cuts tab.

Still no difference with setting the material thickness, in this case 4.0mm, also please noet the settings in the device image below.

; LightBurn 1.2.04
; GRBL-M3 (1.1e or earlier) device profile, user origin
; Bounds: X19 Y21 to X80 Y60

;USER START SCRIPT
M106 P0 S255
G28 ; Safety home,
G53 ; Changes to Machine Coords.
G0 Z33.5 F6000 ; Z value LASER HEIGHT touchscreen.
G54 ; Work Coords
G92 Z0 ; This sets Z Work Origin to 0, making your laser height as 0.
G0 Z300 ; Moves the toolhead back up out of the way.
G53 ; machine coords!
G0 X2 Y0 F6000 ; IMPORTANT, this is the offset you found following my laser guide!
G54 ; work coords.
G92 X0 Y0 ; set 0,0 on X,Y
M3 S0 ; brings the laser online at 0 power
;USER START SCRIPT

G00 G17 G40 G21 G54
G90
G0 X0 Y0
G91
; Cut @ 6000 mm/min, 20% power
M9
M5
G0 X0Y0
G0 Z4
; Layer C00
M3
G1 Y39S51F6000
G1 X61
G1 Y-39
G1 X-61
M5
M9
G1 S0
M5
G0 Z-4
G90
; return to user-defined finish pos
G0 X0 Y350

;USER END SCRIPT
M5 ; Safety line, ensures the laser is offline and off.
G0 Z330 F6000 ; rapid toss the toolhead out of the way.
G0 Y350 ; rapid the bed forward.
G28 ; Safety home
;USER END SCRIPT
M2

Device settings

Please note the start and end gcodes have remaind unchanged during all this process.
Also this is my last day on the extended licence of Lightburn, I’m unsure wheather to purchase or not following these problems.

Regards
Graeme

Ohhhh! ; GRBL-M3 (1.1e or earlier) device profile, user origin here’s the problem! You should be running in Absolute Coords mode.
Screenshot 2022-12-15 083527

The reason for this, is user origin adds a G91 before the cut sequence, this is Relative Movements, which means instead of using the work origin we set in the header, it’s trying to move 4mm in Z from the current position, which is at the top of the gantry.

Here’s the difference in the starting block of yours vs mine (in absolute)

G00 G17 G40 G21 G54
G90
G0 X0 Y0
G91 <-- THIS.
; Cut @ 6000 mm/min, 20% power
M9
M5
G0 X0Y0
G0 Z4
; Layer C00

Mine

G00 G17 G40 G21 G54
G90
; Cut @ 3000 mm/min, 10% power
M9
M5
G0 X0Y0
G0 Z20
; Layer C00

User origin also adds a useless G0 X0 Y0 above the G91, but that doesn’t matter. For a bit of info, G90 is absolute coords (all moves are from 0,0). Meaning G0 X10 Y10 moves to 10,10, no matter where the toolhead is. Whereas G91 is Relative coords (all moves are made from current position). Meaning G0 X10 Y10 will move 10mm in both directions starting where it is. So if the toolhead is at 10,10 already, in relative, it’s now at 20,20. The same command will give you 30,30 and so on. Whereas in absolute, the command will ALWAYS go to 10,10.

TL;DR - Make sure you’re in Absolute Coords mode in the laser tab.

2 Likes

Sorry to bother you again. I have dobe everything as stated. The a350 10w then does its motions moving up and diwn a few tine then starts to do the burn when i click start. However the laser dies not fire.

Update I have the laser firing now but its power is practically 0

Skreelink

I bought the licence for Lighburn and eventually found the location for the setting you spotted, it now works fine.

Thank you for all your help

Regards
Graeme

That’s awesome to hear. :slight_smile: Make wonderful things now.

Thanks for sharing this with us!

Hi Skreelink,
So I’ve had excellent results etching grayscale images on to flat glass with Lightburn. Now I’m trying to etch these images on to glasses using LB and the SnapMaker Rotary axis. Have you had any success with this arrangement?

I’m aware of the kludge required to change all ‘X’ axis commands to ‘Y’, and ‘A’ axis commands to ‘B’, however, so far my results have not been that good. Lightburn wants to move the Y axis back and forth while slightly rotating the B axis every pass. The operation is not as smooth as it is with an all linear setup. Instead, it makes stuttering, clunky moves similar to Luban. I would prefer to have the bulk of the motion performed by the B axis instead of the Y axis. Do you know if there any LB settings that would allow this?

Also, the finished image is pretty bad. Lots of banding like you see with a clogged inkjet printhead. So far, I’m not impressed with LB and it’s rotary support for SM.

Have you encountered any of these issues and know of possible solutions?