How to Install/use GRBL With Your Cnc Machine!

178,499

107

28

Introduction: How to Install/use GRBL With Your Cnc Machine!

About: I build stuff.

This instructables will teach you how to install and adapt grbl to your cnc mill/laser cutter.
So first thing first, What is GRBL?

GRBL is a firmware for arduino boards(uno,nano,Duemillanove) that controls stepper motors and spindles/lasers. GRBL uses gcode as input and outputs signals via the arduino pins.
Most industrial cnc machines uses parallel port controller that requires Those big purple connectors. Because GRBL arduino boards you just hook it up to a free usb port.

If you already have your hardware you can skip directly to step 3!

Step 1: Hardware

Grbl is compatible with all atmega 328 based arduino boards, meaning that you could use a uno or a nano but not the mega as its atmega 2560 based. The arduino mega is used in alot of 3d printer because of its more powerful processor but because of the relatively easy tasks of a cnc mill the arduino uno is enough.

To drive stepper motors you need some sort of driver. Some popular choices are a4988 and drv8825 for small motors like nema 14 or 17, but should not be used with more powerful motors like nema23 and higher. Its a good idea to stay clear of the easy drivers.

To connect your motor drivers and arduino you can use a pre-made board like the popular arduino uno cnc shield or build your own. Building your own is pretty easy but can take alot of time. There are also arduino nano based boards made specially for laser cutting.

To summarize:
you will need these parts for a typical cnc machine:

1x arduino board
3x stepper drivers(x,y,z)
1x cnc shield

Step 2: Installation

To Install grbl you need two things:

  1. Download the latest grbl sourcecode as .zip
  2. If you dont have the arduino ide yet, download and install it
  3. Open the grbl .zip and navigate to a folder simply called "grbl"
  4. Extract the folder to a known place and open the arduino ide
  5. In the arduino ide, navigate to sketch>include library> add .ZIP library
  6. Navigate to the grbl folder and click ok.

Grbl is now installed as a arduino library. Navigate to file>example>grbl>grblupload.
A new sketch will open with instructions on how to flash grbl to your board.

Step 3: Setup/Adjustments

Now with firmware on your board you need to adapt grbl to your specific machine. To communicate with your board you need to open the arduino ide serial monitor. You should see a message like this "Grbl x.xj ['$' for help]" if you dont see the message, make sure that your are connected to the correct port and use the baudrate of 115200.

Type "$$" and a list of commands should appear, like this:

$100=250.000 (x, step/mm)
$101=250.000 (y, step/mm)
$102=3200.000 (z, step/mm)
$110=500.000 (x max rate, mm/min)
$111=500.000 (y max rate, mm/min)
$112=500.000 (z max rate, mm/min)
$120=10.000 (x accel, mm/sec^2)
$121=10.000 (y accel, mm/sec^2)
$122=10.000 (z accel, mm/sec^2)
$130=200.000 (x max travel, mm)
$131=200.000 (y max travel, mm)
$132=200.000 (z max travel, mm)

The most important part to change is the steps/mm. Steps/mm needs to be calculated and the easiest way of doing it is by using prusas reprap calulator.

To change a setting, type the identifier of the parameter (for example $100 for x steps) "=" and then the new value.
For example: typing $112=600 changes the z max rate to 600.
Make sure that your setting has been saved by typing $$ and checking the values.

Some settings (like corexy setup,variable spindle) needs to be changed trough the config.h. You find the config file in the arduino library folder for grbl. The file has instructions and should be pretty straight forward to edit. When you have edited the config file you need to reupload the sketch to your board.



Hopefully This instructables was helpful and your cnc machine is up and running!
If something is wrong/missing feel free to point it out in the comments.

CNC Contest 2016

Participated in the
CNC Contest 2016

First Time Authors Contest 2016

Participated in the
First Time Authors Contest 2016

1 Person Made This Project!

Recommendations

  • Plastic Contest

    Plastic Contest
  • The 1000th Contest

    The 1000th Contest
  • Battery Powered Contest

    Battery Powered Contest

28 Discussions

0
Devinity
Devinity

Question 10 hours ago on Step 1

I have Purchased a 3018Pro from Bangood, it worked ok for a while then it stopped responding
on all the Axes, I could only switch on the Spindle. Thinking this was perhaps a fault on the motherboard I ordered a replacement. While waiting for the replacement board the machine started to respond again after installing all the software onto a New/old desktop PC.
Then two days ago it stopped responding again as before with only the spindle powering up.
The new motherboard arrived today so I installed that. No response at all, the originall board still gave me spindle control. I have reinstalled the drivers and all the other software etc that is supplied through the links on banggood site (Several times) with no success.

What am I doing wrong? I can't believe all the Stepper motors have gone wrong at the same time. I don't Know what an ardwino ?? is other than it is some sort of mother board. I enclose photo of the old and new boards. I hope someone Can help me please.

Thank you Dev

Old original board.jpgNew board.jpg
0
Merlin11B
Merlin11B

2 months ago

I hope someone here has an answer, nowhere I’ve been as of yet has so here goes.
I purchased, stupidly, a CNC from Ebay, that runs on an Aruindo Uno, and CNC Shield, and DeWalt 611 router, X&Y axis seem to cut fine. However, the Z axis, no matter the cut depth I select, where I designate as Zhome, refuses to cut beyond 1/8 of an inch. It was purchased from an individual builder, not a company, so there’s no support or warranty, like I said stupidly. So any assistance would be greatly appreciated.

0
gscottconnors
gscottconnors

Question 6 months ago on Introduction

"Some popular choices are a4988 and drv8825 for small motors like nema 14 or 17, but should not be used with more powerful motors like nema23"

Soooo, what do I use for NEMA 23 motors? Thanks!

0
HasseB
HasseB

Answer 6 months ago

TB6560 is a popular option

0
adnraw
adnraw

Reply 4 months ago

does TB6560 compatible with cnc sheild?

0
ShaneA45
ShaneA45

Question 7 months ago on Introduction

laser is always on when engraving and burns every movement it takes.

0
ajeiras
ajeiras

Answer 7 months ago

Hi, I have the same problem in one PCB from cronos maker. But in the original PCB in 3018, I dont that problem, and the firmware is the same.

0
mohamedalazab76
mohamedalazab76

8 months ago

We try to make a wire bending machie, but we need to connect it with grbl to make any shape, how we can make its software(code), can you help us? , please..

0
asseryelisha06
asseryelisha06

Question 8 months ago on Step 3

Hi there. I'm Elisha Mbise From United republic of Tanzania. I'm about to build my punching CNC;I will need only X-Y motions to make any pattern I want. The punching stroke will be stationary as usual.

Would grbl be compatible? ( I wanna use Arduino and it's shield and drivers).

1
AndreasK42
AndreasK42

Question 12 months ago on Step 3

Ok. What's the next steps to print something?
Maybe I have a drawing in Inkscape. How do I tell it my Arduino?

0
Jean-Marcb10
Jean-Marcb10

12 months ago

Great tutorial,

Do you know if I can write a python script that would prompt the grbl controller for it's current position, then write this to a file?

2
Bverysharp
Bverysharp

1 year ago

As usual, instructables to the rescue. After bashing my head against the internet wall for an hour, I found this instructable, and Hey, Presto, I was able to load Grbl with absolutely no problem. Thanks heaps!
(Here is a photo of the one I built.)

Completed machine.JPG
0
HasseB
HasseB

Reply 1 year ago

Glad to hear it!

0
AbdulazizY
AbdulazizY

2 years ago

Can I communicate with you via Facebook?

0
HasseB
HasseB

Reply 2 years ago

Hey!
If you got a question please post it here.

0
boxcorner
boxcorner

Question 2 years ago on Step 3

I have ordered a CNC 2417 from Aliexpress in China. The software they provide comprises a document file, instructions for mechanical assembly of the machine and a large ZIP file which I have been unable to download because the connection it keeps timing out.

I had hoped there would be a list of steps required to get the machine up and running, or better still a flow chart!

My understanding is the CNC 2417 has an Arduino UNO and motor shield. I believe the Arduino needs to have Gbrl firmware installed and presume this can be done using the Arduino IDE. The Arduino will be connected to a computer via USB. I believe driver software needs to be installed on the computer before it is connected to the Arduino. The computer would need to have an app installed to generate G-code, plus an app to drip-feed the G-code to the Arduino, as it doesn't have a large memory capacity. That's my understanding thus far. Is that correct?

So the steps would be: (1) assemble the machine (2) install motor drivers (3) install an app on the computer to generate G-code eg InkScape (4) install an app on the computer to drip-feed the G-code to the Arduino.

Is that correct?

Whilst there are many videos showing people lovingly opening the box and assembling the kit of parts, playing with Allen keys to build the machine, there seems to be very little information about the electrical connections and no step-by-step sequence to get the machine up and running with drivers and firmware, that I have been able to find.

While looking around for alternative software, I stumbled across Banggood's web page offering what appears to be the same machine. There's a link which leads to a Google Drive page where files can be downloaded individually, instead of a huge ZIP file. Much more user-friendly.

The driver says it's for DOS/Windows. Does anyone know where I might find a driver for Linux? I still have an old computer that is configured to dual-boot Linux/Win7, so that is not a major problem, but I would prefer to use Linux.

So to recap. Where might I find electrical connection info for this machine? Are the steps that I enumerated above correct? Where might I find drivers for Linux?

Any help would be much appreciated. Thanks in advance.

1
HasseB
HasseB

Answer 2 years ago

Hey!
You're on the right track.
Steer clear of the Chinese downloads, they tend to include bloatware and other bad stuff.
With this stuff you really want to be on windows. Im a big Linux user myself but keep all my 3D printing / arduino / cnc stuff on a seperate windows machine.

You do need 3 pieces of software:

- GRBL configured and uploaded to the arduino uno via arduino ide

- Pronterface (for now) to send some basic gcode (and 'drip feed')

- Inkscape (to keep it simple for now) to draw and generate gcode

Whats important to understand here is that the uno has no command memory, it simply executes the supplied account and asks for a new one from the computer when done.

Im assuming you got the arduino cnc shield which is pretty common. Look at the pictures on google and match up the motor driver orientation, make sure its the exact same driver though. Dont adjust the driver current right now, your going to break the pot. after that you simply connect the motor wires to the appropriate connector.

Have actually been looking at getting the same machine for myself, let me know how you like it and feel free to leave another comment if someting is still unclear.

1
boxcorner
boxcorner

2 years ago on Step 3

Thank you! Today I spent a few hours reading through pages on GitHub about Grbl, dusting off my Arduino, rediscovering the IDE and brushing cobwebs from my memory, as I haven't used my Arduino for a couple of years. Now I'm trying to bend my mind around CNC and was struggling to understand what part Grbl plays in it all. The second paragraph beginning "GRBL is a firmware for Arduino boards ..." did the trick. Suddenly the mist began to clear. It was for me the, 'Ah, now I understand' moment. A very helpful article. Keep up the good work!