Introduction: 3020 CNC + Arduino + GRBL + CNC Shield V3

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!

Comments

author
saninbreak (author)2017-07-27

una consulta cual debo alimentar primero la placa arduino via usb , o la shield con 12v, y para apagar cual debo quitar el suministro de energia primero.

author
shamil.niyas (author)2017-06-23

Hi Dude,

You mentioned A4899 in step 1 but you really used A4988

author
CDolan1989 (author)2016-12-31

Great project and many may think this is a stupid question, but what is wrong with the 3020 CNC as it is? Is it a sort of an upgrade to use the Arduino instead? Also all the 3020 machines I am finding will not engrave metal, with the Arduino will that allow me to engrave copper boards and produce my own PCBs?

Chris.

author
mikiex (author)CDolan19892017-01-16

I'm no expert, but the first reasons the author converted to arduino was because he uses a Mac (as stated) and along with this many PCs no longer have parallel ports, doing this conversions makes it USB. Also the older driver boards that come with these machines are well known for being a bit sub standard. I would imagine all 3020 machines can do PCBs?

author
curiosity36 (author)2017-01-02

Thanks for good tutorial ible. I'm not converting. Just starting out fresh with DIY machine.

What are the significance of the various jumper pins on the CNC Shield? I have yet to find anything on the jumpers. Is it necessary to have limit switches connected? If so should they be NO or NC switches?

O'scope indicates I'm getting step pulses to the 3 axes motor pins. Motor does not turn. A4988 gets hot.

Any help?

Thank you.

author
yalwis (author)2016-12-30

great project. nice clean. love that project and learned a lot about cnc. i have a problem with stepper drivers when i'm sending g codes to arduino stepper motor holding is working but doesn't move i mean doesn't rotate is that a driver problem or arduino problem? (sorry for bad English)

author
masteruan (author)2016-11-12

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

author
tjndr (author)masteruan2016-11-16

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

author
masteruan (author)tjndr2016-11-25

Try to change the Arduino board with an Arduino official.

author
ChrisH614 (author)tjndr2016-11-16

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.

author
tjndr (author)ChrisH6142016-11-24

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

author
masteruan (author)tjndr2016-11-17

[FIXED Z axis problem]
I've fixed this problem. It's a problem with Arduino shield and mac OS Sierra drivers. Now I'm replaced the Chinese Arduino board with a new Arduino board, and all work.

author
tthompson24 (author)2016-10-14

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!

author
KirkF10 (author)2016-10-08

Question: Where can I get a little help on an Arduino project to restore a desktop CNC to function? I bought 2 coil motors to match a "shield" with 4 driver chips and other parts suggested on https://www.instructables.com/id/3020-CNC-Arduino-GRBL-CNC-Shield-V3/ but I don't know how to get the right software to run on a Raspberry Pi such as the Universal G-Code Sender and the rest that replaces the factory combined system that required a Win98 with printer port to run? Thank you!

author
Vidmo (author)2016-09-25

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

This is for arduinoveith grbl.

For LPT or motor controller you have to check manufacturer's manual/datasheet etc. Motor controllers usually use step/dir control, so you'll need those pins and ground. Without gnd connection nothing will work properly.

author
ErikoK1 (author)2016-09-15

can i use small motor 28byj-48?

author
EA3BILR (author)2016-08-30

Hi,

I have a 3020T and I plan to use it with the ORIGINAL drivers on the controller box and use an Arduino/clone.

Does someone have the 3020T / 3040T DB25 controller box pinout??

Thanks in advanced for your helping.

author
Babatz (author)2016-08-18

Hey, thanks for your awesome instructable! I have a question regarding the pololu drivers, to what value have you turned the potentiometers? Thanks and best regards!

author
bkstmm (author)2016-08-10

I run GRBL and UniGcodeSender with A4988 drivers. They work well together. But the only drawback of running GRBL is the missing some of the better gcodes. Like tool offset for one that makes me have to draw the offsets and does make it harder to get a part correct the first time. As for as Arduino, GRBL, and the rest of the hardware you can't beat it for price, dependabilty, and ease of installing. A run around the net for wiring dirgams and voltages for each type of setup is a safer way to build you cnc. I spent and still do spend hours surfing info on different ways to wire my 3 cnc's.

author
arduinomaster (author)2016-07-03

Very good. Took me 15 month to find you as in your meta tags the word autolevel was missing.

author
billgeo (author)2015-10-31

Oh come on man, you can dedicate an old windows PC as a controller for the CNC.

For simple 2D designs I do all the work on an fairly old core2duo, 4gig RAM machine.

CAD, CAM and Mach3, all in one place, and a 2m parallel cable connecting the

CNC controller to the PC. Runs perfectly. Why complicate things?

author
TimH18 (author)billgeo2016-05-31

you can't buy any machines now with lpt ports, and you certainly can't get them for a laptop.

author
EricAusome (author)billgeo2015-11-01

It not complicating things, it actually simplifies things. I learned a new skill on top of it.

Also, I don't think you understand the level of dislike I have for Windows.

author
billgeo (author)EricAusome2015-11-01

Yeah, from the machines perspective, you can say it's more simple this way, yes.

And if it's a personal preferance on top of that, I have no argument there!

I am also more of a Linux guy myself so...

author
meysam1391 (author)2016-03-11

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

author
bahaa rajab (author)meysam13912016-05-10

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

author
TimH18 (author)bahaa rajab2016-05-31

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

author
CostinC1 (author)2016-05-16

@meysam1391 - set the baudrate at 115200

author
Bogus Cichocki (author)2016-04-29

A4998 driver you can use only for small stepper motor up to 1.8A. It is much better to use tb6560 driver with arduino.

author
panmaneecnc (author)2016-04-04

g code sender solution with wireless and android you can try it at https://play.google.com/store/apps/details?id=appinventor.ai_ploy_panmaneecnc.GRBL

author
CementTruck (author)2016-02-15

Also, do you have any images of your jumper settings?

author
CementTruck (author)2016-02-15

If you look at Protoneer's website you'll see that your board's colors match their V3 board, but the layout and design of your board is actually of Protoneer's V2 board. I think I have the same board as you.

author
Vidmo (author)2016-01-14

Stepsticks have 1,5A max current or something like that, and they are overheating without active cooling. You should get better performance with dedicated driver. You could connect arduino with grbl soft to old controller's LPT port instead using cnc shiled. LPT connector have some in and out pins for step, dir, spindle PWM, endstops, etc.

author
EricAusome (author)Vidmo2016-01-15

The original steppers are integral to the board...not interested in fooling around with them :)

The motors are 1.8A i believe, so I am not really getting that much more out of them.

author
Vidmo (author)EricAusome2016-01-16

I'm not sure what you mean.
I only wanted to suggest, that you could connect your Arduino to LPT instead of changing all controller to Uno with CNC shield.

It would save few bucks and probably have better performance than CNC shield. You wouldn't need to mess with steppers.
Your idea was good, but it could be done a little simpler way.

author
ki4swy (author)Vidmo2016-01-14

+1 to Vidmo's , connect the grbl to the lpt port or to the headers that were marked, you would get better performance with the original drivers.

author
bippy (author)2016-01-12

thankyou i bought a clone on ebay and im buiding my own cnc mill as soon as the parts arrive from china so all of this help a huge deal

author
dstmartinmaker (author)2015-09-09

Very nice! I want to do this!

author
mr_lunch (author)2015-09-08

Nice work :) You mentioned that the jumper settings on your CNC Shield clone were different. What did you wind up using for the 1/8th microsteps?

author
EricAusome (author)mr_lunch2015-09-08

This may differ for all clones, but on my particular clone, which was labeled a V.3 the 1/8 stepper settings were, these match Protoneer's instructions but the other settings differ if I recall.

M0: high (bare)

M1: high (bare)

M2: low (jumper)

About This Instructable

215,924views

664favorites

License:

Bio: 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 ... More »
More by EricAusome:UHMW Polymer Carver Deadblow MalletCarbon Fiber Slingshot (Advanced)Sable 2015 CNC + Arduino + GRBL = LunchBox CNC
Add instructable to: