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 »
99 comments
1-40 of 99next »
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
Apr 17, 2011. 11:55 PMprometheus442 says:
I've decided to go this route with my laser cutter. It seems to be the simplest at the moment.

But just to be clear, do you only need one power supply for all 3 drivers? If so, I may have ordered a couple extra. Every time I've tried to connect more than one device to a power supply, things got a little screwy. How would you suggest connecting it to the boards?

Great instructable! I really appreciate it.

P.S. With regards to earlier comments on an arduino-controlled motor-winder, that would be so freaking awesome. It must be done and soon.
Apr 20, 2011. 9:45 PMprometheus442 says:
Yeah, it's 8.4V so it should be enough. I actually just got the power supplies in today, so I'll be able to test them out very soon. I was referring to other projects where I had one power supply for multiple outputs. For example, I was doing a project involving 8 vibrating pager motors connected to one battery bank. The motors were supposed to work independently based on the state of a CdS sensor each one was connected to, but I only ever got one motor to move.

That project was a total wiring and engineering disaster. You've never seen such a thing outside a server room. Given more time, I could have made it work. C'est la vie.

Anyway, It'll probably work fine. By the way, nice job on checking and replying to comments for so long.
May 3, 2011. 11:53 AMgunnk says:
Don't forget that it's not just the voltage. You need to be able to deliver the right voltage with enough current. For example, the stepper motors at Sparkfun are rated for 12V and 0.33 amps. To run three of them I would need a power supply capable of 12V at 1 amp. I'm guessing your 8.4V supply is some sort of "wall wart". If so, they are usually labeled with both their voltage and max current. Good luck!
Apr 24, 2011. 7:52 PMpryde4114 says:
sorry for what might seem like an obvious questions but not too good with electronics, but if you need a 5V power supply could you not just use the 5V pin in the arduino to supply the power to the steppers?

Also to ask, the 5V power supply is to supply power to the Stepper motors correct? just confused because according to the site (http://www.kysanelectronics.com/Products/datasheet_display.php?recordID=7435) it says that its a 14V motor.
Apr 25, 2011. 3:19 PMpryde4114 says:
ahhhh i seee
thank you very much for that
Apr 18, 2011. 8:44 PMalbert71 says:
Would you please elaborate a bit more about the serial interface, im new at this and i got cofused, i have allwired upalready as you show, but i have noidea how to send G code to teh Arduino and from there to teh controllers
Aby help is greatly appreciated it
Aug 14, 2010. 4:28 PMG00 says:
Thanks for the tutorial aggrav8d. I am proactive with CNC but not too much with Arduino. Your tutorial is pointing me to the right direction for one of my projects. I really want to get rid of CNC software and make an stand alone application for a very specific project that shouldn't need G-Code at all. Although I want to see the way the rep-rap application interpreter works, good tip }{itch. I think that there is a critical mass on hobby CNC and Arduino, so the mix is going to be interesting. My Open Source project by the way, is an Arduino controlled CNC Coil Winder. If someone is interested or had been working on that let me know. Cheers!~
Apr 17, 2011. 4:13 PMhulfarsson says:
Hi, are you still into rolling coils? I´m rolling single string pickups with an Arduino based rig, see here-

http://www.youtube.com/watch?v=3I_7oAJTuHI

I would love to see your solution!
Mar 15, 2011. 3:49 PMkikiclint says:
design your own and cut out all of the little laminates and the cases, and figure out a way to wire it all correctly. All you have to do is assemble. If it is precise enough, you could mill the rotor and everything and have it create a tightly packed motor. Not sure how you would magnetize the center portion though after milling it. I saw a video that showed the take apart of a larger stepper. Google around for it and try to recreate it.
Apr 11, 2011. 7:20 PMslayer04 says:
If you wrote the g-code for some pattern you wanted to cut, how easy would it be to convert it to something the arduino would understand?

Thanks and good instructible by the way !
1-40 of 99next »

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!
65
Followers
6
Author:aggrav8d(Marginally Clever Software)
I want to make a living through robotics and inventing. I don't get to travel enough. I'm looking for someone to sponsor a really big art project. When I have news about robot stuff but not enough ...
more »