Problem getting a laser to work
-
I have read all of the posts relevant to getting a laser to work.
I must admit that my 71 year old brain had difficulty understanding the wiki and g codes.
I followed the instructions "Controlling a PWM Laser with the Duet Board", after wiring as per instructions I could not get it to work at all. I think I have something wrong in the config file:-
M555 P2 ; Set output to look like Marlin
G21 ; Work in millimetres
G90 ; Send absolute corrdinates...
M83 ; ...but relative extruder moves
M574 X1 Y2 S1 ; set endstop configuration (Y endstop only, at high end, active high)
M92 X87.4890 Y87.4890 Z4000 ; Set axis steps/mm
M92 E430 ; Set extruder steps per mm
M906 X950 Y950 Z950 ; Set motor currents (mA)
M201 X500 Y500 Z15 ; set accelerations
M203 X9000 Y9000 Z100 ; set maximum XYZ speeds
M566 X300 Y300 Z30 ; Maximum instantaneous speed changes mm/minute
M208 X200 Y200 Z190 ; set axis maxima
M208 X0 Y0 Z0 S1 ; set axis minimum (adjust to make X=0 the edge of the bed)M307 H3 A-1 C-1 D-1 ; Disable Heater output on H3
M452 H3 R255 F200 : Enable Laser mode on output 3 (heater 3) max intensity 255 PWM frequency 200
M571 P3 F200 S255
M563 P0 D0 H3 ; Define tool 0 uses heater 3M558 P0 ; No Z probe installed
M302 P1 ; disable the "do not extrude when cold" function
G92 Z0 ;fake Z homed
M564 S0 ; allow Z below Z=0
T0 : select tool 0So I thought I would try and connect to Fan0, this worked in so far as if printing a filled square the Laser would switch ON at the square edge and then immediately OFF. This happens on both edges. Also the power seems to be low, it's not even marking a sheet of paper.
This is the config for the Fan0 setup:-
M555 P2 ; Set output to look like Marlin
G21 ; Work in millimetres
G90 ; Send absolute corrdinates...
M83 ; ...but relative extruder moves
M574 X1 Y2 S1 ; set endstop configuration (Y endstop only, at high end, active high)
M92 X87.4890 Y87.4890 Z4000 ; Set axis steps/mm
M92 E430 ; Set extruder steps per mm
M906 X950 Y950 Z950 ; Set motor currents (mA)
M201 X500 Y500 Z15 ; set accelerations
M203 X9000 Y9000 Z100 ; set maximum XYZ speeds
M566 X300 Y300 Z30 ; Maximum instantaneous speed changes mm/minute
M208 X200 Y200 Z190 ; set axis maxima
M208 X0 Y0 Z0 S1 ; set axis minimum (adjust to make X=0 the edge of the bed)M452 P0 R255 F200 : Enable Laser mode on fan0 max intensity 255 PWM frequency 200
M571 P0 F200 S255 ; Set output on extrude
M106 P0 S0 I0 F500 H-1 ; Set fan 0 value, PWM signal inversion and frequency. Thermostatic control is turned off
M563 P0 D0 H3 ; Define tool 0 uses heater 3M558 P0 ; No Z probe installed
M302 P1 ; disable the "do not extrude when cold" function
G92 Z0 ;fake Z homed
M564 S0 ; allow Z below Z=0
T0 : select tool 0I am totally confused now and in need of detailed help.
Thanks -
@appjaws said in Problem getting a laser to work:
M307 H3 A-1 C-1 D-1 ; Disable Heater output on H3
M452 H3 R255 F200 : Enable Laser mode on output 3 (heater 3) max intensity 255 PWM frequency 200
M571 P3 F200 S255
M563 P0 D0 H3 ; Define tool 0 uses heater 3The first 2 lines look OK to me if the laser is driven from the heater 3 output. The M571 and M563 lines should be removed.
M452 P0 R255 F200 : Enable Laser mode on fan0 max intensity 255 PWM frequency 200
M571 P0 F200 S255 ; Set output on extrude
M106 P0 S0 I0 F500 H-1 ; Set fan 0 value, PWM signal inversion and frequency. Thermostatic control is turned off
M563 P0 D0 H3 ; Define tool 0 uses heater 3P0 means the heater 0 pin, not fan 0.
-
Thanks dc42
Is the following all I need to define that the laser should work PWM from Fan0?
M106 P0 S0 I0 F500 H-1 Is the only reference to -
No, you need I-1 in the M106 command to disable the fan and make the pin available as a general purpose output pin. And of course P20 in the M452 command.
-
Well I made the changes as suggested and am getting the following errors:-
Error: M106: Fan 0 is disabled
Error: Attempting to extrude with no tool selected.This is the config:-
M555 P2 ; Set output to look like Marlin
G21 ; Work in millimetres
G90 ; Send absolute corrdinates...
M83 ; ...but relative extruder moves
M574 X1 Y2 S1 ; set endstop configuration (Y endstop only, at high end, active high)
M92 X87.4890 Y87.4890 Z4000 ; Set axis steps/mm
M906 X950 Y950 Z950 ; Set motor currents (mA)
M201 X500 Y500 Z15 ; set accelerations
M203 X9000 Y9000 Z100 ; set maximum XYZ speeds
M566 X300 Y300 Z30 ; Maximum instantaneous speed changes mm/minute
M208 X200 Y200 Z190 ; set axis maxima
M208 X0 Y0 Z0 S1 ; set axis minimum (adjust to make X=0 the edge of the bed)
M452 P20 R255 F200 : Enable Laser mode on fan0 max intensity 255 PWM frequency 200
M106 P0 S0 I-1 F500 H-1 ; Set fan 0 value, PWM signal inversion and frequency. Thermostatic control is turned offM92 E430 ; Set extruder steps per mm
M558 P0 ; No Z probe installed
M302 P1 ; disable the "do not extrude when cold" function
G92 Z0 ;fake Z homed
M564 S0 ; allow Z below Z=0
T0 : select tool 0What am I doing wrong?
-
If you have laser mode selected using M452 then you should not be trying to extrude. Laser mode uses M3 to set the laser power.
Is this an existing system that was using M571 to control a laser and you just want to upgrade the firmware, or is this the first time you have connected a laser to a Duet?
-
Thank you so much, I now understand and can report that using M3 to control the laser works.
I knew it was my lack of understanding.This is a new installation of a laser onto my ormerod using Duet 6
-
I have something very strange.
M3 S255 turns the laser OFF as does M3 S0
It appears that the maximum power is around M3 S127 -
@appjaws said in Problem getting a laser to work:
I have something very strange.
M3 S255 turns the laser OFF as does M3 S0
It appears that the maximum power is around M3 S127Try lowering or increasing the PWM frequency with the
M452
F
parameter. Some of the laser module controllers are a bit picky. You can also use theR
parameter ofM452
to set the PWM level that corresponds to max, so in your case,R127
. -
I tried changing the frequency but could not see any improvement.
I am currently using M3 S107 as my maximum power.
It works but I would prefer to have 255 levels of power, especially engraving photos.
Any other ideas as to how I can use the full range? -
@appjaws which laser and laser control board did you buy?
Most of them use a "simple" PWM signal between 0-5V to control the laser intensity.I doubt that your laser really has a 50%-ish PWM signal as "full power" signal...
-
I've just measured the voltage on the Fan0 pin and it is fluctuating between 5.5V - 10.7V.
Do you think I am over driving the PWM input?
The problem I had no information supplied with the 2000mw laser and control board that I bought.
I have tried to find out the correct voltage but was unsuccessful.This is a picture of the laser I bought
-
@appjaws said in Problem getting a laser to work:
I've just measured the voltage on the Fan0 pin and it is fluctuating between 5.5V - 10.7V.
Do you think I am over driving the PWM input?
The problem I had no information supplied with the 2000mw laser and control board that I bought.
I have tried to find out the correct voltage but was unsuccessful.The ones I've seen have all been 5v PWM controlled, so maybe you're over-driving? Do you have a link to where you bought it? And/Or some high res images of the top+bottom of the PCB?
-
I bought it on ebay and the supplier has no information.
I could take some photos of the board but I will need to dismantle my setup first.
I wonder what size of resistor I could connect in series to reduce the actual voltage reaching the control board -
Me, and others here on the forum use the HEATER_3 pin with a few extra components, instead of the fan output. Somebody even made a custom PCB for it.
-
I did start with that plan but could not get my lashup to work. I now have a better understanding so perhaps I'll try heater 3 again.
Thanks for your help. -
I still haven't got the heater 3 solution as explained in the article "Controlling a PWM Laser with the Duet Board" The diagram indicates that the expansion header pin 8 is heater 3 but I have a constant 3.29 volts between that and pin 2 which is grd.
So I am wondering if the old version 6 boards, which I am using, have the same pin assignments as the version 2 boards.So I have reverted to using the fan connector with the output reversed and a pull-up 1K resistor connected to +5V.
This is the results of checking the voltage at different S values.
Svalue Voltage Laser
0 4.4
10 2.58
11 2.47
13 2.33 ON
15 2.27
20 2.19
40 2.05
60 1.97
80 1.88
100 1.77
120 1.64
140 1.51
160 1.39
180 1.27
200 1.14
220 1.08
240 0.87
250 0.78
252 0.77
254 0.75
255 0.74 OFFThe increasing S values at the top end result in the power of the laser reducing.
Clearly I have something wrong but I am at a loss as to what to do next. -
@appjaws said in Problem getting a laser to work:
So I am wondering if the old version 6 boards, which I am using, have the same pin assignments as the version 2 boards.
By this, do you mean this board? - https://reprap.org/wiki/Duet_Wiring#Duet_0.6
-
yes that is the original board on my ormerod
-
@appjaws said in Problem getting a laser to work:
yes that is the original board on my ormerod
In that case, yes, the pinouts are different. I'm not sure if the circuit will need modification or not on there either.