Lightburn Code for Mach3

I have a 10w Endurance laser set up on my CNC. I run Mach 3 and use M11Px Sx and M10Px to turn the laser on and off. Within Lightburn I use the GRBL M3 profile to generate code. I run the code thru a custom script to change M3/M5 to M11/M10 with some other minor modifications this works great for cutting wood veneers at 100% power.

The issue I have discovered is that if I generate code this way Mach3 ignores any and all S commands for laser power. I can set the power to S0 and it fires at 100%. Great for cutting but not great for engraving. I have been working around this with changes to feed rate but this degrades the quality as it induces vibration in the machine.

I have played with other GRBL profiles in LB and I can make get Mach3 to recognize the Sx commands with those but I can not get those profiles to turn on and off between jogs/cuts like I can with the GRBL M3 profile.

The M3 profile inserts a laser on/off command at each jog move where the other GRBL profiles just turn the laser on and use G1/G0 moves to turn the laser on and off as needed.

I have also used Inkscape to generate code and it works great for power control but it is clunky. Lightburn is a much nicer way of generating laser code.

I would like to find a solution to this. If anyone has any kind of ideas or information it would be greatly appreciated.

How are you normally controlling the laser power through Mach3?

Well if things were working as they should the Sxx command should control the laser power. But something in the way that Lightburn or the GRBL M3 profile generate the code causes Mach3 to ignore any and all Sxx commands.

If I use inksacape and the LaserTools extension I can control power very well ….but I’d like to use Lightburn as it is much easier to use the inksacape.

Not sure if this answers your question or not.

I would try a really simple program like a circle using both methods and compare to see what is actually different. Make some manual edits until you can get the M3 profile S commands to work and then create another script to make that edit for you.

Thanks I will try it. It’s not a huge issue for me as I usually just cut wood veneers with the laser at 100% power. But I would like to be able to figure this out. I can’t be the only person using mach3 and Lightburn for laser who has this issue.

Unfortunately I think most people have to get creative about the laser control, both on/off and power level depending on their specific hardware. For example, I use the counter-clockwise spindle command to enable the laser (M4), I use a virtual B axis to set the power level, and then use motion coordinated commands to turn it on and off (M62/M63). I still use Lightburn, but I have to post-process it to substitute the appropriate commands.

Think you could send me screen shots of your mach3 configuration?

Sorry, I switched to Mach4 a few years ago. Even before the switch I was using an external motion controller, so unless you’re using the same one (pokeys57cnc) then it probably wouldn’t help much.

So with some research and testing I have found a way to get my laser to not only work with correct S commands using Mach 3, GRBL and Lightburn. I now the the capability to run multiple power levels in the same program.

This requires M10/M11 and PWM set up correctly in mach3.

In Lightburn use the GRBL profile.

At every G0 move add a M10Px above this commas and M11Px Sxx below this command.

Be sure all M3 and M5 commands are also changed to M11/M10.

I had chatGPT write me an apple script to change all of these things for me. It still Needs work but is functional.

There are a couple things to work out still, like if you want to run the program again it must be reloaded manually. Rewind or M30 results in 100% power for the whole program. Not sure why this is happening.

1 Like