Table of Contents

CNC Shield





Safety Statement

The author of this document is not liable or responsible for any accidents, injuries, equipment damage, property damage, loss of money or loss of time resulting from improper use of electrical or mechanical or software products.

Assembling electrical and mechanical CNC machine components like power supplies, motors, drivers or other electrical and mechanical components involves dealing with high voltage AC (alternating current) or DC (direct current) and other hazardous items which can be extremely dangerous and needs high attention to detail, experience, knowledge of software, electricity, electro-mechanics and mechanics.

BEFORE MAKING ANY CONNECTIONS OR DISCONNECTIONS POWER MUST BE REMOVED FROM THE DEVICE AND THE CONTROLLER. FAILURE TO DO SO WILL VOID ANY AND ALL WARRANTIES.

Before starting please read though all the instructions.

Note : Any Mains power connections must be installed by a Licensed electrician or suitability qualified person.

Errors and omissions excepted

Introduction

The CNC Shield was designed by Protoneer.co.nz to take advantage of the demand for a low-cost controller solution for DIY CNC machines. It was designed to be 100% compatible with Grbl, the Opensource G-Code interpreter, and fit onto the popular Arduino Uno. The CNC Shield can be used to control a number of different types of CNC machines, including CNC milling machines, laser engraving/cutting machines, drawing machines, 3D printers or any project that needs precision control of stepper motors. It uses Pololu and compatible stepper drivers, either the A4988 or the higher current DRV8825.


There are 3 main components needed to get the CNC Shield up and running, 1) CNC Shield; 2) Stepper Drivers, and; 3) Arduino UNO. Each of these will be mentioned below.


Version 3.0 of the CNC Shield is used throughout this guide.


The CNC Shield is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.


Please note: this document is a guide and not a manual. The CNC Shield and Grbl are Opensource and under constant development and modification. As a result, this document provides guidance but is by no mean comprehensive nor authoritative. It is essential that all users do their own research and find solutions that suit their application and requirements.

Features

Arduino UNO Compatible


CNC Shield


DRV8825 Stepper Drivers


A4988 Stepper Drivers


Application

Suitable for a variety of small and medium sized automation equipment and instruments, such as: engraving machine, marking machine, cutting machine, laser typesetting, plotters, drawbots, CNC machine tools, handling the devices.


Notes for Some Compatible UNOs

Some compatible UNOs uses the CH340 USB to serial chip. In order for your computer to recognize the UNO you may need to download the latest CH340 driver:


http://www.wch.cn/download/CH341SER_ZIP.html


Read more here:


http://www.arduined.eu/ch340-windows-8-driver-download/


http://www.microcontrols.org/arduino-uno-clone-ch340-ch341-chipset-usb-drivers/


Grbl on the UNO

Before connecting the UNO to the CNC Shield it is best to load Grbl onto the UNO. For a full description and complete details of Grbl please see the Wiki on the Grbl project pages:


https://github.com/grbl/grbl/wiki


There are many conversations about which version of Grbl to use with a v3.0 CNC Shield. Protoneer say that only Grbl v0.8 is compatible, but later version can be used with slight modification to the config.h file. For more details about the difference between v0.8 and v0.9 see:


https://github.com/grbl/grbl/wiki/Connecting-Grbl


To use v0.9 and higher just comment out the “#define VARIABLE_SPINDLE” line in config.h. For example, in v0.9 this is on line 247:


243 // Enables variable spindle output voltage for different RPM values. On the Arduino Uno, the spindle
244 // enable pin will output 5V for maximum RPM with 256 intermediate levels and 0V when disabled.
245 // NOTE: IMPORTANT for Arduino Unos! When enabled, the Z-limit pin D11 and spindle enable pin D12 switch!
246 // The hardware PWM output on pin D11 is required for variable spindle output voltages.
247 #define VARIABLE_SPINDLE // Default enabled. Comment to disable.


Change line 247 to:


247 //#define VARIABLE_SPINDLE // Default enabled. Comment to disable.


For v1.1 change line 339 to:


339 //#define VARIABLE_SPINDLE // Default enabled. Comment to disable.


So given the above, choose the version of Grbl that suits your application and build and download as per the instructions in the Grbl Wiki page.


There are many settings that can be defined prior to loading Grbl onto the UNO. For more information on what each of the settings mean see the Wiki page:


https://github.com/grbl/grbl/wiki/Configuring-Grbl-v0.9

https://github.com/gnea/grbl/wiki/Grbl-v1.1-Configuration

Loading Grbl on the UNO

The best and easiest way to load Grbl onto the UNO is to use the Arduino IDE. This can be downloaded from:


https://www.arduino.cc/en/Main/Software


Install and follow the instruction as detailed on the Arduino website.


To load Grbl onto the UNO:

  1. Open the sketch (from the Arduino IDE menu File/Examples/grbl/grblUpload)
  2. In the IDE make sure you have all the settings correctly set for the type of board, port and etc.
  3. Click the “Upload” button.
  4. The IDE will report “Done Uploading” when it is finished uploading:
  5. If you get errors, then please read the Arduino IDE help and/or the Grbl Wiki.



Confirm Grbl on the UNO

  1. Open the IDE serial monitor (Tools/Serial Monitor)
  2. If Grbl is loaded correctly then it will report the version in the Monitor window:



Wiring and Connections Guide


Safety and Handling Requirements

Before wiring it is essential to note a couple of safety issues and handling requirements.


While the voltages on and around the CNC Shield are low (5V for the Arduino and up to 36V for the CNC Shield and steppers) it is still possible to hurt both yourself and the components if handled incorrectly or without care. The following points are critical and cannot be emphasized strongly enough. Read carefully:






Component Assembly

Below is a general outline process for connection of the various components:




In the tables below High indicates that a Jumper is insert and Low indicates that no jumper is inserted.


A4988 Stepper Driver configuration

M0 M1 M2 Microstep Resolution
Low Low Low Full step
High Low Low Half step
Low High Low Quarter step
High High Low Eighth step
High High High Sixteenth step


DRV8825 Stepper Driver configuration

M0 M1 M2 Microstep Resolution
Low Low Low Full step
High Low Low Half step
Low High Low 1/4 step
High High Low 1/8 step
Low Low High 1/16 step
High Low High 1/32 step
Low High High 1/32 step
High High High 1/32 step




https://blog.protoneer.co.nz/arduino-cnc-shield-v3-00-assembly-guide/


Testing

Protoneer has published what they call a “Pre-Flight Checklist”. This is a great resource for testing the CNC Shield. See:


https://blog.protoneer.co.nz/arduino-cnc-shield-v3-00-assembly-guide/

Configuring Grbl

There are many Wikis, blogs and posts about how to configure Grbl, see the links section below for some. For Grbl v0.9 see:


https://github.com/grbl/grbl/wiki/Configuring-Grbl-v0.9


Connect to the UNO using a serial console program like Putty or a Grbl GUI (see links below for some examples) and enter “$$” to see a list of settings:


$0=10 (step pulse, usec)
$1=25 (step idle delay, msec)
$2=0 (step port invert mask:00000000)
$3=6 (dir port invert mask:00000110)
$4=0 (step enable invert, bool)
$5=0 (limit pins invert, bool)
$6=0 (probe pin invert, bool)
$10=3 (status report mask:00000011)
$11=0.020 (junction deviation, mm)
$12=0.002 (arc tolerance, mm)
$13=0 (report inches, bool)
$20=0 (soft limits, bool)
$21=0 (hard limits, bool)
$22=0 (homing cycle, bool)
$23=1 (homing dir invert mask:00000001)
$24=50.000 (homing feed, mm/min)
$25=635.000 (homing seek, mm/min)
$26=250 (homing debounce, msec)
$27=1.000 (homing pull-off, mm)
$100=314.961 (x, step/mm)
$101=314.961 (y, step/mm)
$102=314.961 (z, step/mm)
$110=635.000 (x max rate, mm/min)
$111=635.000 (y max rate, mm/min)
$112=635.000 (z max rate, mm/min)
$120=50.000 (x accel, mm/sec^2)
$121=50.000 (y accel, mm/sec^2)
$122=50.000 (z accel, mm/sec^2)
$130=225.000 (x max travel, mm)
$131=125.000 (y max travel, mm)
$132=170.000 (z max travel, mm)


It is essential to modify these settings to suit your application, machine and requirements.


Images