Duet 3 Mini MPCNC and laser
-
@YYCSparks so, there's a lot of room here for ?
a) are you using a duet3d board? If so, which one?
b) What's your current RRF configuration?
c) what is your design program?
d) is the setup with the router all working?
-
@markz thank you and yes that makes sense.
I am using a Duet 3 Mini with a current version of RRF on it 3.4 if I’m not mistaken.
Yes the router/CNC part all works I can home the machine and run jobs.
I currently use a mix of Fusion360 and Carbide Create for GCode on the CNC side and was planning to use LaserGRBL initially but probably buy Lightburn if things go well. -
-
@YYCSparks Pretty config file : )
So, pretty much you want to define another "Tool" that is the laser and then programmatically switching tools will use the laser instead of the router.
Here's your current tool code (note this is tool 0, not 1):
; Configure CNC Outputs M950 R0 C"out6" L0:24000 ; Create spindle index 0, with PWM pin on OUT 9 and Supports range 0-24000 RPM ; Configure Tools M563 P0 R0 S"spindle1" ; define tool 1 with spindle 0 G10 P0 X0 Y0 Z0 ; set tool 1 axis offsets T0 ; select tool 0
So, to add the laser, in your case I'd give it a fake range of 0:24000 (to match your spindle) and then on==24000.
;Configure Laser Pin M950 R1 C"idontknow" L0:24000 ; define spindle 1 pin ;Configure Laser Tool M563 P1 R1 S"laser" ;define tool 1 named laser using spindle 1 pin G10 P1 X0 Y0 Z0 ; set tool 1 axis offsets
So, you get the pin association matching where the laser is hooked up, this should work programmatically by just switching tools in RRF.
Where to hook the laser up:
You have outputs 3,4,5 all available. They should all work depending on the laser relay current requirements or drive an SSR like the spindle.
-
@markz thank you for the information.
Given that I am just using out6 to turn the CNC on and off with no PWM control would it be better to move the Spindle to another pin and then use this for the laser:
-
@YYCSparks I'd leave the spindle where it is. You just need a spare pin for the laser, of which you have at least 3 - use out5. Then use the M950 to tell RRF which pin the laser is connected to. My impression is that you wanted a 12V output and the one you're pointing at is 5V.
The fact that they name one pin for laser doesn't mean it has to be used for it. I think they do this because it's the only 5V PWM pin - but you don't need 5V.
-
@markz Yes you are right I need a 12 volt not a 5 volt so I will more forward with your recommendation.
Thank you for your time and advice.
-
@markz sorry, silly question but where do you switch the Tool in use?
As well I would really rather not fry my laser or board so if this is my laser and the cable I have in the image below.
Then I need to connect the Red and Black to a 12volt power source as I am using a 24volt supply so I will need a buck converter to bring that down to 12volt correct.
Then the yellow PWM wire to the v_outlc2+ pin? -
@YYCSparks Usually the tool switch is done as part of the manufacturing software. So, in Fusion360 if you have it machine more than one step and the steps use different tools then it will automatically generate the tool switching code in-line in the gcode. The tool definition includes a tool number.
Here's a piece from my Fusion360 manufacturing tab showing the tool number and offset options.
As for the 24V to 12V thing, hmmm - if you are only sending DC voltages (on/off) then a DC converter would be fine. It won't work for PWM if the laser requires that since it can't switch that fast.
-
@YYCSparks most likely the PWM wire needs a TTL level signal, in which case the LASER/VFD output on the Duet 3 Mini would be suitable; but check with the datasheet for the laser module.
-
@YYCSparks If you haven't looked at it yet, I'd recommend looking at:
https://docs.duet3d.com/en/User_manual/Machine_configuration/Configuration_laser
-
Thank you both @markz and @dc42 for you help and advise.
After checking the VFD ports looks to do what I want it to for the PWM control so I followed the Guide that Mark posted about setting up a laser.I moved the spindle SSR control to out5 and setup this in my config:
M452 C"out6" R255 F200
In the guide it lists the Frequency at 200, is there a way to tell what this is on the laser?
I think I am pretty close so I apricate the help.
Also it looks like CNC and laser modes are two seperate things, if so what or how would you setup the machine swap back and forth? -
@YYCSparks Usually the machine will swap back and forth under control of the manufacturing application (Fusion360). When you're using a laser it sends the laser command to RRF during the job.
You can do this more manually by setting the laser manually and not having the manufacturing app do any laser setting.
There are lots of intro Youtube videos about using a laser with Fusion360.
I use MPCNC as the Fusion360 postprocessor. It's slightly out of date for RRF.
It uses these two (old RRF) lines to set the CNC Mode ->
DuetMillingMode: "M453 P2 I0 R30000 F200", // GCode command to setup Duet3d milling mode DuetLaserMode: "M452 P2 I0 R255 F200", // GCode command to setup Duet3d laser mode
In my copy of mpcnc I've got them commented out, but you could use them updated for RRF 3. The new version commands are:
// GCode command to set Duet3d milling mode M453 // GCode command to set Duet3d laser mode .. laser uses out5 pin inverted, PWM frequency 200Hz M452 C"out5" F200
I don't really understand the interaction between this setting and the 'spindle' definition.
-
@markz that's funny my setup is an MPCNC as well and I have used it for CNC work and thought I had a reasonable handle on things but getting this laser going had me stumped for sure so thank you very much for the help.
So I hadn't really thought if using the laser for cutting I was looking at it more for engraving and I didnt even really think about the fact I could use Fusion360 to create the GCode for that, while it can cut and I can see that, can it engrave? I have not found any examples of using it for that work.
Okay so I have a Macro setup now as I am using Extruder 0 to send 12volts to the laser and then the out 6 pin to control the laser so I have a Macro like this:
Laser On:;Turn On Laser and set Laser Mode M291 P"Turning on the laser standby, make sure you have saftey glasses." R"Warning" S3 ; screen message M42 P2 S1 M452 C"out6" R255 F200 ; Enable Laser mode, on out6, with max intensity being 255, and a PWM frequency of 200
Laser Off
;Turn Off Laser and set CNC Mode M291 P"Turning off the laser standby, and going back to CNC mode." R"Warning" S3 ; screen message M42 P2 S0 M453
-
@YYCSparks I've never had a laser on my CNC so don't have any idea how yours is wired nor the interaction with the M452 and MPCNC. If you'd like to post the Laser model I'll take a look at their doc, but someone with a laser would know this better.
-
@markz its alive, Thank you for your help and advice.
https://youtube.com/shorts/x23cIedPRH4?feature=share
Jesse