December 6, 2015 at 8:07 am #4630
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?December 6, 2015 at 9:46 am #4632
I can’t say much on the topic of generation but I do believe most use repetier-host for controlling and sending the code.December 6, 2015 at 10:42 am #4634
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.December 6, 2015 at 11:25 am #4635
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.December 6, 2015 at 2:15 pm #4639
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.January 7, 2016 at 6:14 pm #5542
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 3dpburner.blogspot.com 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 3dpburner.blogspot.com 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.January 7, 2016 at 9:41 pm #5548
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!!!!January 8, 2016 at 3:36 am #5553
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:)January 8, 2016 at 10:59 am #5560
Thanks so much for that link! I have that cheap laser driver and have been looking for references on how to tune it.
Steve CJanuary 8, 2016 at 12:19 pm #5563
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.
KarlJanuary 8, 2016 at 1:57 pm #5576
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?January 8, 2016 at 2:02 pm #5577
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:)January 8, 2016 at 2:50 pm #5581
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.
KarlJanuary 8, 2016 at 2:53 pm #5582
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.January 8, 2016 at 2:59 pm #5583
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.January 8, 2016 at 3:11 pm #5585
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.January 8, 2016 at 3:18 pm #5586
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…January 8, 2016 at 4:24 pm #5589
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.
KarlJanuary 8, 2016 at 4:29 pm #5590
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.January 8, 2016 at 5:29 pm #5599
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….January 8, 2016 at 7:16 pm #5601
Actually, I would think that regex would be the only way to get a search and replace to do what needs done.
I generated some marlin-compatible gcode with the piclaser software to see what it looks like. Here’s a sample:
M106 M03 G1 X0 Y0 M105 S236 G1 X0 Y0 M105 S236 G1 X0 Y0 M105 S236 G1 X0 Y0 M105 S235 G1 X0 Y0 M105 S235 G1 X0 Y0 M105 S235 G1 X0 Y0 M105 S236 G1 X0 Y0
Note that each line with coordinates needs to have a G1 code. The GRBL code apparently doesn’t need it, since it looks like this:
G1 M3 X0Y102.42S143 X0.18S134 X0.36S135 X0.54S133 X0.72S118 X0.9S111 X1.08S97 X1.26S92
Just thought I’d point that out, since you’re looking at modifying the function to create gcode we can use with our marlin-based machines.
KarlJanuary 8, 2016 at 7:27 pm #5602
I just double-checked something on JTP’s website. The command to turn the laser on is M106, not 105, and laser off is 107.January 8, 2016 at 7:47 pm #5603
Yeah I mentioned that earlier. M106 and M107 are the fan control M codes. I don’t know what all the G1 X0 Y0 commands are sprinkled in for. Makes no sense. I’m just going to mod the code to use “M106 S” in place of just “S” and to replace the M05 at the end with an M107.January 8, 2016 at 8:25 pm #5605
I’m not sure why all the commands were for x0 y0, but that is the format the gcode needs to be in – for example, G1 X99 Y45. I think any line that has movement has to have the G1 at the beginning, and spaces between the coordinates.January 8, 2016 at 9:30 pm #5609
Sorry guys. My old laptop is slow as molasses and needed a bunch of windows updates. I decided to play xbox to kill time and kill time I did:) I just finished the code mods. Karl, I went ahead and added the G1 codes before the coordinate moves but I don’t think the white space is necessary. Please test and if this doesn’t work I’ll add the whitespace in too. Good luck all! Keep me posted.
The generated code will look like this:
G1 X0Y0 M106 S186
G1 X0.18 M106 S185
G1 X0Y0.18 M106 S184
G1 Y0.36 M106 S182
G1 X0.18Y0.18 M106 S181
G1 X0.36Y0 M106 S180
G1 X0.36Y0.18 M106 S178
G1 X0.18Y0.36 M106 S179
G1 X0Y0.54 M106 S180
G1 Y0.72 M106 S179
G1 X0.18Y0.54 M106 S177
G1 X0.54Y0.18 M106 S176
G1 X0.72Y0 M106 S177
Vicious1: Hope you don’t mind the file attachment. It’s open source GNU license.January 8, 2016 at 9:53 pm #5611
I don’t mind at all I’m glad to be following along.
I can’t hold out much longer, I’ll need a laser to try out all the hard work that has been done in these forums.
Thank you, for your work.January 9, 2016 at 4:55 am #5618
Leo, thanks for making those changes! I tested out some of the lines using the manual control window in Repetier Host, and it looks like the white space between the coordinates is necessary. Also, the M106 Sxxx needs to be on its own line. I don’t know if it needs to precede or follow the coordinates.
I’m looking forward to trying this out. Like Ryan said, thanks for all your work on this! You’re adding value to the MPCNC for all of us.
KarlJanuary 9, 2016 at 5:50 am #5619
Ok I’ll work on it later. Are you sure this will do it? Have you tried sending these commands individually with a gcode sender? Did the laser respond to the M106?January 9, 2016 at 7:07 am #5624
I will go test those things on the MPCNC and laser right now.January 9, 2016 at 7:22 am #5625
Okay verified that M106 and M107 work. I ran this code, which ran as expected, burning diagonal lines at increasing intensity.
G91 M106 S50 G1 X20 Y20 M107 G1 X10 M106 S100 G1 X-20 Y-20 M107 G1 X10 M106 S150 G1 X20 Y20 M107 G1 X10 M106 S200 G1 X-20 Y-20 M107 G1 X10 M106 S255 G1 X20 Y20 M107 G90
You must be logged in to reply to this topic.