Software Chain for Laser Cutting

I’ve seen some work in the main forum about using Inkscape plugins to generate Laser code, either the JTECH one or a user’s custom hack.

How is everyone generating, and sending gcode for laser?

Does anyone use Univeral Gcode Sender at all?

I can’t say much on the topic of generation but I do believe most use repetier-host for controlling and sending the code.

Thanks Vicious.

I’ve seen that, but based on being mostly used for 3d print stuff, I wondered about it’s uses for sending gCode more focused on laser projects.

I guess theoretically any sender that works with Marlin would be fine, it’s sending x/y movements and coordinates and the laser/spindle control?

I’m currently reading threads about GRBL w/ Ramps boards, as I already have the XCarve running GRBL and a GRBL specific generator and sender.

May try flashing GRBL on there.

Inventables GRBL is set up for 20 tooth pulleys, so I’d have to either figure out how to change to 16 tooth, or just spend a few bucks and replace the pulleys with ones from them.

I’ll investigate repetier-host when the machine is built and up just to see how it all works.

You are right, it does not matter what is on the end of the machine repetier is just sending gcode including laser control, It can do spindle control but most people just turn it on and off by hand. That is how this machine is so easy to do all these different tasks.

GRBL doesn’t work on ramps boards as far as I know.

I think you will find it is no different, load the gcode, press start. That is all you need repetier for.

I was referencing this link that I found doing some searches in regards to Ramps/GRBL:

Since I have the XCarve, and right now only do basic part cuts for the most part, I’m using their Easel app, bringing in various vector pieces and scaling them and laying them out. Easel generates the paths/gCode, but is, as far as I know, specific to GRBL. It also handles the device communication/gcode sending.

I’m hoping that if all works well and flashing doesn’t prove too much work, to be able to use Easel to do most of the work for me. It would be a whole lot easier (for me, because I’m familiar with the tools) to keep everything in my software tool chain pretty standard. Not that I’m not going to try whatever Inkscape plugins are around and how well they would work for me and use something like Repetier-host as recommended.

I personally don’t use Ramps controller with my MPCNC but I have built a 3dpburner laser burner which uses Ramps controller and is designed by a bright guy name villamy on thingiverse. He has a website where he provides a free image to gcode converter software that works very well for raster engraving . He also has a nice gcode sender app that he built that works with Ramps controller. I bought the image to gcode raster software provided by Jtech photonics also but personally found Villamy’s free version to work better.

The Jtech site is a good resource for info and I’m sure their product is great but if you’re on a budget you can find an equivalent 9mm 2.8w laser at DTR laser shop with a 3 element lens for under $100. An adjustable lens is key to ensure the beam focuses to a spot about 50mm away from the lens to prevent smoke damage to the lens from being to close. A mounted fan doesn’t hurt either. In addition to the laser/lens, you’ll need a heat sink and driver which can both be had for about $20. Then you can just follow the site for guidance on how to connect it all to Ramps and get the software there to convert images to gcode as well.

Here’s a link to my build. It’s a nice little laser engraver but one of these days I’m ginna strip it down and mount the laser on my MPCNC. I’m confident it’ll add more precision and the work area is huge in comparison.

My 3dpburner make

Leo69, That site is cool. I have seen the platform on Thingiverse and never actually read through it.

I am very interest in getting the laser setup you are talking about. I need to look it up tomorrow so I might have some questions. I want to burn something!!!

Vicious1 , It’s been about a year since I built mine but happy to help any way I can. You’ll find that like yourself, Villamy is committed to his project and helping to support it. His BOM page has very good details and links to let you know exactly what’s needed and the electronics page has all of the wiring diagrams to Ramps and guidance for tuning the laser driver also. The software he’s written or modified to work with it runs very well. I’m anxious to see this on an MPCNC. The larger platform and the z axis are definitely door openers for new ideas. I built my laser engraver for PCB etching so the fixed z axis was fine but now I’m thinking it would be nice to be able to engrave something bigger/taller:)

Thanks so much for that link! I have that cheap laser driver and have been looking for references on how to tune it.
Steve C

I tried using the image2gcode software from the 3dpburner site, but the code it generated didn’t have any M106 or M105 commands. In fact, the only M commands were and M3 at the very start and and M5 at the very end. I processed both a black and white and a greyscale image. Neither one had any other M codes except the M3 and M5 I mentioned.


First off, Villamany, if you should read this then I apologize for butchering your tag in earlier posts:)

I only have a working knowledge of this but I took a quick look at some gcode generated by the application and this is what I’ve seen.

  1. The 3dpburner laser engraver uses a customized version of GRBL to send the TTL pulses needed to drive the laser through the Z endstop pins on the Ramps controller.

  2. Those Z endstop pins are mapped in the firmware to respond to Spindle on commands (M3 codes). the M3 code accepts an S parameter (0-255) to control spindle speed on an actual spindle. This is what’s used to generate the TTL pulses. To create a true grayscale image you can’t just turn the laser off and on, there has to be various shades of gray, different current levels between off and full power.

  3. The image2gcode software has a GCODE tab where you can select “Use S” or “Use Z” depending on how your firmware is set up. Select “Use S” if you need to use the M03 codes to drive the laser. The “use z” option doesn’t work for MPCNC because we need our Z axis!

4)Another important setting is in the laser profile tab. The numbers there control the difference in power between off and a full black burn. I think they’re both set to 0 by default so you should make the low value a zero and the high value a 255 and adjust from there.

Why do you need the M103 and M105 codes?

I have a manual spindle speed controller on my MPCNC so I have no need for the M03 codes but I can see how some users would need to find a different approach. Using the M103 and M105 codes to drive a laser would interfere with extruder operation on a 3d printer too. I think Ramps users will just have to keep a set of firmwares on hand to flash depending on what they want to do with their MPCNC on any given day:)

I also use a manual speed controller for my router. The J Tech Photonics laser I am working with uses the cooling fan codes to drive the laser at different intensities, similar to the S parameter you mentioned.

I’m just getting it set up and trying to learn how to use it. Once I have a better understanding of what I need the code to look like, maybe I can modify what is generated by image2gcode to work with my setup. For now I’ll get the piclaser demo.


I bought a license for piclaser but don’t use it. If I can find it I’d be happy to donate it to your cause.

Actually I just found it. It’s actually called LaserEtch from the Jtech website and my license works on the newest version. Like I said, I don’t use it so PM me if interested.

kartinsly: I was just looking at Jyech site and from what I’ve seen their laser set-up responds to M106 (w/S parameter) and M107 codes. Like you mentioned, if all else fails you can just take the image2gcode outpu and do a search and replace in notepad. Replacing “S” with “M106 S” and throwing an M107 (or M106 S0) at the end should work fine.

Sorry for hijacking this thread:) I’m bored.

karlisnsky: Villamany posted the source code to his image2gcode app. I found the function that generates the gcode file and I can customize this for you and recompile if you’d like. Let me know…

Leo, if you could do that, that would be really great. Yes, I figured a search and replace, maybe using regex, would do it, but it would be nice if we could generate what we need without the extra steps.



Yes please! I downloaded the app and looked at the generated code and cringed when I saw it was just using M03 and setting S in the X travel.

Replacing all of that with regex would suck. It’s how I was doing a bunch of stuff exporting from Easel as well.

Regular expressions are overkill for something like this. A find/replace in wordpad or notepad could do it. I’m going to mod the software but the resource files aren’t playing nice with my Sharpdevelop compiler. I have to dig up my old laptop which has a copy of Visual Studio on it. Gimme an hour or two…