Error 20, job halted, Custom machine with FluidNC

Hello, I built my own three-axis laser machine using a Pibot mainboard and programmed the firmware with FluidNC. Everything works correctly: framing, homing, and free, repeated movement of all axes. However, when I start a job it stops after a short tim. Specifically, after finishing the first shape, it moves on to the next shape and then freezes with the following message:
-error:20
Unsupported or invalid g-code command found in block.
On or near line 0:
Job halted
Stream completed in 0:00
UPDATE:
I exported the G-Code generated by Lightburn and opened it with OpenBuild, and the error is the same:

Used A.I. instead of Lightburn Docs, but this should help:

Lightburn supports the M4 G-code command, which enables dynamic, variable-power laser control, but it requires specific GRBL firmware (1.1f or later) or a custom G-code device configuration to function correctly. You must use the standard “GRBL” device profile in LightBurn to use M4, as opposed to the “GRBL-M3” profile, which is for older firmwares that don’t support M4.

There may be a special .lbdev file for FluidNC controllers.

Showing us at least the first few lines of the offending G-Code will be helpful.

Typically, however, this is due to selecting the wrong Device Type, so that LightBurn is generating G-Code in a dialect that the controller doesn’t understand.

Similarly, enabling G-Code Clustering for a controller that can’t handle it never works.

@MikeyH likely pinned it down, but this FluidNC discussion may be relevant:

1 Like

It appears that the offending command is M4. FluidNC supports M4, but only if your config file has a “Laser:” section as described at Spindles | Wiki.js You can get more help with FluidNC via our Discord server, see Discord Server | Wiki.js . This is definitely not a problem with LightBurn; but rather a misconfiguration of FluidNC.

1 Like

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