Alternative Wiring and Setup to Standard Config (Duet 2).
-
I set out to build a laser cutter out of scraps I had lying around. I ended up using a spare Duet 2 Wifi board thanks to RAMPS 1.4 being a nuisance to program (known ATmega 2560 com issues)...
Anyway, where this landed me was on the standard setup guide for lasers on Duet 2. I found the guidance around laser control a bit sparse so have documented what I did.I met the "assumptions" as outlined on the page and this alternative setup guide assumes you do too. These are:
- Your laser runs on 12v
- Your laser requires a 5v active-high PWM
You want to control the laser with M3 and M5 commands(this one seems deprecated)- You have a laser module
- You have a Duet 2 or Duet 3 board
The guide then tells you to either use one of the breakout/expansion boards or some other hardware to match the 3V3 logic level of the Duet 2 with the 5V PWM requirement of the laser.
I had intended to test using a logic level shifter but in the meantime followed these steps and got it working:- Moved the Fan Voltage jumper to use inbuilt 5V instead of Vin. Confirmed this with MultiMeter
- Plugged the 5V PWM wire onto the PWM pin of Fan 0
- Added the following line to config.g:
M452 C"!fan0" F500 R255 S0 ; configure Laser port
C (pin select) - This uses the Fan0 PWM pin but inverted as it is designed to PWM from the negative line of an attached fan (hence why the other Fan0 pin reads 5V as it is Vout). As ground is all tied together this isn't floating under load
- Wired up my laser's power connectors to the 12V PSU
- Put visor on, plugged in the machine and ran a test G1 S255 line
So far this has been operating very nicely and I haven't had to buy any extra hardware. If anyone has good reason not to do this I will update the post to reflect the discussion below.
-
@SamanthaJaneyCake that wiring has the disadvantage that when starting up, the laser is likely to be turned on until the command to configure the laser port has been processed in the config.g file.
Duet 3 boards have a laser/vfd output that is inactive (i.e. low) while the board is initialising.
-
@dc42 A valid concern. Two potential solutions/mitigations:
- Put laser config at very start of config file
- Put a 4.7k pulldown between PWM and GND
Upgrading to Duet 3 falls outside of the design intent (to use almost exclusively parts lying around my flat).
-
@SamanthaJaneyCake said in Alternative Wiring and Setup to Standard Config (Duet 2).:
Put a 4.7k pulldown between PWM and GND
That either won't work or will stop the laser from turning on at all.
-
@dc42 right you are.
Well, the safe solution would be to put in a manual switch that requires activation before a job. Or… if you’re me… live with it. Good reminder to get your visor on before power up anyway. -
Even better solution: I hooked up the power wires for my laser to the bed heater output and made that a GPIO that I then turn on and off via gCode.