This is a Gcode generator extension for Inkscape, that will generate Gcode compatible with LaserPecker engravers. The LaserPecker App already has a built-in Gcode converter with capability of line-filling, which is pretty easy to use. Please consider using the built-in Gcode mode first.
LaserPecker is a brand of affordable and portable consumer level laser engravers. For more details, visit The Unofficial Wiki for LaserPecker.
Before generating Gcode for LP, please select the correct model and firmware number.
1) Install Inkscape v0.92 or newer and watch this video on how to download a file from GitHub.
2) Depending on your Inkscape version and operating system, download laserpecker.inx
and laserpecker.py
from extension/<your_inkscape_version>/
directory into...
~/.config/inkscape/extensions/
~/.var/app/org.inkscape.Inkscape/config/inkscape/extensions/
Preferences
> System
> Look for User extensions
> click Open
C:\Program Files\Inkscape\share\inkscape\extensions\
3) Restart Inkscape and you should be able to access the extension from Extensions
> LaserPecker
> Gcode Generator for L1/Pro/L2
Laser head idle movement speed is hard-coded to 6000mm/min.
1st Gen LP Only:
Maximum engraving range depends on the model of your LP. It is noted in the dropdown list of the entension for your reference.
This extension warns if the target graphics are larger than allowed engraving range, and you should scale it down and try again.
The origin (X=0,Y=0) could be in the centre or top-left of the maximum engraving range depending on the model. This is taken care of by this entension. This is one of the reasons why a generic Gcode file may not work.
The position of your graphics on Inkscape canvas is irrelevant. This extension will automatically center your graphics in the LP's engraving range for the best engraving quality.
Output Gcode file should end in .txt
otherwise the LaserPecker App won't recognise it.
Note
Click to watch video tutorial (using Inkscape 0.92 here, v1.x looks slightly different):
1) Launch Inkscape. 2) Import an image, preferably a black and white image onto the blank canvas. 3) Select the image, then "Path" > "Trace Bitmap" 4) Use the following optimal settings (using Inkscape 0.92 here, v1.x is slightly different):
Extensions
> LaserPecker
> LaserPecker Gcode Generator
10) Fill in the values as prompted and click Apply
to generator Gcode.
11) Ignore any warnings. The auto generated markers overlay on top of your graphics can be deleted.You may have noticed that only the edges of your graphic are converted to paths, and therefore to Gcode. While this is desireable in some situations, like for cutting shapes out of your materials, we sometimes want to fill the shapes so they look like the original image, not just a hollow trace.
Here is how:
There are three options you can/should tweak:
It is that easy! After filling your shape, generate Gcode as you would and optionally inspect your Gcode (read the next section) before engraving.
1) follow this guide (TL;DR part) to compile & install autotrace
(linux-only I'm afraid).
2) Use the single-line command shown in the link above to convert your bitmap (png) image to svg
3) Use this Gcode extension to generate Gcode for LaserPecker.
autotrace
is using px as default unit, and there's no need to change it to mm before resizing your graphic. As long as the width x height numerical values are within 100x100, the Gcode entension will work and treat them as mm.
4) Note that you may see some warning messages during generation. As long as there's no error, you can ignore them. In the end, if you see some horrible overlay of arrows appear on top of your graphic, the Gcode is generated OK, and you can move or delete this layer as you wish.Click to watch video tutorial:
1) Open up the generated file with a text editor 2) Select all texts and copy 3) Open NC Viewer 4) Clear the sample Gcode and paste your Gcode in 5) Click the blue "Plot" button to visualise your Gcode.
Once the .txt
Gcode files are generated...
Download
directory for example. Then in LP app, go to Examples > G-code
tab, click on the +
symbol and add your Gcode file to the app. Finally, your Gcode file is available in LP App under Examples > G-code
tab.
I have included a few sample images for you to test convert to Gcode and engrave with LaserPecker. The reason why I did not include any sample Gcode is because you will need to choose the best settings (power,speed) for your material at the point of generation.
L1/Pro only: In testing
directory, I have created some Gcode files to help you quickly test and find out the optimal power+speed settings for cutting or engraving your target material.
engraving_test_p160-255,s500-800.txt
: Sweep across different power and speeds with small step sizes to help you map different engraving results to accurate Gcode settings (power,speed).cutting_test_p200-255,s70-400.txt
: This helps you to find the lowest possible setting that your material can be cut with. If even the highest setting (p255,s70) is unable to cut your material, consider cutting multiple times.sample_result.jpg
: Test results on a recycled paper.In resources
directory, there are several sets of grid
files, aiming to help you position your object under the laser. Each set has the following files:
.svg
: The SVG file of the grid. Open it with Inkscape and convert to Gcode with your choice of settings and test your LaserPecker's engraving distortion and sizing..txt
: Gcode for the grid with speed=500 and power=200. This is MUCH faster than using a bitmap image to engrave the grid over the 100mm x 100mm area..png
: PNG image of the grid only for quick preview. I do not suggest engraving this as it's MUCH slower than using Gcode.This extension helps you to utilise absolute Gcode coordinates and engrave over 200mm x 140mm area with L1 model. However, the oversize engraving result has been inconsistent around the far ends. In my opinion it's not worth the hassle, so I have stopped working on this. There's a chance that LaserPecker will officially unlock this capability, if they manage to reduce distortion via their App.
This extension is based on J Tech Laser Tool Plugin V 2_2 for Inkscape for laser engraving and cutting.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA