Shop OBEX P1 Docs P2 Docs Learn Events
Stepper motor help — Parallax Forums

Stepper motor help

Technic-R-CTechnic-R-C Posts: 117
edited 2008-10-11 17:55 in BASIC Stamp
Hello

I am currently trying to gain control of my Hurst AS unipolar (6 wire) stepper motor and I need some help.· The cheapest alternative that I have found to control the stepper is included below in·the schematic below.· Each of the four coils are activated simultaneously with·TIP31 NPN transistors, which are protected by 1N4003 micro 1 amp diodes.· The BS2px pins·I believe protected by the 1 KoHm 1/4 watt resistors (will they protect the stamp pins?)· The stepper I want to control is a Hurst AS stepper motor (datasheet)· Here is a link to the website I am using for wiring.· Would the current wiring and parts work with this stepper? Do i need stronger transistors? Will i destroy the stamp?

Stepper motor is 12 VDC -·3W.· 6 wire

Thanks

Technic-R-C

Post Edited (Technic-R-C) : 7/26/2008 7:09:38 AM GMT
232 x 225 - 2K
«1

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-07-26 12:22
    The diodes should be across the coils (windings).

    (pic attached.)
    232 x 263 - 10K
  • Technic-R-CTechnic-R-C Posts: 117
    edited 2008-07-26 16:37
    Thanks
    So with the schematic that you provided your saying that I whould be able to run my 12 VDC 3 Watt motor from·four BS2px pins with no problem whatsoever (no burnign pins)?· If this is the case, what do you mean by attaching the diodes across the coils?· Would one end of the diode be attached to the battery supply (positive or negative?? im assuming its positive)·whilst the other is attached to the wire distinguishing one coil from another?· What would be the amperage of my stepper motor considering it is 12 volt and 3 watt.· Is there a way to calculate this?· If so will the TIP31 NPN transistor work with a max amperage of 3.0?

    Technic-R-C
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-07-26 17:40
    P = E·x I

    therefore

    I = P / E

    I = 3W / 12V

    I = 0.25A


    Post Edit:

    Check -- 12V x 0.25A = P

    ··················3W = P

    T-R-C asked...
    Would one end of the diode be attached to the battery supply (positive or negative?? im assuming its positive)·whilst the other is attached to the wire distinguishing one coil from another?
    The cathode would go to +V and the anode to the motor terminal/wire.· From what you're showing, it had better be positive.

    Post Edited (PJ Allen) : 7/26/2008 5:50:48 PM GMT
  • Technic-R-CTechnic-R-C Posts: 117
    edited 2008-07-26 17:50
    So the TIP31 NPN transistors should more than exceed the expectations when controlling the stepper motor.· So to finalize, will the circuit work withough damaging the stamp???··Are the types of diodes and resistors correct?

    Technic-R-C

    Post Edited (Technic-R-C) : 7/26/2008 5:56:14 PM GMT
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-07-26 18:08
    My suggestion, given your trepidation/s, is that you initially wire up some LEDs and resistors·in place of the coils, by way of simulation.· 12V source, "10mA" each ought to do... use a 1kΩ, each.· See how that works out.
  • Technic-R-CTechnic-R-C Posts: 117
    edited 2008-07-26 18:52
    Might sound kind of dumb, but wouldn't the LED burns out when I·connect a 12V battery with 1.3A to the ciurcuit conatining LED's instead of coils.· (thats the only power supply I have)

    Technic-R-C
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-07-26 18:55
    Crikey...

    Use an LED and a resistor in place of each coil.· I specifically mentioned a 1kΩ.· So that's an LED and a 1kΩ in place of each coil.· Do you require a schematic?


    Post Edit -- pic attached

    Post Edited (PJ Allen) : 7/26/2008 7:06:21 PM GMT
    460 x 504 - 62K
  • Technic-R-CTechnic-R-C Posts: 117
    edited 2008-07-26 20:25
    Thanks, that makes more sense.· So i'm going to try these circuits out tonight after I buy some parts and I'll get back to you with results.· By the way, I read somewhere that applying more voltage than the amount required will still run the stepper with better performance?· So would the stepper run with a lower voltage like a 9.6 volt supply - 2900 mili amperage?· I know that motors would run, but steppers??

    Thanks for all the help by the way turn.gif
    Technic-R-C
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-07-26 21:06
    T-R-C asked...
    I read somewhere that applying more voltage than the amount required will still run the stepper with better performance?
    I would have to disagree, more is NOT better.
    You should run it with the specified voltage or within the specified range.
  • Technic-R-CTechnic-R-C Posts: 117
    edited 2008-07-26 23:22
    I was reading the Tech Specs about the TIP31 and I was wondering what this meant
    V(CE): 1.2 V(BE): 1.8 I(C) Max· link
    Does this mean If I use the 12 V battery power source for my stepper will it damage the transistor. (man 1.8 V????)· Or will the pin voltage off of my BS2px damage the transistor? (5V)

    Technic-R-C
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-26 23:36
    Read the "official" datasheet (www.fairchildsemi.com/ds/TI/TIP31.pdf) rather than the "Tech Specs". In particular, look at the test conditions and the graphs.

    Vce(sat) is the voltage measured between the collector and emitter when the transistor is saturated under certain conditions (which are stated). Similarly, Vbe(sat) is the voltage measured between the base and emitter when the transistor is saturated under the conditions stated.

    For questions about potential for damage, look under "absolute maximum" ratings. There are also graphs that show "safe area" and power dissipation vs. case temperature.
  • Technic-R-CTechnic-R-C Posts: 117
    edited 2008-07-26 23:40
    attachment.php?attachmentid=73627

    min 40 V, am I reading this correctly??· I am sure I dont need a 40V supply to run the transistor?
    And it appears like there is no maximum

    Technic-R-C
    313 x 270 - 5K
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-26 23:53
    Here's a link to a reference book with definitions like "collector-emitter sustaining voltage". This was found with a simple Google web search. You should try it before you make assumptions about what something means.
  • SawmillerSawmiller Posts: 276
    edited 2008-07-27 00:16
    quote

    Each of the four coils are activated simultaneously with·TIP31 NPN transistors, which are protected by 1N4003 micro 1 amp diodes.

    end quote

    you activate the coils sequentialy to move the stepper forward or back, in full or half step mode

    in regards to stepper motor operation...
    you can use up to 20 times the voltage that the stepper is rated for, to get better current response.

    however never exceed the rated current for the stepper.

    it sounds like you need to read up on stepper ops, before hooking it up, do like pj said and check the rest of your circut before hooking up the wires.

    you can limit the current with resistors , or with chopper chips, but do limit it
    there are many fine documents out there that explain how to do steppers.

    if i wanted to control a low current stepper, i would probally use a ULN2803A Darlington Array· since i believe it already includes the diodes and the bemf protection diode ( check the docs to make sure )

    and some current limiting resistors in line with the coils, if i was to go above the rated voltage.
    dan


    Post Edited (Sawmiller) : 7/27/2008 12:22:07 AM GMT
  • Technic-R-CTechnic-R-C Posts: 117
    edited 2008-07-27 02:27
    Sawmiller said...

    quote

    Each of the four coils are activated simultaneously with·TIP31 NPN transistors, which are protected by 1N4003 micro 1 amp diodes.

    end quote

    you activate the coils sequentialy to move the stepper forward or back, in full or half step mode

    in regards to stepper motor operation...
    you can use up to 20 times the voltage that the stepper is rated for, to get better current response.

    however never exceed the rated current for the stepper.

    it sounds like you need to read up on stepper ops, before hooking it up, do like pj said and check the rest of your circut before hooking up the wires.

    you can limit the current with resistors , or with chopper chips, but do limit it
    there are many fine documents out there that explain how to do steppers.

    if i wanted to control a low current stepper, i would probally use a ULN2803A Darlington Array· since i believe it already includes the diodes and the bemf protection diode ( check the docs to make sure )

    and some current limiting resistors in line with the coils, if i was to go above the rated voltage.
    dan

    Thanks, whew, I was just about to connect a 9.6 Volt 2900 miliamperage (2.9 amps)·battery to a 0.25 amps rated stepper (compliments to PJ's knowledge of equations).· Thanks for the info sawmiller.
    At the moment I have given· up my attempt to connect my stepper to my BS2px and started to do a little bit more research.· Well lo and behold the research was beneficial·because I found a website insiting that my current circuit schematic·was not good and not made for a stepper but for a relay.· So here it the link to this website.· Proper schematic attached below.
    It seems that i need to also add a zener diode into my circuit to prevent motion breaking, drive breaking, etc.· So will this 1N4742A 1-Watt Zener Diode zener diode work?· It is rated at 1 watt while the stepper is rated at 3.· Will this cause problems?
    Second, i believe in the document it states that i need 2 zener diodes for the entire circuit correct?· ( 1 for a pair of coils)· Is this right?
    Finally, what is the C1 in the circuit?·
    So many questions, sorry?
    Thanks
    Technic-R-C
    355 x 203 - 2K
  • SawmillerSawmiller Posts: 276
    edited 2008-07-27 05:23
    first of all, just because the power supply says 2.9 amps , doesnt mean thats what you will draw. thats the max
    use the eqation e = I *R where e is voltage. so you have to find out what resistance your coil has, then add enough resistance in the form of a current limiting resister to limit your current to .25A
    like so
    I = E/R , .25 = 9.6/( x +y ) where x is your coil resistance, and y is the additional resistance you have to add to keep the current to .25 A... plug in the coil resistance and solve for y

    that drawing you have looks complicated
    the purpose of the diodes accross the coil is that when you cut the current to the coil, the coil will generate a voltage/current of its own as the magnetic field colapses only in the reverse direction.
    so you put the diode so it wont conduct normally, but will when the field collapses, short circuting the back emf
    i'm not sure about the zeners, i've only used them to limit the voltage in paraell with them.
    as i said before look arooound , google stepper basics, there are some articles here on that if i remember right, in the nuts and volts issues.

    or look here at the stepper motor docs...
    http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/txtSearch/stepper/List/1/ProductID/65/Default.aspx?SortField=ProductName%2cProductName

    theres a diagram and code
    ·look at the datasheet for the chip if you want to use discete componets.
    dan

    Post Edited (Sawmiller) : 7/27/2008 6:34:57 AM GMT
  • Technic-R-CTechnic-R-C Posts: 117
    edited 2008-07-29 05:41
    Hello once again,

    I was reading some Nuts and Volts columns when I came upon some info about controlling steppers and other devices with a ULN2803A Darlington Array.· Well the schematiac of the Darlington array was exactly similar to my original schematic.· And I was wondering wether or not to buy the darlington instead of building my own.· Before I make my decision I have a couple of questions.

    1.· In the datasheet it states that the input·current is typically .93mA (max 1.35mA)·per input.· So in theory, would I be able to control(25mA/.93mA=·~4 Darlingtons)·25 inputs (4 Darlington Arrays·controlling 4 steppers) without exceeding the max source of the Stamp? (For my project I would only need 12 inputs from 3 darlington arrays to control 3 steppers)???

    2.· Since I my stepper is rated at 0.25 amps - 250 mA (3 watt 12 V), will i be able to control the stepper when using half steps (250 mA + 250 mA = 500 (danger zone) -·2 coils turned on at once)? (500 mA max for darlington)

    3.··What kind of transistors and diodes·are used in the ULN2803A?

    Thanks

    Technic-R-C
    attachment.php?attachmentid=73628
    24 x 7 - 44B
  • Technic-R-CTechnic-R-C Posts: 117
    edited 2008-07-29 16:49
    If anyone could help I need a quick response.

    Technic-R-C
  • SawmillerSawmiller Posts: 276
    edited 2008-07-29 17:07
    see my reply above, look at the docs for the stepper motor that parallex sells
    it's about the same as yours
    dan
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-29 17:29
    Look at the datasheet for the ULN2803A. You'll see that the continuous current for a transistor (Darlington pair) is different when only one conducts at a time as opposed to all 8 being on together. In the latter case, only 150mA is allowed per transistor for a total of 1.2A. That's not what you're asking for.

    The transistors and diodes in the ULN2803A are not made to look like some kind of numbered standard. They're all integrated on a single piece of silicon. It doesn't make sense to ask "what kind of transistors and diodes" they are. They're just what the datasheet says, Darlington pairs with diodes to absorb reverse EMF pulses from relays or motor coils with specifications as described in the datasheet.
  • Technic-R-CTechnic-R-C Posts: 117
    edited 2008-07-29 18:57
    Look at the datasheet for the ULN2803A. You'll see that the continuous current for a transistor (Darlington pair) is different when only one conducts at a time as opposed to all 8 being on together. In the latter case, only 150mA is allowed per transistor for a total of 1.2A. That's not what you're asking for.
    I'm sorry I don't quite understand.· So your saying that if all 8 transistors are turned on at once only 150mA is allowed per transistor.· So if two transistors are turned on at once then they can each source 600 mA for the total of 1.2A?· Is 1.2 amp the max current for the whole Darlington array?· With the total of 1.2A does this mean that that is the limit current for my external stepper power supply?· I've looked at the datasheet and it has·only made me more confused.·
    The transistors and diodes in the ULN2803A are not made to look like some kind of numbered standard. They're all integrated on a single piece of silicon. It doesn't make sense to ask "what kind of transistors and diodes" they are. They're just what the datasheet says, Darlington pairs with diodes to absorb reverse EMF pulses from relays or motor coils with specifications as described in the datasheet.
    That makes sense.
    ······Technic-R-C
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-29 19:13
    Look at the graphs on the datasheet. There are different datasheets depending on the manufacturer:
    focus.ti.com/lit/ds/symlink/uln2803a.pdf
    www.st.com/stonline/products/literature/ds/1536/uln2804a.pdf
    Look at Figure 11 on the ST datasheet. It shows peak collector current vs duty cycle vs
    # of transistors on at the same time. This mostly gives some idea of heat load.

    The TI datasheet indicates that the absolute maximum total ground current on the chip is 2.5A. This will
    be exceeded if more than 5 transistors are on and conducting the 500mA maximum current per transistor.

    The issue in bringing this up is that the figures for maximum current for one transistor don't apply to the
    whole chip which has limits of its own. You have to look at all the information on the datasheet. You can't
    just pick and choose what's important to you. You asked about two transistors being on at once and what
    total current is allowed. You figure it out based on the information in the datasheets. It's all there.
    You need to figure out enough about heat to determine whether that's a limiting factor. The collector to emitter
    voltage (Vce) and the current you want to switch will tell you how much heat will be produced which has to be
    gotten rid of.
  • Technic-R-CTechnic-R-C Posts: 117
    edited 2008-07-30 02:31
    Thanks Mike,
    Due to the fact that I can't buy the Darlington Array in any local store I have bought 4 TIP31 transistors, 4 IN4003 silicon diodes, and·4·1k-Ohm 1/4 watt·resistors·to control my stepper.· The stepper I am using is rated at 3W, 12V, 0.25A (250mA) and I should be able to drive it with the schematic posted in my first post. Thanks to all for helping me comprehend this rather new topic.

    However like usual I still have a couple of questions.· I would like to use my BS2px power source (9V, 300mA) to power my stepper (12V, 3W, 250mA) as well as the Stamp by using the Vin pin.· However I am know that the stamp will not be able to sink 300mA of current.· Is there any way to use my power outlet as a means of driving the stepper as well as the stamp?

    Technic-R-C

    Post Edited (Technic-R-C) : 7/30/2008 3:24:21 AM GMT
  • Technic-R-CTechnic-R-C Posts: 117
    edited 2008-07-30 15:58
    Any ideas?
    Couldn't find any info on the web or prior posts.

    Technic-R-C
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-30 16:24
    You have two problems. They're all "common sense" if you'll think about them.

    1) Your power source is rated at 9V with a maximum drain of 300mA. If it really fulfills the specification, it will put out power at somewhat more than 9V at low current drains. As the current demand increases, the voltage will drop until it becomes roughly 9V at a drain of 300mA, then the voltage will drop rapidly after that. At some current drain, the power supply will either become damaged or some kind of internal protective mechanism will come into play essentially cutting off the output.

    The Stamp itself requires a certain amount of current and the switching transistors require some base current all of which comes out of the power source. The stepper motor, while rated at 250mA, probably draws much more than that for peak current as it's starting to move and when it's under heavy mechanical load. All of this is to say that a 300mA power supply is inadequate for the task.

    2) Your stepper motor is rated at 12V while the power source is rated at 9V. At 9V, the motor will not be able to draw its maximum current (which is a good thing for the 300mA power source), but it also won't have much torque and will be very slow at coming up to speed. Motor windings have a certain amount of resistance and Ohm's law says: Current = Voltage / Resistance.
  • Technic-R-CTechnic-R-C Posts: 117
    edited 2008-07-31 18:07
    Thanks Mike,

    Ok.. so·I got the parts and tried to connect the·LED with the 1k resistor (schematic·provided by PJ)·before·I connected the motor·and something REALLY wierd happened...

    Before I get to that I am giong to quickly explain my wiring, which might be the problem.

    -Only one transistor at the moment is connected
    -Pin 15 is wired along with a 1k resistor to the base of the TIP31 transistor
    -The collecter of the transistor is wired to the power supply (9V Duracell Alkaline battery) and a IN4003 diode.
    ···· -In betweein the diode a 1k 1/4W resistor is connected to an LED.
    -The emitter is connected to the negative terminal of the 9V battery
    ·(Images of wiring attached below)

    here is the code
    ' {$STAMP BS2px}
    ' {$PBASIC 2.5}
    delay            VAR       Word
     
    delay = 2000
     
    DO
      HIGH 15        'turns on transistor and in turn the LED
      PAUSE delay
      LOW 15
    
    LOOP
    

    The problem:

    If I use the wiring listed above and the code nothing happens (the LED does no light up at all).
    However If I just touch the BS2px withough turning it on, the LED lights up.· Isn't the pin supposed to activate the transistor not my finger???

    I have no idea what to do.· Help would be appreciated

    Technic-R-C




    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-31 18:12
    Your description of the circuit is unclear. That's why a diagram is always better. Your images didn't make it to the posted message.

    You didn't mention that the (-) 9V lead is connected to the Stamp's Vss. That's necessary.
    The base current has nowhere to flow if that's not connected.
  • Technic-R-CTechnic-R-C Posts: 117
    edited 2008-07-31 18:51
    Thanks for the quick response Mike
    Your description of the circuit is unclear. That's why a diagram is always better. Your images didn't make it to the posted message.
    I have added a diagram to help clear up my circuit.
    You didn't mention that the (-) 9V lead is connected to the Stamp's Vss. That's necessary.
    The base current has nowhere to flow if that's not connected.
    So I connect the negative terminal of my external power supply to the stamps Vss (wouldn't this be too much current to sink)? Or do i connect the emitter wire of the transistor to the Vss as well as too my 9V external power supply?· I though that my external battery was able to sink both the stamps current and its own current?

    Technic-R-C

    Post Edited (Technic-R-C) : 7/31/2008 8:06:03 PM GMT
  • Technic-R-CTechnic-R-C Posts: 117
    edited 2008-07-31 21:41
    Great,

    I got the LED working perfectly!!!!

    All I had to do was connect the emitter terminal to Vss and the negative terminal of the battery.· Thanks Mike smile.gif
    I found a link online with a schematic to help me out also.

    Now its time to connect the stepper

    Technic-R-C



    Post Edited (Technic-R-C) : 7/31/2008 10:38:12 PM GMT
  • Technic-R-CTechnic-R-C Posts: 117
    edited 2008-07-31 23:22
    ANOTHER problem...

    Well the LED worked great, but now when I attached the stepper I came across an unfortunate problem.·

    The stepper coils, instead of turning on when the Basic Stamp sent a High comman to a pin, were all turned on at once when the stamp was powered up.·(checked with LED's.)· Wiring diagram from the manufactur for my stepper attached as well as a diagram of my current schematic.·
    When the stamp is turned on, the coils act as an energy source and turn on the LED's.· Now I am completely lost.

    I am leaving for vacation in 3 days and I need to have this done before those 3 days.

    If anyone could provide some help or guidance I would really appreciate it!!!

    Technic-R-C
    ' {$STAMP BS2px}
    ' {$PBASIC 2.5}
     
    ' testing only one transistor with coil and LED attached in between diode
     
    delay            VAR       Word 
    nuts             VAR       Word
     
    delay = 2000
     
    DEBUG "initializing", CR        ' LED turns on at once which means coil is always on
    PAUSE 2000
    
    DEBUG "start", CR
     
    HIGH 12                         ' tests coil and LED at once
    PAUSE delay
    LOW 12
     
    DEBUG "finished", CR
    
    245 x 170 - 9K
Sign In or Register to comment.