Playing with stepper drivers

Discussion in 'General Electronics Chat' started by Metalfan1185, Jan 15, 2009.

  1. Metalfan1185

    Thread Starter Active Member

    Sep 12, 2008
    146
    0
    Hey guys,

    I recently recieved some stepper motors and the controller IC's to drive them,

    They give me 4 inputs (A, A(not), B, and B(Not)) and i can drive the motor in steps as long as i give the right Logic number at the inputs.

    Here is the datasheet for the controller:

    http://www.allegromicro.com/en/Products/Part_Numbers/97024/97024.pdf

    I would like to develop a circuit that would allow me to control the motor in both directions...Thinking out loud, i was thinking of using a 4 bit counter to give the steps a sequence , and then for each binary count, the corresponding logic to give the Driver IC the right combination of H's and L's to drive the motor to step increasingly, and decreasingly.



    So i give a Binary counter 1 pulse, and I get this:

    A /A B /B
    ------------
    H L H L

    Next pulse: (2ND)

    A /A B /B
    ------------
    L H H L

    NEXT (3RD) PULSE:

    A /A B /B
    ------------
    L H L H

    NEXT (4TH) PULSE

    A /A B /B
    ------------
    H L L H


    Then the next pulse will be the first one again, so my binary counter will count:

    0 0000
    1 0001
    2 0010
    3 0011
    ----then repeat

    0 0000
    1 0001
    2 0010
    3 0011
    0 0000
    1 0001
    2 0010
    3 0011
    0 0000
    1 0001
    2 0010
    3 0011 ....and so on.


    While the logic after the binary counter is giving the Driver the appropriate Logic Levels to turn the stepper ->

    1 H L H L
    2 L H H L
    3 L H L H
    4 H L L H


    So by counting in binary up will spin in one direction, and down will spin the other direction...


    Am i thinking in the right direction here? is there an easier way to do this with logic circuits and not processors (I dont know how nor have the resources to program them)

    I hope this is written in a way that is easily understood...Thanks
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    Just to help the headache, you can do half steps, too - http://zone.ni.com/devzone/cda/ph/p/id/247.

    Since the patterns repeat, it is also simple to use a multiplexer to output the stepping sequence according to the selection bits. Works for full and half step; count up to go one way, down to reverse.
     
  3. Metalfan1185

    Thread Starter Active Member

    Sep 12, 2008
    146
    0
    any ideas on finding a 7442 or 74154 that works backwards?
     
  4. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    Try 4 74151's. Each multiplexes 8 lines into 1, so they will do full or half stepping sequences.

    You'll need an Up/Down counter (BCD) and a clock source - plus some transistors to drive current through the stepper coils.
     
  5. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,346
  6. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Look at a 74x193; syncronous binary up/down counter.
    If you clock the UP input, it counts up.
    If you clock the DOWN input, it counts down.
    Just use the QA and QB outputs.

    Since it's a synchronous counter, you will not have "glitches" on the outputs.
     
  7. Metalfan1185

    Thread Starter Active Member

    Sep 12, 2008
    146
    0
    If i used the 74193 would i still need to use the 4 bit Binary signal for the stepper? if you convert them to decimal, i think i need 6, 7, 10, 11.
     
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    I meant to just use Qa and Qb (bits 0 and 1) from the 74193, along with inverters to get the opposites (Qa\ and Qb\).

    You don't have to worry about presetting/resetting the counter. It doesn't matter what the upper two bits are doing. However, you need to use a binary counter; a BCD counter will reset at inappropriate times.
     
  9. Metalfan1185

    Thread Starter Active Member

    Sep 12, 2008
    146
    0

    The IC that i pulled off of the board has MOSFETS for the output stages. So the main High Current side is covered. All im trying to do, is use a clock source to control the speed, and an option to change it's direction. I think if i give the Driver IC the Binary Numbers in succession, (7,6,10,11,7,6,10,11, and so on) and reverse succession, This may allow me to change direction. And by changing the clock speed either way, that will change the speed.


    There is something listed on that datasheet as "2 Phase" operation, would this offer more speed or torque over driving it a different way? I want it to have as much torque as possible.
     
  10. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    If you put too much current through the windings, all you get is a hot, ruined stepper motor.
     
  11. Metalfan1185

    Thread Starter Active Member

    Sep 12, 2008
    146
    0

    Ahhh! This just may be the solution! I mis-read it the first time. I understand it now!

    Very Much Thanks, why didn't i think of that?!!!
     
  12. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
  13. Metalfan1185

    Thread Starter Active Member

    Sep 12, 2008
    146
    0
    Wow, forget all that BS, i think im going to order some of those chips!

    The motors I have a Uni-polar (they have 2 center tapped coils) but i think if i left the centers disconnected it would do the same thing.

    1 Question though, I see a clock input for the speed, how do you reverse the Motor?
     
  14. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    You count up to go one way, down to go the other.
     
  15. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Yes, you can use unipolar steppers as bipolar by ignoring the center tap if you wish. You can obtain more torque from them in bipolar mode, since you can pass current both ways; in unipolar mode you only pass current one way.

    Bipolar steppers are more difficult to drive due to the reverse current requirement; you need an H-bridge for each coil. IC's like I mentioned in the prior post incorporate two complete H-bridges along with logic to control them, which greatly simplifies driver complexity.

    However, you could benefit by experimenting with the steppers in unipolar mode. It's quite common to source current to the center taps of the two windings, and use Darlington transistors to sink current from the ends of the windings. You can get Darlington drivers in IC's like the ULN2803A and ULN2804A, both have eight Darlington pairs with internal protection diodes.

    There is a CW\/CCW input. When held low, each clock causes the motor to step clockwise; when held high, each clock causes the motor steps counter-clockwise.
     
  16. Metalfan1185

    Thread Starter Active Member

    Sep 12, 2008
    146
    0
    Thanks, you guys are great! Im going to look for some of those IC's and see if i can get some soon.

    Im new to stepper motors, i know how they work, but unsure of the many ways to drive them
     
  17. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Before you go ordering things, tell us more about your stepper motors.

    What is their rated voltage and current?

    Since they are unipolar, the voltage rating will be for the center tap to the ends of the coil.

    If you are going to use them in bipolar mode, you'll need twice the voltage, same current.
     
  18. russ_hensel

    Well-Known Member

    Jan 11, 2009
    818
    47
  19. Metalfan1185

    Thread Starter Active Member

    Sep 12, 2008
    146
    0
    ok, well they are 4V, 1.8 deg/step


    and another is 3.7V, 1.8 deg/step

    my dad said they are a something 16, which is a size i suppose...

    i just want to rig one or two up so i can control the direction and speed, like, maybe try and use one to slide out a shelf or something...

    but that would need something programmable, i have no expierience with programmable IC's, the tutoriaLS THAt i have read make it sound so complex. clocks and buffers and address lines and crap...im lost lol
     
Loading...