GRBL – Motion Control for Makers

GRBL - Machine Control for Makers

GRBL software powers the Arduino CNC revolution. I am not aware of any comparable software. What exactly does it do? Basically, the software when loaded onto an Arduino creates the heart of a low cost high performance cnc controller. It allows us to use an Arduino to run our CNC machines. If you already have GRBL and need more information on how to adjust the settings for your machine get the GRBL Settings Pocket Guide by clicking the link below.

Download the GRBL Pocket Guide by clicking Here

Introduction

Much of the following is from the GRBL wiki & GitHub page.

Download GRBL software from the GitHub page click here

Access the GRBL Wiki page here  It’s an exhaustive information repository and well worth a look.

I use GRBL in my DIY CNC Controller. The software runs the machine very smoothly with excellent acceleration & deceleration control. The best part, I do not need a computer with a parallel port to run my CNC mill. GRBL looks for lines of G-code passed over USB. It also manages all of the timing necessary which allows for the machine controller to be computer agnostic. As long as you have a PC with a USB port and gCode parsing software, you have the makings of a CNC controller.

Definition

The following is directly from the GitHub page:

“An open source, embedded, high performance g-code-parser and CNC milling controller written in optimized C that will run on a straight Arduino”

Open source – v0.9 released under the GPLv3 license available for anyone to download and use at no cost. In fact several companies use GRBL as the motion control software of choice. They include the following: Inventables, Carbide 3D, OpenBuilds, Panucatt Devices & Protoneer

History

Origins: Based on Arduino gCode Interpreter by Mike Ellery
Lead Developer [2009 – 2011]: Simen Svale Skogsrud (Norway). aka The Originator/Creator/Pioneer/Father of Grbl.

Simen is a principal at Bengler a company that invents “unlikely and interesting uses for technology.” He specializes in product design, software architecture and broad spectrum tinkering. Simen coined the phrase “Motion control for machines that make things.” Check out his excellent post here detailing GRBL

Lead Developer [2011 – Current]: Sungeun(Sonny) K. Jeon, Ph.D. (USA) aka @chamnit

Why Arduino

Arduino is everywhere. People are familiar with the hardware and IDE. Its low cost minimizes the barrier to entry for CNC motion control. Additionally, the proliferation of Arduino allows for widespread adoption of GRBL. Using the Arduino platform aligns with the larger maker movement of democratizing fabrication.

Features

GRBL has some excellent features that are worth mentioning.

1) It enables communication over USB. No more trying to find a boat anchor of a computer with a native parallel port. Most industrial and many hobby CNC controllers require a parallel port.

2) Grows with your skill as a machine operator. GRBL has many advanced parameters that many beginners will not need. However, these functions allow the user to grow into using the full capabilities of their machine.

What GRBL doesn’t do

I am having a hard time writing this. Keep in mind, I am not aware of a comparable alternative for comparison. I find it hard to complain about free software that provides so much utility. Nonetheless, these are a few of the current limitations & drawbacks.

1) Backlash compensation – in any machine there is “slop” that’s a technical term. Backlash is lost motion due to the mechanical components of the system. The best way I know how to explain this is consider a traditional milling machine. You turn the hand in one direction and the table moves. If you stop and then turn the handle in the opposite direction, the table will not move immediately in the opposite direction. Backlash is measured in the number of thousands of an inch the handle rotates before the machine table moves. Backlash compensation is a way to tell the software how much lost motion your machine has in the x,y & z axis. The machine controller will use these values each time the machine changes direction to improve the precision of the motion.

2) Currently Grbl supports 3 axis of motion, x, y and z. but does not support rotation axes.

3) Tuning GRBL can be somewhat intimidating. However, I created this pocket guide to help with the setup. Click Here to Download Your GRBL Pocket Guide

What else does GRBL need?

In order to create a cnc controller using GRBL software, we need a few additional items outlined below. Click here for a step by step guide to setup your DIY CNC Controller.

What you need…

1) Arduino – to host the GRBL software

2) Stepper Motor Drivers – the bridge between the Arduino and stepper motors that actually move your machine.

3) Power supply – connect to your stepper motor drivers and provides the power to the drivers & stepper motors. Note, you will need to power your Arduino separately. I power mine over the USB line from my netbook.

4) Computer – You will need to have a USB connection between a computer and the Arduino

5) G-Code Parser – (Software) This allows you to upload a gCode file and the software sends the file one line at time to the GRBL software.

6) Stepper Motors – These provide the motion to move your machine

The graphic below outlines how all of these items work together. It makes more sense to me when I can see the big picture.

DIY CNC Controller Overview with Arduino, grblShield, power supply and stepper motors

DIY CNC Controller – Overview

What’s next for GRBL? (H3)

The first one on the list below is of particular interest to me. I would love the ability to adjust feed rates in real time. This is particularly helpful when running a part for the first time when the speeds and feeds recipe is still unproven. In my case, I run lots of different parts in small quantities. I often have to stop the machine and go back to my CAM software to update the feed rates and repost the tool paths. Go back to my mini mill and start the program again.

The following is directly from the GRBL Wiki page

Queued for the next Grbl release:

1) Real-time adjustable feedrates: On Haas CNCs, there is a feature with 5%, 25%, 50%, and 100% real-time feed rate adjustments. This is primarily for testing and proofing G-code programs and to adjust feed rates live, if a cutting tool is chattering and needs to be slightly sped up or down. The implementation has been solved at this point, but just needs to be installed and bugs to be worked out.

2) Other overrides: Along with feed rate overrides, other overrides will be added, such as coolant, spindle, and rapids overrides.

3) Backlash compensation: There are many ways of handling backlash, which all have different levels of complexity and drawbacks. The main problem is how to ensure that the CNC keeps moving smoothly as possible through the backlash without compromising accuracy.

4) Jogging: This is planned as a separate Grbl run-time mode to be run independent of grbl’s G-code parser. In production CNC machines, this is the same behavior, where jogging is a special control mode.

5) Other Advanced Controller Features: Program resume (restart a job midway), block deletes, single block mode, and ‘%’ program mode.

Conclusion

We in the maker community owe a big thank you to Simen Svale Skogsrud the original developer of GRBL. Without his work & generosity, we would not have the opportunity to bring CNC manufacturing into the home. In 2009, Simen transitioned the development responsibilities to Sungeun(Sonny) K. Jeon. We also owe him a debt of gratitude. If you would like to help support the further development of GRBL, you can donate directly to Sonny by cliking the link below.

Click Here to Support GRBL

I am a big fan of GRBL. Without this software, I would not have been able to learn CNC machining.

16 Comments

  1. Johan Bezuidenhoudt

    Hi I need some advice on the GRBL 3.6.1 as my hobby CNC machine give me lots of problems and I’m not sure how to sort it out, it freezes and change direction in to the wrong way and cuts through the work piece and messis it up. I have deleted the grbl of my laptop and reloaded it but it still keep on doing the same mistakes.

    Reply
    1. Tim (Post author)

      Hi Johan – That sounds frustrating. Have you worked through the process of tuning your GRLB settings? It’s especially important to start with the axis direction & steps/mm settings. You can see how to do that here at the post I wrote about GRBL settings. Once you have the basic settings, I recommend you download the test circle gcode program and run that. You can download that here. If you still have questions feel free to contact me by email Tim@DIYMachining.com

      Reply
  2. Paul Norsworthy

    I am having a problem you may be able to help me with. I have made a wire foam cutter for tool cut outs. My problem is that the GRBL cuts across the pattern to get to a starting point, that I assume it has decided on. Is there a way of setting the cutting path? Thanks

    Reply
    1. Tim (Post author)

      Paul, glad to hear from you. Yes, you can set the cutting paths. This is typically done in your CAM software. If not, you might try hand editing the gcode and use something like NC Viewer to preview your changes. See this blog post about how to use NC Viewer. If you would like, feel free to email the file to me at Tim@DiyMachining.com and I will take a look.

      Reply
  3. Bill Swan

    Hi Tim,

    It has been a while since we were in contact concerning Mini-Mills. I have been struggling to put together a DIY CNC controller using Pololu 4988’s. I have been trying to use the GRBL sketch provided by GitHub, but cannot get it to compile. “GRBL.h not found” is the error message I get. I am also finding that Pololu 4988 drivers are extremely fragile (I have had a half dozen fail for unknown reasons). Can you offer any ideas about these problems as I am about to give up, which is something I almost never do.

    Reply
    1. Tim (Post author)

      Bill, that’s never fun when things are breaking! Based on your comment, we are looking at two different problems. First let’s address the “GRBL.h not found.” This has to do with loading the GRBL software onto the Arduino. Typically this means you need to add the GRBL library to the Arduino IDE prior to uploading the GRBL sketch to the Arduino. Take a look at Step 1 from this blog post. Second, I have never used the Pololu 4988 drivers. However, I understand these can be installed backwards in the CNC shield which will result in the driver getting fried. You might also see if the stepper motors are sourcing too much power from the driver. I am afraid I do not have a clear answer for your second question. Feel free to contact me at Tim@DIYMachining.com or reply here.

      Reply
  4. Tim

    How can I save and select programs using an arduino and GRBL that I use repeatedly?

    Reply
    1. Tim (Post author)

      Hi Tim, great name! You will need a gcode sender to stream your saved gcode files to your Arduino that is running GRBL. You only need to install GRBL once on your Arduino. Then you connect the Arduino via a USB cable to a PC running a Gcode sender program. I use Universal Gcode Sender. You then create gcode files that tell the machine where and how fast to move. These files get saved on the PC and can be streamed over and over again to the Arduino. If you need a step by step guide to install the various pieces of software, check out the Arduino CNC Controller here

      Reply
  5. Mal

    Hi,

    I have just bought a CNC router (3018 engraver).
    I have created a file with Easel and set the cut depth to 1mm
    I generate the code and export it and then when I open the file and start the machine (having set the x,y and z axis to zero) it cuts to a depth of 4 mm – despite another setting that states max 1 mm cuts

    Can you help? I feel there must be another setting for the z axis that I have wrong

    Reply
    1. Tim (Post author)

      Hi Mal, thanks for leaving a comment. I am happy to help. I recommend using a gcode simulator like NCviewer to isolate the issue. Click here for a link on how to use NCViewer and a link to the web based application. No software to download. What I would do is open the gcode file in NCViewer to verify the maximum depth of the Z-axis. This will tell us if the issue is with the gcode or with a machine setting. If the gcode includes a Z-axis depth of 4mm, you likely have an issue with your gcode generator (ie the CAM software or the post processor). If the gcode commands a depth of 1 mm, then the issue is with the machine or controller. If you would like me to take a look at the gcode, please email it to me at Tim@DIYMachining.com

      Reply
  6. Jean-pierre

    Hi!,
    do you have an updated version of the GRBL pocket guide the version that you have si for grbl ver.9 only most people use ver 1.1 and up!
    thx

    Reply
    1. Tim (Post author)

      Jean-Pierre, great question. No I do not have an updated pocket guide. It’s on the “To Do” list! 😉 You are not the first person to ask for one. I will need to move this task up the list…

      Reply
  7. Dan

    I Have A 3018pro how do Reset GRBL your Pocket Guide Says ctrl-x how and ware do use the code I weld all at the same time did not work I used your setting burnt wood and broke the bit this is a brand new woodpecker board I push reset on the board Its Flashing like the old Kmart blue light special thank for looking

    Reply
    1. Tim (Post author)

      Hi Dan, glad you reach out. I haven’t used the ctrl-x command to execute the soft reset of GRBL. The gcode sender I use, Universal Gcode Sender, includes a soft key that can be pressed with the mouse to execute the soft reset. I rarely use the software rest. I find that to resolve any issues, I need to power cycle the Arduino and CNC controller board.

      Reply
  8. George DeVirgilio

    How do I change the directions of the angle arrows? If I push the arrow for upper left the machine goes bottom right. I am using laser GRBL on my Universal Engraver 2025.

    Reply
    1. Tim (Post author)

      Based on your comment, It sounds like the axis direction might be reversed. Check out the GRBL Settings – Pocket Guide. Take a look at $2

      Reply

Leave a Comment

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