Lightburn G Code Error Message on "Cycle Start"

Post anything you want to discuss with others about the software.

Lightburn G Code Error Message on "Cycle Start"

Postby Loren » Thu Feb 27, 2025 3:37 pm

I added an Opt Laser to my CNC router. At this point I am working out the software side of this addition and using Lightburn to create my laser G code.

When I hit "Cycle Start" an error message window pops up that says something about there is G code that UCCNC does not recognize. Is it the ";" they are using for comments?

Here is a simple example of the G code generated by Lightburn.

;LightBurn 1.7.06
;Custom GCode device profile, user origin
;Bounds: X41.4302 Y50.0875 to X44.8302 Y52.2875
G00 G17 G40 G20;Restore imperial mode
G54
G90;Restore absolute mode
G0 X0Y0
G91;Restore relative mode
;Cut @ 236.1999 in/min, 50% power

M8
M5
G0 X3.4Y-2.2
;Layer C01
M10Q127.5
M4
G1 X-3.4F236.2
G1 Y2.2
G1 X3.4
G1 Y-2.2
M9
M5
G90;Restore absolute mode
M2
END OF CODE.

Another question.

When using the M10Q{power} command, is the M4 command needed? I have both in the code, but question if that is correct?

Thanks for any help sorting this out.
Loren
 
Posts: 6
Joined: Mon Jul 25, 2022 12:10 pm

Re: Lightburn G Code Error Message on "Cycle Start"

Postby Loren » Thu Feb 27, 2025 3:47 pm

I think I answered one of my questions on the comment characters.

I found where to change that in Lightburn. It was set to use a semicolon. I change it to ().

Now for the M10Q{power} and M4 commands.
Attachments
Lightburn Comment Character.jpg
Loren
 
Posts: 6
Joined: Mon Jul 25, 2022 12:10 pm

Re: Lightburn G Code Error Message on "Cycle Start"

Postby cncdrive » Fri Feb 28, 2025 3:43 am

You need the M3 command, it is an enable signal for the M10/11 to work, so you have to execute the M3 once, the best is if you executing it in the beggining of your g-code program.
cncdrive
Site Admin
 
Posts: 5183
Joined: Tue Aug 12, 2014 11:17 pm

Re: Lightburn G Code Error Message on "Cycle Start"

Postby iOne » Fri Feb 28, 2025 3:56 am

Hi,

You need a M3 or M4 as enable, depending on your settings (if you want just M3 for the spindle for instance) before the M10Qxxx.
Are you using the UCCNC plugin to convert the code from lightburn to UCCNC?

I have an old version of lightburn, so I do not know if UCCNC is supported directly now from lightburn, but for old versions you need to convert the Gcode that lighburn generates to "UCCNC readable" using the plugin. The plugin (by memory, I have not used it for a while) has the option to replace the M3 for a M4 if you want to use a M4 as laser enable. I hope this helps.
iOne
 
Posts: 38
Joined: Fri Sep 02, 2022 4:56 am

Re: Lightburn G Code Error Message on "Cycle Start"

Postby Loren » Fri Feb 28, 2025 2:30 pm

Okay so one M3 or M4 near the top of the program is all that is needed until an M5 is called. Correct?

My understanding is to use M4 for variable power, or does it not matter while using the M10 Q{power} command?

I am not using the UCCNC Lightburn upload plugin.

I am trying to get the G code to be written out of Lightburn so I can run it directly. I think it is just a matter of getting the Menu page "Custom Gcode" completely configured for what UCCNC needs to run.

Thanks for the help and I will keep trying to fill out the Lightburn Custom Gcode page and testing. Any tips are greatly appreciated.
Loren
 
Posts: 6
Joined: Mon Jul 25, 2022 12:10 pm

Re: Lightburn G Code Error Message on "Cycle Start"

Postby iOne » Fri Feb 28, 2025 9:40 pm

No, M3 or M4 is the same, it is just the "laser enable" command. You can use whatever you want...I just leave M3 for my spindle alone so I use M4 for the laser. The variable power comes from the Qxxx depending how your hardware is wired. You may just have ON and OFF only if you do not have a proper signal.

If you are starting with this, I would just first start trying some basic tests with the MDI in UCCNC before a full Gcode. Try M3 (or M4, whatever your config is) and then a M10 Q10. You should see the laser just turning on and if you have the new laser adapter with the LCD it should say on the screen "Power: 1%" or 2% something like that. (I suppose that I do not need to mention that the laser should be pointing to a non combustible spoil-board and not to yourself or the dog and you should be wearing the protection glasses before doing these tests). M11 should turn it off.

If that is successful, I would try the UCCNC plugin converter to ensure that you do not have a Gcode syntax problem. After that test is successful, then I would try a custom lightburn post processor because as far as I know you cannot export directly from lightburn, the code needs to be modify so UCCNC can read it, but again I am in an old LB 1.4 version so I do not know if anything changed lately.
iOne
 
Posts: 38
Joined: Fri Sep 02, 2022 4:56 am

Re: Lightburn G Code Error Message on "Cycle Start"

Postby Loren » Mon Mar 03, 2025 5:04 pm

I have a profile setup just for the laser and I am using the M4 command to enable the laser at the top of the program and an M5 at the bottom to disable the laser.
I am using M10Q{power} commands to fire the laser, and M11 it stop it from firing.

I have things setup and can make through cuts successfully making rectangle cutouts. Everything is working as it should from my view.

When engraving or more like fill with lower powered cut moves. I am getting these "witness" lines in the overscan area of the moves. I expect the laser to shut off in that part of the move, and it is staying on although at lower power. It can be seen in the results and visibly when the laser is running the tool path.

Results.

Here is my g code.

(Layer C03)
(Cut)
M10Q0
G1 X-0.3333F400
M11
(Cut)
M10Q127.5
G1 X-0.8568
M11
(Cut)
M10Q0
G1 X-0.3333
M11
(Cut)
M10Q0
G1 Y-0.006
M11
(Cut)
M10Q0
G1 X0.3333
M11
(Cut)
M10Q127.5
G1 X0.8568
M11
(Cut)
M10Q0
G1 X0.3333
M11


Between the M10Q0 or the M11 commands be cutting the power to the laser in the X0.333 and X-0.333 moves? That is the overscan part of the Lightburn generated g code.

Thoughts?

Maybe something not configured just right in UCCNC?
Attachments
Witness Lines.jpg
Loren
 
Posts: 6
Joined: Mon Jul 25, 2022 12:10 pm

Re: Lightburn G Code Error Message on "Cycle Start"

Postby Loren » Thu Mar 06, 2025 1:35 am

More info

The laser is not responding to M10 Q0 or M11 commands for zero laser output.

Here is a snip it of code. I made the over scan distance 3.3333 inches so had time to watch it.

G1 Y-14.1934(PWR) M10 Q1
M11
(Cut)
G1 Y-3.3333(PWR) M10 Q0
M11
(Cut)
G1 X0.006(PWR) M10 Q0
M11
(Cut)
G1 Y3.3333(PWR) M10 Q0
M11
(Cut)
G1 Y14.1934(PWR) M10 Q1
M11
(Cut)
G1 Y3.3333(PWR) M10 Q0
M11
(Cut)
G1 X0.006(PWR) M10 Q0
M11
(Cut)
G1 Y-3.3333(PWR) M10 Q0
M11
(Cut)
G1 Y-14.1934(PWR) M10 Q1

Here is video of it running the code. Yes high Z and lower power on purpose so i could video it. You can see the shift in brightness for the M10 Q0 but it is not zero power.

https://youtu.be/-fVjTT_WBlE?si=Gm8LjcjS78QU7Zub
Loren
 
Posts: 6
Joined: Mon Jul 25, 2022 12:10 pm

Re: Lightburn G Code Error Message on "Cycle Start"

Postby elenagilbert » Tue May 06, 2025 8:09 am

iOne wrote:No, M3 or M4 is the same, it is just the "laser enable" command. You can use whatever you want...I just leave M3 for my spindle alone so I use M4 for the laser. The variable power comes from the Qxxx depending how your hardware is wired. You may just have ON and OFF only if you do not have a proper signal Among Us Online

If you are starting with this, I would just first start trying some basic tests with the MDI in UCCNC before a full Gcode. Try M3 (or M4, whatever your config is) and then a M10 Q10. You should see the laser just turning on and if you have the new laser adapter with the LCD it should say on the screen "Power: 1%" or 2% something like that. (I suppose that I do not need to mention that the laser should be pointing to a non combustible spoil-board and not to yourself or the dog and you should be wearing the protection glasses before doing these tests). M11 should turn it off.

If that is successful, I would try the UCCNC plugin converter to ensure that you do not have a Gcode syntax problem. After that test is successful, then I would try a custom lightburn post processor because as far as I know you cannot export directly from lightburn, the code needs to be modify so UCCNC can read it, but again I am in an old LB 1.4 version so I do not know if anything changed lately.

Thank you for sharing a very detailed and practical guide! The basic tests with MDI in UCCNC, as you suggested, will help beginners avoid many unnecessary mistakes when starting to use lasers. I especially appreciate the safety warnings – very correct and necessary!

In your opinion, if the user only has a simple TTL source (on/off but no power adjustment), should he use Lightburn, or should he switch to another software that is more optimized for such hardware?
elenagilbert
 
Posts: 7
Joined: Sat Feb 08, 2025 8:56 am


Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

cron