Using m42 command to control laser
I'm able to control my laser with M42 p0 S0..1 but I would like to be able to use 0..255 as my range. since most programs use 255 as the max.
This is what is in my config g.
M950 P0 C"exp.heater3" Q2000
M42 p0 S0..1
0=off, 1= full pwr
o_lampe last edited by
jay_s_uk last edited by
@oman737 in laser mode, typically M3 is used to turn the laser "on" and then the S value in G0 and G1 sets the laser power. M5 turns the laser "off"
@jay_s_uk That's what I thought but when I Used the method explained in https://duet3d.dozuki.com/Wiki/Laser_PWM_control it never seems to work. it would tell me that Error: M3: Command is not supported in machine mode Laser. I even tried M571 P"exp.heater3" F200 S255 but got Error: M571: Pin 'exp.heater3' is not free. At this point, I'm not sure where to go.
Here is my config.g file in case I'm missing something.
; Configuration file for Duet WiFi (firmware version 3)
; executed by the firmware on start-up
; generated by RepRapFirmware Configuration Tool v3.2.3 on Fri May 21 2021 12:29:37 GMT-0400 (Eastern Daylight Time)
; General preferences
G90 ; send absolute coordinates...
M83 ; ...but relative extruder moves
M550 P"CR-10" ; set printer name
M918 P1 E4 F2000000 ; configure direct-connect display
M552 S1 ; enable network
M586 P0 S1 ; enable HTTP
M586 P1 S0 ; disable FTP
M586 P2 S0 ; disable Telnet
M569 P0 S0 ; physical drive 0 goes forwards
M569 P1 S0 ; physical drive 1 goes forwards
M569 P2 S1 ; physical drive 2 goes forwards
M584 X0 Y1 Z2 ; set drive mapping
M350 X16 Y16 Z16 I1 ; configure microstepping with interpolation
M92 X80.00 Y80.00 Z1501 ; set steps per mm
M566 X900.00 Y900.00 Z12.00 ; set maximum instantaneous speed changes (mm/min)
M203 X22000 Y22000 Z300 ; set maximum speeds (mm/min)
M201 X2000 Y2000 Z20.00 ; set accelerations (mm/s^2)
M906 X800 Y800 Z800 I30 ; set motor currents (mA) and motor idle factor in per cent
M84 S50 ; Set idle timeout
; Axis Limits
M208 X0 Y0 Z0 S1 ; set axis minima
M208 X300 Y300 Z360 ; set axis maxima
M574 X1 S1 P"xstop" ; configure active-high endstop for low end on X via pin xstop
M574 Y1 S1 P"ystop" ; configure active-high endstop for low end on Y via pin ystop
M574 Z1 S2 ; configure Z-probe endstop for low end on Z
M452 C"exp.heater3" R255 F200 ; Enable Laser mode, on exp.heater3, with max intensity being 255, and a PWM frequency of 200
@oman737 what version of RRF are you using?
@t3p3tony I'm using 3.3
jay_s_uk last edited by
@oman737 are you actually using exp.heater3 as the output?
can you try running
M98 P"config.g"to see if it throws any errors
@jay_s_uk This is what I got
HTTP is enabled on port 80
FTP is disabled
TELNET is disabled
Thank you for all of the help I don't know what it was that made it work but when I ran a gcode that was made in lightburn it worked as it should.
o_lampe last edited by o_lampe