Door magnet safety switch
-
Is there a way to turn off only a laser when an external trigger is detected? I was following this guide https://docs.duet3d.com/en/User_manual/Tuning/Triggers and was able to get an emergency stop but really what I want is for the power to be shut off to my laser and keep the movement going. Is there a way to force my out6 pin (which is the PWM control of my laser) to stay off? I am at a loss. My RepRapFirmware version is 3.4.5 and I am using a Duet 3 Mini 5+ WiFi board. I am also using LightBurn as software that sends my machine gcode and it works just fine. Below is my config.g file.
; Configuration file for Duet 3 Mini 5+ (firmware version 3.4.5) ; executed by the firmware on start-up ; ; generated by RepRapFirmware Configuration Tool v3.3.16 on Sat Apr 15 2023 14:54:17 GMT-0400 (Eastern Daylight Time) ; General preferences G90 ; send absolute coordinates... M83 ; ...but relative extruder moves M550 P"LazerGraph" ; set printer name M669 K1 ; select CoreXY mode ; Network M552 S1 ; enable network M586 P0 S1 ; enable HTTP M586 P1 S0 ; disable FTP M586 P2 S0 ; disable Telnet ; Laser M563 P1 S"Laser" M452 C"out6" R255 F200 ; Enable Laser mode, on out1, with max intensity being 255, and a PWM frequency of 200 ; Drives M569 P0.0 S0 ; physical drive 0.0 goes backwards M569 P0.1 S0 ; physical drive 0.1 goes backwards M569 P0.2 S0 ; physical drive 0.2 goes backwards M569 P0.3 S0 ; physical drive 0.3 goes backwards M569 P0.4 S1 ; physical drive 0.4 goes forwards M584 X0.0 Y0.1 Z0.2:0.3:0.4 ; set drive mapping M350 X16 Y16 Z16 I1 ; configure microstepping with interpolation M92 X80.00 Y80.00 Z80.00 ; set steps per mm M566 X900.00 Y900.00 Z24.00 ; set maximum instantaneous speed changes (mm/min) M203 X9000.00 Y9000.00 Z600.00 ; set maximum speeds (mm/min) M201 X250.00 Y250.00 Z50.00 ; set accelerations (mm/s^2) M906 X800 Y800 Z800 I50 ; set motor currents (mA) and motor idle factor in per cent M84 S30 ; Set idle timeout ; Axis Limits M208 X0 Y0 Z0 S1 ; set axis minima M208 X210 Y190 Z137 S0 ; set axis maxima ; Endstops M574 X2 S1 P"io0.in" ; configure switch-type (e.g. microswitch) endstop for high end on X via pin io0.in M574 Y2 S1 P"io1.in" ; configure switch-type (e.g. microswitch) endstop for high end on Y via pin io1.in ;M574 Z2 S2 ; Z probe M950 S0 C"io3.out" ; Duet 3 Mini 5+ M558 P9 C"io3.in" H5 F120 T6000 ; Duet 3 Mini 5+ G31 X20 Y0 Z137 P25 ; set Z probe offset, trigger height, and trigger value M557 X25:210 Y0:190 S20 ; Heaters M140 H-1 ; disable heated bed (overrides default heater mapping) ; external trigger M950 J1 C"!io5.in" ; Input 5 uses io5.in pin, inverted M581 P1 S0 T0 R0 ; Emergency stop when switch becomes open ; Custom settings are not defined
One more thing, I noticed that M581 only detects edge triggers and was wondering if there is a way to detect level triggers instead. I really appreciate any and all help.
-
@TrafficViolation personally I'd do this in hardware, on my K40 I have a switch on the lid that breaks the circuit to the "water safeguard" input, I've also got this wired in series to a manual switch on the control panel so I can force the laser to be off all the time.
All the best
Barry M -
@CNCModeller Thank you so much for your reply and letting me know what you did. We actually decided to hook up the magnetic switch to the PWM output so the laser will have a duty cycle of 0 when the lid is open. I do think in the future we will also have a manual hardware switch.