What sets the laser speed in the g-code?

I got tired of not being able to line up my svg files between luban and carbide create for laser engraving onto something I’d cnc’d. So I went with Lightburn which works but despite the fact that comments in the g-code say that it’s going to cut at 13.3mm/sec, it’s actually flying around the board at around 800 mm/sec.

Here’s what the start of my g-code looks like:
; LightBurn 0.9.16
; SnapMaker device profile, absolute coords
; Bounds: X0.19 Y0 to X190.69 Y323.85
; Cut @ 13.3 mm/sec, 100% power
G0 X0.19 Y21.12 F0
; Layer C23
M03 P100 S255
G1 Y323.85 F798
G1 X95.44
G1 Y295.49
G1 X95.44 Y295.47

Any thoughts?

1 of two options here:

  • You haven’t run this yet and you’re mistaking 798mm/min (13.3mm/s) for 798mm/s.
  • It’s misbehaving because you didn’t set the whitespace scan speed in device settings different than your cut speed:

You have to set a whitespace scan speed that’s different than your cut speed. Lightburn assumes that Marlin treats G0 and G1 speeds the same, which may be true in some releases, but not Snapmaker’s version. It actually has different speeds for G0 and G1. So you have a G0 F0 which is ignored because F0 isn’t a valid feed rate, so it’ll take whatever you previously moved at which I’m guessing is 800mm/s since that’s what you said.

You need to set this in device settings:

With this setting disabled, in an example file I have:

With this setting enabled and set different than cut speed:

If your whitepsace scan speed is set the same this happens, even if it’s turned on. Notice the lack of a feed rate:
Lightburn is being very “helpful” by “optimizing” the “unnecessary” feedrate out since Marlin has the “same” feedrates. Here’s the lead developer from their forum:

Another gripe I have with the Lightburn/Snapmaker pairing is it only generates G91 relative moves. If you open the enclosure or pause the print, the controller or touchscreen will set G90 absolute, and you will not be able to resume unless you have a terminal which you remember to type G91 in before resuming. The fix would be the touchscreen / controller restore the positioning mode after doing whatever it does, but since that will never happen maybe the Lightburn dev could add a G90 based output, but he’s said as much in the forums that also won’t happen as it would require a huge codebase change.

1 Like

(1) I did run it and the snapmaker touchscreen said 797mm/sec so I took that as the value.
(2) I did not do anything to change the inputs beyond what Lightburn suggested so that’s likely the problem. So the device settings I need to change are in Lightburn?
You mention that it only generates G91 relative moves but the gcode file it generates specifies G90? Unless I’m missing something which wouldn’t be surprising

Yea, you’ll find that setting in here:

And in more detail with the G91 vs G90, if the device flavor is set as Marlin I thought it will always generate relative moves as follows:

; LightBurn 0.9.16
; SnapMaker device profile, user origin
; Bounds: X47.48 Y125.23 to X272.52 Y214.77

; # This opening section will be whatever you
; # have in your user start gcode
M425 X0.02 Y0.02 Z0.02 F1 S0

; # This section will change based on whether you 
; # select User Origin, Absolute Coords, or 
; # Current Position when you save the gcode
G0 X0 Y0 F3000

; # But this is where it starts cutting / engraving, 
; # and it will always start with G91, and every
;# move after this will always be based on G91
; # relative positioning.
; Scan+Cut @ 10 mm/sec, 44% power
G0 X1.73 Y-44.7 F3000
; Layer C00
M03 P0 S0
G1 X0.25 F600
M03 P44 S112.2
G1 X97.56
M03 P0 S0

Would you mind posting what device you have set up?

If there’s a way I missed to get it to generate non-relative moves that would be awesome, maybe I just missed a setting?!