List of G and M Codes Supported by Lightburn

K40 Laser
Cohesion3D Laserboard
Cluster Smoothie Firmware

Hi All,

Is there a list of Smoothie g and m codes that Lightburn supports?

Thanks for your help.

LightBurn doesn’t support any G or M codes. It generates them, but it doesn’t ever read them on its own. What is it that you’re trying to get from this list?

Thanks Oz.
Sorry for the poorly worded question.

For instance, I know see, from inspecting the config.txt file, that M3 turns the laser on and M5 turns it off, just like spindle on and off in the Smoothieware online documentation.

I thought it would be nice if there were a list of specific g and m code definitions that Lightburn creates. That way it would be easy to decipher the gcode output from Lightburn, in case I want to tweak it.

It really uses very few instructions in the body of the code:

G0 - rapid move
G1 - cutting move (with S as the power paramer and F as the speed)
G4 - Dwell move, if used
M3 / M5 to turn on / off the laser output
G90 / G91 to flip between absolute and relative modes

Ok, one more question. Below is a gcode snippet from Lightburn. I added the line numbers.

001 ; LightBurn 0.9.09
002 ; Smoothieware device profile, absolute coords
003 G00 G17 G40 G21 G54
004 G90

010 M3
020 ; Cut @ 100 mm/sec, 20% power
030 M106
040 G0X22Y27
050 G1X73Y26S0.2F6000
060 G0X74Y165
070 G1X21
080 M107
090 G1S0
100 M5
110 G90
120 ; return to user-defined finish pos
130 G0 X0 Y0
140 M2

I am wondering why the laser is not turned off with an M5 when it rapids. Does the Laserboard somehow automatically know to turn the laser off during rapid moves? Sorry for my ignorance. Being new to laser cutters, I wouldn’t expect the spindle on a cnc router to automatically turn off in the same way.

Also, what does the M2 do on line 140? I can’t find any documentation on that.


The Cohesion3D LaserBoard (in its default setup and wiring for a K40) does not use M3 and M5 to turn the laser on and off. A G1 line moves while the laser fires, a G0 is a travel move (laser does not fire).

The M3/ M5 switch you see defined in the config file is partially a remnant of when C3D did things a different way, and partially still there to support doing things in said different ways if needed. The board (and those commands in LB) support a bunch of different ways of controlling lasers, none of which you will most likely ever need to worry about.

Oh, Ok, thanks Ray.

I guess I’ll just have to work my way through the quirks of the software/hardware.
Time to go make some smoke!

Thanks again.

If you have a problem or concern, post to the Cohesion3D Forum about it so we can help you there. That seems a more logical way to proceed. Enjoy the burning.

Got it.
Thanks Ray.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.