Grbl is an opensource software that turns your Arduino development board into a full blown G-Code interpreter.
Below the layout of the pins on the Arduino board. Each Stepper Motor Driver needs to be connected to the following pins:
- Stepper Driver Enable/Disable – Pin 8
- Direction – Pin 5-7 depending on the Axis(X,Y,Z)
- Stepping Pulse – Pin 2-4 depending on the Axis(X,Y,Z)
Limit Switches prevent the machine for over extending each axis and are connected to Pins 9-11.
Grbl also allows for Spindle control with Pins 12 and 13 and coolant control with Pin A3.
UPDATE!!! We have given back to the GRBL project and developed a ARDUINO CNC SHIELD that is 100% GRBL compatible.(Click here for more details)
If you are interested in making your own CNC machines we recommend you have a look at the following books:
- Build Your Own CNC Machine – By James Floyd Kelly and P. Hood-Daniel
- CNC Machining Handbook: Building, Programming, and Implementation – By Alan Overby
I built it. I connected it. It doesn’t work. I took the DRV8824, connected it independently, and got just a hum noise (no motion). So I know the driver is trying to do something, but when placed in the sockets of the shield it doesn’t twitch or hum or anything indicating a spark of life.
What am I missing here?
Hi. The drivers will usually not make a sound on the shield while they are not stepping. (Its a setting in GRBL that switch them off while not being used.) are you running GRBL?
could you replace the spindle with a laser connected to a realy?
Yes… I have actually hooked it up to a Cheap Chines laser cutter with great success. Just make sure to test it with a led or some lind of indicator before hooking it up to a laser.
Also if put in a limit switch will that be ground to pin 9 or 10?
That is correct.
So just for clarification, the laser control would connect with spindle enable?
Yes… I used the enable pin and then adjusted the PWM dial on the Laser cutter.
In case of use with a laser, which Pin do you use for switching on/off the laser, can you adjust the power of the laser with PWM and which software do you use for creating such G-Code (including power on/off and PWM).
Thanks
Hi Thomas. I use the Spindle Enable pin to switch a relay that controls the laser. At this stage I have not use PWM because my cheap laser does not have an input for it but ther are a few poeple on the Github GRBL site that has done and PWM implementation. I think switching the Spindle enable pin is M5 and M0 stops it.
Hi! i wish to know if this shield supports the coreXY configuration… anoter question, is avaiable any version made on single side PCB?.
Thanks you very much!!!
CoreXY only use 2 steppers from what I understand. This should be doable but to make it work the GRBL firmware will need to be updated. There are already some effort done on it… have a look at https://github.com/grbl/grbl/issues/286
I have another question for you. My A4988 drivers don’t drive the motors unless the sleep & reset pins are connected. How do I do that? Using the code for the enable pin, high or low, doesn’t help.
Hi Gailen, My CNC shield does all that for you(http://www.ebay.com/itm/Arduino-CNC-Shield-V3-03-GRBL-compatible-Uses-Pololu-Drivers-/271659685052). Else you will have to look up the details on the Pololu driver you are using. https://www.pololu.com/product/1182
Thanks Bertus. for both answers, XY & enable. I need to go back and review the sketch. I’m sure there’s more questions to come.
Great stuff… Good luck.
Does this work with Arduino Uno only or does it work with Arduino Duemilanove and other boards?
I am looking to use Arduino with three DRV8825 drivers along with GRBL and Universal GCode Sender. Would this work?
I have also seen some clone boards with CH340G USB to Serial chips, would this code work with these boards as well?
Thanks very much.
Hi. This works with the Duemilanove as well. The DRV8825’s will work but I recommend that you add heat sinks as they do run very hot. The boars with the CH340G work fine.
No good luck so far. I can’t get it to do anything. The motors don’t hum, buzz or move. I’ve downloaded grbl 9 and flashed it, I’ve downloaded your library and nothing.Do you know of any way to test the individual pieces? I even used a breadboard for the drivers and nothing.
okay, the best way to debug this is to use a multimeter. Start by testing the power supply. Be sure to always have the steppers connected tot he drive before powering up. test if the enable pin is the correct level. Test it the direction pin is not floating(Needs to be 0v or 5v). Next start pulsing the stepper pin on and off.
Could it be something as simple as the 9v battery not having the amps to drive it?
Yes. a normal small 9v rechargeable battery provides only about 200mAh. One of these stepper drivers could take up to 2’000mA.
Even with the sleep and reset jumped? What should the enable level be, high or low?
Enable needs to be grounded to work. Sleep and Reset needs to be connected to enable it. Have a look at this link: https://www.pololu.com/product/1182
Success! I connected one of my RC plane Lipo batteries and the motors turn.
I have built a cnc drilling machine which works well using your pages as a guide, but this morning I decided to add the travel limit micro switches. Earthing pins 9 to 11 makes no difference. Does anything else have to fitted or a setting changed?
Have you enabled hard limits from the GRBL settings menu? Without it the pins are not enabled… same with homing.
HI, Just discovered although I changed the enable to 1 I didn’t press return to save it. Thanks for your advice.
I am planning on using GRBL to convert a mini-mill to CNC by connecting external NEMA 23 Stepper drivers through a breakout board to the Arduino running GRBL. I’ve standardized on using the MEGA 2560 and DUE for other projects and would prefer to use one of these.
1. I presume the DUE is not GRBL compatible as it has no EEPROM.
2. Can the MEGA run the basic GRBL code set without mods?
Other thoughts…I thought I would build a DUE with a small LCD screen into a front end as a manual simple operator control panel that would drive the MEGA serial port (just like a PC would) I want to include a few basic milling functions as part of the panel. Also,It would be fairly easy to iinclude an SD memory card reader to eliminate the need for a PC to drive the system. You throughs?
Hi Ed. There is an option to compile GRBL on the Mega if you go to the config file. You are right about the Due not being the perfect fit… A bit of a shame but that’s life. I don’t want to say anything yet, but I would suggest you subscribe to my mailing list as I will be making some announcements soon… http://eepurl.com/DIq-z
I have made an X-Y plotter using grbl flashed in Uno.I have connected the motor pins with step and direction and have kept the enable pin open.My plotter doesn’t draw straight vertical or horizontal lines other than that it works perfectly.Is this problem coz of the enable pin?If Yes,what should I connect with the enable pin?
Hi. If the steppers are moving it would indicate that the enable pin is working. Not sure what you setup is like, but it sounds like an mechanical issue. Using two motors on one axis could also cause this if they are not totally synced.
I have arduino nano with ULN 2003 (For hardware refer https://www.youtube.com/watch?v=rLQajSRnELc) I wanted to make laser engraver for me. How can I modify gbrl code for my requirement.Thank you
Nice video, GRBL is not designed for those kind of driver. IT works with stepper drivers with step,direction pins.