The Ultimate GRBL G-Code Commands List PDF: A Comprehensive Guide for CNC Machinists In the world of DIY CNC machining and hobbyist robotics, GRBL is the undisputed king. This open-source firmware powers everything from desktop engravers and 3018 Pro machines to custom plasma cutters and high-end hobby mills. However, a CNC machine is only as smart as the code you feed it. Whether you are writing a program by hand, debugging a toolpath generated by CAM software, or trying to understand why your machine refuses to move, having a reference guide is essential. This article serves as your complete guide to the GRBL command structure. We will break down the essential G-codes, M-codes, and the critical GRBL system commands ( $ ). For your convenience, we have also compiled a downloadable GRBL G-code commands list PDF cheat sheet at the end of this article, designed for you to print and keep next to your controller.
What is GRBL and Why Does It Use a Subset of G-Code? Before diving into the lists, it is important to understand what GRBL actually does. GRBL is a high-performance, interpreter firmware for microcontrollers (typically the Arduino Uno, Nano, or ESP32). It takes standard G-code inputs via a serial connection and translates them into precise electrical pulses that drive your stepper motor drivers. While industrial machines (like Haas or Fanuc) support thousands of commands, GRBL is optimized for speed and memory efficiency. Therefore, it supports a specific subset of standard G-code. If you are migrating from industrial machining to GRBL, you will notice that commands like G83 (Peck Drilling) are handled differently or require specific logic. Understanding exactly which commands GRBL supports prevents the frustration of sending a command only to receive an "Unsupported Command" error.
The Core G-Codes: Motion and Modes These are the bread-and-butter commands that tell your machine how to move. In GRBL, motion commands are modal, meaning once a command is set (like G1), it stays active until changed or canceled. 1. Motion Modes
G0 (Rapid Move): Moves the machine at maximum speed (defined by $110 , $111 , $112 ). Used for traversing between cuts. grbl g code commands list pdf
Example: G0 X10 Y5 (Move quickly to coordinate X10, Y5).
G1 (Linear Move): Moves the machine at a specific feed rate ( F ). Used for cutting.
Example: G1 X50 Y0 F500 (Cut to X50 at 500mm/min). The Ultimate GRBL G-Code Commands List PDF: A
G2 (Circular Motion Clockwise): Moves in an arc from the current position to the target position in a clockwise direction. Requires an offset ( I, J ) or a radius ( R ). G3 (Circular Motion Counter-Clockwise): Moves in an arc counter-clockwise.
Example: G2 X0 Y10 I0 J10 (Cut a clockwise arc).
2. Work Coordinates and Positioning
G17, G18, G19 (Plane Selection):
G17 : XY Plane (Standard for mills). G18 : XZ Plane. G19 : YZ Plane. Note: Essential for circular interpolation (G2/G3) to define which plane the arc moves in.