CNC Router — GRBL Command Reference

Jul 14, 2026 11:55am · 5 views
cncgrblgcodecommandsreferenceugscncjs1c3d
Markdown

CNC Router — GRBL Command Reference

GRBL is the firmware on most desktop CNC routers. This is a quick reference for the commands you'll use at the console and the GCode you'll see in toolpaths.

GRBL Real-Time Commands

These work immediately, even mid-job — send directly from UGS or CNCjs console:

CommandAction
~Resume from feed hold / pause
!Feed hold — pause the job
?Status report (position, state)
Ctrl+XSoft reset — emergency stop, keep position
$XKill alarm lock after emergency stop
$HHome all axes (if homing enabled)
$HXHome X axis only

GRBL Settings ($ commands)

SettingDescriptionExample
$0Step pulse time (μs)$0=10
$1Step idle delay (ms)$1=25
$2Step port invert mask$2=0
$3Direction port invert$3=4
$5Limit pin invert$5=0
$10Status report mask$10=1
$11Junction deviation$11=0.010
$20Soft limits enable$20=1
$21Hard limits enable$21=0
$22Homing enable$22=1
$23Homing direction invert$23=0
$24Homing feed rate$24=25
$25Homing seek rate$25=500
$27Homing pull-off$27=1
$100X steps/mm$100=40
$101Y steps/mm$101=40
$102Z steps/mm$102=200
$110X max rate (mm/min)$110=3000
$111Y max rate$111=3000
$112Z max rate$112=500
$120X acceleration$120=200
$121Y acceleration$121=200
$122Z acceleration$122=50
$130X max travel$130=400
$131Y max travel$131=400
$132Z max travel$132=90
$30Max spindle speed (RPM mapping)$30=1000
$31Min spindle speed$31=0
$32Laser mode enable$32=0

Common GCode Commands

GCodeDescription
G0 X10 Y10Rapid move to X10 Y10
G1 X10 Y10 F500Linear move at 500mm/min
G2 X10 Y0 I5 J0Clockwise arc
G3Counterclockwise arc
G17XY plane (default)
G20Inch mode
G21Millimeter mode
G28Home axes
G90Absolute positioning
G91Relative positioning
G92 X0 Y0 Z0Set current position as origin
M3 S10000Spindle on clockwise at 10000 RPM
M4 S10000Spindle on counterclockwise
M5Spindle stop
M8Coolant on
M9Coolant off

Zeroing Workflow

; Jog to desired XY origin
G92 X0 Y0       ; Set XY zero here

; Jog Z to material surface
G92 Z0           ; Set Z zero at surface

; Return to origin and begin job
G0 X0 Y0
G0 Z5            ; Safe height clearance

Troubleshooting GRBL

SymptomCheck
Steps missing (position drift)Acceleration too high — reduce $120/$121
Machine won't homeHoming not enabled ($22=1), or limit switch wiring
Spindle doesn't runCheck M3 command, $30 setting, PWM wiring
Alarm on connectSend $X to kill alarm, then $H to home
Position wrong after resetAlways home after power cycle or reset

Links