Setting up for laser using M452 / M3 on heater 7 PWM output
-
I've just completed setting up a macro to set the Duet Wifi to operate the spindle with M3 S# and M5 commands. What I'm now trying to do is drive a laser module via the same PWM output on heater 7 (expansion breakout board). Here is the macro I run -
; LASER SETTINGS
M563 P0 D-1 H-1 ; clear tool
M563 P0 D0 ; create a tool - no heaters
M307 H6 A-1 C-1 D-1 ; Clear Heater 7
M452 P6 R255 F200 I0 ; switch to laser mode using Heater 7 PWM to control the laserAfter this I was expecting the PWM to be zero after running M3 S255 and then the PWM would go 100% only during a G1/G2/G3 move. Instead the PWM goes 100% when I run M3 S255 and then goes to zero when I do a feed move or a rapid move. The only way to get PWM 100% back again is to run M3 S255 again but any moves turn it back off.
I was hoping to avoid using extrusion calls in the move commands along with the M571 P6 F200 S1 I0 option as the M571 option remains active even after flicking back to CNC mode.
What I want -
M3 S255 ;laser enabled and ready to go full power but not on
G0 X100 Y100
;laser still off
G1 Z0 ;laser on only during G1 feed
G1 X200 Y200 F1000 ;laser only during G1 feed
;laser off
G0 X100 Y100
M5 ;laser disabledWhat I get -
M3 S255 ;laser enabled and turns on
G0 X100 Y100 ; laser turns off at start of rapid move
G1 Z0 ;laser remains off
G1 X200 Y200 F1000 ;laser remains off
G0 X100 Y100
M5 ;laser disabledAm I misinterpreting how M452 laser mode works?
Firmware Name: RepRapFirmware for Duet 2 WiFi/Ethernet
Firmware Electronics: Duet WiFi 1.02 or later
Firmware Version: 2.02RC1(RTOS) (2018-08-31b4)
WiFi Server Version: 1.21
Web Interface Version: 1.22.3 -
Laser mode in firmware 2.01 and later expects G1 commands to include a S parameter to set the laser power. See the upgrade notes for firmware 2.01 and 2.02.
-
Thanks David, I'll give that a go tonight. I assume M3/M5 won't be needed if I include the S parameter on each G1/G2/G3 move? Without the S parameter the laser won't fire?
-
Without the S parameter, the same S parameter will be used as for the previous G1/G2/G3 move. I originally wrote it so that no S parameter means S0 because that would be safer; but it seems that GCode file generators for laser cutters expect the S parameter to be remembered.
-
@dc42 said in Setting up for laser using M452 / M3 on heater 7 PWM output:
Without the S parameter, the same S parameter will be used as for the previous G1/G2/G3 move. I originally wrote it so that no S parameter means S0 because that would be safer; but it seems that GCode file generators for laser cutters expect the S parameter to be remembered.
Here is a sample gcode renerated with lightburn:
; LightBurn 0.9.18 ; GRBL device profile, current position ; Bounds: X0 Y0 to X10 Y10 G00 G17 G40 G21 G54 G91 M4 ; Cut @ 1500 mm/min, 100% power M8 G0X0Y0 ; Layer C15 G1Y10S255F1500 G1X10 G1Y-10 G1X-10 M9 G1S0 M5 ; return to starting pos G0 X0Y0 M2
As you said in reply above, the laser should stays on for all the G1 lines but this is not the case and i would like to understand why ?
my board is here:
Firmware: RepRapFirmware for Duet 2 WiFi/Ethernet 3.1.1 (2020-05-19b2)thank you for your help achieving this , if possible.
-
I just missed the S1 parameter in my M452 command