GCODE does not turn off laser between travels ($32=1)?

Hi All,
I have two simple squares drawn on LB and a volt meter over my PWM output which will eventually drive a co2 laser. Between the move from the first to the second square the PWM signal stays on. All my searches say $32=0. But I definitely have $32=1.

Here’s the generated gcode, I don’t see where S=0 until the end ?

; LightBurn 1.4.00
; GRBL device profile, current position
; Bounds: X0 Y0 to X177.87 Y41
G00 G17 G40 G21 G54
; Cut @ 50 mm/sec, 50% power
G0 X0Y2.5
; Layer C03
G1 Y30S50F3000 ;power set to 50%
G1 X30
G1 Y-30
G1 X-30
;second square
G0 X59.479Y-1.5 ;laser stays on during this travel
G1 Y40
G1 X40
G1 Y-40
G1 X-40
G0 X118.394Y-1
G1 S0 ;power set to 0%
; return to starting pos
G0 X-177.873Y0

Here’s my GRBL params:
















































If I use GRBL-M3 it works as expected- the PWM voltage is 0 between moves. Have I missed something simple ? I am using GRBL ESP32 1.3a- the latest version.


It’s likely that your firmware is not compiled with variable spindle or otherwise is not configured to enable laser mode ($32=1).

Im pretty sure it is: at 50% power I get 2.5Volts over the PWM output and at 100% I get 5 volts and $32=1- you can see that in the grbl params posted. Further nothing I see in the GCODe is actually turning off the laser

Here’s the relevant part of my machine config file-

// Laser pin set
#define SPINDLE_TYPE SpindleType::PWM

#define DEFAULT_LASER_MODE 1 // true

Thanks for your inpu

Power level and on/off are different settings from memory some controller cards only allow changes to certain settings, maybe that is the problem here

Can you run $I in Consoel and return output?

Have you measured voltage at 0% power?

In laser mode G0 traversal moves should not burn when using M4. G1S0 moves should similarly also not burn.

What specific GRBL implementation are you using?

Power at 0% is 0V.

Thanks, yes I looked up the grbl docs more thoroughly and G0 should turn off the laser power so that explains the gcode part of my post

It’s grbl esp32 by bdring on an MKS DLC32 v2.1 (I removed the stock MKS firmware)

That’s an interesting point thanks for the suggestion

I changed
#define SPINDLE_TYPE SpindleType::PWM to
#define SPINDLE_TYPE SpindleType::LASER
and it works as expected now, I suspect SpindleType::PWM is for CNC spindles which shouldn’t turn off during travels. Pretty silly mistake on my part :confused:

Thank you @Wyked and @berainlb for your assistance, much appreciated.


Some times he obvious is hard to see, glad its sorted.

1 Like

Glad it’s working.

Can you run $I in Console and return output?

I’d like to see the configured options now.

1 Like



[MSG:Using machine:MKS DLC32 Sparks V0.4]



Here you go @berainlb



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