3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

How to wire an arduino-based 3-axis CNC machine

How to wire an arduino-based 3-axis CNC machine


I've seen a number of tutorials about how to build the platform for a 3-axis CNC milling machine.  I have not seen anyone tackle the tricky subject of the electronics.

Here now is my attempt to do so.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Parts

You'll need:

- an arduino. I chose duemilanova. (depends on the board you get)
- 3 stepper motors.  I chose NEMA 17s . ($15/ea)
- 3 EasyDrivers from Sparkfun . ($15/ea)
- some Cat5 ($2?)
- a 12V power supply for the steppers ($5?)
- a soldering iron
- some electrical tape
- an optional female plug is not a bad idea (<$1)

TIP: Don't get a 6ft or 10ft Cat5 cable.  Buy your cat5 by the foot from any computer or electronics store. That stuff has one wire inside instead of lots of little fibers.  Little fibers are a huge pain to work with. 

« Previous StepDownload PDFView All StepsNext Step »
114 comments
1-40 of 114next »
May 28, 2012. 6:48 AMmuhsien5806 says:
Sir
I've copied and pasted this code into an Arduino sketch, but when verifying, I get an error message that "easydriver does not name a type". How do I rectify this?
Apr 11, 2012. 3:21 PMniksa77 says:
(removed by author or community request)
Apr 12, 2012. 6:03 AMniksa77 says:
(removed by author or community request)
Mar 28, 2012. 10:40 PMbufalloo says:
I'm still confused. I'm having trouble finding how to interpret G-code to the stepper drivers. If possible, could you give me some pointers on how to find some sample code to do this? For example, could this be configured to be used with replicatorg for 3d printing?
Mar 13, 2012. 4:20 PMacl9865 says:
Hey,
When I bought my arduino it came with a 9v wall wart. I have a variable DC power supply at home, what voltage would you recommend supplying to the Nema 17's?
Mar 14, 2012. 5:01 PMacl9865 says:
Ok thanks. Did you end up building a frame for yours? I'm trying to find the most cost effective way of providing linear motion. Rack and pinion is pricey, all thread gets mixed reviews. Would you recommend 1 motor on each side of my longest length to prevent binding from one side being powered while the other isn't?
Mar 3, 2012. 6:59 PMhappytriger2000 says:
Hi,
I'm getting this "avrdude: stk500_getsync(): not in sync: resp=0x00" right after uploading it to my Arduino Duemilanov, what does it mean?, is the uploading completed fully?
Mar 4, 2012. 5:47 PMhappytriger2000 says:
Hiya,
I took a screenshot of the chosen borad = arduino Duemilanove w/ AT328, opent attachment.
Actually I was looking for the Gcode interpreter code, but not sure if the above code is the right one. I want Arduino to accept Gcode and run the Stepper motor. I have a Arduino borad, a PMDX 122 board 3 x 3phase stepper Driver w/ Motor, power supply ready, and the code which I haven't figure out yet.

thanks
Mar 6, 2012. 5:43 AMhappytriger2000 says:
Oops, the code provided was only a sample code to run stepper motor, sorry my fault.
Jan 11, 2012. 3:55 PMkotten says:
If someone made it this far, it means that they now can control the stepper driver with Ardunio but Ardunio doesn't yet know how to interpret G code? If that is correct, then the next step would be to install a GCode Interpreter in the Arduino Library, such as mentioned here: http://reprap.org/wiki/Arduino_GCode_Interpreter.

Are you aware of Grbl http://dank.bengler.no/-/page/show/5470_grbl?ref=mst
or http://www.contraptor.org/arduino-gcode-interpreter. And how do they relate to what you are or have done?


Aug 17, 2011. 1:32 PMElectronics Man says:
So if I would use the shield on this website--

http://www.adafruit.com/products/81

Do you think I could still use the codes you used for your arduino?
And also what software do you use to create the designs? Have you ever heard of Goolge Sketchup? I was wondering if I could use that to create my designs then send them to my arduino.
Aug 21, 2011. 4:35 PMElectronics Man says:
So can you help me with the software? I dont know which ones are compatible with the arduino and my motor shield I bought here-->

http://www.adafruit.com/products/81

And also could you help me design a carrige for the Z-Axis that uses a servo instead of a stepper?

Thanks!!!!!!!!!
Nov 2, 2011. 5:13 PMbbyrd1 says:
It might help you to examine my machine. There's a complete wiring diagram there too. Of course, your project may require a different approach. And yes-- you can use SketchUp. I speak to that on my site too. www.ProDrawer.com
Aug 14, 2011. 5:04 PMElectronics Man says:
I hate to ask such a stupid question but can someone please help me out with stepper motors? Do I need on with 4 wires coming out of? it if so what do each of the wires do? And could someone please suggest a good place to buy them?
Aug 16, 2011. 9:51 AMElectronics Man says:
thanks! Have you thought of trying to use this shield?---

http://www.ladyada.net/make/mshield/use.html
Aug 6, 2011. 9:03 PMcfrancke says:
agrav8d you say you need a 5v power supply for this project, but didn't you say the Nema 17 needs 12 volts? I'd like to run a nema 17 1 axis with an arduino but not sure what power supply to use for the Nema 17 stepper motor. Any help, links would be MUCH appreciated!!
Aug 8, 2011. 6:47 AM90mp11 says:
Variable voltage power supplies are good for driving motors. I've just built the electronics for a 3 axis CNC and the variable power supply from Active Robots (UK) let me run them at a low voltage for testing, so I don't blow my EasyDriver boards on the firsty run
Apr 7, 2011. 8:47 AMbac512 says:
I was just looking through an old printer to scavenge parts from, and I notice has 2 stepper motors, but only 1 stepper motor driver.. which got me to thinking, the CNC machines DONT operate MULTIPLE steppers at once, do they? don't they basically move all x, move y, then move z (or so other order, but, complete to the point). Would it cheaper/easier to build a switching circuit to switch the steppers in and out of the stepper driver, so you'd only need 1 driver, 1 arduino, and 1 switching circuit? and that circuit could probably easily handle 3, or even more for the really fancy machines?
May 3, 2011. 11:58 AMgunnk says:
Not sure what kind of circuit you have in mind, but remember that you'll need to keep supplying power to each stepper at all times. Steppers only provide holding torque when powered, so you'll get all sorts of slip if you cut power to them (especially if your machine has any kind of rotating bit on it).
May 3, 2011. 4:51 PMbac512 says:
hmmm... ok, even more reason not do use only one driver :)
Jul 13, 2011. 12:50 PMwillrandship says:
Well, if you can keep it powered while switching, you might get away with it.
Apr 8, 2011. 1:47 PMbac512 says:
thats true, I wasn't thinking things through completely. BUT, it COULD be useful in other things (robotics?) that used multiple steppers to make it cheaper. (again, yeah, less accuracy, but, for something that didn't need THAT MUCH accuracy....).....
yeah, unfortunately, i don't know enough about electronics to know how to design the circuit....
Aug 8, 2011. 6:51 AM90mp11 says:
The only problem with that approach is that you would quickly wear out a switching circuit, as it would have to switch hundreds of times to form a diagonal, or arc line, of which many projects are built.

I like the idea in essence, and for a 2.5 axis engraving machine, this would be ideal, but for a 3 axis, you'd be making more work for yourself, and creating more cost in the upkeep to keep replacing components that burn out on the switching circuit.
Jul 13, 2011. 5:15 AMbace1978 says:
hello everybody here
i bild this stepper motor driver bord with a arduino uno
with te demo code it runs fine it was fun to bild
now getting it to work with a cnc software is the next step en bilding a cnc frame
gr bramco from the netherlands
May 29, 2011. 12:17 PMHeilandStark says:
Hi Dan,
thanks a lot for this instructable. I just find out the same Easystepper drivers but I'm not sure I can use with this board I've bought on ebay: afishonaladder.com/docs/5_Axis_Interface_Board_adapter.pdf
I have 3 stepper motors scavanged from an old copier and I'll buyt the same 5V power supply you suggest.
Hope I could work with this board and keep going into the project.

Thanks a lot for your advise.

HS
May 29, 2011. 2:00 PMHeilandStark says:
thx but what I'm not sure about is if the board is compatible with the Easystepper drivers.
Thx
HS
1-40 of 114next »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
73
Followers
7
Author:aggrav8d(Marginally Clever Software)
I want to make a living through robotics and inventing. I don't get to travel enough.