+ All Categories
Home > Documents > How to Wire an Arduino Based 3 Axis CNC Machine

How to Wire an Arduino Based 3 Axis CNC Machine

Date post: 02-Nov-2014
Category:
Upload: royson316
View: 218 times
Download: 4 times
Share this document with a friend
Description:
How to Wire an Arduino Based 3 Axis CNC Machine
11
http://www.instructables.com/id/How-to-wire-an-arduino-based-3-axis-CNC-machine/ Home Sign Up! Browse Community Submit All Art Craft Food Games Green Home Kids Life Music Offbeat Outdoors Pets Photo Ride Science Tech How to wire an arduino-based 3-axis CNC machine by aggrav8d on June 15, 2010 Table of Contents How to wire an arduino-based 3-axis CNC machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Intro: How to wire an arduino-based 3-axis CNC machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Step 1: Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Step 2: Wire the stepper motor to the EasyDriver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Step 3: Soldering and wiring. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Step 4: Sample arduino code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Step 5: In conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Transcript
Page 1: How to Wire an Arduino Based 3 Axis CNC Machine

http://www.instructables.com/id/How-to-wire-an-arduino-based-3-axis-CNC-machine/

Home   Sign Up!   Browse   Community   Submit

   All     Art     Craft     Food     Games     Green     Home     Kids     Life     Music     Offbeat     Outdoors     Pets     Photo     Ride     Science     Tech

How to wire an arduino-based 3-axis CNC machineby aggrav8d on June 15, 2010

Table of Contents

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

Intro:   How to wire an arduino-based 3-axis CNC machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1:   Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 2:   Wire the stepper motor to the EasyDriver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 3:   Soldering and wiring. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 4:   Sample arduino code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 5:   In conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

Page 2: How to Wire an Arduino Based 3 Axis CNC Machine

http://www.instructables.com/id/How-to-wire-an-arduino-based-3-axis-CNC-machine/

Author:aggrav8d    Marginally Clever SoftwareI 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.

You cannot be bored unless you are boring.

Intro:  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.

Page 3: How to Wire an Arduino Based 3 Axis CNC Machine

http://www.instructables.com/id/How-to-wire-an-arduino-based-3-axis-CNC-machine/

Step 1: PartsYou'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 5V 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.  Littlefibers are a huge pain to work with. 

Step 2: Wire the stepper motor to the EasyDriverNow we'll wire up each of the EasyDrivers.

Remove some of the interior wire from the Cat5 and strip the ends.  For each servo you will need two normal pairs of white/colored and one oddball of a white and twocolored.  In all, you'll have to strip 14 ends.

PCB soldering is easy, once you get used to it.  There are many other tutorials that cover the subjct.  Follow the image as indicated.  Your color combinations for theservo may be different.  I had to google for a long time to find this page with the color codes for my model.

TIP: "Do NOT connect or disconnect a motor while the driver is energized. This will cause permanent damage."  -- Sparkfun

Next we'll wire the power sources and the arduino.

Image Notes1. NEMA-17 order is red, green, blue, yellow. I was not easy to google that info!2. These power the servos. That's separate from the power for the board logic.3. These connect to the arduino. The arduino tells the board which way to go and how far.4. These power the board logic. That's separate from the servo power.5. You'll probably want to add a cooling system. When the stepper power is on this board gets hot to the touch!

Step 3: Soldering and wiring.I've done this all in one step, but feel free to wire each EasyDriver one at a time, check that it works, and then unplug it from the power and do the next one.

All 6 GND wires from the EasyDrivers are soldered to a single line, which goes to GND on the arduino.

All 3 +5V from the EasyDrivers are soldered to a single line, which goes to +5V on the arduino.

All the positive leads from the stepper power are soldered to a single line, which is then soldered to the female plug.

All the negative leads from the stepper power are soldered to a single line, which is then soldered to the female plug.TIP: Remember to put the plug cover on the wire BEFORE you solder everything together. Then slide the cover down and over the soldering.

TIP: Don't forget to have everything disconnected while you solder!

Double check you didn't wire the board power to the stepper power.  That would be bad.

Now the wiring is done, time to test it with some code. 

Page 4: How to Wire an Arduino Based 3 Axis CNC Machine

http://www.instructables.com/id/How-to-wire-an-arduino-based-3-axis-CNC-machine/

Image Notes1. This stepper is controlled on pins 4 and 5.2. This stepper is controlled on pins 6 and 7.3. This stepper is controlled on pins 8 and 9.4. All the positive leads from the stepper power are soldered to a single line, which is then soldered to the female plug. Repeat for all negative leads from the stepperpower.5. Remember to put the cover on the wire BEFORE you solder everything together. Then slide the cover down and over the soldering.6. All 6 GND wires from the EasyDrivers are soldered to a single line, which goes to GND on the arduino. The three from the stepper power go to the plug.7. Arduino Duemilanova Atmega328 with an ethernet shield on top. You don't need an ethernet shield. I'm just telling you so you don't wonder why the picture looksdifferent from your Duemilanova.8. 9DOF IMU. Not part of this CNC project. Inb4 "what's that?!"

Step 4: Sample arduino code// for duemilanove atmega328 arduino board + easydriver stepper controller// [email protected] 2010-06-15#define SENSOR_X_PIN 1#define SENSOR_Y_PIN 2#define SENSOR_Z_PIN 3#define DIR1_PIN 4#define STEP1_PIN 5#define DIR2_PIN 6#define STEP2_PIN 7#define DIR3_PIN 8#define STEP3_PIN 9#define DELAY 150

void setup() {Serial.begin(9600);pinMode(SENSOR_X_PIN,INPUT);pinMode(SENSOR_Y_PIN,INPUT);pinMode(SENSOR_Z_PIN,INPUT);

pinMode(DIR1_PIN,OUTPUT);pinMode(STEP1_PIN,OUTPUT);pinMode(DIR2_PIN,OUTPUT);pinMode(STEP2_PIN,OUTPUT);pinMode(DIR3_PIN,OUTPUT);pinMode(STEP3_PIN,OUTPUT);}

void loop() {int i;

digitalWrite(DIR1_PIN, LOW); // Set the direction.digitalWrite(DIR2_PIN, LOW); // Set the direction.digitalWrite(DIR3_PIN, LOW); // Set the direction.delay(DELAY);Serial.println(">>");

for (i = 0; i<6800; i++) // Iterate for 4000 microsteps.{digitalWrite(STEP1_PIN, LOW); // This LOW to HIGH change is what creates thedigitalWrite(STEP1_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.if((i%2)==0) {digitalWrite(STEP2_PIN, LOW); // This LOW to HIGH change is what creates thedigitalWrite(STEP2_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.}if((i%4)==0) {

Page 5: How to Wire an Arduino Based 3 Axis CNC Machine

http://www.instructables.com/id/How-to-wire-an-arduino-based-3-axis-CNC-machine/

digitalWrite(STEP3_PIN, LOW); // This LOW to HIGH change is what creates thedigitalWrite(STEP3_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.}delayMicroseconds(DELAY); // This delay time is close to top speed for this} // particular motor. Any faster the motor stalls.

digitalWrite(DIR1_PIN, HIGH); // Change direction.digitalWrite(DIR2_PIN, HIGH); // Change direction.digitalWrite(DIR3_PIN, HIGH); // Change direction.delay(DELAY);Serial.println("<<");

for (i = 0; i<6800; i++) // Iterate for 4000 microsteps{digitalWrite(STEP1_PIN, LOW); // This LOW to HIGH change is what creates thedigitalWrite(STEP1_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.if((i%2)==0) {digitalWrite(STEP2_PIN, LOW); // This LOW to HIGH change is what creates thedigitalWrite(STEP2_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.}if((i%4)==0) {digitalWrite(STEP3_PIN, LOW); // This LOW to HIGH change is what creates thedigitalWrite(STEP3_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.}delayMicroseconds(DELAY); // This delay time is close to top speed for this} // particular motor. Any faster the motor stalls.}

Step 5: In conclusionIf everything worked right, you should have three steppers each moving at different speeds back and forth.  There should be a light on each EasyDriver showing that ithas power.  If you have a light and no movement, You might not have a good connection to your arduino.

So what next?Now that you have three motors working through the arduino you can use the serial interface to tell the arduino what you want the steppers to do.  By changing thedifferent motors in the right pattern you can interpret G-CODE and start cutting patterns.  The biggest choice you face is what to cut!

Thanks for reading!Dan

Page 6: How to Wire an Arduino Based 3 Axis CNC Machine

http://www.instructables.com/id/How-to-wire-an-arduino-based-3-axis-CNC-machine/

Image Notes1. Congratulations! You earned it.

Related Instructables

Hobby cnc bymraspotcnc

Build a CNCRouter fromScratch (Part 2):Complete VideoTutorial byphooddaniel

Mostly self-reproducing 3-axis CNCmillingmachine(SHELVEDPROJECT) byebidk

Easy to BuildDesk Top 3 AxisCNC MillingMachine by TomMcWire

Make your owncnc controllerby charcoal999 How to make a

mini millingmachine-manual or CNC!by Honus

Comments

50 comments Add Comment view all 58 comments

 everywhere says:  Jan 16, 2011. 4:49 PM  REPLYHow long until you can start interprating gcode

 aggrav8d says:  Jan 20, 2011. 9:52 AM  REPLYWell I could start doing that now but I'd like to finish building a machine first. There are open source programs that will make it easy to run g-code on anarduino. I don't have the names in my brain. Google it! :)

 mhkabir says:  Mar 5, 2011. 12:08 AM  REPLYmaybe RepRap

 kokotipi says:  Jan 12, 2011. 10:33 AM  REPLYhello

I m sorry if this question has been already asked but is it possible using this configuration to add a 4th motor?I would need to do that in order to build my 3 axes cnc machine ... the machine i m trying to build is using 4 motors. 2 for the X axis 1 for the Y and 1 for theZ.

Thank you very much for your help!

Page 7: How to Wire an Arduino Based 3 Axis CNC Machine

http://www.instructables.com/id/How-to-wire-an-arduino-based-3-axis-CNC-machine/

Best regards

J

 aggrav8d says:  Jan 14, 2011. 9:46 AM  REPLYGreat question!

I am building a similar design. since two of the steppers are supposed to work exactly the same they can be slaved together. You can probably wire themboth to a single EasyDriver and run double the current through the stepper power.

Don't forget to keep your EasyDrivers cool! Running for hours could melt the chips.

 kokotipi says:  Feb 4, 2011. 10:38 AM  REPLYI got it done with the 4 stepper motors, 4 easydriver and a Arduino unoI modify your code slightly et voila!Thank you so much for your post!

Here is your code using a 4 stepper motor:

// for duemilanove atmega328 arduino board + easydriver stepper controller// [email protected] 2010-06-15#define SENSOR_X_PIN 1#define SENSOR_Y_PIN 2#define SENSOR_Z_PIN 3#define DIR1_PIN 4#define STEP1_PIN 5#define DIR2_PIN 6#define STEP2_PIN 7#define DIR3_PIN 8#define STEP3_PIN 9#define DIR4_PIN 10#define STEP4_PIN 11#define DELAY 150

void setup() {Serial.begin(9600);pinMode(SENSOR_X_PIN,INPUT);pinMode(SENSOR_Y_PIN,INPUT);pinMode(SENSOR_Z_PIN,INPUT);

pinMode(DIR1_PIN,OUTPUT);pinMode(STEP1_PIN,OUTPUT);pinMode(DIR2_PIN,OUTPUT);pinMode(STEP2_PIN,OUTPUT);pinMode(DIR3_PIN,OUTPUT);pinMode(STEP3_PIN,OUTPUT);pinMode(DIR4_PIN,OUTPUT);pinMode(STEP4_PIN,OUTPUT);}

void loop() {int i;

digitalWrite(DIR1_PIN, LOW); // Set the direction.digitalWrite(DIR2_PIN, LOW); // Set the direction.digitalWrite(DIR3_PIN, LOW); // Set the direction.digitalWrite(DIR4_PIN, LOW); // Set the direction.delay(DELAY);Serial.println(">>");

for (i = 0; i<6800; i++) // Iterate for 4000 microsteps.{digitalWrite(STEP1_PIN, LOW); // This LOW to HIGH change is what creates thedigitalWrite(STEP1_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.if((i%2)==0) {digitalWrite(STEP2_PIN, LOW); // This LOW to HIGH change is what creates thedigitalWrite(STEP2_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.}if((i%4)==0) {digitalWrite(STEP3_PIN, LOW); // This LOW to HIGH change is what creates thedigitalWrite(STEP3_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.}if((i%4)==0) {digitalWrite(STEP4_PIN, LOW); // This LOW to HIGH change is what creates thedigitalWrite(STEP4_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.}delayMicroseconds(DELAY); // This delay time is close to top speed for this} // particular motor. Any faster the motor stalls.

digitalWrite(DIR1_PIN, HIGH); // Change direction.digitalWrite(DIR2_PIN, HIGH); // Change direction.

Page 8: How to Wire an Arduino Based 3 Axis CNC Machine

http://www.instructables.com/id/How-to-wire-an-arduino-based-3-axis-CNC-machine/

digitalWrite(DIR3_PIN, HIGH); // Change direction.digitalWrite(DIR4_PIN, HIGH); // Change direction.delay(DELAY);Serial.println("<<");

for (i = 0; i<6800; i++) // Iterate for 4000 microsteps{digitalWrite(STEP1_PIN, LOW); // This LOW to HIGH change is what creates thedigitalWrite(STEP1_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.if((i%2)==0) {digitalWrite(STEP2_PIN, LOW); // This LOW to HIGH change is what creates thedigitalWrite(STEP2_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.}if((i%4)==0) {digitalWrite(STEP3_PIN, LOW); // This LOW to HIGH change is what creates thedigitalWrite(STEP3_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.}if((i%4)==0) {digitalWrite(STEP4_PIN, LOW); // This LOW to HIGH change is what creates thedigitalWrite(STEP4_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.}delayMicroseconds(DELAY); // This delay time is close to top speed for this} // particular motor. Any faster the motor stalls.}

 aggrav8d says:  Feb 5, 2011. 9:19 PM  REPLYDon't forget to put in those sensors to protect your machine. Nothing worse than having the gantry try to run off the end of the table.Congratulations! Send me a picture of your completed machine and I'll include it in the Instructable.

 Calrain says:  Dec 16, 2010. 5:00 AM  REPLYCan I just confirm... I think you mean:"All 6 GND wires from the EasyDrivers are soldered to a single line, which goes to GND on the arduino."

Instead of"All 9 GND wires from the EasyDrivers are soldered to a single line, which goes to GND on the arduino."

If I read right.. there are 3 GND per EasyDriver but 2 of those go to the Arduino GND and the other goes to the Stepper motor GND.

Should that read 6 instead of 9?

 aggrav8d says:  Dec 16, 2010. 9:37 AM  REPLYYes! My bad. Fixed.

 aggrav8d says:  Nov 18, 2010. 1:18 PM  REPLYSENSOR are for limit switches in a future project I will detail on instructables.

 burwuro says:  Oct 12, 2010. 8:46 PM  REPLYFirst of all, great Instructable! Though i was wondering how hard it would be to add a 4th controler, and would theese stepper motors work instead of theones you have shown? http://www.alltronics.com/cgi-bin/item/94M005/55/Airpax-82227-B82359 Thanks!

 G00 says:  Aug 14, 2010. 4:28 PM  REPLYThanks 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 myprojects. 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 Iwant 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 isgoing 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 thatlet me know. Cheers!~

 aggrav8d says:  Aug 25, 2010. 5:58 PM  REPLYIf you can make a robot that can create motors, steppers, or servos, then you have my undivided attention :)

 Robot Lover says:  Aug 11, 2010. 7:29 PM  REPLYMy dad is going to make this and I was just wondering if the ethernet shield is needed for this project?

 aggrav8d says:  Aug 12, 2010. 7:17 AM  REPLYOh, I meant to ask: What material will he use for the frame? Plastic or metal would be better than wood.

Page 9: How to Wire an Arduino Based 3 Axis CNC Machine

http://www.instructables.com/id/How-to-wire-an-arduino-based-3-axis-CNC-machine/

 Robot Lover says:  Aug 12, 2010. 9:02 AM  REPLYHe has not built it yet but I'm thinking that he will probably use a combination of both. Thanks for your help. I would give you a patch but i'm fresh out!Thanks again 5*

 aggrav8d says:  Aug 11, 2010. 11:24 PM  REPLYNope! I only got it because I was trying something with WIFI and it happened to be in the photo. I was trying to avoid those "what is THAT?!" questions. Ibet you *could* use it instead of serial USB to send gcode instructions. It will probably make things more complicated.

 diluded000 says:  Aug 9, 2010. 10:13 PM  REPLYI built a system that runs G-code output from variety of applications, using the parallel port on a old Pentium 100, input to a CNC controller board, that runssome 90 oz/in Nema 23 steppers on my Sherline milling machine. Originally I hand built an L297/298 based circuit, but it wasn't stable enough to run forhours on end. I designed an Arduino based control of temp on an annealing oven, but the DOS based TurboCNC does the trick for me on the millingmachine. My controller was $85 from www.lightobject.com. Y'all should check out the forums on CNCzone, I think it is the best resource out there for CNC.They have a long list of G-code generating and interpreting utilities from various sources (many free). While there are lots of machine specific tweaks, G-code is common denominator among most CAD/CAM setups. And this system would look lots better with some corrugated wire covers that they sell at theauto parts store. Get some cable ties the same color as the Flexon, it looks much more badass.

 rwehner11190 says:  Aug 1, 2010. 6:37 AM  REPLYRather than using a female plug, I cut and stripped the wire from the 5V supply. There are two wires, red and blue, inside. I'm not sure which of the two islive, but I can check with a multimeter. Do you know which of the two wires hooks up to the positive or negative leads from the stepper power leads? Does iteven matter? Also, the signal leads from one of the easy drivers attach to pins 8 and 9. There are 'step' and 'dir' outputs on the easy driver, but which ofthese outputs connect to pins 8 and 9 respectively? Thanks for your help!

 aggrav8d says:  Aug 1, 2010. 8:34 AM  REPLYI prefer to not cut up a perfectly good power supply because I might want to reuse it on another project later. YMMV. Look at the outside of the wiring -one side should have markings of some kind to indicate it is the positive lead - white stripes, perhaps. If you aren't sure which is positive, use a meter tocheck. It's cheaper than destroying your hardware. :)

The first few lines of Arduino code say

#define DIR3_PIN 8#define STEP3_PIN 9

You can alter these values as needed.

 alvairone200 says:  Jul 29, 2010. 5:21 PM  REPLYhelp lol I been reading you comments and be for that I thought of trying to find a kit to build a 4 x 4 cnc plasma machine but I think I would need a lot of help.Ihave time and a little bit of money any suggestion as to the best kit to buy or could someone help me with a kit

 cliffyd says:  Jun 29, 2010. 12:48 PM  REPLYNice work but I take it we can't use a program like mach 3 for instance to run the steppers as a cnc mill? You're saying we have to write seperate codes foreverything we wanna cut. I like the idea of using the arduino I'm just not the greatest "code jockey" so it would be a huge pain in the @#* to re-write a codefor any project! Good work though!

 dylanwinn says:  Jul 20, 2010. 6:05 PM  REPLYYou don't have to use an Arduino. You can wire 3 of the EasyDrivers up to a parallel port and use Mach3 or no problem.

 aggrav8d says:  Jun 29, 2010. 1:16 PM  REPLYSome people have written instructables about how to build a CNC. This instructable shows you how to wire up a (crude) CNC. From there you still needto create an interface between the arduino that drives the steppers and the software on your computer that generates the paths (aka g-code). You mightwant to look at GRBL (http://github.com/simen/grbl) which claims to be the missing link. I have yet to try it myself.

 dylanwinn says:  Jul 21, 2010. 12:20 AM  REPLYI do not currently have a functional CNC mill, but I have installed GRBL on my Arduino and tested it as best as I could. It is by far the best ArduinoGcode interpreter I have found, though it does not support extruders for 3D printing. Just remember to change the AVRdude command line to 57600baud when you flash the .HEX, and set your serial terminal (I recommend Termite) to 115200 baud.

 maxpower49 says:  Jun 15, 2010. 6:30 PM  REPLYdo you have to figure this out every time you want to cut something or is there a program that will do this for you

 aggrav8d says:  Jun 15, 2010. 10:02 PM  REPLYThere are a few open source programs now that will convert a DXF file to G-CODE. Unfortunately the standard for G-CODE is effectively junk. Fromwhat I read, nobody sticks to it. What needs to happen is someone needs to write a standard interface between mill software and mill hardware - just likedrivers for any other peripheral on your computer. Hmm... Anyone want to pay me to do this? I could dedicate a few months to the problem and bang outa pretty good solution.

Page 10: How to Wire an Arduino Based 3 Axis CNC Machine

http://www.instructables.com/id/How-to-wire-an-arduino-based-3-axis-CNC-machine/

 alfredhenriksen says:  Jun 19, 2010. 5:54 AM  REPLYWhat is wrong with G-Code? Or are you talking about M-Code who are different from each machine. The G-Code is already a standard, see "RS-274D is the recommended standard for numerically controlled machines developed by the Electronic Industry Association in the early 1960's. TheRS-274D revision was approved in February, 1980. These standards provide a basis for the writing of numeric control programs. " Please elobratethat how you mean that the standard is junk as it have be around for a long time and have gone many interations. Sure, there is limits but allprogramming languange have limits! :) http://www.linuxcnc.org/handbook/gcode/g-code.html http://en.wikipedia.org/wiki/G-code In my world it's awording I follow: "shut up and hack" Why are you asking for money, are you motivated by money or by programming something new and beautiful? :)Either way, I love this tutorial. Thank you! Finally I got a way to do simple operations on my cnc machine without EMC.

 aggrav8d says:  Jun 19, 2010. 7:30 AM  REPLYI think you are confused on a number of issues.

"Due to the lack of further development, the immense variety of machine tool configurations, and little demand for interoperability, few machinetool controllers (CNCs) adhere to this standard. Extensions and variations have been added independently by manufacturers, and operators of aspecific controller must be aware of differences of each manufacturers' product." -- the wikipedia entry for g-code

Maybe you have the freedom to spend all day writing code and not worrying about paying your bills. Are you rich? Do you still live in your parent'sbasement? Either way, I don't live in your world. Please post some instructables of your own before you tell me to shut up.

 alfredhenriksen says:  Jun 20, 2010. 4:26 AM  REPLYPlease be more concrete than a quote from wikipedia. Which specific extensions and variations don't work? ................."EXTENSIONS ANDVARIATONS" is not even talking about the essensial G-Code, as the machine would not comply the RS-274D standard, and who will buy it?.....I suspect that these manufactures make the new G-Godes to partly lock their customs to their product, to custom fit their product(=faster?), getting a competion edge and they've documented the proprietary g-code so it's nothing more than looking in the manual, andthinking about them when porting to other machines, or make a new G-Code from a CAD/CAM-program. A problem can always be solved! :)Most of these codes disappered when a company disappered. It's really not a problem as long one KNOW S the limits of thesoftware/hardware and take care to avoid these bad apples. :) It could be a problem several years ago, but it's a classic evolution ofsomething old and beautiful. .............................................................................................................. How was Linux created? How wasMicrosoft created? How was Apple created? They wrote/bought/made code before they could earn money. It's called dedication and risk-taking in a business world. They all took a chance, hoping making money. (Linux was created by a strong personal NEED) I have beenaround people like you and I don't need to prove anything for you. Have a nice day.

 aggrav8d says:  Jun 20, 2010. 10:41 AM  REPLYIf you don't need to prove anything then why did you start this debate? Isn't your point to prove that G-CODE is OK? I don't believe that G-CODE is really all that great as a standard. Think about it: you have to convert a DXF file to g-code before it will run on a machine oncefor each type of machine. That doesn't sound like a proper standard to me. "But!" you say "No two machines have the same envelope,tools, or extra features!" So? No two computer monitors have the same resolution but they still make it work. What I should have is astandard driver API that lets me query device properties, tool types, and send it comletely standard instructions while receiving real-timefeedback. That way the job of calculating the best path for the tools is abstracted in software that could be written by anyone with accessto the API, which would lead to more developers being able to invest better at improving the software. That's economical and benefitseveryone. No secret knowledge of bad apples required. No writing custom control software for every hardware platform. You analogy isjunk. I would create the code but I don't have the time UNLESS someone can free me from my obligations to rent and bills. Apple has thetime to write - they had capital at the start to make an investment. Linux has time to write - they're all volunteers who work other jobs. I amnot in either of these situations. Also, it's called "Return On Investment". What, exactly, are "people like [me]"? People who make youexplain yourself? People who don't agree with you? People who punctuate and capitalize appropriately?

 ziggalo says:  Jul 20, 2010. 1:10 AM  REPLYactually any kind of interface that will convert g-code to arduino-friendly code that'll work with this machine.

 ziggalo says:  Jul 20, 2010. 12:56 AM  REPLYI have a question. Would you be capable of making this machine work with say, Mach 3? If you are able to create some software thatwould make this possible, How much money are we looking at? I really love this arduino driven CNC, and it would be even moreperfect if it was able to work with existing post-processors/g-code generators.

 aggrav8d says:  Jul 20, 2010. 12:44 PM  REPLYGRBL probably bridges the gap for you. If not, I'd be willing to take a look and give you an estimate. I'm still working on perfectingmy CNC, at which time I will need to tackle this step (and having a little financing would make it a lot easier)

 cmchapman says:  Jun 16, 2010. 5:08 AM  REPLYI'd give you some money over on kickstarter.com if you really want to write an open standard interface for milling hardware and software. I'm sureother people would too!

 aggrav8d says:  Jul 14, 2010. 5:32 PM  REPLYand I'd love to take your money to do that! Unfortunately kickstarter doesn't seem to support canadian projects yet because their paymentprocessor is wonky.

 aggrav8d says:  Jun 15, 2010. 10:04 PM  REPLYSince no standard currently exists, you'll need to write your own translator between the g-code they offer and the limits of your system. You'll stillneed software to drive the CNC, too.

Page 11: How to Wire an Arduino Based 3 Axis CNC Machine

http://www.instructables.com/id/How-to-wire-an-arduino-based-3-axis-CNC-machine/

 }{itch says:  Jun 16, 2010. 5:10 AM  REPLYThe folks at rep-rap have written an arduino based G-Code interpreter. You can just send the g-code commands via serial and the arduino willcalculate the required stepper motor movements. I haven't used it myself yet but have had a look at it for a CNC machine i have in the works.Here's the link .

 dylanwinn says:  Jul 20, 2010. 5:59 PM  REPLYFYI: I have had NO luck getting that to compile, but I'll continue working on it and post here with any progress.

 rwehner11190 says:  Jul 9, 2010. 10:48 AM  REPLYIs it possible to control 4 stepper motors with a single arduino duemilanove? i.e. are there enough I/O ports on the chip? I assume that I would just need tobuy a fourth motor controller?

 aggrav8d says:  Jul 9, 2010. 1:53 PM  REPLYGood question! You need two digital pins for each stepper - one for direction, one for step timing. since the Due has 13 pins you should be able to run upto 6 servos. I recommend using the extra pins to add trigger switches so that the machine can automatically recalibrate itself in the event of a powerfailure. You need only one switch at the near end of each axis, for a total of 3. 4 servos * 2 pins + 3 pins = 11 pins, so everything works. You'll even havea few pins left over in case you need to add extra sensors.

 aggrav8d says:  Jul 2, 2010. 8:39 PM  REPLYVery informative! Thank you.

 MaddMann says:  Jul 2, 2010. 6:52 PM  REPLYThis site is all about sharing knowlwdge and I intend to use your knowledge to build my CNC so I thought I would repay your knowledge with some of mineas a guy that's been in the wire and cable manufacturing industry for , well, let's just leave it at a long while ;-) The 6ft or 10ft cat5 cable with "hundreds oflittle fibers" are actually Patch Cords (these are the ones that go from your PC to the wall jack). Each of the 8 insulated singles is made of stranded copperconductor; typically 7 strands) as opposed to "regular" Riser and Plenum Cat5, Cat5e, Cat6, & Cat7 (these are the ones in your walls and ceilings) whereeach of the 8 insulated singles is made of a single solid copper conductor in sizes Cat5 & 5e 24 AWG, Cat6 23AWG, & Cat7 22 AWG. Cat5. 5e, & 6 arewidely available by the foot at your local Lowes or Home Depot - just make sure the print on the cable doesn't say "Patchcord"

 cdxanti says:  Jul 1, 2010. 4:51 PM  REPLYCorrect me if I'm wrong but I can run my 3v 4amp stepper motor using this board without blowing the arduino or the chip?

 aggrav8d says:  Jul 2, 2010. 9:19 AM  REPLYThe power to run the stepper is separate from the power to run the chip & the arduino. The stepper power runs THROUGH the chip because the chipcontrols the pulses. I do not know how high your amperage can go before you burn out the chip. I've seen people attach cooling systems to their chips. Iknow that at 12v/2a the chip is hot to the touch. Ask on the Sparkfun product page for more information, or try their forums. Post back here when you findout - I'd like to know what the upper limit is.

 tech_monkee says:  Jun 21, 2010. 4:30 AM  REPLYi have a few motors that where stripped from old printers and such. the motors where obtained $0.00 :) so no complaints. my only problem is that each motorhas like 6 wires. are all six wires needed or is there a combination i can look for that will just trigger a step of movement? i don't have a camera currently totake a pic but i will post one up later if needed. this driver configuration looks to the most simple i've come across so far, as soon as i can figure out thewiring on my motor i will definately be building this.

 AndyHope says:  Jun 25, 2010. 10:34 PM  REPLYYou can place an ohm meter across the windings, if you have six wires that means you have two windings and a power for each. by measuring theresistance of the coils you can find out which wires are which I.E. (made up values but the theory is the same) you measure from wire 1 and wire 2 andget 27 ohms from 2 to 3 and get 27 ohms then from 1 to 3 and get 54 ohms you now know that wire 2 is power. also that 1 and 3 are the opposite sidesof you coil.

 aggrav8d says:  Jun 21, 2010. 9:44 AM  REPLYhttp://www.schmalzhaus.com/EasyDriver/ look about halfway down, there's instructions on how to connect a 6-wire. http://reprap.org/wiki/StepperMotorMight give you some hints about what colors go where. Good luck!

 sammyBoy says:  Jun 16, 2010. 7:53 AM  REPLYNice instructable.

GRBL is an almost complete implementation of the G-Code (only 3 axis) standards specifically written in C for the *duino atmega platforms.

 mycroftxxx says:  Jun 20, 2010. 4:31 PM  REPLYAugh, you beat me to it!

view all 58 comments


Recommended