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.

Step 1: parts

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. 

<p>I wanna ask you...i made the seem with you...but i got trouble....question : how much current did you need to supply the shield.... voltage :12voltdc and the current to supply 3 motors is???</p>
<p>you need to check the specs for your steppers and see what V they run. I used a 12v wall wart and spliced 3 wires of the 1 pos/neg. and ran them to my easy drivers. worked for me. they are capable of 30v max if you have large steppers prob around 24v. run a second walwart to your driver board they are anywhere from 5-15v chek specks and run a line to that.</p>
<p>trying to make this code run 6 steppers, will this code do that?</p>
<p>No the code has to be tweek'd for 6 to run. unless you spliced 2 motor wires together to run off the same pins might work but they would be limited to doing the exact same thing.</p>
<p>I paid $2.25 for my easy drivers on Ebay. exact replica's anyway!</p>
I'm just getting into Arduino, so I do apologize for the question, however is it possible to use an Arduino Uno for this project?
Heyy, It's not possible for me to get 4 easy drivers to use it with 3D printer , rather I would like to use my own drivers, I 'm thinking to use L293D or simple H bridges to run my Bipolar stepper ( 4 wires) , how can I make it run , I have seen number of programs and software like grbl for easy drivers ,Adafruit motor shield V1 and V2 , grbl shield but not with H-bridges , so the issue is pretty common for many people as well. <br>I tried two out of three motors , uploaded grbl to Arduino and sent Gcodes from Universal Gcode sender , only one of my motor seem to work (however very slowly nad an irritating &quot;buzzzzzzzz&quot; like noise is coming out of it). I tried some variations with steps for different axis and I could see it move with 10 steps/mm. <br>I don't know what to do. <br>Can't you make easy drivers or motor shield or grbl shield on your own ? <br>Also I need a 4 axis driver as I would be using it for my 3d printer. <br>Thanks, any help would be appreciated.
<p>How did you get the universal Gcode sender to work? I went to gethub and downloaded it. I clicked on the file that had Jar.Jar in it and nothing happened and then clicked on the sw file and nothing happened! What do you do with the github downloaded file to make the sender come up? What are the steps? I am using windows 7 64.</p><p>Thanks</p>
<p>Soo could you plug this into a program like Mach3 or linux cnc?</p><p>meaning, if you have your arduino interpret Gcode can you hook this up to a program like the above?</p>
<p>I have ordered grbl cnc shield v3 from ebay from this link <a href="http://www.ebay.in/itm/TDP004-ARDUINO-CNC-SHIELD-V3-00-GRBL-COMPATIBLE-/161520584178?pt=LH_DefaultDomain_203&hash=item259b6085f2" rel="nofollow">http://www.ebay.in/itm/TDP004-ARDUINO-CNC-SHIELD-V...</a></p><p>now when i try to connect this shield it requires power before i mount it onto my arduino uno. The issue is that before i could use the setup i have to detach the shield from uno and power it first and then mount it and connect it to pc. is there any solution to this? </p><p>do reply asap</p>
Could you add a fourth stepper motor to pins 1 and 2? Could you also control a heatbed and an extruder (nichrome wire), because I am trying to build a 3d printer. Also how do you control the z-axis with only one motor.
<p>Pins 1 and 2 are required for data input, you could only use them IF you set it up to just run the program you've already loaded, that didn't require any additional input. (in other words, no)<br>Running it with an uno, you really don't have enough output pins to control anything additional. If you built it with a mega, or something else, then you'd have additional data pins for controlling other things, but honestly it sounds like you should be using a ramp board anyways.<br>Z axis only requires 1 motor. I've seen some designs for extruder based printers that use 2 Z axis motors, but it's no more required than 2 motors on the X axis.</p>
<p>If you could answer a quick question for me, I would sincerely appreciate the help. </p><p>I'm making a homemade laser-cutter, and the problem I'm facing at the moment is how to trigger the laser ON instead of driving a stepper motor (the motor for the Z-Axis). Now, in your photo for Step 2: &quot;Wired the Stepper Motor To the EasyDriver&quot; you show &quot;5 Out and Ground.&quot; Are these pins something I can control off and on? I'm using GRBL on the Arduino Uno, so I'm not sure exactly how I would write the GCode to do this. </p><p>Thank you so much!!!</p>
<p>Hi jmsiefer,</p><p>What you need is a relay module that will control the trigger of the laser. </p>
<p>I'm building my own cnc router at this moment, using scrap materials. The constructrion of the hardware is allmost finished, en looks quite good! Time to start the programming en controlling of the steppermotors. I surely will use this handy tutorial. But what seems most unclear to me now is how i convert a drawing to g-code, and how do i get the g-code to the arduino?</p><p>Any help with this would be very appreciated!</p>
<p>Look up GRBL, it's a program you upload to the arduino to convert g-code to the motor drivers.</p>
<p>Nice project!! I had a quick question. I was looking into getting the easy driver and 3 steppers for my cnc build but i'm not sure if my steppers will work with the easy drivers. all the steppers i have looked at so far are rated for 1.3A or so. the easy driver is only rated for 750mA. Will that stepper work for me or do i have to look for one rated under 750mA. I would appreciate it</p>
<p>Hi diyman!</p><p>I'm not the author, bus as I've been studying and searching on how to make these 3D moves, and from what I got, usually the stepper controllers I found were rated to a determined Current(A) on EACH coil. So as this steppers have 2 coils, I've read that it means it can handle a total of 1.5A. <a href="http://www.ebay.co.uk/itm/171370859610" rel="nofollow">This one shield</a> seems to be what I look for:</p><p>&quot;4 H-Bridges: per bridge provides 0.6A (1.2A peak current) with thermal protection, can run motors on 4.5V to 36V DC&quot; </p><p>I'm about to order it, but I'm still colecting some other hardware (and few cash ;) )</p><p>So I think that one you said works fine! I looked over it, but the L293D looks better and cheaper for me. Also I'm pretty sure I've read somewhere, that you can actualy kind of stack more L293D on each of the provided ones to increase Current! I won't need that, but it's a possibility.</p><p>For now I'll use it just to drive DVD Drive stepper motors, which I guess won't need more than 200/300mA, for testing purposes, to get it bigger later, with the same Electronics, but with Nema (17, probably)stepper motors driving a threaded rod.</p><p>I'm so eager to finally get to that big project! But I'm learning all by my self almost from 0, so it takes some time.</p><p>To the author, congratulations! There is actually a fault on guiding people on the electronics part of these machines, but you covered it really well! Thank you for that, and I hope to be able to return my knowledge back with a good tutorial and my good intention to exchange knowledge.</p><p>Best regards</p><p></p>
<p> can this code interpret g code??</p>
<p> can this code interpret g code??</p>
<p>hello..i am having issues with the output.</p><p>this is what i have done so far:<br>1- downloaded hex file from <a href="https://github.com/grbl/grbl/downloads" rel="nofollow">https://github.com/grbl/grbl/downloads</a><br>2- using Xloader, i have uploaded the hex file.<br>3- downloaded grbl controller.<br>Now when see the outputs from arduino uno pins, except pin 2,3,4 and 5, all pins are consistently high, while these 4 are consistently low.<br>i need to know where i am making a mistake.<br>The above mentioned steps are what exactly i have done not even a single thing different.<br>Please help&hellip;<br>Thanks</p>
<p>Hi, great job!.</p><p>I'm trying to use the adafruit motorshield as stepper controller but I don't know the pin configuration for grbl files.</p><p>Do you have any sketch about this?</p><p>Thanks a lot </p>
<p>Will this work with Arduino UNO or will it only work with Arduino Duemilanova ?</p><p>Is it possible to connect 3 stepper drivers with ONE EasyDriver ? ( i doubt it's possible, but wants to know about the possibility for that )</p>
<p>Yes, this will work with all flavors of Arduino.</p><p>Short answer, Yes you can connect all 3 to the same easydriver but they will all turn the same.</p><p>Long Answer: Stepper motors, unlike &quot;regular&quot; DC motors, have 2 sets of coils inside. To turn a stepper, you need to alternately turn these coils on and off, which is what the Easy-driver does. So, if you want to control 3 stepper motors... you need 3 drivers.</p>
<p>another question here, can I connect one Raspberry Pi, directly to 3 Stepper Motor, and control all 3 of them to turn different direction/speed ?<br>or must I connect a Raspberry Pi -&gt; 3 EasyDriver -&gt; 3 Stepper Motor</p>
Can I run 4 steppers with Arduino and stepper drivers ? <br>Why do you have to use easy drivers , when you could just buy cheap ICs like L293Ds and ULN2003/4 to drive your steppers? <br>
<p>Each driver needs 2 digital lines: Step and Direction. So, you can run as many drivers as your arduino has pins for.</p>
<p>I'm still new to the Arduino and can't answer your 4-axis question, but I am currently working on building a CNC using the L298 driver. To use the L298 &quot;like&quot; an EasyDriver, you also need the L297 controller (or equivalent) and some other components. The L293D is only a driver (handles the voltage and current) and requires a controller just like the L298. The ULN2003/4 is a DARLINGTON ARRAY and is not designed for the current desires of a stepper.</p><p>Datasheets:</p><p><a href="http://www.ti.com/lit/ds/symlink/l293d.pdf" rel="nofollow">L293D</a></p><p><a href="http://www.farnell.com/datasheets/1696835.pdf" rel="nofollow">L297</a></p><p><a href="http://www.tech.dmu.ac.uk/~mgongora/Resources/L298N.pdf" rel="nofollow">L298</a></p><p><a href="http://www.doyoung.net/video/DATASHEET/PDF/ULN2003.pdf" rel="nofollow">ULN2003</a></p>
<p>Hello <br>The Lord's great imaged motor control and stepper motors rather for the help of the driver. <br><br>I just have one question .... Can I control L298 driver, front using the Arduino for the help mach3</p>
<p>I am currently working on building a CNC using the L298 driver. To use it &quot;like&quot; an EasyDriver, you also need the L297 controller (or equivalent) and some other components (look up PDF).</p>
Hi. Are you using the grbl code in Arduino for the CNC? <br>Or have you made one your self? <br>What prog are you using for designing and g-code? <br> <br>Best, <br>Andy
Thanks for the info...Can I wire up 3 different stepper motors to work on my cnc or do they have to be the same? I was wondering if I could adjust the movements on each stepper separately
You can. It's a lot easier to use three of the same thing - less variation means less debugging.
i wanted to make my project, cnc milling, wireless. so i need inputs on how i would be able to send gcode generated in eagleCAD wirelessly?? and what all necessary changes i would need to make in electronics section of the project. kindly help.
Sorry, I can't help you with this. I have almost zero experience with wireless.
thanks for your response. i had some input that we can send the gcode generated via a serial-to-bluetooth converted and can recieve the code in reciever blutooth which we will interface on controller, in place of serial port. i was just wondering whether it will work or not
I don't see a problem as long as the connection doesn't drop. Wifi, cable, bluetooth... it's all the same.
yes, you right. i am doing my final year project and our guide is expecting us to do some out-of-box change..so someone in our group suggested making it wireless, and now we are juggling to get the idea implemented..
Could these NEMA17's be enough to have a dremel on it and cut wood? Or are they too weak? Nice tutorial!
Very well said. I'm a noob and need serious help. If you don't mind, I'll compile a list on the programming side of things since I only plan to engrave my business name and phone number on keys. Thanks a bunch. Btw, I love this tutorial.
I'll hopefully be able to release a schematic/EAGLE file for a complete self containing driver using an Arduino, 3 easy drivers along with maybe an Ethernet shield. Thanks for the instructions, now I have something to go off of!
You, sir, are a bada$$. <br> <br>Thanks.
Thanks. I still don't understand how you program the Arduino to understand G code. Could you please go into a little more detail? Or post another Instructable? <br>Sorry I seem so ignorant and lost. It's because I am. I'm trying to learn this as a 65 year old guy who grew up in a world where things like Arduinos were beyond our wildest imaginings.
try http://www.github.com/i-make-robots/drawbot/ or <br>http://www.github.com/i-make-robots/delta-robot/ . Both are robots that listen to gcode from the serial connection and then do...things.
How does the Arduino know which way and which motor from the G code via USB? Does it just natively &quot;speak&quot; G code?
I program my arduino to understand gcode, then figure out which motor to move (and which direction) based on the gcode instructions.<br>A good example of a system I built with two motors is my polargraph drawing robot, the Makelangelo: www.marginallyclever.com/drawbot
is there any reason why the delay has to increase between rising edges? would it be fine if you left it at 160? also how does i&lt;3400 come out to 4000 microsteps? <br> <br>Sorry for all the questions but i'm very fascinated in this for my arduino. Also I am in the process control and automation field professionally and for max torque out of stepper motors it is best to keep them running at lower speeds. Depending on your power supply voltage just about anything over 10 revs/second starting dropping torque considerably.
The changing speed is only to demonstrate the effect on the stepper.
Lee - I think you've spotted a few typos in my code. thanks for that!

About This Instructable


684 favorites


Bio: I want to make a living through robotics and inventing. I don't get to travel enough.
More by aggrav8d: Unforgiving Tiny Tetris Programming 101 with DIY RGB LED scrolling message ticker How to transform a Makelangelo 3 into a 3D printer
Add instructable to: