CNC Shield Setup and Software

I’m writing this as I set up my CNC board for the WriteHand, but this generic CNC board can be used in all kinds of different CNC type projects, controlling up to 4 axis.

The CNC board has a website link on it, which is how I ended up finding the guides here. To use Grbl, a program used to convert GCode to stepper motor movements, I had to upload the program to my Arduino Uno using the directions here.

An old version of the post had the following information, however Grbl’s newest release (1.1) both is uploadable without XLoader and includes a “Laser Mode” required for use with a servo.

To use Grbl, a program used to convert GCode to stepper motor movements, I had to upload the program’s hex file to my Arduino Uno. Following the creators instructions , we downloaded the hex file at GitHub and uploaded it with XLoader to the Arduino. I used a baud rate of 115200 as that was part of the name the hex file was called (grbl_v0_9j_atmega328p_16mhz_115200.hex).

xloader

When the upload was complete, I booted up Arduino and opened the Serial Monitor. I got a strange error before changing the baud rate from 9600 to the matching 115200. Then, by selecting “New Line” instead of “No Line Ending”, I could type ‘$’ to see all the settings of Grbl.

serial-discussion

It is also quicker to utilize a Grbl Controller tool, such as zapmaker’s GrblController as found on GitHub. This is what I will be utilizing, however I have found that the grbl settings do not line up correctly and I have to set these manually using the “$” functions, as shown above.

Next, I plugged in my Pololu A4988 stepper motor drivers so that the current adjustment screw was located above the 6 pins (for the DrawBot project, I only insert 2 for X and Y control). Before hooking things up, Pololu has guides for setting the current adjustment, but I needed the current rating of my Casun stepper motor type 42SHD0339-20B. I couldn’t find it on Casun’s own website, but this information is given on the RepRapChampion website where I bought the motor. Current per phase rating looks like it may be 1.2A – I’ll use 1A to be safe. I’ll also note that the motor is a 200 step 2 phase motor (400mN.m holding torque).

I want to limit my current to 1A, so using the A4988’s voltage relation of Current Limit = VREF × 2.5, I should set VREF to 0.4 volts. With the CNC sheild placed on the Arduino Uno, and the two A4988’s installed, I was able to access the ground on the top of the shield and with the other end of the voltage meter on my screwdriver, adjust the screw until my reading was 0.4V on each driver board.

Then I could try my stepper motors. The stepper motor drawings show the wires on the stepper motor (starting from the green side) are labeled A1, A2, B1, B2, and the protoneer website shows the order of the motor hookups to be B2, B1, A1, A2. However, after some trial and error work, I found they should be placed in the order of the labels on the underside of the A4988 driver boards on top, which list them as 2B, 2A, 1A, 1B (in order of furthest to closest to adjustment screw – and yes the number letter combo is reversed). The images below are a little more clear.

 

Leave a Message!

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