G-code Workshop

GRBL error and alarm codes

GRBL reports a problem with a line in one of two forms. error:N means GRBL rejected one G-code line or command and the job usually continues or stops at that line. ALARM:N means the machine stopped and is locked; clear the cause, then send $X to unlock or $H to home. The tables below list every code in GRBL 1.1.

Most common on laser engravers

Alarm codes

CodeNameMeaning
ALARM:1Hard limitHard limit has been triggered. Machine position is likely lost due to sudden halt. Re-homing is highly recommended.
ALARM:2Soft limitSoft limit alarm. G-code motion target exceeds machine travel. Machine position retained. Alarm may be safely unlocked.
ALARM:3Abort during cycleReset while in motion. Machine position is likely lost due to sudden halt. Re-homing is highly recommended.
ALARM:4Probe failProbe fail. Probe is not in the expected initial state before starting probe cycle when G38.2 and G38.3 is not triggered and G38.4 and G38.5 is triggered.
ALARM:5Probe failProbe fail. Probe did not contact the workpiece within the programmed travel for G38.2 and G38.4.
ALARM:6Homing failHoming fail. The active homing cycle was reset.
ALARM:7Homing failHoming fail. Safety door was opened during homing cycle.
ALARM:8Homing failHoming fail. Pull off travel failed to clear limit switch. Try increasing pull-off setting or check wiring.
ALARM:9Homing failHoming fail. Could not find limit switch within search distances. Try increasing max travel, decreasing pull-off distance, or check wiring.
ALARM:10Homing failHoming fail. Second dual axis limit switch failed to trigger within configured search distance after first. Try increasing trigger fail distance or check wiring.

Error codes

CodeNameMeaning
error:1Expected command letterG-code words consist of a letter and a value. Letter was not found.
error:2Bad number formatMissing the expected G-code word value or numeric value format is not valid.
error:3Invalid statementGrbl '$' system command was not recognized or supported.
error:4Value < 0Negative value received for an expected positive value.
error:5Setting disabledHoming cycle failure. Homing is not enabled via settings.
error:6Value < 3 usecMinimum step pulse time must be greater than 3usec.
error:7EEPROM read fail. Using defaultsAn EEPROM read failed. Auto-restoring affected EEPROM to default values.
error:8Not idleGrbl '$' command cannot be used unless Grbl is IDLE. Ensures smooth operation during a job.
error:9G-code lockG-code commands are locked out during alarm or jog state.
error:10Homing not enabledSoft limits cannot be enabled without homing also enabled.
error:11Line overflowMax characters per line exceeded. Received command line was not executed.
error:12Step rate > 30kHzGrbl '$' setting value cause the step rate to exceed the maximum supported.
error:13Check DoorSafety door detected as opened and door state initiated.
error:14Line length exceededBuild info or startup line exceeded EEPROM line length limit. Line not stored.
error:15Travel exceededJog target exceeds machine travel. Jog command has been ignored.
error:16Invalid jog commandJog command has no '=' or contains prohibited g-code.
error:17Setting disabledLaser mode requires PWM output.
error:20Unsupported commandUnsupported or invalid g-code command found in block.
error:21Modal group violationMore than one g-code command from same modal group found in block.
error:22Undefined feed rateFeed rate has not yet been set or is undefined.
error:23Invalid gcode ID:23G-code command in block requires an integer value.
error:24Invalid gcode ID:24More than one g-code command that requires axis words found in block.
error:25Invalid gcode ID:25Repeated g-code word found in block.
error:26Invalid gcode ID:26No axis words found in block for g-code command or current modal state which requires them.
error:27Invalid gcode ID:27Line number value is invalid.
error:28Invalid gcode ID:28G-code command is missing a required value word.
error:29Invalid gcode ID:29G59.x work coordinate systems are not supported.
error:30Invalid gcode ID:30G53 only allowed with G0 and G1 motion modes.
error:31Invalid gcode ID:31Axis words found in block when no command or current modal state uses them.
error:32Invalid gcode ID:32G2 and G3 arcs require at least one in-plane axis word.
error:33Invalid gcode ID:33Motion command target is invalid.
error:34Invalid gcode ID:34Arc radius value is invalid.
error:35Invalid gcode ID:35G2 and G3 arcs require at least one in-plane offset word.
error:36Invalid gcode ID:36Unused value words found in block.
error:37Invalid gcode ID:37G43.1 dynamic tool length offset is not assigned to configured tool length axis.
error:38Invalid gcode ID:38Tool number greater than max supported value.

Source: the official Grbl v1.1 documentation (gnea/grbl, GPLv3). Other firmware such as FluidNC may use extra codes.

Related: send G-code from Android, supported machines.

By Miguman, CNC machine operator, programmer and toolmaker with more than 25 years of experience. Updated .