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 > Stepper Motors and Drives


Stepper Motors and Drives Discuss stepper motors, drivers and related topics here.


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 02-10-2008, 07:39 PM
 
Join Date: Sep 2007
Location: United States of America
Posts: 32
w102acd is on a distinguished road
Two Input ULN2003 Circuit

All,

I have been playing around with CNC for a few months now. I decided I wanted to go the hard route and write my own code (Visual Basic), build my own machine, and build my own stepper motor circuit. My successes have been all 2D. I programmed an Etch-A-Sketch using two stepper motors and just recently have built a 2 axis table using drawer slides (similar to Etch-A-Sketch but on paper). The knowledge gained has been very useful in understanding the fundamentals of CNC. I have been using the simple parallel port to ULN2003 to control each step that each of the 2 motors take. I found a circuit at www.doc.ic.ac.uk/~ih/doc/stepper/control2/connect.html that I would like to use. It is the two-wire connection using a ULN2003 to control a motor in high torque mode only. I have tried to wire it exactly as described with no luck.

I wondered if anyone has used it, seen it, heard about it used with success. I suppose I could simply buy all of the components and put them together, but where's the fun in that. I just thought it would be cool to build something from the ground up myself and not just grab something off the shelf.

Thanks in advance,
w102acd
Reply With Quote

  #2   Ban this user!
Old 02-10-2008, 08:39 PM
 
Join Date: Aug 2005
Location: USA
Posts: 1,622
One of Many is on a distinguished road

Originally Posted by w102acd View Post
All,

I have been playing around with CNC for a few months now. I decided I wanted to go the hard route and write my own code (Visual Basic), build my own machine, and build my own stepper motor circuit. My successes have been all 2D. I programmed an Etch-A-Sketch using two stepper motors and just recently have built a 2 axis table using drawer slides (similar to Etch-A-Sketch but on paper). The knowledge gained has been very useful in understanding the fundamentals of CNC. I have been using the simple parallel port to ULN2003 to control each step that each of the 2 motors take. I found a circuit at www.doc.ic.ac.uk/~ih/doc/stepper/control2/connect.html that I would like to use. It is the two-wire connection using a ULN2003 to control a motor in high torque mode only. I have tried to wire it exactly as described with no luck.

I wondered if anyone has used it, seen it, heard about it used with success. I suppose I could simply buy all of the components and put them together, but where's the fun in that. I just thought it would be cool to build something from the ground up myself and not just grab something off the shelf.

Thanks in advance,
w102acd
Have you verified the voltage out the parallel port to the inputs of the 2003 are above 3.5v on state? Laptops may be on the low side. Make sure the grounds of each source are common unless you are using opto-coupled isolation.

I have also had some issues with the pulse width on the inputs to drive a solenoid not a stepper.

DC
__________________
Learn cause and effect through experience. Mastering those relationships is the "Common Sense" ability within the art of any trade.
Reply With Quote

  #3   Ban this user!
Old 02-10-2008, 09:45 PM
 
Join Date: Sep 2007
Location: United States of America
Posts: 32
w102acd is on a distinguished road

DC,

I checked the parallel port outputs and they show something like 3.1V when turned on. I was also trying to use one of the pins of the parallel port to supply the +5V for this circuit. I have a 12V 3A power supply for powering the stepper motors. The inputs are not opto-isolated.

I think my logic is wrong on how this circuit works. It states that coils one and three are always the inverse of each other. However, it appears to me that turning coil three on will turn coil one on as well. Similarly, for coils two and four. It appears to me that the 5V power on the right side will supply half of the TTL signal while the parallel port power will supply the rest. Therefore, one of these by themself is not enough to trip the coil. Am I missing something???

Thanks,
w102acd
Reply With Quote

  #4   Ban this user!
Old 02-11-2008, 09:35 AM
 
Join Date: Aug 2005
Location: USA
Posts: 1,622
One of Many is on a distinguished road

Originally Posted by w102acd View Post
DC,

I checked the parallel port outputs and they show something like 3.1V when turned on. I was also trying to use one of the pins of the parallel port to supply the +5V for this circuit. I have a 12V 3A power supply for powering the stepper motors. The inputs are not opto-isolated.

I think my logic is wrong on how this circuit works. It states that coils one and three are always the inverse of each other. However, it appears to me that turning coil three on will turn coil one on as well. Similarly, for coils two and four. It appears to me that the 5V power on the right side will supply half of the TTL signal while the parallel port power will supply the rest. Therefore, one of these by themself is not enough to trip the coil. Am I missing something???

Thanks,
w102acd
This device is signal inverting. When the input goes high, the output goes low.

The 5v supply on the right side is set up with bias resisters which ties the output near the mid zone of half the 12v supply to feed back the difference when the output is at the supply rail of 12v. The resistor on the input side, I see as current limiting possibly to assure no false triggers to the non-inverted inputs?

Input pin1 is inverted and put out via pin16 which is then input back to pin2 and output pin15=coil 1. This places input 1 and coil 1 output non-inverted. However, Pin3 output is direct to output pin14 inverted on coil 3. Same sequence for pins4&6. That explains why coils 1&3 and 2&4 should always be opposite polarity.

If the voltage at the pin1 is not 3.5v, then it may not trigger via the input resistors, if the voltage drop across the resistor goes below 2.5-3v at either pin1 or pin6.

Just guesses since I have not worked with this circuit. Someone else can chime in and clarify my goofs if need be.

DC
__________________
Learn cause and effect through experience. Mastering those relationships is the "Common Sense" ability within the art of any trade.

Last edited by One of Many; 02-11-2008 at 09:53 AM.
Reply With Quote

  #5   Ban this user!
Old 02-11-2008, 01:21 PM
 
Join Date: Sep 2007
Location: United States of America
Posts: 32
w102acd is on a distinguished road

I will try some more this evening to get the circuit to work.

I may possibly just jump to using a 74LS86 and 74LS112 to do the work for me. My problem is that I can't control three stepper motors (one per axis) and still have six limit switches (two per axis) using only one parallel port with the way I have it configured now. Would this circuit help with the maximum speed I can get???

Maybe I am jumping the gun. I can control three stepper motors and have five inputs for limit switches. Is it reasonable to use only one input for each axis limit switch??? My thought and example...Say you have two limit switches on the x axis. The program is running when the x axis limit input becomes high. Since I know which direction I was traveling in the x axis I can figure out which limit I have hit in the x direction. Therefore, I don't need to know which limit was hit, just that a limit was hit. And let the code figure out which one and how to proceed.

Thanks again,
w102acd
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 02-11-2008, 04:28 PM
 
Join Date: Aug 2005
Location: USA
Posts: 1,622
One of Many is on a distinguished road

It's all personal preference as to how you want to handle the inputs and the code. An over travel on many of the older industrial machines was just a limit switch tied in Normally closed series with the E-stop switch. This would require only one input and any fault would drop out the control enabling line. It should be reasonably obvious which axis is in an over travel condition. At that point since it is an open loop stepper system, you might as well re-home the axis or re-orient the origins to the original X0,Y0 and/or Z0 reference to be certain no steps were lost or gained in the incident.

I cannot tell you much about speed. This will be partially determined by your code and how it must interpret the path program. Some of the speed limitations will be from the bus or parallel port speed if your code doesn't get in the way. The rest of the limitations may be in the stepper motors ability to take short duration pulses and still keep moving smoothly. Then there is the resolution you expect if running a lead screw for X pulses per distance unit dec or mm.

DC
__________________
Learn cause and effect through experience. Mastering those relationships is the "Common Sense" ability within the art of any trade.
Reply With Quote

  #7   Ban this user!
Old 02-11-2008, 09:14 PM
Motorcoach1's Avatar  
Join Date: Jan 2008
Location: USA
Posts: 30
Motorcoach1 is on a distinguished road

look at this http://electronics-diy.com/electroni...per_motors.php hope it helps
Reply With Quote

  #8   Ban this user!
Old 02-12-2008, 09:04 AM
 
Join Date: Sep 2007
Location: United States of America
Posts: 32
w102acd is on a distinguished road

Well, last night I spent some more time with the circuit with no luck.

I then spent the rest of the night wiring the "Control" block of the parallel cable in order to give me the four additional outputs to control the z axis motor. While doing this I pulled out the 5 input channels for future use. And now I have a 3 axis controller. Now I need to build the z axis and test it out. Managed to fry an IC along the way (that is why I bought 5 of them).

Motorcoach: Thanks for the link but I was trying to use the circuit which controls a stepper motor with only two input channels. The link you sent describes what I have working already (four input channels). The previous link describes the circuit.

2 pains have already come up when using the "Control" block. The first is the 3 inverted signals (ie need to send "11" to the block to turn off all pins). the second is the change in port address. This does not allow me to simultaneously move the Z and the X or Y motors. Notice X and Y have the same port address. Any advice on how to handle this??? I wanted to use my machine to mill/engrave things into wood/foam/etc. I am thinking that I will do Y-Z sweeps and step in the X. So my tool will travel along constant Y slices while varying Z. And then it will move in the X and return with another constant Y slice. And do this until finished. Does this make sense???

Thanks,
w102acd
Reply With Quote

  #9   Ban this user!
Old 02-12-2008, 10:33 AM
 
Join Date: Aug 2005
Location: USA
Posts: 1,622
One of Many is on a distinguished road

I'd expect the pulse signals you are after are calculated for a given move based on what an interpreter that can convert the path program into individual step and direction signals, then fed as a word length to the parallel port all at the same time. That breaks it down to the smallest move. Normally 2 lines on a parallel port are used for step and direction.

Another approach to consider using 2 lines per axis?

DC
__________________
Learn cause and effect through experience. Mastering those relationships is the "Common Sense" ability within the art of any trade.
Reply With Quote

  #10   Ban this user!
Old 02-12-2008, 11:04 AM
pminmo's Avatar  
Join Date: Jun 2003
Location: St. Peters, Mo USA
Age: 59
Posts: 3,325
pminmo is on a distinguished road

You have several options, latching each axis with a 4 bit latch such as a 74ls75 or 74hc75 and using two other bits to control which latch is updated.

But rather than use that type of setup, why not switch to a step/dir control so you would be compatible with most of the cnc software out there? In this circuit on my website you could replace the FETs with the 2003's if you wanted to keep the 2003's. http://pminmo.com/discrete/discrete.htm

Also, you can series your limit switches if you use normally closed switches to free up input pins, or you can parallel them to use such as cncpro (free dos cnc program) does.
__________________
Phil, Still too many interests, too many projects, and not enough time!!!!!!!!
Vist my websites - http://pminmo.com & http://millpcbs.com
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 02-12-2008, 12:24 PM
 
Join Date: Sep 2007
Location: United States of America
Posts: 32
w102acd is on a distinguished road

Thanks for the replies!!!

I think I will be happy with the setup I have now (until necessity steps in). I looked at the circuit on the link and some smoke started coming out of my ears!!! Whenever I look at circuit diagrams, it brings back to childhood following the line games where there are lines that are all crossed and you have to start at one end and find the other. Since this is a learning experience for me, I am not allowing myself to do anything that acts as a black box (ie stuff in => stuff out).

Since I am writting my own code to do all of this I am not using GCode or anything like that. I am simply using X,Y,Z coordinates. I simply tell the motor to go from here to there in a straight line. The resolution is controlled by the number of points. For example, a circle with four linear segments does not look much like a circle; however, a circle with 1000 linear segments is as close as I will ever get to a circle anyway. So my "input files" consist solely on a header specifying how many points to readin and then a data dump of the coordinates.

After this machine, I will most probably build something that uses commercial software, drivers, etc. After I understand how it all works first.

I have written a code to convert a picture into a set of X,Y,Z coordinates. The X and Y are simple; the Z is done by converting the color (RGB) into a single value. With a specified tool diameter, I am hoping the tool paths will become apparent. Obviously, the resolution will be set by the tool diameter.

If anyone wants to see any of this, let me know and I will post it.

Thanks,
w102acd
Reply With Quote

  #12   Ban this user!
Old 02-12-2008, 12:53 PM
 
Join Date: Jul 2003
Location: Holmen, WI
Posts: 1,082
samco is on a distinguished road

I bet your having fun (I did the same thing about 10 years ago - making my own stepper drives and writing my own software to run a small plotter.)

take a look at emc2 - it will run on easy on a 600mhz computer. Its stepper module will do a bunch of different outputs.. http://www.linuxcnc.org/docs/2.2/htm...stepgen.9.html step/dir,up/down,quadrature,3phase, 4phase.....

http://www.linuxcnc.org/
http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl

It is opensource - so you can take a look at how it is done.

sam
Reply With Quote

Reply




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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie- stl input jcoats CamBam 1 02-09-2008 01:40 PM
MDI input for BP Interact 1 Mk2 motorman46 Bridgeport and Hardinge Mills 2 01-19-2007 08:23 AM
Uln2003 ipodman1991 General Electronics Discussion 2 12-03-2006 11:54 AM
I need some input Steve@Reliance CNCzone Club House 2 09-27-2006 03:54 AM
Can a 3ph input VFD run on 1ph ? Don Lester Phase Converters and VFD 3 06-27-2006 12:51 PM




All times are GMT -5. The time now is 10:01 AM.





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