Laser fire?

345 views
Skip to first unread message

ajf

unread,
Oct 28, 2014, 4:20:18 AM10/28/14
to smoothiewa...@googlegroups.com
Hi All,

I'm trying to convert a cheap-o Chinese K40 laser cutter to run Smoothieware on an Azteeg X5.  Motion works well.  But looking at the sample config for laser there is only the PWM intensity pin.  My PSU also requires laser fire to be triggered (choice of active LOW or HIGH), at least that's how I was running it with Marlin on RAMPS.  Marlin would use M3/M5 to turn the laser on/off and set the intensity on G1/G2/G3 moves depending on S value.  I know I can config a pin to fire the laser via the switch module, but am I missing something in how Smoothie deals with lasers?

Regards,
aj

Bernhard Kubicek

unread,
Oct 28, 2014, 4:43:41 AM10/28/14
to smoothiewa...@googlegroups.com
on "normal" reprap motherboards, what might be a promising "cheat" would be to use the fan output for that.
Fanspeed is controlled by a hardware PWM.
In marlin I would change this PWM frequency from e.g. from the heater controller ISR according to the current velocity.


Bernhard

--
You received this message because you are subscribed to the Google Groups "Smoothieware Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smoothieware-sup...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Arthur Wolf

unread,
Oct 28, 2014, 5:08:20 AM10/28/14
to smoothiewa...@googlegroups.com
Hello.

If you use a K40, you should have a single PWM control pin on the laser PSU.
I don't know about an Azteeg X5, but with a Smoothieboard you just use one of the Mosfets to control it, it will do on/off and pwm control ( G0 is off, G1 is on, S parameter is power control ).

We really need a tutorial for the K40.

Cheers.


--
You received this message because you are subscribed to the Google Groups "Smoothieware Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smoothieware-sup...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Courage et bonne humeur.

ajf

unread,
Oct 28, 2014, 5:59:45 AM10/28/14
to smoothiewa...@googlegroups.com
Hi Arthur,

I first converted the K40 to LMN's Marlin fork via Dan's build log.  But, there was a lot of erratic behavior, especially for G2/G3 moves.  Judging by the output of LMN's gcode generator, the were having similar issues, as it only does G1 and just segments arcs in to lines.  

The K40 is my first laser, so I don't know much about them, but it won't fire just by setting the intensity.  There are several variations of PSUs, however, as far as I know, they all have an intensity pin and two fire pins (HIGH and LOW.)  On mine, the original (oh, so crappy board and SW) used LOW to fire and there was a momentary switch on the panel for "test" firing the laser manually on the HIGH (5V.)  With RAMPS, I had the PSUs intensity pin tied to a PWMed pin and a digital pin to LOW.

The gcode would look something like this, which I generated from my own fork of LMN's THLaser Inkscape plugin:

G21 ; All units in mm

; Cut Feedrate 400
; Move Feedrate 400
; Laser Intensity 70 
G28 ; home all

M5

G00 X2.762953 Y240.677863 F400
M3 S70
G01 X132.762873 Y240.677863 F400
G01 X132.762873 Y1.678163 F400
G01 X2.762953 Y1.678163 F400
G01 X2.762953 Y240.677863 F400
G01 X2.762953 Y240.677863 F400
M5

G00 X67.763619 Y71.178072 F400
M3 S70
G02 X32.407879 Y85.822898 I0.000000 J50.000566 F400
G02 X17.763053 Y121.178638 I35.355739 J35.355739 F400
G02 X32.407510 Y156.533259 I49.998760 J0.000000 F400
G02 X67.763619 Y171.178146 I35.356109 J-35.356428 F400
G02 X103.118876 Y156.533113 I-0.000000 J-49.998906 F400
G02 X117.762774 Y121.178638 I-35.355859 J-35.354475 F400
G02 X103.118507 Y85.823044 I-50.001564 J-0.000000 F400
G02 X67.763619 Y71.178072 I-35.354888 J35.353184 F400
G01 X67.763619 Y71.178072 F400
M5

G28
G00 X0 Y0 F4000 ; home all

I figure I can use the same gcode on Smoothie with the following config:

# Laser module configuration
laser_module_enable                          true            # Whether to activate the laser module at all. All configuration is ignored if false.
laser_module_pin                             0.25             # this pin will be PWMed to control the laser
laser_module_max_power                       0.8              # this is the maximum duty cycle that will be applied to the laser
laser_module_tickle_power                    0.0              # this duty cycle will be used for travel moves to keep the laser active without actually burning

switch.laserfire.enable                      true             #
switch.laserfire.output_pin                  0.25^            # connect to laser PSU fire (^ = active HIGH, v active LOW)
switch.laserfire.output_type              digital       #
switch.laserfire.input_on_command      M3               # fire laser
switch.laserfire.input_off_command           M5         # laser off

I just got done rewiring my K40 and making some mechanical/structural changes.  Still need to reassemble, but once it's up and running, I'll be happy to do a tutorial. 

I've also started a Google group, Opensource Laser, where there are a few of us discussing this stuff.

Regards,
aj

PS: I'm loving Smoothieware! All my deltas are going to be converted...


On Tuesday, October 28, 2014 2:08:20 AM UTC-7, Arthur Wolf wrote:
Hello.

If you use a K40, you should have a single PWM control pin on the laser PSU.
I don't know about an Azteeg X5, but with a Smoothieboard you just use one of the Mosfets to control it, it will do on/off and pwm control ( G0 is off, G1 is on, S parameter is power control ).

We really need a tutorial for the K40.

Cheers.


2014-10-28 9:20 GMT+01:00 ajf <ajf...@gmail.com>:
Hi All,

I'm trying to convert a cheap-o Chinese K40 laser cutter to run Smoothieware on an Azteeg X5.  Motion works well.  But looking at the sample config for laser there is only the PWM intensity pin.  My PSU also requires laser fire to be triggered (choice of active LOW or HIGH), at least that's how I was running it with Marlin on RAMPS.  Marlin would use M3/M5 to turn the laser on/off and set the intensity on G1/G2/G3 moves depending on S value.  I know I can config a pin to fire the laser via the switch module, but am I missing something in how Smoothie deals with lasers?

Regards,
aj



--
Courage et bonne humeur.

Bob Clough

unread,
Oct 28, 2014, 6:25:44 AM10/28/14
to smoothiewa...@googlegroups.com
There are many types of laser PSUs in the K40 lasers - mine has an interlock input, an enable input, and a pwm input to set the power.  All three need to be used to make the laser actually fire.
Reply all
Reply to author
Forward
0 new messages