Welcome! Log In Create A New Profile

Advanced

Laser raster GCode interactions with Marlin firmware and GRBL software

Posted by jdargot 
Laser raster GCode interactions with Marlin firmware and GRBL software
July 09, 2018 02:35PM
Hello,

I will start from the beginning to ensure I cover all the details.
I built a Shapeoko model 3D printer/CNC running off Arduino Mega and Ramps 1.4, configured with Marlin and GRBL interchangeably. I recently decided to convert the whole thing into a laser engraver and after a lot of consideration, decided to go with Marlin for speed and SD capability. The issue is that the best Gcode softwares seem intended for GRBL.
I am primarily using LaserGRBL and LaserWeb. Both of these work fine for vector cuts (I use the D9 port and tweaked the firmware to read an M3 command instead of M106). As you can see from the Gcode I attached, this may work for vectors but not rasters which give the bit-by-bit commands. Essentially, this M3 command is sent followed by an S0 to give the laser zero power and in each following line, the motor commands are given with an S command for laser intensity. The problem is that Marlin seems to need an M3 command every line in order to change the laser's intensity.
As it is now, the Gcode runs with no laser and when I manually add M3 to every line after the start, it runs just fine. Since I can't change LaserGRBL, I would like to find some way of adapting the firmware to read this code without M3 on every line.
Is this possible? If so, how would I go about it? I'm still newer to the language so you might need to use small words.
Any advice is greatly appreciated. Thank you.
Re: Laser raster GCode interactions with Marlin firmware and GRBL software
July 09, 2018 02:37PM
Here is a sample of the Gcode I referenced.

G90
G0 X0 Y0
M3 S0
F1000
X0.1 S19
X0.15 S18
X0.2 S17
G0 X0.25 Y0 S0
G1 X0.45 S17
X0.55 S18
X0.65 S17
X0.7 S19
X0.85 S18
X0.9 S17
X0.95 S18
X1.05 S19
X1.1 S18
X1.2 S17
X1.25 S18
X1.3 S17
X1.4 S18
X1.5 S17
X1.65 S18
X1.85 S19
...
Re: Laser raster GCode interactions with Marlin firmware and GRBL software
July 10, 2018 12:59AM
You should take a look into the 'laser' section of this forum. There are lots of hints, how to control a laser for engraving.
I often use 'inkscape' with various plugins to generate grayscale Gcode. Sometimes I have to postprocess the generated Gcode in a text-editor. Some people have written postprocessing-scripts in Python.
It's pretty hard for the Arduino ( or the USB port ) to process all the data fast enough.
A 32bit controller would be better.
Re: Laser raster GCode interactions with Marlin firmware and GRBL software
July 10, 2018 02:50PM
Thanks. I actually have a controller I am using under most situations. It's just a little harder when I want to set for multiple passes and such.
Yeah, I have considered inkscape too. I'll need to look further into the plugins there.
And I'll definitely look into that laser section, thanks for the advice.
Re: Laser raster GCode interactions with Marlin firmware and GRBL software
July 11, 2018 03:42PM
WHAT?

I have a shapeoko 2 with arduino and GRBL board
can throw a router or laser on it --- it's great

Laser is controlled off of pin12 TTL to laser control board

Laser GRBL and other software crbide create generate good g-code and UGS runs it out to machine

There is 3D printer Firmware (Marlin) and CNC firmware (GRBL)

Perhaps you should use modify cooking softwate to paint a house?

I don't know why you selected Marlin?

Current Marlin bloated with code for every machine and every bell and whistle
Would be nice it one could choose configuration before compile and load of Marlin.

The software is Named Laser GRBL NOT laser GRBL / Marlin

might want to look at:

Marlin firmware as laser cutter

[reprap.org]


Turnkey K40 Laser Arduino + Ramps Firmware

[github.com]


angry smiley
Re: Laser raster GCode interactions with Marlin firmware and GRBL software
July 11, 2018 04:24PM
I get it, GRBL is based around router/laser work to begin with and as such, it is simpler to connect to those softwares. My reason for picking Marlin is because it's fast, versatile, and works well for SD projects. It's not the easiest thing to convert but I am asking here because I think it is worth it and I want to see if others have tried. The gcode is rather similar all things considered and at the very least, I learn what not to do in the future.
Re: Laser raster GCode interactions with Marlin firmware and GRBL software
December 07, 2018 09:18PM
Hi jdargot! Check out this little app ImageToGcode
It works with Marlin and Repetier firmware.
Sorry, only registered users may post in this forum.

Click here to login