3020 CNC + Arduino + GRBL + CNC Shield V3

322,235

738

58

About: I make stuff for a living, an Industrial Designer by lifestyle, education and interest. Always up to learn something new and keep my skills on the cutting edge.

Let's convert an inexpensive Chinese CNC machine from Parallel Port to Arduino and GRBL.

Alright guys, this is a culmination of weeks of reading, researching and determination. It's my first instructable so hope this helps get you where you need to go.

A little bit of background, before we start:

The 3020, 3040 and 6040 (and the more obscure 2015, 2016 and 2020) CNC router milling machines that come out of China are hugely popular in the hobbyist and professional circles. If you are a DIY type, these machine offer a great way to repeat processes and basically do some things that no hand tool will allow you to do. For the professionals, these machines with their relatively accurate leadscrew/ballscrew assemblies allow for another machine to be pumping away making parts if the machine machine is occupied with a job. All in all, these inexpensive machines (ranging from $600-2500 shipped DHL) are a great way to get into CNC. They can be found all over eBay and Aliexpress, in my experience, you can find marginally cheaper options on Aliexpress and their buyer protection is much better than eBay's.

The model numbers denote the size of the workable area, ie. the 3040 is 30cm x 40cm, the 6040 is 60cm x 40cm etc etc. The range of these models makes for choosing the right one for your shop pretty easy, the more expensive and larger ones (typically 3040 and 6040) will have the more accurate ball screw type linear movements instead of a typically trapezoidal lead screw. the 2015, 2016 and 3020 machines (some 3020 will have ballscrews) will have a nylon or Delrin type nut for linear travel.

You can tell which model has the leadscrew or ballscrews by the letter after the model. 3040T will have "trapezoidal leadscrews" and a 3040Z will have ballscrews (ballscrewz?) :D

I have experience with both the ball screw and lead screw type movements, for the money you are paying, it's better to get a machine with ball screws as they wear better and very little, if no backlash (side to side play) is present. These machines will come setup with stepper motors and typically have cable tracks already built in, also they will come with a controller box.

The controller box on almost all of these machines will come with a very old Mach 3 style Parallel Port interface. Signal pulses will be sent from the Mach 3 software to the port and that drives the motors and makes the CNC machine come alive. This type of system is old, dated and is Windows only. I have been a Mac person since 2003 so I won't switching back to PC's anytime soon, so when I heard you could convert this to Arduino powered, I went from "that CNC is a neat tool" to "that CNC will be mine".

Step 1: Gather Your Bits and Bobs

So, after that long winded introduction, here's how I changed over a 3020 machine with the following bits and bobs:

1) 3020 CNC machine http://www.aliexpress.com/wholesale?catId=0&initi...

2) Arduino Uno (a clone will also work)

3) Protoneer CNC Shield V3.XXX (new boards are due any time now, clones are also available)

http://www.ebay.com/itm/Arduino-CNC-Shield-V3-10-G...

4) 3 x A4899 Stepper Motor Drivers (these attach to the CNC Shield, make sure they attach in the right direction!)

5) 3 x 4 Pin Dupont Female Connectors (one for each axis, the board will show you where to attach them)

6) Shielded USB cable (for Arduino, this should be long enough to go from the controller box to your laptop/PC)

7) GRBL firmware http://www.ebay.com/itm/Arduino-CNC-Shield-V3-10-G...

8) G-code generator of choice (inkscape plugin, makercam, JSCUT)

9) G-code sender of choice (Universal G-Code Sender, GRBL Controller, Chilipeppr, etc etc)

Step 2: Crack Open the Controller Box.

You'll see in the video that the conversion is complete, but when you crack open the box, you'll basically see three main components.

1. The power source, this will either be a coil or in my case, a perforated metal box. It will have the main power leads coming from the inside. One set of DC wires will be connected to the driver board...

2. The driver board, you'll recognize this because the leads from the connection cables to the XYZ ports will be attached to this. If you had a board like my 3020, they will be super easy to undo since they are screw terminals. Just undo them and you can pull them out. The power leads from the power source should also be present, this also needs to be undone)

3. The spindle VFD (Variable Frequency Driver), this maybe a closed box or an open circuit board. You'll recognize this since it will have a control board and dial to control the spindle speed.

--

If you forget the label the XYZ cables, don't worry, just follow them to the ports on the back and you can see which is which.

Step 3: Prep the Arduino and CNC Shield.

The Arduino needs to be flashed with the most current version of GRBL. What does GRBL stand for? No idea, jury's still out.

GRBL is an open source G-Code interpreter, it is to CNC machines as Marlin firmware is to 3D printers. You can find it here: https://github.com/grbl/grbl

Once you have GRBL on your Arduino, you can mount it into the case. BUT before you do that, you need to remove the old parallel port driver board. Don't throw it out, there are likely some awesome electronics components you can salvage from it. You've already undid the wires so this shouldn't be too hard.

I had to mount my Arduino board first with a couple of screws (into the screw bosses from the old board) before attaching the CNC Shield.

Step 4: CNC Shield Physical Settings

The CNC Shield has spots for 4 driver chips. It accepts the A4988 or the DRV8825, the later being more powerful and able to accept up to 36volts and 1/32 microstepping.

I only had A4988 available, so I went with those.

Before installing the driver chips, you have to decide how many micro steps you want to have your machine run at. Rule of thumb is, the more micro steps, the smoother the motions, but lower the torque. Vice versa, the less micro steps, the more torque the stepper motors have.

You have to use jumpers to set how many micro steps, I wanted 1/8 microsteps, which I believe is a good compromise between smooth motion and torque.

To find out how to set this up:

http://blog.protoneer.co.nz/arduino-cnc-shield-v3-...

CNC Shield NOTE: I have a clone of the CNC Shield V3, so my jumper settings differed from those advertised on the Protoneer blog. This could be an anomaly, or it could be a wide spread board mistake.

NOTE: when installing the driver chips, make sure they are installed in the correct orientation. You can see on the board where the pins for the stepper motors and on the drivers chips you will see which set of pins need to be going towards the pins. Alternative, you can just look at the many many pictures of the CNC Shield online.

Step 5: Solder Stepper Motor Leads

Ok...so you've removed the XYZ cables from the old driver board, the Arduino and stuff is mounted...now you need to interface the old with the new.

The XYZ cables will need Dupont female connectors to connect to the CNC Shield. You can do this a few ways, the easiest way was to make up a female connector with leads that you can solder the old cables to. The cables will already be colour coded into pairs so try and keep them in the same orientation. It will be RED/RED and BLACK/BLACK, not Black/Red, Black/Red. Conventional electronics wisdom says so but this time its not.

Stepper motors work 2 pairs of leads, this dictates the direction they push when a current is put through, if you find that the direction is reversed when you fire up the machine and jog around, its a simple matter of taking that axis lead on the board and turn it 180 degrees.

Step 6: Connect Power, USB, Arduino and PC

For my conversion, I have a dedicated USB cable that I put into the Arduino and it just simple comes out of the control box, I didn't bother positioning board so I can unplug it. This USB plug not only connects your computer to the Arduino, but it also powers it.

The CNC Shield also needs power, this is to power the stepper motors. The power does not feed into the Arduino, so don't worry about frying it. There should be a screw terminal to attach the lead from the power supply to the CNC Shield, do this.

Once you've attached it, you can fire up your favourite GRBL controller software.

Step 7: CUT! ENGRAVE! DO STUFF!

That's it...this may seem like a long process but honestly, if you've read this entire thing, it will have taken longer to read this than it would be to convert it. This whole process took me about 45 mins.

So...if you didn't watch the video. Here it is again.

Have fun!

Step 8: BONUS! Math!

Here's a quick mini tutorial on finding out the value to put into your GRBL settings for the correct amount steps for translating designs into the real world accurately.

A typical stepper motor has 200 steps PER revolution. These are known as FULL steps or 1.8° per step. This setting has the most torque and is the fastest, however not the smoothest.

Most of these machines will list the kind and size of lead/ballscrew it has. On my 3020, the lead screw is 1404.

14: 14mm diameter of the screw thread (OD)

04: 4mm pitch (or the distance between threads)

We are mostly concerned with the 04 number since it describes the amount of linear travel something connected to the lead screw will travel with ONE revolution. So a 1205 thread is 12mm diameter and 5mm thread size, so on and so forth. This also applies to ball screws, 1603 is 16mm diameter and 3mm thread size.

--

Now we can connect the two numbers together.

Stepper: 200/rev

Leadscrew: 4mm/rev

The settings in GRBL call for a PER mm number so its a simple math really.

200/4 = 50 steps to make something travel 1mm

(if we have a 3mm thread, it would be 200/3 etc etc)

50 is the number I put in GRBL

--

Heres where we get fancy, micro stepping.

I have my CNC machine set up to be 1/8 micro stepping, which means each step is divided into 8 microsteps.

200 steps x 8 micro steps = 1600 total steps/rev

The same math applies

1600/4 = 400 steps to make something move 1mm (again, if your thread is different, than the divider number will be different)

400 is the number I put into GRBL

--

The more steps the smoother the motions, but slower it will be and less power on the torque.

THANKFULLY, the Chinese CNC machines are all metric, which makes this math very simple. If these were ACME threads, there would be some metric/imperial conversions which would result in some very odd numbers.

--

Ok now go cut yourself something fun!

Share

    Recommendations

    • 1 Hour Challenge

      1 Hour Challenge
    • Classroom Science Contest

      Classroom Science Contest
    • Beauty Tips Contest

      Beauty Tips Contest

    58 Discussions

    0
    None
    BartC24

    Tip 6 weeks ago

    If you have a chinese CNC with 4 color cables to the stepping motors, the correct sequence from top to bottom is: blue, red, green, black

    1
    None
    BartC24

    Tip 6 weeks ago

    After a lot of troubleshooting, my CNC shield (v3.0) started to work after flashing the Arduino to GRBL version 0.8. Higher versions DO NOT work. You need the 3.51 version board for GRBL 1.1

    1
    None
    BartC24

    7 weeks ago

    Hi, you mention A4899 drivers. I think that is a typo, it should be A4988 drivers.
    BC

    0
    None
    tthompson24

    2 years ago

    Hi. I am a High School robotics student and I am trying to use this shield to make a CNC device like an Etch-a-Sketch. I was wondering if I could hook up a couple of potentiometers and use those to control the stepping motors. Thanks!

    2 replies
    0
    None
    John McClaintthompson24

    Reply 2 months ago

    Hi, I was beginning to look into stepper motors some years ago, and used a couple off ebay, an old computer power supply for five volts, and built a box with a pair of microswitches, 90 degrees apart, a spindle in a bushing, with a flywheel, and a cam to trip each switch in turn.
    I hooked it to a terminal board, and was able to test my stepper motors, simply applying the "digitized output" systematically to the leads of the stepper motors and had forward and reverse.
    To gain the same capacity with micro-steps, you'd have to include a board, whether "woodpecker" or an Arduino set, which I would recommend the latter. You could also use a 555 timer ic, make a signal generator with square waves, and control its frequency with a pot, and by that, get your more controlled "etch a sketch" mode working. The 555, as an 8 pin, or 556, a double, in 14, easily makes all sorts of signal generators, and can be among the most useful of ic's for prototyping.
    Semper Fidelis,
    John McClain

    0
    None
    MarkH544tthompson24

    Reply 1 year ago

    No, stepper motors do not work this way. They can only be instructed to make a step clockwise or a step anti clockwise. The driver accepts a direction and a step pulse, which then energises the stepper motor coils to turn. If you wanted to build something similar you'd need a rotary encoder, rather than pots.

    0
    None
    PranayS

    Question 4 months ago on Step 8

    how to clone Y axis in CNC Shiel V3 ?. Please Help me . i have 2 y axis motor .

    0
    None
    skendrot

    5 months ago

    Can you use the Carbide Motion software with the Arduino CNC Shield setup?

    0
    None
    masabeau

    Question 9 months ago on Introduction

    Hi Eric, can you help me ?

    I've bought myself a Chinese CNC 3018. The machine is using a crappy woodpecker CNC board. It constantly stops during milling. I've changed the board for an Arduino Uno an cnc shield V3. The machine runs stable but when I,m milling something the size is much smaller than it suppose to be. I already tried the pressision step jumpers but that isn,t work. See image from the same gcode file

    1 answer
    0
    None
    masabeaumasabeau

    Answer 9 months ago

    see picture. The big panel is made with the woodpecker board and the onee milling is done with the Arduino shield.

    IMG-20180910-WA0008.jpg
    1
    None
    meysam1391

    3 years ago

    Hi.I have a problem.I connected my Arduino board and step driver4988 on cnc shild and connect to gcode universal when click open. write connected to com4@9600baund but my step motor not move Please help Thanks for nice site

    3 replies
    0
    None
    MarkH544meysam1391

    Reply 1 year ago

    GRBL on an arduino uno requires 115200 baud.

    0
    None
    bahaa rajabmeysam1391

    Reply 3 years ago

    It's same my problem
    Maybe the power should be AC not Dc

    0
    None
    TimH18bahaa rajab

    Reply 3 years ago

    do NOT use AC on the protoneer board, you will fry all your electronics.

    0
    None
    masteruan

    2 years ago

    Great Project!

    I've a problem with Z axis. I've Arduino and CNC Shield like in your Instructables. When I try to move the Z axis this remain stop, and the others motors make a noise. The others motors work properly, and also the switch for relay.

    1. If I put the motor Z on the driver X or Y is OK. Move

    2. If I put the DRV8825 driver Z on CNC Shield pin X or T axis it's OK.

    3. If I put the X or Y motor in Z driver on CNC shield not work.

    a. Wich kind of cnc shield do you have?

    b. Can I test the CNC shield?

    Thank's

    5 replies
    0
    None
    tjndrmasteruan

    Reply 2 years ago

    I'm facing the same problem ,. not getting the pulse on z- axis step pin.

    If
    connect arduino uno, stepper driver seperately on breadboard. Z axis
    motor works. It seems there is something wrong with cnc shield v3.00

    0
    None
    ChrisH614tjndr

    Reply 2 years ago

    Iv'e got the same board and, everything works fine. are you sure the stepper board is installed the right direction? The potentiometer should be at the bottom of the board. maybe you put just that one in upside down? I got my board from china on ebay and, have not had an issue with it. it is V3 red with protoneer website written on it. maybe you guys need to check the solder joints on the bottom of your cnc shields z pins. and the capacitor on the z section. I'm sure all the boards don't go through a Quality Check. it may be your wires for the z axis are wrong. just throwing stuff out there. its odd that two people have a problem with the same axis. maybe you both do have bad boards. My driver boards are the same as in the instructable.

    0
    None
    MarkH544ChrisH614

    Reply 1 year ago

    Make sure you put the drivers in the correct orientation. If you are unsure, do not power it on. You should see a small "EN" on the shield, which is for the ENABLE pin on the driver. I put a driver in the incorrect orientation and blew the driver and the direction pin on the arduino. requiring me to purchase another driver and arduino.

    1
    None
    tjndrChrisH614

    Reply 2 years ago

    CNC shield V3 was defected . Only X & Y axis were working. I
    bought a new CNC shield V3 with Protoneer written on it. All axis are
    working fine now.

    Thanks

    0
    None
    masteruantjndr

    Reply 2 years ago

    Try to change the Arduino board with an Arduino official.