40W laser running out of boundary (lightburn)

I’m using lightburn with the Artisan and 40W and am hitting an error I’ve never seen. I use the method of saving the gcode file and sending that to my machine via WiFi, I am not directly connecting for Lightburn direct control.

I load up the gcode, set my origin, and run boundary. Everything looks good. As soon as I start the project the laser swings way left out of bounds. I assume it’s something related to Lightburn but I’m at a loss.

Anyone else experience this?


How are you setting up your project? When you load up the file on the machine, set origin, etc. You’re using the crosshair I assume? If so, make sure in Lightburn you’re using the “User Origin” or “Current Position” setting.

Would you mind sharing your gcode so I could analyze it and see if I notice anything wrong?

Sure, this is with user origin…
thanksgivingtest.nc (506.3 KB)

For setup I have everything positioned for lower left origin. I load the gcode (sent via Luban over WiFi) then set the crosshairs lower left. Then I run boundary and that looks good. It only shifts left when I start the job. What’s interesting is the Y axis seems correct, just the X fails.

Thank you!

Looking at the gcode, there’s nothing out of the ordinary.

G0 X0 Y0 F0 ; Ensuring it starts at origin
G91 ; relative mode swap
; Scan @ 2400 mm/min, 60% power
M106 P0 S255
G0 X62.922 Y0.074 F0 ; Move to first starting position
; Layer C10
G1 X1 F2400
M03 P60 S153
G1 X4.964 ; beginning engrave

I made some relevant notes to the start and what it’s doing. All relative moves are X positive, so it would be heading right instead of left. When you position the laser, are you making sure to tap “set origin” on the touchscreen? Also, have you made sure to set the laser offset in Lightburn?

I do set origin on the machine. But I have NOT done the offset in Lightburn. Previously I never needed to (with the 10W/A350, but now I’m on the Artisan). I see that setting and don’t want to take too much of your time, is that in your comprehensive post for the Snapmaker 2.0? I thought it was only needed if I was doing direct control.

I still think it’s very weird that Run Boundary looks perfect… it only messes up when I start the job.

Thanks a ton for such quick help.

The 10W sets origin from the low power of the actual cutting laser, the new 20/40W uses a secondary laser for the crosshair. As such, it’s likely offset from the actual cutting laser. You can possibly find this by using a pen and placing a small dot and line up the crosshair on it, then do a square in Lightburn placed in the lower left corner origin. Run it, and measure the distance between the square and the dot and plug that into the pointer offset in Lightburn.

I’m talking about the pointer offset option in Lightburn, not the origin offsets in my guide.
Screenshot 2023-11-04 201326

I don’t know if the Artisan compensates for it in the firmware or not. Sadly I don’t have the Artisan or 40W laser, so all I can do is help with the gcode side, which all looks good. :frowning: I hope you can get an easy solution.

1 Like

So this is interesting- I started to compare the GCode produced by Luban and noticed that it doesn’t use G91 and the overall start code is different. About to go play with hand editing to see what happens. Hopefully… I don’t burn my house down.

;Header End
; Laser multi-pass, pass 1 with Z = 0
; G-code for laser engraving
; Generated by Snapmaker Luban
; G-code START <<<
M2000 W1 P100
M2000 W2 P100
M4 S0
M2000 L23 P0
G0 F6000
G1 F2400
G0 X225.81 Y5.97
G1 X225.95 Y5.76 S153
G1 X226.12 Y5.73

Luban generates code in absolute coords instead of relative coords like Lightburn. I prefer absolute coords for editing purposes, as it’s easier to edit or remove parts. The start gcode differences include some proprietary gcode lines. I’m not sure what W1/W2 are following the M2000, but the M2000 L23 P0 line is to use only half the diodes in the 40W toolhead, making it 20W essentially. P1 would use all of them for full power. In Luban this is “Half diode mode”.

Okay, this is definitely a bug. Tried another file and Run Boundary is correct but when I start the job it runs off the plate. Now to figure out if it is a Snapmaker or Lightburn bug (I’m guessing Snapmaker).

Time to send to support and cross my fingers…

1 Like

There is an offset from the crosshair to the laser. Mine is about 22mm. There is a setting on the Snapmaker for the crosshair offset but that and the Laser Offset in Lightburn don’t seem to have an effect. I found my origin with the crosshairs and manually moved the laser over 22mm to solve that problem.

Did you ever get a resolution on this? I’m experiencing the exact same behavior.

I have also discovered this problem is limited to my 40W laser. If I run the same gcode file with my 10W laser it moves as expected. But when running the exact same file with the 40W laser, the boundary works as expected, but the moment it actually starts the job the laser immediately moves to the far left off the end of the board - pulsing the laser as it goes.

It’s almost like the 40W laser doesn’t recognize relative coordinates properly and interprets all relative moves as negative - even if some are actually positive.

However the 40W does work when using a file from Luban - which uses absolute coordinates. I haven’t tried direct control with lightburn as I prefer the file transfer method.

Support confirmed it is a known issue and limited to file transfer only. Direct connection for Lightburn should work (but is very inconvenient for me so I haven’t tested yet).

Thanks for the update! Unfortunate, because direct connection is also very inconvenient for me. But at least it’s a known issue. Did they mention anything about when it might be fixed?

It didn’t seem like a priority so you should submit a support request :slight_smile:

Adding my “me too” here since I have 2+ years experience with 1.6W and 10W lasers and had them configured perfectly between Lightburn and Snapmaker 2.0 A350 (with Quick Swap) and now with the 40W laser the job is starting off the left edge of the work platform even when origins are set up using the previously working methods.

I have the Artisan and 10W Laser.
Since inline power mode is supported, i switched to grbl machine in lightburn. Since them the run boundary does not work. I goes somewhere.

If i switch back to marlin device in lightburn, the run boundary works perfect.

Replying to myself since I found a solution that works for me at least.
In Lightburn I still have all origins in lower-left corner. I changed very little

Laser Window Start From: Absolute
Device Settings Start GCode:
M106 P0 S255
M3 S0

Device Settings End GCode: (I know the Z appears low, I want it parked here, most people would put 330 here instead of 270)
G0 Z270 F6000

adding myself as another “me too” case (Lightburn → nc → File transfer via Luban) → Laser runs boundary correctly, then the 40W laser runs off to the left when starting the job on the printer. (SM 2.0 A350T, Nov3 2023 firmware)

1 Like

Same problem here.