Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home 3D Printing

GRBL Setup Tutorial: CNC Controller Configuration Step-by-Step

GRBL Setup Tutorial: CNC Controller Configuration Step-by-Step

March 11, 2026 /Posted byJayesh Jain / 0

GRBL is the open-source firmware that powers the vast majority of desktop CNC routers, laser engravers, and mills in India and worldwide. Written in C for the AVR platform, GRBL turns a standard Arduino Uno or Nano into a capable 3-axis CNC motion controller that interprets G-code and drives stepper motors with precise timing. If you have just bought a 3018 CNC router, laser engraver, or built your own CNC machine, this GRBL setup tutorial will walk you through every step of configuration.

Table of Contents

  1. What Is GRBL and What Does It Do?
  2. Hardware: Arduino and CNC Shield
  3. Flashing GRBL to Arduino
  4. Wiring the CNC Shield
  5. Configuring Stepper Drivers (A4988/DRV8825)
  6. GRBL Settings ($ Parameters) Explained
  7. Calibrating Steps Per mm
  8. Homing Switches and Limit Switches
  9. Sender Software: gSender and Candle
  10. Running Your First Cut
  11. Troubleshooting GRBL Issues
  12. Frequently Asked Questions

1. What Is GRBL and What Does It Do?

GRBL (pronounced “gerbil”) is a high-performance, open-source firmware for CNC motion control. It was designed for Arduino Uno (ATmega328P) but has since been ported to other platforms. GRBL:

  • Reads G-code commands over USB serial (from your laptop running gSender/Candle)
  • Executes precise stepper motor step pulses at up to 30 kHz
  • Controls spindle speed via PWM output
  • Handles limit/homing switches for safe machine operation
  • Manages coolant and probe inputs
  • Implements look-ahead buffering for smooth motion curves

The current stable version is GRBL 1.1h, which introduced improved arc generation and better status reporting. GRBL-HAL is a newer fork targeting 32-bit boards (STM32, ESP32). For Arduino Uno-based CNC shields, GRBL 1.1h is the standard choice.

2. Hardware: Arduino and CNC Shield

Arduino Uno

GRBL runs on the Arduino Uno (ATmega328P at 16MHz). The Uno’s 16MHz clock is the limiting factor for step frequency — it handles up to about 30kHz step pulses, suitable for most stepper motors with microstepping. An Arduino Nano can also run GRBL for very compact builds.

CNC Shield V3

The CNC Shield V3 is the most common GRBL expansion board in India. It plugs directly onto the Arduino Uno headers and provides:

  • Sockets for 4 stepper driver modules (X, Y, Z, and A/clone axis)
  • Microstepping selection jumpers (MS1, MS2, MS3) per axis
  • Limit switch inputs (X+, X−, Y+, Y−, Z+, Z−)
  • Spindle PWM output
  • Spindle enable (DIR) output
  • Coolant output
  • Emergency stop pin
  • 24V terminal for stepper power (motor supply)

GRBL Boards (All-in-One)

Dedicated GRBL boards like the Woodpecker CNC board, Blackbox (OpenBuilds), and various Chinese integrated boards combine the Arduino and CNC shield into one PCB. These are simpler to wire and are often pre-flashed with GRBL. Most 3018 Pro kits sold in India use one of these integrated boards.

Aluminium Heat Sink

B-Type Aluminium Heat Sink for MK7/MK8 – Stepper Driver Cooling

GRBL CNC stepper drivers (A4988/DRV8825) get very hot during long jobs. Stick these aluminium heatsinks directly on the driver ICs to prevent thermal shutdown and missed steps during multi-hour cuts.

View on Zbotic

3. Flashing GRBL to Arduino

If your machine did not come pre-flashed with GRBL, or you want to update to the latest version, follow these steps:

  1. Download GRBL. Get the latest release from github.com/gnea/grbl/releases — download the source zip (grbl-1.1h.20190825.zip).
  2. Install Arduino IDE. Download Arduino IDE 1.8.x from arduino.cc (v2.x also works). Install on Windows, Mac, or Linux.
  3. Import GRBL library. In Arduino IDE: Sketch → Include Library → Add .ZIP Library → select the downloaded GRBL zip file.
  4. Open the GRBL example sketch. File → Examples → grbl → grblUpload
  5. Select correct board and port. Tools → Board → Arduino Uno. Tools → Port → select your Arduino’s COM port (Windows: Device Manager will show it; Linux: /dev/ttyUSB0 or /dev/ttyACM0).
  6. Upload. Click the Upload arrow. The process takes about 30 seconds. The IDE will show “Done uploading” when complete.
  7. Verify. Open Serial Monitor at 115200 baud. You should see: Grbl 1.1h ['$' for help]. Type $$ and press Enter to see all current settings.

4. Wiring the CNC Shield

Power Supply

The CNC shield requires two power supplies:

  • Arduino power: 5V via USB from laptop (during setup) or 7–12V via DC barrel jack (during operation to avoid PC current draw issues).
  • Stepper motor power: 12–24V DC at adequate current (typically 10–20A for a 3-axis machine). This connects to the VMotor terminals on the shield. Do NOT connect this to the Arduino’s voltage regulator — it will damage the board. The CNC shield routes motor power directly to the stepper driver modules.

Stepper Motor Wiring

Each stepper motor connects to one driver socket on the CNC shield via a 4-pin connector (or screw terminals). The important thing is to identify your motor’s two coil pairs (A1/A2 and B1/B2). You can identify coil pairs with a multimeter — connected wires in the same coil will have resistance (typically 1–5 ohms), while wires from different coils show open circuit (infinite resistance).

If a motor runs in the wrong direction, simply swap the A1 and A2 wires (or flip the connector). Do not try to reverse direction in software until you have verified physical wiring is correct.

Spindle Wiring

The CNC shield’s spindle output is a PWM signal (GRBL pin D11, mapped to the SpnEn header). For a DC spindle with a PWM-capable speed controller (ESC), connect the PWM signal to the controller’s signal wire. For simple on/off spindles, connect SpnEn to a relay module controlled from the shield.

5. Configuring Stepper Drivers (A4988/DRV8825)

A4988 vs DRV8825

  • A4988: Maximum 2A per coil, 1/16 microstepping, well-proven, widely available in India at ₹80–₹150 each. Good for NEMA17 motors up to 1.7A.
  • DRV8825: Maximum 2.5A per coil, 1/32 microstepping, lower noise, better for NEMA23 motors. Slightly more expensive at ₹150–₹250 each.

Microstepping Jumpers

Under each stepper driver socket on the CNC Shield V3 are three jumper pairs (MS1, MS2, MS3). These set the microstepping mode:

MS1 MS2 MS3 Microstepping (A4988)
OFF OFF OFF Full step
ON OFF OFF 1/2 step
OFF ON OFF 1/4 step
ON ON OFF 1/8 step
ON ON ON 1/16 step

Most 3018 CNC routers use 1/8 or 1/16 microstepping. Higher microstepping = smoother motion but lower maximum speed (due to GRBL’s step frequency limit). 1/8 stepping is a good balance.

Setting Current Limit (VREF)

The most critical stepper driver adjustment is current limit. Over-current burns motors and drivers; under-current causes missed steps. Use a multimeter in DC voltage mode:

  • Measure VREF between the driver’s trimpot (center of the small adjustable potentiometer) and GND.
  • For A4988: Imax = VREF / 0.625 (with 0.1Ω sense resistors). Set VREF = (rated motor current × 0.625).
  • For DRV8825: Imax = VREF / 0.5. Set VREF = (rated motor current / 2).
  • Start at 70–80% of motor rated current. For a 1.7A NEMA17: VREF ≈ 0.85V on A4988.

6. GRBL Settings ($ Parameters) Explained

Type $$ in your GRBL sender to see all current settings. Here are the most important ones:

Parameter Description Typical Value (3018)
$0 Step pulse time (µs) 10
$1 Step idle delay (ms) 25 (255 = always on)
$2 Step port invert (bitmask) 0
$3 Direction port invert (bitmask) 0 (adjust if axes move wrong direction)
$4 Step enable invert 0
$5 Limit pin invert (NC vs NO switches) 0 (NC=1)
$10 Status report mask 1
$20 Soft limits enable 0 (1 if homing enabled)
$21 Hard limits enable 0 (1 with limit switches)
$22 Homing cycle enable 0 (1 with limit switches)
$100 X steps/mm 800 (varies by machine)
$101 Y steps/mm 800
$102 Z steps/mm 800
$110 X max rate (mm/min) 800
$111 Y max rate (mm/min) 800
$112 Z max rate (mm/min) 400 (Z is slower)
$120 X acceleration (mm/s²) 40
$130 X max travel (mm) 300 (your machine’s X range)

Change any setting by typing the parameter and value, e.g.: $100=800 followed by Enter. Changes are saved to Arduino EEPROM immediately.

7. Calibrating Steps Per mm

Getting steps/mm right is fundamental — incorrect values mean your G-code dimensions do not match reality. Here is the calculation and calibration process:

Theoretical Calculation

Steps/mm = (Motor steps per revolution × Microstepping) / (Lead screw pitch mm)

Example: NEMA17 (200 steps/rev) × 1/8 microstepping / 2mm lead pitch
= 200 × 8 / 2 = 800 steps/mm

For belt drive: replace pitch with (belt pitch × pulley teeth)
Example: GT2 belt, 20-tooth pulley → pitch distance = 2mm × 20 = 40mm/rev
Steps/mm = (200 × 16) / 40 = 80 steps/mm

Practical Calibration

  1. Set your calculated theoretical value first: $100=800
  2. Mark a reference point on your machine (a piece of tape on the axis).
  3. Send a 100mm move command: G91 G1 X100 F200
  4. Measure the actual distance moved with a ruler or digital calipers.
  5. Calculate corrected steps/mm: New steps/mm = Old steps/mm × (100 / actual mm moved)
  6. Example: moved 97mm instead of 100mm → 800 × (100/97) = 824.7. Set $100=824.7
  7. Repeat until measured movement matches commanded movement within 0.1mm.

8. Homing Switches and Limit Switches

Homing switches allow GRBL to find a consistent machine origin (machine zero) at power-on. Limit switches prevent the machine from crashing into its mechanical ends. These can be the same switches — GRBL supports both modes.

Switch Types

  • Normally Closed (NC): Switch is closed (circuit active) when not triggered. Opens when the axis reaches the switch. Safer — a broken wire triggers a fault rather than being invisible.
  • Normally Open (NO): Switch is open until triggered. Simpler wiring but a broken wire is invisible to GRBL.

NC switches are recommended. Set $5=1 to invert limit pin logic for NC switches.

Wiring Limit Switches

Each axis minimum switch connects to the Xmin, Ymin, Zmin headers on the CNC shield. Connect one switch terminal to the signal pin and the other to GND. No pull-up resistors are needed — the CNC shield or Arduino provides internal pull-ups on limit inputs.

Enabling Homing

$22=1   ; Enable homing cycle
$23=0   ; Homing direction mask (0 = home to -X, -Y, +Z)
$24=25  ; Homing feed rate (mm/min) - slow speed for switch contact
$25=500 ; Homing seek rate (mm/min) - fast approach speed
$26=250 ; Homing debounce delay (ms)
$27=1   ; Homing pull-off distance (mm) - backs off switch after homing
$21=1   ; Enable hard limits (optional - halts machine if limit hit)
$20=1   ; Enable soft limits (requires homing to be done first)

After enabling homing, type $H to run the homing cycle. The machine will seek each axis minimum (or maximum for Z) at the seek rate, back off, and re-approach slowly for accurate repeatability.

9. Sender Software: gSender and Candle

gSender (Recommended for Beginners)

gSender by Sienci Labs is the most polished and beginner-friendly GRBL sender available. Key features:

  • Visual 3D toolpath preview
  • Built-in GRBL settings editor with descriptions for every parameter
  • Probing wizard (touch plate support)
  • Macros for common operations
  • Job time estimation
  • Spindle/laser control panel
  • Available for Windows, Mac, and Linux. Free.

Candle (Lightweight Alternative)

Candle is a simpler GRBL sender popular for its low resource usage. It shows a basic 3D toolpath view, has manual jogging controls, and supports GRBL 1.1 status reporting. Good choice for older laptops or when you need a minimal interface. Free, open-source.

Universal G-Code Sender (UGS)

UGS is a Java-based sender with a long track record of reliability. Good for production environments. Requires Java runtime. The UGS Platform version has a more modern interface with plugin support.

Basic Workflow in gSender

  1. Connect: Select COM port and click Connect. gSender will identify your GRBL version.
  2. Home machine: Click the Home button (runs $H).
  3. Load G-code: File → Open. Navigate to your .nc or .gcode file.
  4. Set work zero: Jog to your intended start position (usually bottom-left corner of material), then click Zero → Zero All Axes.
  5. Verify Z height: Jog Z to material surface, use paper or touch plate to set Z zero.
  6. Preview: Use the 3D preview to confirm the toolpath looks correct.
  7. Run: Click Start. Monitor the cut — have an E-stop ready.
MK8 Extruder Aluminum Block

Left Side MK8 Extruder Aluminum 3D Printer Block

Building a CNC machine that also handles filament-based material deposition? A quality aluminium extruder block ensures reliable operation for hybrid CNC/3D printer builds.

View on Zbotic

10. Running Your First Cut

Before cutting real material, follow these steps to reduce the chance of an expensive mistake:

Air Cut Test

Raise the Z-axis 20mm above the material and run your G-code. With the spindle off, watch the machine trace the entire toolpath in air. Verify:

  • The toolpath matches your expected design
  • The machine does not travel to unexpected positions
  • No axis reaches its travel limit
  • The cut origin (zero position) is correct

First Layer Test Cut

Modify your G-code to cut only the first pass (reduce total Z depth to one pass depth). This verifies feed rates, spindle speed, and material response before committing to the full depth.

Key G-code Commands to Know

G28       ; Return to home (machine zero)
G0 X0 Y0  ; Rapid move to work zero (X=0, Y=0)
G1 Z-1 F100  ; Feed move: cut 1mm into material at 100mm/min
G91       ; Set incremental positioning mode
G90       ; Set absolute positioning mode (default)
M3 S1000  ; Spindle on clockwise at 1000 RPM (if spindle is PWM-controlled)
M5        ; Spindle off

11. Troubleshooting GRBL Issues

Alarm: Limit Switch Triggered

GRBL enters an Alarm state if a limit switch triggers unexpectedly. Type $X to clear the alarm and unlock the machine. Check that your limit switch wiring is correct and that $5 is set appropriately for your switch type (NC vs NO).

Axis Moves in Wrong Direction

Change the direction invert bitmask with $3. The bitmask is binary: bit 0 = X, bit 1 = Y, bit 2 = Z. To invert X only: $3=1. To invert X and Y: $3=3. Alternatively, swap the coil pair wires on the motor connector.

Stepper Motor Stalling / Missing Steps

Causes: current limit too low (raise VREF), acceleration too high (lower $120–$122), max rate too high (lower $110–$112), loose coupling, or mechanical binding. Reduce acceleration and speed first to diagnose.

Inaccurate Cutting (Dimensions Wrong)

Recalibrate steps/mm ($100–$102). Check for mechanical backlash in lead screws or belt stretch. Verify microstepping jumpers match your steps/mm calculation. Check that the workpiece is not shifting during cutting (workholding issue).

GRBL Not Responding / No Connection

Check COM port selection, ensure baud rate is 115200 in your sender software. Try a different USB cable (data cable, not charge-only). On Windows, check Device Manager for driver issues. On Linux, ensure user is in the dialout group: sudo usermod -a -G dialout $USER

NTC Thermistor

100k NTC Thermistor with Copper Tip

When building custom CNC spindle temperature monitoring or a hybrid CNC/printer system, reliable NTC thermistors provide accurate readings for your controller board.

View on Zbotic

Frequently Asked Questions

What is the latest version of GRBL and where do I download it?

GRBL 1.1h (released 2019) is the latest stable version for Arduino Uno. Download it from github.com/gnea/grbl/releases. GRBL-HAL is a more recent fork for 32-bit platforms (ESP32, STM32). For most Indian hobbyists with 3018-style CNC routers, GRBL 1.1h on Arduino Uno remains the standard and best-supported choice in 2026.

Can GRBL control a 4th axis?

GRBL 1.1 supports 3 axes plus an A-axis clone (the 4th driver on the CNC Shield can be configured to clone the Y or X axis for dual-motor gantry setups). True 4th-axis rotary (A-axis for rotation) requires GRBL-HAL or a different firmware like Marlin or LinuxCNC. Most hobbyist 3018 machines do not need a 4th axis, but if you plan rotary engraving, investigate GRBL-HAL on ESP32.

How do I reverse a motor direction in GRBL?

Use the $3 direction invert bitmask. It is a binary value where bit 0 = X, bit 1 = Y, bit 2 = Z. To invert X axis only, set $3=1. To invert Y only, set $3=2. To invert both X and Y, set $3=3 (binary 011). Alternatively, physically swap one coil pair wire on the motor connector — this is simpler if you have easy access to the wiring.

What is the difference between GRBL and Klipper for CNC?

GRBL runs directly on the Arduino microcontroller and handles all motion planning on-chip. Klipper offloads motion planning to a Raspberry Pi, leaving the microcontroller only to execute step pulses — this enables much higher step rates and more complex kinematics. Klipper is primarily designed for 3D printers. For CNC routing and milling, GRBL (or GRBL-HAL on 32-bit boards) is the standard choice. LinuxCNC on a dedicated PC is used for high-precision industrial CNC work.

Why does my CNC machine lose steps on long cuts?

Lost steps on long cuts are typically caused by: stepper driver overheating (add heatsinks and a small fan), current limit set too low (raise VREF), feed rate too high for the cutting force (reduce feed rate), mechanical binding (check that all axes move freely by hand), or USB communication interruptions (use a dedicated laptop not running other tasks, and try a different USB cable). Heatsinking the stepper drivers is the most common fix for Indian conditions where ambient temperatures are high.

Build and Upgrade Your CNC Machine

Zbotic stocks stepper motor components, heat sinks, thermistors, and maker electronics to help you build, configure, and upgrade your CNC router or 3D printer. Browse our full range of maker supplies.

Shop CNC and Maker Components

Tags: Arduino CNC, CNC configuration, CNC controller, GRBL setup, gSender
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
28BYJ-48 Stepper Motor with UL...
blog 28byj 48 stepper motor with uln2003 driver complete tutorial 596328
blog 433mhz rf module low cost wireless data transmission guide 596336
433MHz RF Module: Low Cost Wir...

Related posts

Svg%3E
Read more

3D Printer Filament Dryer: Keep Materials Moisture-Free

April 1, 2026 0
Table of Contents Why Filament Moisture Is a Problem Signs of Wet Filament Dedicated Filament Dryers Available in India DIY... Continue reading
Svg%3E
Read more

3D Printer Belt Tensioning: Prevent Artifacts

April 1, 2026 0
Table of Contents How Belt Tension Affects Print Quality Identifying Belt Tension Problems How to Tension X and Y Belts... Continue reading
Svg%3E
Read more

3D Printer Hotend Guide: All-Metal vs PTFE Lined

April 1, 2026 0
Table of Contents What Is a Hotend and How It Works PTFE Lined Hotends Explained All-Metal Hotends Explained Temperature Limits... Continue reading
Svg%3E
Read more

Bambu Lab A1 Mini Review: Compact Speed Printer India

April 1, 2026 0
Table of Contents Bambu Lab A1 Mini Specifications Unboxing and Setup Experience Print Quality at Various Speeds AMS Lite Multi-Colour... Continue reading
Svg%3E
Read more

Creality Ender 3 Upgrades: Best Mods Under ₹5,000

April 1, 2026 0
Table of Contents Essential First Upgrades PEI Bed Surface Upgrade Direct Drive Extruder Conversion BLTouch Auto Bed Levelling Silent Mainboard... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now