Welcome! Log In Create A New Profile

Advanced

2.5W Laser TTL Confused

Posted by gauthib72 
2.5W Laser TTL Confused
January 30, 2019 11:02AM
I am wondering if someone can steer me straight in regards to adding a laser to my 3d printer? I am trying to get this to work on my older Prusa i2. I picked up a 2.5w module which comes with the small driver board that has a TTL input. As many have tried and there is lots of good information on here, I am having a hard time trying to nail down a way to get my setup to work - I have researched so much, I have just confused myself!.D9 remapping to pin 44 doesn't work, using a 7805 regulator direct from the D9 to TTL does not work either.. I don't just want to have the laser turn off and on I would like to use the PWM and TTL..I am running Arduino 1.8.3 and Marlin 1.1.9 which does have a Laser option in Config Adv.

So here is where I am at: I think if I run a wire from the + TTL on the board to Pin D6 on the ramps board and the gnd to gnd in the same Ramps 1.4 servo block, I can get the 5v signal for TTL and PWM – but I don’t know what lines to change in the firmware, it's confusing as I am no programmer.

Hoping someone can assist

Thanks!
Re: 2.5W Laser TTL Confused
January 30, 2019 08:19PM
What Firmware Marlin 1.1.9
What Software?
------ send g-code to printer
------ Generate laser paths and control laser ON/OFF

Find a pin that you can PWM at 5V
hook that up to laser TTL

Find g-code that controls that pin
Tell software the command to control laser

[jtechphotonics.com]


confused smiley
Re: 2.5W Laser TTL Confused
January 31, 2019 09:11AM
Hi cozmicray

Yes, 1.1.9 Marlin firmware, will use Inkscape software to generate gcode

I tried remapping the D9 to pin 44 but it does not work for me I get no voltage readings so my biggest problem is changing Marlin to recognize the pin
I read that pin D6 is PWM 5v so I want to use that pin but am unsure which lines in marlin to change
I think I get the wiring .. just not Marlin

refering to this:
[marlinfw.org]
Re: 2.5W Laser TTL Confused
January 31, 2019 01:03PM
I don't quite understand what you mean when you say you've remapped D9 to pin 44. The mapping of a name like D9 to a physical pin is fixed in hardware.

If you do want to map a function to a different pin, you would change the value for that function.

e.g. in pins.h

#define HEATER_0_PIN        13
Re: 2.5W Laser TTL Confused
January 31, 2019 01:58PM
yes sorry remapping, what I meant by changing this line as most have done from the D9 pin to 44

//
// Heaters / Fans
//

#ifndef RAMPS_D9_PIN
#define RAMPS_D9_PIN 44
#endif

I can't understand why using the D9 fan port on the Ramps 1.4 board with a 12v to 5v 7805 regulator to TTL port, doesn't work for me either similar to the method on Youtube video by Jake's Workshop on October 26, 2017

I've also read problems with polarities on some of the generic laser driver boards which I am checking out..
Re: 2.5W Laser TTL Confused
January 31, 2019 07:29PM
Get your mom to read this to you

RAMPS1.4 Laser Upgrade

[jtechphotonics.com]


angry smiley
Re: 2.5W Laser TTL Confused
January 31, 2019 09:03PM
LOL..I have read the article before but as I understand it, looks like the power port on the laser driver is wired to d9 which would switch my laser on /off..but I want to use the ttl port just using the signal to control the pwm...am I misunderstanding?? As I read switching the laser on/off via just power may damage the diode..please correct me if I am wrong..
Re: 2.5W Laser TTL Confused
February 01, 2019 12:37PM
Laser Supply is connected to 12V power supply.
TTL trigger (H2) hooked up to D9.

When M106 issued D9 5v Laser ON
M107 D9 0v Laser OFF

Test laser with 12v supply ON
apply 5v to TTL -- laser should come ON
remove 5V Laser OFF

****** Ding Ding Ding
D9 high current capable 12V output
did 12v fritz your Laser TTL trigger

======================

Here they use pin 6 (a pin that can be PWM at 5V

Marlin Laser/Spindle Configuration

[marlinfw.org]


confused smiley
Re: 2.5W Laser TTL Confused
February 01, 2019 02:25PM
Quote
gauthib72

I can't understand why using the D9 fan port on the Ramps 1.4 board with a 12v to 5v 7805 regulator to TTL port, doesn't work for me either similar to the method on Youtube video by Jake's Workshop on October 26, 2017

I suspect that a 7805 regulator isn't fast enough to switch the output voltage at the rate that the PWM switches, so the output just stays at 5V continuously. If there's little capacitance, then it should still work at *very* slow speeds. After all, a 7805 is designed to keep the output at a constant 5V as much as possible.
Re: 2.5W Laser TTL Confused
February 01, 2019 02:54PM
use a voltage divider
or
put a 5V zener diode in circuit


How can I use a 12 V input on a digital Arduino pin?

[electronics.stackexchange.com]

fizzzz zap :::::::: magic smoke released!!!!

confused smiley
Re: 2.5W Laser TTL Confused
February 05, 2019 06:16AM
First warning: The chinese laser driver boards may work in any possible way. I assume that the laser is powered by 12V and the TTL is expected to be 0..5V. Normally 5V means full power and 0V means off - but this can also be inverted!

The analog TTL modulation input is "emulated" via PWM output from your RAMPS board.

Have a look at the introduction text here: [marlinfw.org]
(and ignore the lower part as the M3/M5 laser support as implemented in Marlin is kind of broken at the moment... )

You did compile the Marlin firmware for your RAMPS board, did you? Then edit configuration.h (as explained in the link) and re-compile/upload the modified firmware to your board.

Assumed wiring:
- Your laser is powered directly from 12V
- the TTL input is connected to D6 (part of the SERVOS block on RAMPS board: [reprap.org] )
- TTL GND is wired to any of the RAMPS GND (e.g. the one next to D6)
- TTL GND is *also* wired to GND of your laser power.

It depends on your laser driver's circuitry but it is often essential that TTL GND is the same as laser power GND.

Now should be able to use M106 G-codes to control power output to your laser.

M106 P1 S0 ; Laser off (P1 = 2nd fan output)
M106 P1 S128 ; Laser at 50%
M106 P1 S255 ; Laser at 100%
//dont' forget, your laser driver might be inverted, i.e. 255 is off, 0 is full power

Do you have some kind of frontend to Marlin (e.g. Octoprint)? Makes it easy to try these commands manually first...

And never forget protection glasses and the fire extinguisher! I'm serious!
Re: 2.5W Laser TTL Confused
February 09, 2019 03:38PM
hey guys thanks again for the input - i'm getting there!!smiling smiley

Thanks - trapperjohn, using the method you mentioned, I wired the TTL to pin 6 and gnd then added the line

#define FAN1_PIN 6 // 2nd fan output attached to laser TTL input

just before the

#endif // CONFIGURATION_H (in configuration.h)

in pronterface which is what I use for the "frontend" control...when I type the commands below it works!

M106 P1 S0 ; Laser off (P1 = 2nd fan output)
M106 P1 S128 ; Laser at 50%
M106 P1 S255 ; Laser at 100%

so - tried cutting a small square, drawing it out in inkscape which spit out the gcode

m107 S0

G90
G21
G1 F300
G1 X90. Y110.
G4 P0
m106 S255
G4 P0
G1 F300.000000
G1 X110. Y110.
G1 X110. Y90.
G1 X90. Y90.
G1 X90. Y110.
G4 P0
m107 S0
G1 F300
G1 X0 Y0


I modified the code to this:



G90
G21
G1 F300
G1 X90. Y90.
G4 P0
m106 p1 S255 command per above to turn on laser
G4 P0
G1 F1000.000000
G1 X110. Y110.
G1 X110. Y90.
G1 X90. Y90.
G1 X90. Y110.
G4 P0
m106 p1 S0 command to turn laser off
G1 F300
G1 X0 Y0

okay...the printer does all the correct moves, but the laser does not turn on when it should, to cut the square?? any thoughts??

Thanks
Re: 2.5W Laser TTL Confused
February 09, 2019 10:00PM
Depends on your firmware, it may not accept lower case

Try M106 P1 S255 not m106 p1 S255
and M106 P1 S0 vs m106 p1 S0
Sorry, only registered users may post in this forum.

Click here to login