Commit 23360535 authored by leonmuller's avatar leonmuller

07-March-2015 - 10 hours : Cleaned up the exporters code a lot. Added ppm and...

07-March-2015 - 10 hours : Cleaned up the exporters code a lot. Added ppm and feedrate detection from
the layer name. Updated the gcode that is exported to be neater and work better with
pulsed mode using G01, G02 and G03 commands.

07-March-2015 - Fixed the G28 command at the end of the job. Added defaults for laser power,
feedrates and ppm if defined. If ppm isn't defined in the layer options it will operate as
continuous wave mode. See the help in the extension dialog for how to use.

07-March-2015 - Marlin codebase mod : You need to patch the Marlin codebase to turn on the
laser before moving for G02 and G03 commands. This plugin assumes this has been done. More
details to come in the future. Copy the code from the G01 above in marlin_main.cpp
parent 5399d4b5
About This Fork
---------------
10.14.14 by ajf (https://github.com/ajfoul)
About This Project
------------------
Modified to output gcode that is compatible with K40 style laser cutter
running Marlin
(https://github.com/lansing-makers-network/buildlog-lasercutter-marlin).
I couldn't get the original version from LMN repo to work with LMN's Marlin as
it never set the laser intensity on the M3 command.
This works form me, but YMMV. Very limited testing. Never leave your laser
cutter unattended while it's powered/operating. Keep a fire extinguisher
close by, wear saftey goggles, and be afraid!
USE AT YOUR OWN RISK!
10.17.14 - A little more testing reveals that G02 (CW ARC) and G03 (CCW ARC)
moves are problematic. Not sure if it's the modifications in this fork, the
original THLaser, LMN's Marlin, Inkscape, or some combination that is causing
the issues.
running Marlin (https://github.com/lansing-makers-network/buildlog-lasercutter-marlin).
Basically, you should consider this pre-alpha code. Examine the exported
Gcode and do test runs on cardboard/paper before trying to cut on valuable
stock.
26-Feb-2015 - 2 hours : Forked from user ajfoul to extend functionality of smoothie
laser power levels 0.0 to 1.0, generic Marlin power levels being 0 to 100.
Also: G28 at the end of the job doesn't seem to be working at the moment, at
least not when running the gcode on my machine.
07-March-2015 - 10 hours : Cleaned up the exporters code a lot. Added ppm and feedrate detection from
the layer name. Updated the gcode that is exported to be neater and work better with
pulsed mode using G01, G02 and G03 commands.
10.19.14 - G02 and G03 really screw things up, so I've set the default
min_arc_radius to 500 to force all cut moves to be G01. That has it's own
issues. At this point I wouldn't recommend using the Gcode from this for any
real jobs.
07-March-2015 - Fixed the G28 command at the end of the job. Added defaults for laser power,
feedrates and ppm if defined. If ppm isn't defined in the layer options it will operate as
continuous wave mode. See the help in the extension dialog for how to use.
26-Feb-2015 - Forked from user ajfoul to extend functionality of smoothie
laser power levels 0.0 to 1.0, generic Marlin power levels being 0 to 100 and to add in
raster image detection and export support.
07-March-2015 - Marlin codebase mod : You need to patch the Marlin codebase to turn on the
laser before moving for G02 and G03 commands. This plugin assumes this has been done. More
details to come in the future. Copy the code from the G01 above in marlin_main.cpp
THLaser Inkscape Plugin
-----------------------
Turnkey Laser Inkscape Gcode Export Plugin
------------------------------------------
This program is an Inkscape extension for exporting a set of paths as
gcode script.
......@@ -49,7 +31,7 @@ is released under the same license (GPL v2).
Installation
------------
Copy the files thlaser.py and thlaser.inx into your Inkscape extensions
Copy the files turnkeylaser.py and turnkeylaser.inx into your Inkscape extensions
folder. Fire up inkscape and you will find the plugin under Extensions ->
Export -> THLaser GCode Export.
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Note : 73% on my unit runs the laser tube at 18ma. This is the maximum current that should be put through a 40 watt CO2 laser tube.
Cut Perspex = F300 @ 73%
Score cardboard = F1400 @ 9%
Cut Paper (Pulsed) = F600 @ 8% - 60ms pulse 2 pulse per millimetre.
\ No newline at end of file
G21 ; All units in mm
; Default Cut Feedrate 300 mm per minute
; Default Move Feedrate 2000 mm per minute
; Default Laser Intensity 72 percent
G28 ; home all
M5 ;turn the laser off
;(************************************************************)
;(***** Layer: 8 *****)
;(***** Laser Power: 8 *****)
;(***** Feed Rate: 600.0 *****)
;(***** Pulse Rate: None *****)
;(************************************************************)
;(MSG,Starting layer '8')
G00 X93.693928 Y42.800959 F2000
G01 S8.00 X93.693928 Y123.034303 F600 B0 D0
M5 ;turn the laser off
M5 ;turn the laser off
;(************************************************************)
;(***** Layer: 8 *****)
;(***** Laser Power: 8 *****)
;(***** Feed Rate: 600.0 *****)
;(***** Pulse Rate: 2.0 *****)
;(************************************************************)
;(MSG,Starting layer '8')
G00 X89.182149 Y42.856593 F2000
G01 S8.00 X89.182149 Y123.089937 F600 L60000 P1 B1 D0
M5 ;turn the laser off
M5 ;turn the laser off
;(************************************************************)
;(***** Layer: 8 *****)
;(***** Laser Power: 8 *****)
;(***** Feed Rate: 600.0 *****)
;(***** Pulse Rate: 1.0 *****)
;(************************************************************)
;(MSG,Starting layer '8')
G00 X84.297648 Y42.816729 F2000
G01 S8.00 X84.297648 Y123.050073 F600 L60000 P0.5 B1 D0
M5 ;turn the laser off
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension>
<name>ShinyLaser Gcode</name>
<id>com.istartup.shinylaser</id>
<name>TurnkeyLaser Exporter</name>
<id>com.turnkey.Tyranny</id>
<effect>
<object-type>path</object-type>
......@@ -10,16 +10,30 @@
</effects-menu>
</effect>
<dependency type="executable" location="extensions">shinylaser.py</dependency>
<dependency type="executable" location="extensions">turnkeylaser.py</dependency>
<dependency type="executable" location="extensions">inkex.py</dependency>
<script>
<command reldir="extensions" interpreter="python">shinylaser.py</command>
<command reldir="extensions" interpreter="python">turnkeylaser.py</command>
</script>
<param name='tab' type="notebook">
<page name='tab' _gui-text='Help'>
<_param name="fullhelp" type="description">ShinyLaser exports Inkscape paths to Gcode compatible with Ramps+Marlin or Smoothieware laser mainboards.
<_param name="fullhelp" type="description">TurnkeyLaser exports Inkscape paths to Gcode compatible with Ramps+Marlin or Smoothieware laser mainboards.
You're able to specify in your layer names the laser power output, feedrate and optionally the pulse per millimetre option for pulsed lasing mode as opposed to the default continuous wave operation mode.
1)Name your layer like the following example :
35 [feed=600,ppm=40]
2)Draw your designs and group them based on lasing options in the layer name.
3)Select the paths you want to export, then run this script.
In the example above the layer will be cut at 35% power with a feedrate of 600mm per minute and a pulse rate of 40 pulses per millimetre (at 60ms pulses).
If the ppm option isn't specified in the layer options then output lines will be cut in continuous wave mode at the power and feed specified.
If you do not specify the laser power or other options in the layer name then they will default to the options in the export dialog box under "Preferences".
For the latest revision please visit https://github.com/TurnkeyTyranny/laser-gcode-exporter-inkscape-plugin
</_param>
</page>
......@@ -28,10 +42,10 @@
<item value="ramps">Ramps 1.4</item>
<item value="smoothie">Smoothie</item>
</param>
<param name="biarc-tolerance" type='float' _gui-text='Biarc interpolation tolerance'>1</param>
<param name="biarc-tolerance" type='float' _gui-text='Biarc interpolation tolerance'>0.5</param>
<_param name="help" type="description">Biarc interpolation tolerance is the maximum allowed distance between a path and it's approximation. If this value is exceeded, the path will be split into two segments.</_param>
<param name="biarc-max-split-depth" type="int" _gui-text="Maximum splitting depth">4</param>
<param name="min-arc-radius" type="float" precision="5" min="-1000" max="1000" _gui-text="Minimum arc radius">0.05</param>
<param name="min-arc-radius" type="float" precision="5" min="-1000" max="5000" _gui-text="Minimum arc radius">0.00005</param>
<param name="Xoffset" type="float" precision="4" min="-1000" max="1000" _gui-text="Offset along X axis">0.0</param>
<param name="Yoffset" type="float" precision="4" min="-1000" max="1000" _gui-text="Offset along Y axis">0.0</param>
<param name="logging" type="boolean" _gui-text="Log debug output from plugin:">true</param>
......@@ -41,16 +55,16 @@
<param name="filename" type="string" _gui-text="File name: ">output.g</param>
<param name="directory" type="string" _gui-text="Directory: "></param>
<_param name="help" type="description">(blank is your desktop)</_param>
<param name="feed" type="int" min="0" max="5000" _gui-text="Cut Feedrate:">5000</param>
<param name="Mfeed" type="int" min="0" max="5000" _gui-text="Traversal Feedrate:">1400</param>
<param name="laser" type="int" min="0" max="100" _gui-text="Laser Intensity (0-100%):">10</param>
<param name="feed" type="int" min="0" max="5000" _gui-text="Default Cut Feedrate:">300</param>
<param name="Mfeed" type="int" min="0" max="5000" _gui-text="Default Traversal Feedrate:">2000</param>
<param name="laser" type="int" min="0" max="100" _gui-text="Default Laser Intensity (0-100%):">10</param>
<param name="homebefore" type="boolean" _gui-text="Home X & Y Before:">true</param>
<param name="homeafter" type="boolean" _gui-text="Home X & Y After:">false</param>
<param name="Xscale" type="float" precision="4" min="-1000" max="1000" _gui-text="Scale along X axis:">1</param>
<param name="Yscale" type="float" precision="4" min="-1000" max="1000" _gui-text="Scale along Y axis:">1</param>
<param name="double_sided_cutting" type="boolean" _gui-text="Double-sided cutting:">false</param>
<param name="draw-curves" type="boolean" _gui-text="Draw curves:">true</param>
<param name="double_sided_cutting" type="boolean" _gui-text="Cut both sides of material?">false</param>
<param name="draw-curves" type="boolean" _gui-text="Draw curves in inkscape layer">true</param>
<param name="unit" type="enum" _gui-text="Units: ">
<item value="mm">mm</item>
......
This diff is collapsed.
G21 ; All units in mm
; Cut Feedrate 400
; Traversal Feedrate 4000
G0 X0 Y0 ; home
M5
G00 X2.762953 Y240.677863 F4000
M3
G01 S0.1 X132.762873 Y240.677863 F400
G01 S0.1 X132.762873 Y1.678163 F400
G01 S0.1 X2.762953 Y1.678163 F400
G01 S0.1 X2.762953 Y240.677863 F400
G01 S0.1 X2.762953 Y240.677863 F400
M5
G00 X67.763619 Y71.178072 F4000
M3
G02 S0.1 X32.407879 Y85.822898 I0.000000 J50.000566 F400
G02 S0.1 X17.763053 Y121.178638 I35.355739 J35.355739 F400
G02 S0.1 X32.407510 Y156.533259 I49.998760 J0.000000 F400
G02 S0.1 X67.763619 Y171.178146 I35.356109 J-35.356428 F400
G02 S0.1 X103.118876 Y156.533113 I-0.000000 J-49.998906 F400
G02 S0.1 X117.762774 Y121.178638 I-35.355859 J-35.354475 F400
G02 S0.1 X103.118507 Y85.823044 I-50.001564 J-0.000000 F400
G02 S0.1 X67.763619 Y71.178072 I-35.354888 J35.353184 F400
G01 S0.1 X67.763619 Y71.178072 F400
M5
G0 X0 Y0 ; home
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment