NEJE-like Laser as CNC upgrade
-
@FelixH While the WorkBee does currently use RRF2 (2.0.3 I think, though it should be okay to use 2.05.1), I don't think there's anything in RRF 3.1.1 that breaks the compatibility, other than updating fans, endstops, thermistor and heater (if used) assignments in config.g (and possibly a few other codes). I haven't tested the WorkBee DWC, but DWC 1.22.6 works for me in RRF 3.1.1 with Duet 2 WiFi, on which the WorkBee interface is based. So you could create another folder to hold a RRF 3.1.1 config, and try it out, and you can always just flash firmware back to RRF2 as needed.
Ian
-
@FelixH said in NEJE-like Laser as CNC upgrade:
- If I understand that correctly, the laser I ordered accepts 3v3 PWM signals, so I do not know if I need to prepare a breakout board as the one described there.
I use my Duet2 Ethernet running Firmware Version 3 without breakout board to control same laser as you ordered. The Laser needs 12V Power supply continuously and Laser beam is controlled by PWM-signal.
Heater 3 pin controls Spindel- and Laser Power. Heater 6 pin is output of Laser PWM signal.
This is my code to switch to laser mode:
; Configuration file for Duet Ethernet (firmware version 3.1.1) ; executed at Startup of Laser mode ; ; G54 ; 1. Koordinatensystem anwählen M208 X550 Y1200 Z230 S0 ; Set axis maximum ; M453 C"nil" ; CNC-Modus Pin für Spindel abwählen M950 P0 C"exp.heater3" ; M42 P0 S255 schaltet Laser Spannungsversorgung ein, M42 P0 S0 schaltet aus M42 P0 S0 ; Laser Power Ausschalten M452 C"exp.heater6" R500 S1 Q20000 ; laser uses heater3 pin, PWM frequency 100Hz; ; ; Tools M140 H-1 ; Heizbett aus M563 P0 D-1 H-1 ; Tool0 abwählen M563 P1 D-1 H-1 ; Tool1 abwählen M563 P0 S"Laser" ; Define tool 0 G10 P0 X-7 Y-45 Z-68.5 ; Set tool 0 axis offsets vs. Headposition -68.5 Z-Achse Nullpunkt (Laser Fokus) T0 M42 P0 S0 ;Laserpower aus nach Werkzeuganwahl.
This code switches to CNC-Mode
; Configuration file for Duet Ethernet (firmware version 3.1.1) ; executed at start-up of CNC mode ; ; G54 ; 1. Koordinatensystem anwählen M950 P0 C"nil" ; falls Laser-Modus Aktiv war, Pin freigeben M453 C"exp.heater3" R500 ; spindle forward on heater 3 pin, R=Max Spindeldredzahl ; Tools ;M140 S-274 ; Heizbett aus M140 H-1 ; Heizbett aus M563 P0 D-1 H-1 ; Tool 0 abwählen M563 P1 D-1 H-1 ; Tool 1 abwählen M563 P0 S"Spindel" ; Define tool 0 G10 P0 X0 Y0 Z0 ; Set tool 0 axis offsets vs. Headposition M208 X550 Y1200 Z230 S0 ; Set axis maxima
Switching between modes I have to redefine Heater 3 pin.
G-code at beginning of work file is:
G90 T0 M42 P0 S255 ; switches Laser Power on G04 2000 ; wait until Laser power is stabilised M05 G55
trailing code is:
M05 G04 3000 T-1 M42 P0 S0 G54 G0 X5 Y5 Z220
-
@radiomodell thanks a lot for the info! I'm assuming you have these snippets set in macros, right?
So, if I get it correctly, if you have the Bed pin to control both the spindle and the laser, it means that you have to wires coming out of each terminal, so to say?
Another question, the snippet
M42 P0 S255 ; switches Laser Power on
What does it do exactly? Does it power the Laser's PSU via a relay? Because to enable the laser or spindle the M3 command is used with a Sxxx on the movement codes, right?
Vielen Dank nochmals!
-
@FelixH You can use these snippets in macros with firmware version 3. And I selected different I/O pins. Heater3 pin controls one solid state relais. Spindel and laser power supply are both connected to the 230V sockets controlled by relais. Heater6 pin controls laser PWM.
In Laser mode line 9 M950 P0 C"exp.heater3" defines heater3 pin to be controlled by M42 P0 SXXX command . 0 off, 255 on. Laser PWM is defined in line 11: M452 C"exp.heater6" R500 S1 Q20000. Just mentioned wrong comment in line 11. PWM frequency is 20KHz, not 100 Hz. Sorry for that.
Same pin controls spindel on/off in CNC mode. Thus I have te redefine pin in CNC-mode. To CNC mode in line 6 definition is released. In line 8 spindle control is "connected" to heater3 pin. Now in CNC mode it is switched by M3 command. -
Thanks again @radiomodell . It's a lot of info right now, I shall look at in with more detail once my laser arrives. I am still on RRF 2, so I will have to adapt. I also ordered the components to build the breakout board. Just in case...
-
@radiomodell , not to hijack this thread but I am running into the exact same thing. I have the NEJE laser module but cannot get it to be controlled via pwm. It is always at full power. Can you tell me exactly how you have it wired?
I have 12v supply going to 12v, and Gnd pins. Then I have the duex fan6 pwn pin and fan6 gnd pin going to the laser pwm and temperature (or gnd) pins.Looks like you may be able to walk me through this if you're willing.
-
@radiomodell said in NEJE-like Laser as CNC upgrade:
M452 C"exp.heater6" R500 S1 Q20000 ; laser uses heater3 pin, PWM frequency 100Hz;
@radiomodell @FelixH @sh12 Please note 'Q' parameter is incorrect, it should be 'F' for PWM frequency. The example in the Gcode dictionary for M452 was incorrect, but has now been fixed, thanks to @Royassas (see https://forum.duet3d.com/post/168234)
So @radiomodell, you're probably using a PWM frequency of 500Hz, which is the default!
Ian
-
@droftarts said in NEJE-like Laser as CNC upgrade:
So @radiomodell, you're probably using a PWM frequency of 500Hz, which is the default!
Thanks a lot for the hint! Laser worked fine til now. I will correct M452 command before next use.
-
@sh12 As far as I know, expansion board pins are at 5V level. please check your documentation and use a level shifter to connet laser PWM-pin with 3.3 volt.
When using Fan6-PWM Duex output pin following command should do initialization: M452 C"duex.fan6" R500 S1 F20000 . R- parameter sets 100% value of S-Parameter in M3 command. M3 S500 is 100%, M3 S250 is 50%. Dependent on source of G-code i adjust R-Parameter.
My PWM signal input is connected to Heater6 pin on expansion connector of my Duet2. Thus I use this command M452 C"exp.heater6" R500 S1 F20000.
-
@radiomodell Thanks,
Even though the specs on the laser says the pwm will work on 3.3 to 12v, I will connect it to a heater pin today and change the Q to F. -
@sh12 PWM Vpp is 3,3V Check the link and scroll down: http://nejetool.com/module_20w.html
-
@radiomodell said in NEJE-like Laser as CNC upgrade:
@sh12 PWM Vpp is 3,3V Check the link and scroll down: http://nejetool.com/module_20w.html
Thanks @radiomodell . If you go down a little further in the notes it says this:
Is the power adjustable: PWM can be adjusted, PWM: 50KHz-20KHz / 3.3V-12V
I had even contacted the seller to verify and he assured me that it was from 3.3 to 12.Anyway I duplicated your setup and YAY, it is working! So thanks again. Now to focus it and figure correct speed.
Do you know if the firmware was ever updated to allow the laser to be on without the G1 command first for focusing purposes? I saw a thread where David was talking about that. -
@sh12 Firmware fires laser only when moving by G-command. Thus for focus operation I terminate Laser Mode (M452 C"nil") and put a PWM signal manually. (M950... etc ).
M452 C"nil" ; Laser vom automatischen Einschalten bei Bewegung trennen M950 P3 C"exp.heater6" R255 F20000 ; Laserleistung auf P3 umschalten M42 P0 S255 ; Laserpower einschalten G04 P1000 ; Pause, bis Laserpower stabilisiert ist M42 P3 S0.01 ; Laser mit 1% Leistung einschalten
Please be careful! Laser i continuously on and burning on one point!
After focusing laser I use following commands to switch back to normal laser mode:
M42 P3 S0 ; Laser aus G04 P500 ; kurze Pause M42 P0 S0 ; Laserpower aus M950 P3 C"nil" M452 C"exp.heater6" R255 S1 F20000 ;
-
I was referring to this thread
https://forum.duet3d.com/topic/15826/behavior-of-m3-command-im-laser-mode-m452
where @dc42 said there was a request to have a laser mode available for focus. Was just wondering if it ever went anywhere.
Oh well, at least I have it working now. That was the major hurdle. -
Hello and sorry for editing this topic but I'd like to ask to @FelixH or @sh12 or some kind friends here to help me with the same setup (workbee, duet2 wifi, neje 20w). I can't get rid of it knowing how to wire and how to change the right settings/macros or flashing to RRF3 or making the special inverter board.
Maybe on my personnal mail box or a new topic ?
what's the best way ?
Sorry but i come from Grbl world -
@g0rg to be honest, I have been incredible busy the last few months to even considering doing the upgrade... last thing I did was to design a small PCB to connect the laser. It is more or less the same as described in the Duet Wiki, but for through hole components. I shall be able to get into it in a couple of weeks. My setup is still the same: Workbee with Duet, running the latest Ooznest version of the firmware. I guess it is a standard RRF2, but I don‘t know. I am guessing the folks at Ooznest only changed the Web Interface to make it more CNC-friendly, which makes me think if I should update to RRF3 or not.
-
@FelixH from what I gather Oozenest is working on a RRF3 update.
-
@Phaedrux cool! I‘m looking forward to it. With some luck they will incorporate the autosquare feature, if I’m not mistaken it should be easier with RRF3
-
@bearer said in NEJE-like Laser as CNC upgrade:
a little OT, but M997 ignores M505 or is it just me?
Yes, M997 always looks in /sys, and uploads of .bin and .uf2 files always go into /sys.
-
@FelixH I already setup my workbee with autosquare on homing by adding a second switch on Y axis.
As a test purpose i updated a second duet wifi board with RRF3 and i still try to understand how to wire my laser and still try to understand how to spell the fan port i would like to use maybe a help from @sh12