@mintytrebor You are fast! I will try new version of plugin tomorrow.
Here is my actual status that still needs some fine tuning.
I really like the flexibility given by the plugin.
@mintytrebor You are fast! I will try new version of plugin tomorrow.
Here is my actual status that still needs some fine tuning.
I really like the flexibility given by the plugin.
Here is a piece of software as DC42 suggested. Thanks! An Arduino Nano is connected to the Panel-Due serial interface. Hidden in a box it works to move the tool head of my CNC-Mill controlled by Duet2 Ethernet.
Arduino is 5 V, Duet2 interface is 3.3V. Serial connection is done via 3,3 V to 5 V level shifter!
This line is added to my config.g : M575 P1 B57600 S0 to set communication without CRC check.
Push button for directions, continuous move(Fortl.), homing and a switch to start jog mode in general are connected to the input pins of Arduino.
Pushing a "direction button" moves the head a step with the configured distance. Pressing the "Fortl.(Continuous)" button simultaneous with a "direction button" moves the tool head continuously as long as both buttons are down.
A "Home" button does the expected job.
Values for distance, feed rate and timers can be modified to match software to your machine.
A limitation at my machine: Continuous moves are singel steps fired continuously by Arduino. First steps fired are slowed down at the end a little bit until enough commands are buffered. Movement sounds a bit strange.
I transferred this code is to Arduino via "B4R" form Anywhere Software. Download of B4R is free.
B4RNanoJog.b4r.txt
B4R needs extension ".B4R". Please remove extension ".TXT" from filname.
Enjoy.
Hermann
@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
@felixh This is my code for testing laser with 1% power. No need to switch to LASER mode. Just directly control pins. Maybe this code helps for testing.
M950 P3 C"nil" ; free P3
M950 P3 C"exp.heater3" Q200 ; Laser control to P3
M42 P3 S0 ; laser control off
M106 P2 S255
G04 P1000 ; Breake stabilizing laser power supply
M42 P3 S0.01 ; Laser on with 1% power
G04 P3000 ; wait 3 seconds, then
M42 P3 S0 ; turn off laser control and power supply
M106 P2 S0
Here are my commands -with my pin configuration- to switch to laser mode:
M950 R0 C"nil" ; free R0, coming fron CMC-Mode, not working properly in the moment
M950 P0 C"exp.heater3" ; M42 P0 S255 Laser Power Supply on, M42 P0 S0 Laser Power off
M42 P0 S0 ; Laser Power Ausschalten
M452 C"exp.heater6" R255 S0 F20000 ; laser uses heater6 pin for control, 255 is max power in M3 SXXX command, not sticky, PWM frequency 20kHz;
Laser power is switched on in Gcode job file.
@phaedrux Please feel free to use code in documentation. In former post I just modified control of Power Supply to the Fan Pin FelixH was using.
here is the macro with my pin out.
M950 P0 C"exp.heater3" ; M42 P0 S255 to switch on Laser power supply, M42 P0 S0 power supply off
M950 P3 C"nil"
M950 P3 C"exp.heater6" Q20000 ; Laser control to P3
M42 P0 S255 ; Laserpower on
G04 P1000 ; Breake stabilizing laser power supply
M42 P3 S0.01 ; Laser on with 1% power
; following lines automatically switch off Laser power and power supply after 3 seconds. You can put M42 XX commands to a separate Macro to switch off laser independently.
G04 P3000 ; wait 3 seconds, then
M42 P3 S0 ; turn off laser control and power supply
M42 P0 S0
My Duet is on 3.4 B7 Firmware on Duet2 Ethernet. The macro works well until i switch to CNC mode defining "exp.heater3" for spindle power. From that moment the heater3 pin is only usable in CNC mode. Leaving CNC mode does not free the pin. No further control in Laser or FFF mode. My only solution is a reboot of Duet.
B.t.w On 3.4 b7 firmware I added following code to config.g :
M950 P0 C"exp.heater3" ; Floating Pin? Define it an switch it off
M42 P0 S0 ; Power Ausschalten
Without putting "exp.heater3" to defined status it seems to be floating and it fires spindle frequently.
I wish you a Merry Christmas.
@mintytrebor true/false input panel would make handling easier to control conditional commands in macros.
@mintytrebor said in BtnCmd-DWC Plugin-Custom Layouts & Buttons - v0.10.02 21-12-21:
Check the object model browser and you will see that the first example is shown in quotes, and the second is not. One is a string the other is a number. A number in a string, is still a string, and will not get modified.
I mentioned that (and also DWC - firing a lot of error messages). The number input works perfect for me. Thank you.
Btw. Colour changing is no a must have. Especially if it is too much work.
I wish you a Merry Christmas.
@felixh This is my code for testing laser with 1% power. No need to switch to LASER mode. Just directly control pins. Maybe this code helps for testing.
M950 P3 C"nil" ; free P3
M950 P3 C"exp.heater3" Q200 ; Laser control to P3
M42 P3 S0 ; laser control off
M106 P2 S255
G04 P1000 ; Breake stabilizing laser power supply
M42 P3 S0.01 ; Laser on with 1% power
G04 P3000 ; wait 3 seconds, then
M42 P3 S0 ; turn off laser control and power supply
M106 P2 S0
Here are my commands -with my pin configuration- to switch to laser mode:
M950 R0 C"nil" ; free R0, coming fron CMC-Mode, not working properly in the moment
M950 P0 C"exp.heater3" ; M42 P0 S255 Laser Power Supply on, M42 P0 S0 Laser Power off
M42 P0 S0 ; Laser Power Ausschalten
M452 C"exp.heater6" R255 S0 F20000 ; laser uses heater6 pin for control, 255 is max power in M3 SXXX command, not sticky, PWM frequency 20kHz;
Laser power is switched on in Gcode job file.
@mintytrebor I would like to add two points to the wish list after a while of testing:
And please no hurry! It is short before Christmas.
@mintytrebor The Global Variable Input Panel works well for me.
Just replaced the Object Mode Value panel. The Input Panel works as both,display and input.
Pressing Enter transfers input to the global variable.
Configured as string input it accepts numbers also. But comas are not converted to dots as in number configuration.
Thanks for the fast modification
@mintytrebor You are fast! I will try new version of plugin tomorrow.
Here is my actual status that still needs some fine tuning.
I really like the flexibility given by the plugin.
@MintyTrebor Thanks for the fast reply.
I will try the workaround. Please no extra hurry. I will be patient.
This plugin is great. I modified DWC1.22 with a lot of effort to make it more suitable for CNC and Laser mode.
With this plugin I was able to nearly "rebuild" former functionality in no time. The only thing I am missing is an option to put a text(number) input to a global variable. Or did I miss something?
Here is the part of a screenshot of the old DWC.
I use a standalone Duet2 Ethernet with Firmware Release 3.4.0 beta 7, Duet Web Control 3.4.0-b7 and BtnCmd-DWC Plugin v0.9.06
@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 ;
@sh12 PWM Vpp is 3,3V Check the link and scroll down: http://nejetool.com/module_20w.html