5iMX宗旨:分享遥控模型兴趣爱好

5iMX.com 我爱模型 玩家论坛 ——专业遥控模型和无人机玩家论坛(玩模型就上我爱模型,创始于2003年)
查看: 7221|回复: 6
打印 上一主题 下一主题

开源单片机arduino做的3轴雕刻机

[复制链接]
跳转到指定楼层
楼主
发表于 2012-3-2 17:24 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
转自:http://www.instructables.com/id/How-to-wire-an-arduino-based-3-axis-CNC-machine/?ALLSTEPS

原地址上还有pdf下 载,英语不好没看。



i




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 1PartsYou'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.



Step 2Wire the stepper motor to the EasyDriver


i


Now 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 two colored.  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 the servo 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.



Step 3Soldering and wiring.


i


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 3 GND wires from the EasyDrivers are soldered to a single line, which goes to GND on the arduino.

All the positive leads from the stepper power are soldered to a single line.

All the negative leads from the stepper power are soldered to a single line.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!

Solder the positive and female lines to the female plug.

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

Do you have a multimeter?  This would be a good time to check your connections.

Plug in the power.  The +5v light in the corner of each board should light up.

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




Step 4Testing one stepper


i


UPDATE: I've been playing with my steppers and I wrote this little piece of code to play with just a single stepper.
Change the DIR/STEP pins as you see fit.  If you put the stepper on a hollow flat surface like a desk top it will sound like a tiny formula 1 race car.

// for duemilanove atmega328 arduino board + easydriver stepper controller
// dan@marginallyclever.com 2010-06-15
#define DIR1_PIN (12)
#define STEP1_PIN (13)
#define DELAY (1600/10)
#define BAUD (9600)

void setup() {
Serial.begin(BAUD);
pinMode(DIR1_PIN,OUTPUT);
pinMode(STEP1_PIN,OUTPUT);
}


void loop() {
int i,j=DELAY;

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

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

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

for (i = 0; i<3400; i++) // Iterate for 4000 microsteps
{
digitalWrite(STEP1_PIN, LOW); // This LOW to HIGH change is what creates the
digitalWrite(STEP1_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.
delayMicroseconds(j); // This delay time is close to top speed for this
j-=1;
} // particular motor. Any faster the motor stalls.
}



Step 5Sample arduino code


i


欢迎继续阅读楼主其他信息

沙发
发表于 2012-3-2 17:50 | 只看该作者
对那个迷你驱动板比较感兴趣
3
发表于 2012-3-2 17:57 | 只看该作者
原帖由 起子 于 2012-3-2 17:50 发表
对那个迷你驱动板比较感兴趣


淘宝好多卖的
4
发表于 2012-3-2 18:30 | 只看该作者
淘宝多是297的,不能直接接接口板的。
5
发表于 2012-3-2 19:23 | 只看该作者
貌似还只是调试电器部分
回头我给贴一个已经在使用中的系统    应该也是arduino

本想介入一下,后来经过思想激烈斗争,还是选择了51板  :em15:
“我就要回到老地方 …   走在 老路上 … ”
:em15:
6
发表于 2012-3-2 19:35 | 只看该作者
:em26: :em26:
7
发表于 2012-3-2 19:47 | 只看该作者
原帖由 茶壹杯 于 2012-3-2 19:23 发表
貌似还只是调试电器部分
回头我给贴一个已经在使用中的系统    应该也是arduino

都是老外的作业  不是 额滴~
:em26: 这个还接有LCD屏,实时显示X,Y坐标位置




这个 也是一木板机,能干活儿
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

关闭

【站内推荐】上一条 /1 下一条

快速回复 返回顶部 返回列表