Commit 0a58a45f authored by leonmuller's avatar leonmuller

Merge back to master

parents 376ff061 a4ef99b1
About This Project
------------------
About This Fork Modified to output gcode that is compatible with K40 style laser cutter
--------------- running Marlin (https://github.com/lansing-makers-network/buildlog-lasercutter-marlin).
10.14.14 by ajf (https://github.com/ajfoul) 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.
Modified to output gcode that is compatible with K40 style laser cutter running Marlin (https://github.com/lansing-makers-network/buildlog-lasercutter-marlin). 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.
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. 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.
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! 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
USE AT YOUR OWN RISK! Turnkey Laser Inkscape Gcode Export Plugin
------------------------------------------
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.
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.
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.
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.
11.22.14 - Reverted min_arc_radius default
THLaser Inkscape Plugin
-----------------------
This program is an Inkscape extension for exporting a set of paths as This program is an Inkscape extension for exporting a set of paths as
gcode script. It is primarily used by members to the think|haus hacker gcode script.
space (thinkhaus.org) for use with their laser cutter. As such it is
customized to suit our needs and so may not be your best choice if you
are looking for a general purpose Inkscape to gcode script.
This script is a fork of Gcodetools v1.2 written by Nick Drobchenko and This script is a fork of Gcodetools v1.2 written by Nick Drobchenko and
is released under the same license (GPL v2). is released under the same license (GPL v2).
...@@ -37,7 +31,7 @@ is released under the same license (GPL v2). ...@@ -37,7 +31,7 @@ is released under the same license (GPL v2).
Installation 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 -> folder. Fire up inkscape and you will find the plugin under Extensions ->
Export -> THLaser GCode Export. Export -> THLaser GCode Export.
...@@ -48,7 +42,8 @@ You may find it handy to assign the extension to a keyboard shortcut. ...@@ -48,7 +42,8 @@ You may find it handy to assign the extension to a keyboard shortcut.
Include something like the following line to your inkscape keys Include something like the following line to your inkscape keys
preferences file (this will bind the plugin to Ctrl+\): preferences file (this will bind the plugin to Ctrl+\):
<bind key="backslash" modifiers="Ctrl" action="org.thinkhaus.filter.thlaser" display="true"/> <bind key="backslash" modifiers="Ctrl" action="org.thinkhaus.filter.thlaser"
display="true"/>
You can find your keyboard preferences file: You can find your keyboard preferences file:
...@@ -59,6 +54,6 @@ If that file doesn't exist, create it and include the following: ...@@ -59,6 +54,6 @@ If that file doesn't exist, create it and include the following:
<?xml version="1.0"?> <?xml version="1.0"?>
<keys name="My Keys"> <keys name="My Keys">
<bind key="backslash" modifiers="Ctrl" action="org.thinkhaus.filter.thlaser" display="true"/> <bind key="backslash" modifiers="Ctrl" action="org.thinkhaus.filter.thlaser"
display="true"/>
</keys> </keys>
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"?> <?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension> <inkscape-extension>
<name>THLaser GCode Exporter</name> <name>TurnkeyLaser Exporter</name>
<id>org.thinkhaus.filter.thlaser</id> <id>com.turnkey.Tyranny</id>
<effect> <effect>
<object-type>path</object-type> <object-type>path</object-type>
...@@ -10,44 +10,61 @@ ...@@ -10,44 +10,61 @@
</effects-menu> </effects-menu>
</effect> </effect>
<dependency type="executable" location="extensions">thlaser.py</dependency> <dependency type="executable" location="extensions">turnkeylaser.py</dependency>
<dependency type="executable" location="extensions">inkex.py</dependency> <dependency type="executable" location="extensions">inkex.py</dependency>
<script> <script>
<command reldir="extensions" interpreter="python">thlaser.py</command> <command reldir="extensions" interpreter="python">turnkeylaser.py</command>
</script> </script>
<param name='tab' type="notebook"> <param name='tab' type="notebook">
<page name='tab' _gui-text='Help'> <page name='tab' _gui-text='Help'>
<_param name="fullhelp" type="description">THLaser converts inkscape paths to Gcode. (v1.30) <_param name="fullhelp" type="description">TurnkeyLaser exports Inkscape paths to Gcode compatible with Ramps+Marlin or Smoothieware laser mainboards.
This script is a fork of Gcodetools v1.2 by Nick Drobchenko. It is currently maintained by Peter Rogers (peter.rogers@gmail.com) at think|haus.</_param> 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> </page>
<page name='tab' _gui-text='Advanced'> <page name='tab' _gui-text='Advanced'>
<param name="biarc-tolerance" type='float' _gui-text='Biarc interpolation tolerance'>1</param> <param name="mainboard" type="enum" _gui-text="Mainboard: ">
<item value="ramps">Ramps 1.4</item>
<item value="smoothie">Smoothie</item>
</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="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="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="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="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> <param name="logging" type="boolean" _gui-text="Log debug output from plugin:">true</param>
</page> </page>
<page name='tab' _gui-text='Preferences'> <page name='tab' _gui-text='Preferences'>
<param name="filename" type="string" _gui-text="File name: ">output.ngc</param> <param name="filename" type="string" _gui-text="File name: ">output.g</param>
<param name="directory" type="string" _gui-text="Directory: "></param> <param name="directory" type="string" _gui-text="Directory: "></param>
<_param name="help" type="description">(blank is your desktop)</_param> <_param name="help" type="description">(blank is your desktop)</_param>
<param name="feed" type="int" min="0" max="1000" _gui-text="Cut Feedrate:">60</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="Traversal 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="Laser Intensity (0-100):">10</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="HOMEALL (G28) Before:">true</param> <param name="homebefore" type="boolean" _gui-text="Home X & Y Before:">true</param>
<param name="homeafter" type="boolean" _gui-text="HOMEALL (G28) After:">false</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="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="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="double_sided_cutting" type="boolean" _gui-text="Cut both sides of material?">false</param>
<param name="draw-curves" type="boolean" _gui-text="Draw curves:">true</param> <param name="draw-curves" type="boolean" _gui-text="Draw curves in inkscape layer">true</param>
<param name="unit" type="enum" _gui-text="Units: "> <param name="unit" type="enum" _gui-text="Units: ">
<item value="mm">mm</item> <item value="mm">mm</item>
......
This diff is collapsed.
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