Welcome! Log In Create A New Profile

Advanced

Laser cutter/engraver needs 5v PWM - I use Marlin and MKS GEN 1.3

Posted by fabrini 
Laser cutter/engraver needs 5v PWM - I use Marlin and MKS GEN 1.3
August 26, 2016 02:17PM
Hi there,

I've just baught a laser unit which needs 5v PWM hooked to an analog output. The guys that sold me the unit instructed me to use the D9. The thing is the D9 is powering the laser head with 12v as soon as I turn the printer on. And now they don't really know how to guide me.

Researching here and there I figured that I could use some auxiliary output from the board (MKS GEN V1.3).

Maybe one servo output.

Could someone help me out here, please?

I found this Marlin that seems to work on the way I described, using the servos. GITHUB

Thank you so much for your help.
Re: Laser cutter/engraver needs 5v PWM - I use Marlin and MKS GEN 1.3
August 26, 2016 02:45PM
I configured my RAMPS to use an AUX port instead of D9, but the problem still is the same. The pin is pulled up ( high ) during startup.
The only thing I could think of, is to cut off the 12V supply to the Laser driver with a safety switch. ( highly recommended anyways )
VDX
Re: Laser cutter/engraver needs 5v PWM - I use Marlin and MKS GEN 1.3
August 26, 2016 03:16PM
... I'm using different pins - either AUX/servo, or the E-Step-pins, or any other free, available pin, if needed.

To define the correct TTL-voltage and/or polarity I'm using 74HCT14 Schmitt-trigger+inverters to either invert or only drive (with double-inverting) it.

For other common voltages like +10V / 24V / 48V I'll add fast optocouplers and redefine the input or output voltages - so no problem to interface industrial gear ...


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org]
Call for the project "garbage-free seas" - [reprap.org]
Re: Laser cutter/engraver needs 5v PWM - I use Marlin and MKS GEN 1.3
August 27, 2016 02:35PM
Is it so difficult to read topics / posts here to find the answer?
or
do a web search?

This is what you get when you buy a laser from Wang Hu hair solon!

angry smiley

Diode Laser needs:
Supply to laser supply usually 12v --- controlled down to supply 3.3V for diode
(I recommend a separate supply with a switch that can be turned OFF to save your eyes.)

Trigger on laser supply board to turn laser ON/OFF ---- if TTL apply 5-12 v for ON remove for OFF
This trigger may be PWM to control laser ON/OFF time.
The better driver boards opto isolate the trigger.

??? What software / firmware will you be using --- what does it prefer for laser trigger
----- D9 or pin on arduino

Perhaps a look at
[jtechphotonics.com]

[jtechphotonics.com]

confused smiley
Re: Laser cutter/engraver needs 5v PWM - I use Marlin and MKS GEN 1.3
August 27, 2016 03:14PM
o_lampe , Thank you for your reply.
I think you could use a 5V aux, I looking towards some research on PWM for servos, maybe it's a way.
Re: Laser cutter/engraver needs 5v PWM - I use Marlin and MKS GEN 1.3
August 27, 2016 03:19PM
Quote
VDX
... I'm using different pins - either AUX/servo, or the E-Step-pins, or any other free, available pin, if needed.

To define the correct TTL-voltage and/or polarity I'm using 74HCT14 Schmitt-trigger+inverters to either invert or only drive (with double-inverting) it.

For other common voltages like +10V / 24V / 48V I'll add fast optocouplers and redefine the input or output voltages - so no problem to interface industrial gear ...


Also thank you for your reply, I will look into that. I was hoping to find some software solution combined with a aux that delivers only 5v, not 12v as the D9. Even if I couldn't for now have PWM, the ON/OFF solution would be fine for this 1st stage of testing so I can buy some time to a more robust and correct solution, because I need to show this laser working on September 1st.

Best.
Re: Laser cutter/engraver needs 5v PWM - I use Marlin and MKS GEN 1.3
August 27, 2016 03:28PM
cozmicray , thank you for your reply...before getting into the answer itself, you assumed too much in the beginning of your reply. I did researched a lot, I know this two links and none of them described what I asked. The laser unit is not Chinese as you assumed, it from Poland. The company is specialized in laser for various applications, they didn't have one designed for 3D printers or arduino based machines, but they designed one as a prototype and sent me to test it. Now the problem is, they master electronics but not 3D printers and they don't have time to help me this week. So I , after reading decided to post here.

I use Marlin (it's described on subject of my post)

As you can read on the reply I wrote to VDX, I only need to have 5V controlled by G-code and that doesn't shoot as soon as I turn the printer on. I don't know if its possible or not, that's why I'm asking for help.

thank you
Re: Laser cutter/engraver needs 5v PWM - I use Marlin and MKS GEN 1.3
August 27, 2016 11:18PM
Ok so this is what you get for getting laser from Kielbasi haus

( I am Polish-American --- I can say this???)


I hope it was very cheap!
What power laser?

So this Polish laser just uses a 5V supply
5V applied ---- laser ON
5V supply to diode --- nothing else?

So you need to PWM 5V at some serious current to light the laser diode

I suppose a high current, 12v to 5v converter, on D9

Did you fritz the laser by applying 12V from D9?

confused smiley
Re: Laser cutter/engraver needs 5v PWM - I use Marlin and MKS GEN 1.3
August 28, 2016 03:49AM
Search the marlin code for "M106" , which leads you to the code section responsible to PWM control the D9 terminal. Then reroute this code ( in pins.h ?) to any PWM capable 5V pin you like.

Servo control code is useless, because these servos need a specific PWM timing that wouldn't work with the TTL input of the driver.
Re: Laser cutter/engraver needs 5v PWM - I use Marlin and MKS GEN 1.3
August 28, 2016 03:42PM
cozmicray,

The laser has:

PIN 1 - Analog IN 0-5V
PIN 2 - Analog GND
PIN 3 - GND
PIN 4 - Vcc 12V

I did not fry the unit, it can handle a little time with 12V.
The 12 to 5 converter seems to be the obvious solution, the laser company told me they would do one for me, but the problem is the deadline I have to make a presentation of this working, that's why I was trying to reach an intermediate solution to buy some time.

Maybe with what o_lampe said I could buy this time by redirecting the M106 and M107 codes to another 5V pin just to turn it on and off even if I can't have PWM for now. The question is will it start as OFF when the printer is turned on?

thanks,
Re: Laser cutter/engraver needs 5v PWM - I use Marlin and MKS GEN 1.3
August 29, 2016 12:58PM
As I wrote before, the redirected M106 starts in ON state until marlin boots up. Use a switch for the 12V supply to avoid problems.
Re: Laser cutter/engraver needs 5v PWM - I use Marlin and MKS GEN 1.3
August 29, 2016 01:11PM
Looks like a standard laser diode rig.

Supply 12V to pin 3 and 4 with a safety switch.

Put a voltage divider from D9 to pins 1, 2

[electronics.stackexchange.com]

Arduino

[arduino-info.wikispaces.com]

PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.

Firmware would determine what G-code would control these pins.

confused smiley
Sorry, only registered users may post in this forum.

Click here to login