Welcome! Log In Create A New Profile

Advanced

controlling laser power through PWM

Posted by twofieros 
controlling laser power through PWM
January 13, 2015 05:14PM
I've got my laser working. I can control it through my Azteeg X3 Pro board with Gcode for on and off operation. I cannot for the life of me figure out how to control the power through PWM. I have tried most PWM pins and so far I can only turn it on if I send S128 or higher. Anything below that turns it off. I suspect that it is coming on full power too. Today I tried to hook it up to my fan pin and sending M106 Sxxx but that would only turn it on if I sent s255. s254 turned it off. I'm stumped. Could someone look at the documentation for the laser driver and help me figure this out? It can be found here:

[jtechphotonics.com]

Thanks
Re: controlling laser power through PWM
January 13, 2015 06:52PM
What connections are you using? --- H2/H4 on driver?
What firmware?
Is Fan pin set to varible 12v PWM?
Can you put a scope on it --- look at PWM voltage level and timing (<5kHz)?


The Jtech manual has info

CONTROL SIGNAL AND PERFORMANCE
The input connection provides an optically isolated input for control of the laser diode.  The connection and the
jumper settings were described in the previous sections. The voltage required to turn on the opto‐isolator is 2.8
volts.  The input can handle up to 36 volts.  The input can be cycled with no degradation up to 5KHz.  It will work
with 3.3V, 5.0V and 12V, 24V logic boards from various manufacturers like National Instruments.
Re: controlling laser power through PWM
January 13, 2015 07:50PM
???Power control for what purpose -- engraving???
the current limit on JTech driver set by jumper J1.
so PWM of power input is useless?


This could be of aid.

[www.picengrave.com]

See also
[www.shapeoko.com]

confused smiley
Re: controlling laser power through PWM
January 13, 2015 08:40PM
Quote
cozmicray
What connections are you using? --- H2/H4 on driver?
What firmware?
Is Fan pin set to varible 12v PWM?
Can you put a scope on it --- look at PWM voltage level and timing (<5kHz)?


The Jtech manual has info

CONTROL SIGNAL AND PERFORMANCE
The input connection provides an optically isolated input for control of the laser diode.  The connection and the
jumper settings were described in the previous sections. The voltage required to turn on the opto‐isolator is 2.8
volts.  The input can handle up to 36 volts.  The input can be cycled with no degradation up to 5KHz.  It will work
with 3.3V, 5.0V and 12V, 24V logic boards from various manufacturers like National Instruments.

I am using H2 to control the laser.
I'm running the latest Marlin firmware.
Fan is set to 12V PWM.
I don't have a scope. I wish I did. I'm suspicious the Marlin firmware is now sending a 7kHz signal with PWM. That would be too much for this driver. I just don't know if that would explain the behavior I have. I think it would. I've been digging through the firmware to see if I can somehow change the kHz. I just haven't found it yet.
Re: controlling laser power through PWM
January 13, 2015 08:46PM
I am eventually going to try engraving. My first test ran into a few issues. The biggest one is that I etched my glass bed with this laser and I left marks on my black anodized build plate. I want to make sure I have my power levels set correctly for each material. Using the jumpers only chunk the power in half amp increments. I don't want to have to change the jumpers for each material. I would rather just set the level in Gcode for each material.

The other issue I had with my first test was a timing issue. The laser came on immediately before it reached the point to start. I believe it's a buffering issue. I used M42 to command the laser on which gives an instant response from the printer even if other commands are stacked up in the buffer. I believe inserting a G4 (dwell) command before the laser on will solve this issue. I haven't tested it yet as I want to control the power level first. Then progress from there testing each material for cutting speeds at different power levels. Once I have a chart made for each material I then plan to try the G4 command then some engraving/cutting of acrylics.
Re: controlling laser power through PWM
January 13, 2015 09:32PM
Pulse Width Modulation controls laser output by controlling ON/OFF time.
Not by varying the power. Power is set by jumpers J1
ON time --- long ON pulse --- dwell on point darker burn
OFF time --- long OFF pulse --- laser OFF no burn

Laser position Laser ON time
Raster Scan horizontal scan with Laser ON / OFF

See
[www.mr-soft.net]


3D deeper areas get burned more

confused smiley
Re: controlling laser power through PWM
January 13, 2015 09:48PM
Thanks for clearing that up. I was thinking that was how it worked. I will try to get my hands on a scope. As I'm narrowing down my issue I think it's going to be a timing issue. I think the firmware is just cycling it too fast and I need to slow it down under 5kHz.

So, given it's just turning the laser on and off to vary the cutting time. What is the best way to establish power levels for each material? It seems like it might come down to a cutting speed, combined with frequency it is turned on and off, and finally the jumper positions. I wish there was info out there on where to even start for common materials.
Re: controlling laser power through PWM
January 14, 2015 06:07AM
If you don't have anything to look at the PWM you can at least see if it is PWM by attaching an LED to the line and in a darkened room move something quickly near the LED. If it is PWM you will see the images of the object (finger or straw or similar).

Wave your hand in front of your TV to see what I mean.
Re: controlling laser power through PWM
January 14, 2015 01:16PM
Once again
What do you want to do with the laser? Cutting, Engraving?
Marlin firmware What software to control machine / Laser?

What work flow?
-- Drawing software CAD or Photo software
-- CAM -- convert to machine operations
-- Execute --- control

Seems like lots of GRBL laser solutions out there.



twofieros "I wish there was info out there on where to even start for common materials."
Re: controlling laser power through PWM
January 17, 2015 09:42AM
I want to do engraving and cutting with the laser. For software I use Cura, Simplify 3D, Slic3r, and Kisslicer for slicing. I run the printer with Pronterface or Simplify 3D directly through USB. For designing my models I use Sketchup. I have not tried the engraving programs yet. There are a few I can download a trial for first but I haven't even tried that yet. The cutting model I first drew up was with inkscape and a laser cutter extension. If I can't figure out this PWM then I will probably just piece together a dedicated cutter with an Arduino Uno I have laying around. I really wanted to just use the 3D printer since counter space is limited.
Re: controlling laser power through PWM
January 17, 2015 05:27PM
I don't understand why you are using 3D print software?
Is that the only software the board and firmware will work with?

Put something down to protect your bed
Focus laser on workpiece and cut away at full power
do passes until you cut all the way thru.
With a 1.7W Jtech laser -- 12 passes to cut thru 2mm corrugated cardboard.

Engraving --- another beast.

confused smiley
Re: controlling laser power through PWM
January 18, 2015 09:46AM
If you are using the Azteeg and you are using pin 4 as the output pin then the PWM is hardware controlled by the processor and will be 20,000 Hz or so. In order to use a low frequency PWM you need to use another pin and use software PWM.

Edited 2 time(s). Last edit at 01/18/2015 09:47AM by Mjolinor.
Re: controlling laser power through PWM
January 23, 2015 08:30PM
OK, I got my scope. I think I found the problem. I'm seeing the right frequency output for the controller however, I'm only getting +/- 4mV. It looks like the input voltage has to be at least 2.5V. How do I up the output voltage?
Re: controlling laser power through PWM
January 23, 2015 10:41PM
Huh?
You're using PWM control to control a 12V fan?
Do you have a power supply hooked up to system? What voltage?
12 / 24v to run motors?

Is the frequency < 5Khz.

confused smiley
Re: controlling laser power through PWM
January 24, 2015 05:44AM
Post a picture. Are you using one of the switching MOSFET outputs? IIRC the MOSFETs have their own supply so you need power in on at least two of the connectors, one to run the micro and one to run the MOSFETs
Re: controlling laser power through PWM
January 28, 2015 05:50PM
I'm not sure what photos you are looking for. Here are two showing my oscilloscope. One is the 60Hz frequency I see when trying to get a PWM signal. The other is the 12V signal I have when I max out the signal.



I am using an Azteeg X3 Pro board with Marlin firmware. I have the pan pin set to 11 with is HE8 on my board. This is where this measurement was taken today. The program I used was Simplify 3D and I slid the fan control slider to change the PWM setting. Nothing happened until I went max. That's when I got the 12V. My power supply is an ATX 750W unit from a computer. It's manually wired to power the printer. Everything on the printer has worked fine up until I went to add this laser diode. I've had to ditch the factory firmware and start from scratch. I used to have 5 hot ends now I'm down to two and a laser but that is due to the limitations of Marlin. The source file doesn't support 5 nozzles, only 3.

The factory firmware which is marlin based has a bug in it. When I went to 3 nozzles in the setting it cause the print head to move differently. I lost absolute positioning and I could not get it back. That's when I just scrapped it and started with a fresh Marlin.
Re: controlling laser power through PWM
January 31, 2015 05:19AM
You need to look at the MOSFET input.

I meant a picture of your board showing how it is wired.
Sorry, only registered users may post in this forum.

Click here to login