CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Electronics > General Electronics Discussion


General Electronics Discussion Discuss basic electronics, power supplies and anything else electronic related here.


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 04-15-2008, 04:47 PM
 
Join Date: Nov 2007
Location: United Kingdom
Posts: 9
gremilRoute is on a distinguished road
Lightbulb Arduino AlienCNC C control

Just wondering how to control stepper motors through the dir and step line on a 1 axis microstepping driver. AlienCNC.com doesn't seem to be working at the moment (perhaps they've closed?) so i couldn't think of where else to ask. Also would it be really complicated to convert g-code to stepper movement, i want to try and control my cnc router from my mac using a USB.

Cheers for any help, but i've got a feeling i've posted this in the wrong place, sorry if your moving it, i couldn't work out where to put it.


http://www.chatzones.co.uk/discus/me...1axis-6045.pdf
thats the driver datasheet
Reply With Quote

  #2   Ban this user!
Old 04-16-2008, 04:02 PM
 
Join Date: Aug 2007
Location: USA
Posts: 3
slcoleman is on a distinguished road

I can't say I know anything about AlienCNC but you might want to look at these links for the Arduino Motor Shield which can control stepper motors. I just picked one up myself but have not had time to do anything with it yet.

Arduino Motor Shield
http://www.ladyada.net/make/mshield/index.html
http://www.adafruit.com/index.php?ma...431704984583ac
http://www.arduino.cc/en/Main/ArduinoShields

Interfacing Forum
http://www.arduino.cc/cgi-bin/yabb2/...board=hardware
http://www.arduino.cc/cgi-bin/yabb2/...num=1189887306
Reply With Quote

  #3   Ban this user!
Old 04-22-2008, 12:33 PM
 
Join Date: May 2007
Location: USA
Posts: 717
sansbury is on a distinguished road

Originally Posted by gremilRoute View Post
Also would it be really complicated to convert g-code to stepper movement, i want to try and control my cnc router from my mac using a USB.
The Arduino board can drive a very small stepper directly, but for anything bigger than your thumb you need a separate driver that can handle the amount of current. If you google around for stepper motor basics, you should find many tutorials on the basic electromechanics of steppers, which will help you to get your bearings.

As for using an Arduino as a controller.... Well it's really easy actually, so long as you only move one axis at a time. For that, you just need to send out a nice stream of exactly X pulses.

From there, things get very complicated very fast. For a simple diagonal line, you need to move two axes simultaneously and timing is critical in order to ensure that you get a nice clean cut and not a staircase. For an arc, the math gets more involved. My gut says that you would need to code in AVR directly and get into things like registers and latching in order to get the timing anywhere close to correct. Needless to say this is way out of my league.
Reply With Quote

  #4   Ban this user!
Old 04-23-2008, 01:08 AM
 
Join Date: Nov 2007
Location: United Kingdom
Posts: 9
gremilRoute is on a distinguished road

Originally Posted by sansbury View Post
Needless to say this is way out of my league.
Lol, sounds like a challenge for a newb like me, my dad's a computer programmer so i might get his help
, i just don't understand the types of pulses sent to the STEP of my stepper controller, would pwm work? and at what kind of speed or does it vary from board to board?
Reply With Quote

  #5   Ban this user!
Old 04-23-2008, 09:01 AM
 
Join Date: May 2007
Location: USA
Posts: 717
sansbury is on a distinguished road

You're getting warmer. Most stepper controllers take two signals: STEP and DIR(ection). The DIR is pulled to logic HI or LO and held there to set which way the motor spins. You just write the pin and leave it there.

The STEP signal will send one logic pulse per step or microstep. Basically you set up a loop with a timer interval and turn the pin on and off. My first guess is that your drive will step on the transition from logic HI to LO, i.e., on the falling edge of the signal as it would look on a scope, but some will work the opposite way. The values for how many MS the signal is HI or LO isn't critical per se, that is, you could have it HI for 5 ms and LO for 1 or LO for 5 and HI for 1; either way you get one step every 6ms.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 04-23-2008, 11:26 AM
 
Join Date: Nov 2007
Location: United Kingdom
Posts: 9
gremilRoute is on a distinguished road

Originally Posted by sansbury View Post
For a simple diagonal line, you need to move two axes simultaneously and timing is critical in order to ensure that you get a nice clean cut and not a staircase. For an arc, the math gets more involved.
If you step it slowly and have a precise stepper motor then surely you wouldnt notice a staircase, also a fraction of a circle is quite simple, it's just
y=±√(r^2 - x^2 + z) where r is the radius and z is an x axis strech of the circle
to make it a fraction of it you vary the range of x.

i dont know how complicated the gcode arcs are, what parameters do they use?
Reply With Quote

  #7   Ban this user!
Old 04-23-2008, 04:02 PM
 
Join Date: May 2007
Location: USA
Posts: 717
sansbury is on a distinguished road

Originally Posted by gremilRoute View Post
If you step it slowly and have a precise stepper motor then surely you wouldnt notice a staircase, also a fraction of a circle is quite simple, it's just y=±√(r^2 - x^2 + z) where r is the radius and z is an x axis strech of the circle to make it a fraction of it you vary the range of x.
That's the right start, but you're still a long way from cutting metal.

Imagine that you want to move the cutting point from X0 Y0 to X1 Y1. For each step sent to either the X or Y axis you will move that axis by let's say .001". So, you start by stepping both the X and Y once at the exact same instant, which will move you to X.001 Y.001. Repeat a thousand times and you're there.

Now imagine that you want to move from X0 Y0 to X2 Y1. You can't step both axes at the exact same moment because that would result in moving at a 45deg angle towards X1Y1 not X2Y1. Instead, what you might do is to calculate the number of steps needed to get each axis to the right place, and then start blipping them out, only you blip the X axis twice as fast as the Y. Bear in mind that "real" controllers will also take acceleration into account since you can't go from standstill to top speed and back instantly, though at slower speeds you might be able to ignore this. This is what most controllers call "trajectory planning" IIRC and it gets progressively more complicated as the machine gets more sophisticated and is adjusted on the fly to obtain maximum performance.

With an arc you do the same thing except that the rate is constantly increasing or decreasing. If you watch a CNC positioning system trace a circle you will see how one axis goes from minimum to maximum speed and back while the other axis does just the opposite. Synch the two properly and you get a nice circle. Look on Youtube if you haven't seen one in person.

If you enjoy staring at breadboards and computer screens, are not easily frustrated, and have a lot of spare time on your hands, then this will keep you occupied for some time.

Alternatively, I see that the www.reprap.org project recently switched to using the Arduino as the basis for their 3-axis positioning robot which is a Java/OSS system. While that does not use GCode it might be the best place to start as the basic principles are all the same.

i dont know how complicated the gcode arcs are, what parameters do they use?
There is this fantastic website called Google--you type in questions and it returns sites that help answer it. I'll bet the guys who thought of that will be rich someday!
Reply With Quote

Reply

Tags
aliencnc, arduino, mac, router, stepper




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP! Need datasheet for aliencnc 4axis stepperboard glenngb Linear and Rotary Motion 2 06-17-2008 11:38 AM
Need some help please, datasheet Aliencnc 4axis board glenngb Controller Cards 3 03-25-2008 02:23 PM
mach3 and aliencnc Help! glenngb Mach Software (ArtSoft software) 0 03-07-2008 08:38 AM
15i control help for (AiCC) (hpcc) high precision contour control programming gibbsmaster Fanuc 2 12-28-2007 09:57 AM
Using Flashcut CNC Spindle rotate card control to control laser power pyroplotter FlashCut CNC 0 10-15-2007 09:46 PM




All times are GMT -5. The time now is 11:08 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361