Moves to target coordinates at maximum traverse rate (seek rate). No feed rate required. Each axis moves at its own maximum rate, so the path is not guaranteed to be a straight line. Subject to rapid overrides (100%/50%/25%).
Controlled straight-line move at the specified feed rate. The tool path is always a precise straight line with all axes arriving simultaneously. Subject to feed rate overrides (10%-200%).
Clockwise circular or helical interpolation in the currently selected plane (G17/G18/G19). Internally rendered as tiny line segments controlled by $12 (arc tolerance).
Counter-clockwise circular or helical interpolation. Same as G2 but in the opposite direction.
Pauses execution for a specified duration. Ignored in check mode ($C). Non-modal.
Sets work coordinate system offsets. Always used with an L word to specify the operation: L2 sets absolute offsets, L20 sets offsets relative to current position. Defined by the NIST RS274/NGC standard.
Selects XY as the active plane for arc commands (G2/G3). I and J specify arc center offsets. Default plane.
Selects ZX as the active plane for arc commands. I and K specify arc center offsets.
Selects YZ as the active plane for arc commands. J and K specify arc center offsets.
Interprets all coordinate and feed rate values in inches.
Interprets all coordinate and feed rate values in millimeters. This is the default.
Moves to the predefined home position stored in EEPROM (set by G28.1). If axis words are given, moves to those coordinates first as an intermediate point, then to the stored position. This is NOT homing — use $H for homing.
Stores the current machine position as the G28 target position. Persistent in EEPROM.
Same as G28 but uses a second stored position (set by G30.1).
Stores the current machine position as the G30 target position. Persistent in EEPROM.
Linear probe move toward workpiece. If the probe does not make contact before reaching the target position, an alarm is thrown. Probe result stored in PRB parameter (viewable via $#).
Same as G38.2 but does not alarm on failure. Sets PRB flag to :0 if no contact made.
Probe expects to start in contact and moves away. Alarm if still in contact at target position.
Same as G38.4 but does not alarm on failure.
Disables cutter radius compensation. This is the default and only supported mode — grbl does NOT support G41/G42 cutter compensation.
Applies a tool length offset. Only the dynamic form (G43.1) is supported — grbl has no tool table. Non-persistent (cleared on reset). Only applies to the configured tool axis (typically Z).
Cancels any active tool length offset. Default state.
Overrides the active work coordinate system for the current line only. Must be paired with G0 or G1. Non-modal — only applies to the line it's on.
Selects work coordinate system 1. This is the default coordinate system. Offset is stored in EEPROM and set via G10 L2/L20.
Selects work coordinate system 2.
Selects work coordinate system 3.
Selects work coordinate system 4.
Selects work coordinate system 5.
Selects work coordinate system 6.
Machine decelerates to a complete stop at the end of each motion command before executing the next. Default path control mode in grbl.
Cancels the active motion mode. No axis words should be present when G80 is active.
All subsequent movement coordinates are interpreted as absolute positions relative to the current work coordinate system origin (set by G54-G59). Default mode.
All subsequent movement coordinates are interpreted as incremental distances from the current position.
Arc center offsets (I, J, K) are always relative to the current position. This is the default and ONLY arc offset mode grbl supports.
Sets a temporary coordinate offset so that the current position reads as the specified value. Non-persistent — cleared on reset.
Cancels the G92 offset, resetting it to zero.
Feed rate F specifies the inverse of time in minutes to complete the move. Each motion command MUST include an F word. F2 means the move should complete in 0.5 minutes (1/2).
Feed rate F is in units (mm or inches) per minute. This is the default mode. F is modal — persists until changed.
Sets a work coordinate system offset (G54-G59) to absolute values. The offset is stored persistently in EEPROM.
Sets a work coordinate system offset such that the current position becomes the specified coordinate value. Persistent in EEPROM.
Halts program execution. Resume with cycle start (~). Spindle and coolant remain in current state.
Conditional program pause. In grbl, M1 always pauses (same as M0) because there is no optional stop switch.
Ends the program. Stops spindle and coolant. Does not rewind.
Turns the spindle on clockwise at the speed specified by S. In laser mode, enables constant power mode.
Turns the spindle on counter-clockwise. In laser mode, enables dynamic power mode where laser power scales proportionally with speed and disables during rapids.
Turns the spindle or laser off. In laser mode, S0 also disables the laser instantaneously without stopping motion.
Enables mist coolant output. Requires ENABLE_M7 compile-time option to be enabled in grbl config.h.
Enables flood coolant output.
Disables both mist and flood coolant. Default state.
Ends the program, stops spindle and coolant, and rewinds to beginning. Triggers a feedback message.
Initiates the homing sequence — moves each axis toward its limit switches to establish machine zero. Only available when $22=1 (homing enabled). Searches at $25 seek rate, re-approaches at $24 feed rate, then pulls off by $27 distance.
Executes a jogging motion that can be cancelled in real-time. Unlike G0/G1, jog commands do not affect the G-code parser state and can be interrupted instantly. Introduced in grbl 1.1.
Overrides the alarm lock to allow movement. Use carefully — machine position may be lost after alarm. Recommended to use G91 incremental mode after unlocking.
Toggles check mode on/off. In check mode, grbl parses G-code and reports errors without moving any axes. Dwells are ignored, spindle and coolant are disabled. Auto-resets when toggled off.
Displays all current grbl settings ($0 through $132) stored in EEPROM.
Displays G54-G59 work coordinate offsets, G28/G30 stored positions, G92 offset, tool length offset (TLO), and last probe result (PRB) with success flag.
Returns the current active modal states including motion mode, coordinate system, plane, units, distance mode, feed rate mode, tool, spindle speed, and feed rate.
Returns grbl version, build date, and optional custom user string. User string can be set with $I=xxx (max 80 chars).
Shows the two startup G-code lines ($N0 and $N1) that execute on every power-up or reset after homing (if enabled).
De-powers spindle, coolant, and stepper enable pins. Blocks all commands. Can only exit via soft-reset (Ctrl-X) or power cycle. Returns to ALARM state on re-init.
Restores all $0-$132 settings to their compile-time default values.
Clears all G54-G59 work coordinate offsets and G28/G30 stored positions from EEPROM.
Clears ALL EEPROM data: settings, coordinate parameters, startup lines, and build info string.
Sets the length of each step pulse in microseconds. This is the duration the step pin is held HIGH for each motor step. Most stepper drivers need at least 2-3us, but noisy or optocoupled setups may need more. Increase if you experience missed steps or erratic motion.
Sets the delay in milliseconds before stepper motors are disabled after completing a motion. When set to 255, steppers are never disabled (always energized). Lower values save power and reduce heat but allow the machine to drift out of position when idle.
Bitmask that inverts the step signal polarity for each axis. Bit 0=X, Bit 1=Y, Bit 2=Z. Use when a stepper driver expects active-low step signals instead of the default active-high.
Bitmask that inverts the direction signal for each axis. Use to reverse the positive direction of an axis without rewiring the motor. Bit 0=X, Bit 1=Y, Bit 2=Z.
Inverts the stepper enable pin logic. When disabled (0), the enable pin is LOW to enable drivers. Set to 1 if your drivers require HIGH to enable.
Inverts the logic of the limit switch input pins. Set to 1 if using normally-closed (NC) limit switches, which is recommended for noise immunity.
Inverts the logic of the probe input pin. Use to match your probe's switch type (NO vs NC).
Configures what data the '?' real-time status report includes. Controls whether work position (WPos) or machine position (MPos) is reported, and whether planner/serial buffer data is included.
Sets the junction deviation value in mm, which controls how fast the machine takes corners between line segments. Higher values allow faster cornering but less precise path following. Lower values produce more accurate corners but slower motion.
Sets the precision of arc rendering in mm. Arcs (G2/G3) are internally converted to tiny line segments; this value controls how closely those segments approximate the ideal arc. Smaller values produce smoother arcs but generate more segments.
Switches status report position values between mm (0) and inches (1). This only affects the reporting format — internal calculations and G-code parsing remain the same and follow G20/G21.
Enables software-enforced travel limits. When enabled, grbl checks if a move would exceed the max travel ($130-$132) and rejects it with an error before motion starts. Requires homing ($22=1) to establish a reference position.
Enables hardware limit switches. When triggered during motion, grbl immediately halts all motion and enters an ALARM state. Strongly recommended for machine protection, but requires proper switch wiring and electrical noise filtering.
Enables the homing cycle ($H command). When enabled, grbl locks out all G-code commands at startup until the machine is homed. Required for soft limits ($20) and accurate machine coordinates.
Bitmask that controls which direction each axis moves during the homing search. By default, all axes home toward the negative direction. Set a bit to home that axis toward the positive direction instead.
Sets the slow feed rate in mm/min used during the second homing approach (locate phase). After the initial fast seek hits the switch, the axis backs off and re-approaches at this slower rate for precise home position determination.
Sets the fast seek rate in mm/min used during the first homing approach. The axis moves at this rate until it hits the limit switch, then backs off and re-approaches at the slower $24 rate.
Sets the debounce delay in milliseconds for homing limit switches. After a switch triggers, grbl waits this long for the signal to settle before confirming the switch state. Helps prevent false triggers from switch bounce.
Sets the distance in mm that each axis backs off from the limit switch after homing completes. This ensures the switch is fully deactivated after homing, preventing immediate hard limit alarms during normal operation.
Sets the maximum spindle speed in RPM. This value is mapped to the maximum PWM duty cycle output. Used by the S command to scale spindle speed proportionally across the PWM range.
Sets the minimum spindle speed in RPM. This value is mapped to the minimum PWM duty cycle. Any S value at or below this produces the minimum PWM output. Useful for spindles or lasers that have a minimum operating speed/power.
Enables laser mode, which changes how the spindle PWM output behaves during motion. In laser mode, the laser automatically turns off during G0 rapids, and M4 enables dynamic power scaling that adjusts laser power proportionally with speed during acceleration/deceleration.
Sets the number of step pulses required to move the X axis one millimeter. This is the fundamental calibration setting for X axis positioning accuracy. Calculated from motor steps/rev, microstepping, and drive mechanism (leadscrew pitch, belt/pulley, etc.).
Sets the number of step pulses required to move the Y axis one millimeter. Same calculation as $100 but for the Y axis.
Sets the number of step pulses required to move the Z axis one millimeter. Same calculation as $100 but for the Z axis. Z often uses a different drive mechanism (e.g., ballscrew vs belt) so this value frequently differs from $100/$101.
Sets the maximum travel rate for the X axis in mm/min. grbl will never exceed this speed on the X axis regardless of the programmed feed rate. Set conservatively — if set too high, the stepper will stall and lose steps.
Sets the maximum travel rate for the Y axis in mm/min. Same as $110 but for the Y axis.
Sets the maximum travel rate for the Z axis in mm/min. Z axis is often slower than X/Y due to gravity loading and the drive mechanism used.
Sets the acceleration for the X axis in mm/sec^2. Controls how quickly the axis ramps up to and down from the target speed. Higher values produce faster motion but risk losing steps if the motor cannot keep up.
Sets the acceleration for the Y axis in mm/sec^2. Same as $120 but for the Y axis.
Sets the acceleration for the Z axis in mm/sec^2. Same as $120 but for the Z axis. Z often needs lower acceleration due to gravity and spindle mass.
Sets the maximum travel distance for the X axis in mm, measured from the home position. Used by soft limits ($20) to prevent the machine from moving beyond its physical range. Always specified as a positive value.
Sets the maximum travel distance for the Y axis in mm. Same as $130 but for the Y axis.
Sets the maximum travel distance for the Z axis in mm. Same as $130 but for the Z axis.
Immediately generates and sends back runtime data with a status report including machine state, position, feed rate, and buffer state. Accepted at any time except during homing and critical alarms.
Places grbl into a suspend/HOLD state. If in motion, the machine decelerates to a controlled stop and then suspends. Does not disable spindle or coolant — only halts motion. If jogging, cancels the jog and flushes remaining jog commands.
Resumes from a feed hold, safety door/parking state (when door is closed), or M0 program pause. If parking is enabled and safety door state is ready to resume, it re-enables the spindle and coolant, moves back into position, then resumes.
Toggles the flood coolant (M8/M9) output pin and directly changes the coolant modal state in the G-code parser. May be commanded in IDLE, RUN, or HOLD states.
Toggles the mist coolant (M7/M9) output pin. Requires the ENABLE_M7 compile-time option. May be commanded in IDLE, RUN, or HOLD states.
Increases spindle speed override by 10%.
Decreases spindle speed override by 10%.
Increases spindle speed override by 1% for fine adjustment.
Decreases spindle speed override by 1% for fine adjustment.
Toggles the spindle enable/disable state, but only while in HOLD state. When motion resumes via cycle start, the last spindle state is restored with a 4-second delay before resuming the tool path. Ignored while in motion.
Immediately halts and safely resets grbl without a power cycle. If reset while in motion, throws an alarm indicating position may be lost. If reset while not in motion, position is retained and re-homing is not required.
Immediately suspends into DOOR state. If in motion, decelerates to a stop then suspends. Disables spindle and coolant. If parking compile-time option is enabled, retracts the spindle to a safe position.
Immediately cancels the current jog state by performing a feed hold and automatically flushing any remaining jog commands in the buffer. Ignored if not in a JOG state.
Resets the feed rate override to 100% of the programmed feed rate.
Increases the feed rate override by 10% of programmed feed rate.
Decreases the feed rate override by 10% of programmed feed rate.
Increases the feed rate override by 1% of programmed feed rate for fine adjustment.
Decreases the feed rate override by 1% of programmed feed rate for fine adjustment.
Resets the rapid rate override to 100% full rapid rate.
Sets the rapid rate override to 50% of full rapid rate.
Sets the rapid rate override to 25% of full rapid rate.
Resets the spindle speed override to 100% of programmed speed.
G-code words consist of a letter and a value. Letter was not found.
Numeric value format is not valid or missing an expected value.
Grbl '$' system command was not recognized or supported.
Negative value received for an expected positive value.
Homing cycle is not enabled via settings ($22).
Minimum step pulse time must be greater than 3 microseconds.
EEPROM read failed. Settings have been reset and restored to default values.
Grbl '$' command cannot be used unless grbl is IDLE. Ensures smooth operation during a job.
G-code locked out during alarm or jog state.
Soft limits cannot be enabled without homing also enabled.
Max characters per line exceeded. Line was not processed and executed.
Grbl '$' setting value exceeds the maximum step rate supported. Compile-time option dependent.
Safety door detected as opened and door state initiated.
Build info or startup line exceeded EEPROM line length limit. Grbl-Mega only.
Jog target exceeds machine travel. Command ignored.
Jog command with no '=' or contains prohibited G-code.
Laser mode requires PWM output. The spindle output pin must support PWM for laser mode ($32=1).
Unsupported or invalid G-code command found in block.
More than one G-code command from the same modal group found in block.
Feed rate has not yet been set or is undefined.
G-code command in block requires an integer value.
Two G-code commands that both require the use of the XYZ axis words were detected in the block.
A G-code word was repeated in the block.
A G-code command implicitly or explicitly requires XYZ axis words in the block, but none were detected.
N line number value is not within the valid range of 1 - 9,999,999.
A G-code command was sent, but is missing some required P or L value words in the line.
Grbl supports six work coordinate systems G54-G59. G59.1, G59.2, and G59.3 are not supported.
G53 requires either a G0 seek or G1 feed motion mode to be active. A different motion was active.
There are unused axis words in the block and G80 motion mode cancel is active.
A G2 or G3 arc was commanded but there are no XYZ axis words in the selected plane to trace the arc.
The motion command has an invalid target. G2, G3, and G38.2 generate this error if the arc is impossible to generate or if the probe target is the current position.
A G2 or G3 arc, traced with the radius definition, had a mathematical error when computing the arc geometry. Try breaking up the arc into semi-circles or quadrants, or redefine with arc offset definition.
A G2 or G3 arc, traced with the offset definition, is missing the IJK offset word in the selected plane to trace the arc.
There are unused, leftover G-code words that aren't used by any command in the block.
The G43.1 dynamic tool length offset command cannot apply an offset to an axis other than its configured axis. The grbl default axis is the Z-axis.
Tool number greater than max supported value.
Hard limit triggered. Machine position is likely lost due to sudden and immediate halt. Re-homing is highly recommended.
G-code motion target exceeds machine travel. Machine position is safely retained. Alarm may be safely unlocked.
Reset while in motion. Grbl cannot guarantee position. Lost steps are likely. Re-homing is highly recommended.
Probe is not in the expected initial state before starting probe cycle. G38.2 and G38.3 require probe not triggered; G38.4 and G38.5 require probe triggered.
Probe did not contact the workpiece within the programmed travel for G38.2 and G38.4.
Reset during active homing cycle.
Safety door was opened during active homing cycle.
Cycle failed to clear limit switch when pulling off. Try increasing pull-off setting ($27) or check wiring.
Could not find limit switch within search distance. Defined as 1.5 × max_travel on search and 5 × pulloff on locate phases.
On dual axis machines, could not find the second limit switch for self-squaring.