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

Stepper motor control

Rob311Rob311 Posts: 83
edited 2006-04-21 06:57 in BASIC Stamp
I have 2 available pins left on my stamp and want to drive a stepper motor.

Any sugestions?

~Rob

Comments

  • Grant_OGrant_O Posts: 36
    edited 2006-04-19 23:17
    www.simplestep.com

    get a cheap stepper motor driver and use the two pins as Tx and Rx and do it with RS232 ASCII.
    ·
    That’s what I did and it seemed a lot easier to program. Just tell it how many steps you want to go and it goes. Also gives you the ability to set an acceleration and deceleration profile. Some may have the ability for a rotary or linier encoder (depending on your application)·so you can do relative movements. And adjustable currents for various motor types.

    Post Edited (Grant_O) : 4/19/2006 11:22:56 PM GMT
  • Rob311Rob311 Posts: 83
    edited 2006-04-19 23:25
    i found this
    http://www.eettaiwan.com/ARTICLES/2002MAR/PDF/2002MAR08_AMD_MPC_AN81.PDF
    but i cant get it to work
    im using a bs2 and ULN2803A Darlington Array
    i only get holding force for 2 of the 4 phases
    any other ideas?
  • Rob311Rob311 Posts: 83
    edited 2006-04-20 02:23
    Thanks much
    look like the one i had posted... maybe i can get this variation working =)
    ...still open for any other ideas incase i cant
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-04-20 04:59
    Get a BS2p40.

    You have 16 more pins to drive 4 steppers.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Rob311Rob311 Posts: 83
    edited 2006-04-20 11:02
    why waste the outputs?
    if i can get it done with 2 pins, why would i use 4?
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-04-20 12:10
    OK, here's the two-coil excitation schematic.· I'd pulled it down, figuring it redundant,·as it was pretty much the same as that in Rob311's link.· It works with the KP4M4 (which is a UNIpolar.)

    I'll go out on a limb here -- you can use either a 2003 or a 2803, just know that they aren't pin-for-pin equiv., the 2803 has one more driver than the 2003.· That, and I ran mine w/·& w/o the zener (a 15V.)


    Post Edited (PJ Allen) : 4/20/2006 2:02:41 PM GMT
    595 x 268 - 60K
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-04-20 12:14
    Well, if you want to do it with two pins; you may need to add a stepper controller as the stepper always require four phases of control.

    A stepper controller may be a good investment if you ever want to switch from unipolar to bipolar or switch to higher power than the UNL2x03 can provide.

    The BS2p40 really just gives you the most flexibilty to have a BasicStamp do it all.· You might be able to add logic that can keep it down to two pins.· I just don't have the information for such.· Google is your friend.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-04-20 12:55
    Rob -

    The real answer to your question depends on a number of things, but based on what you've said so far, 2 pins are plenty. First you need to determine what kind of stepper motor you have, or want to actuate - unipolar or bi-polar. Second you have to decide if you're willing to use external circuity, and if so how much and what kind. Last you need to specify what kind of "control" you're really after. If all you want to do is make it turn in one direction, that's one thing. If you want various options like: FORWARD, REVERSE, or full step, half step, micro-step, or single stepping, then you need to so specify.

    In any/all instances much of the anwer boils down to the following, which you may not have considered. With ONLY two pins available, you still have four possibilites of states for those two pins, as follows:

    /code

    ·State···· Pin· Pin
    Number····1··· 2
    ·· --- ---
    ···· 1······· 0··· 0
    ···· 2······· 0··· 1
    ···· 3······· 1··· 0
    ···· 4······· 1··· 1
    code/

    Said even slightly differently, there are also IC's which will permit you to input two state inputs, and will fan out the data across 4 pins:

    /code
    ················ Inputs
    ················ |···· ·|
    ··············· A······B
    ··············· =====
    ·············· |········ ·|
    ··············· =====
    ··············· C·D E F
    ··············· |· |· |·|
    ··············· 0 1· 2 3
    ··············· Outputs
    code/

    So, in summary, there is a good deal more "power" (or utility) in just two pins, than one may initially realize.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-04-20 14:07
    Rob311,
    I took a look at the article you mention and was surprised to find it was actually a Parallax BasicStamp 1 text - just posted at a Taiwan web site. I have never tried this method. It is the first time I have actually heard of it.

    Smoothness can be a function of how fast or slow you are going. Seems like you should be getting four distinct steps, not two.

    Apparently your concern between using 2 pins and UNL2803 or 4 pins is in regards to how smooth you want to run. There are several ways to feed power to a unipolar stepper: 4 steps with single coil on; 4 steps with two coils on; 8 steps or what is known as half-step mode.

    You appear to be using the second, which should provide the greatest holding power and most torque. Seems like you might have an error in software [noparse][[/noparse]are you sure you have translated the BS1 code to BS2 code properly]·or hardware that results in only two positions, not four.

    The first method may be smoother, but weaker. The third might be even smoother, but holding power is sacraficed further in alternating positions.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-04-20 14:19
    Also, it's really hard to see, but the schematic at that link shows in fine print, and·in a really weird way (i.e. with little notes),·that IC pin 1 is jumpered to pin 11 and that·pin 4 is jumpered to pin 10.
  • Rob311Rob311 Posts: 83
    edited 2006-04-20 17:30
    Bruce
    What would that chip be called?
    /code
    Inputs
    | |
    A B
    =====
    | |
    =====
    C D E F
    | | | |
    0 1 2 3
    Outputs
    code/
    it woudl be perfect. simple enough for me to use and powerfull enough to be used.
    a name, or part number would be greatly appreciated.
  • Grant_OGrant_O Posts: 36
    edited 2006-04-20 18:04
    doesnt it have something to do with boolean logic gates (And, NAnd, Or, Nor gates)?
  • Grant_OGrant_O Posts: 36
    edited 2006-04-20 19:00
    here is a link that will describe this method of Binary (n-to-2n) Decoding to some degree. you will have to read the next few slides though. enjoy!
    http://www.asic-world.com/digital/combo1.html

    Post Edited (Grant_O) : 4/20/2006 7:03:54 PM GMT
  • Rob311Rob311 Posts: 83
    edited 2006-04-20 21:31
    Ok, so it looks like its not a chip, but a bunch of logic gates.. i can do that...
    i think...
    anyone know of a good brand/type of logic gate?
    anything i need to know about buying them? or should i jsut got to jamco and order 4 random "and" gates and 4 random "inverters"?
  • Vern GranerVern Graner Posts: 337
    edited 2006-04-20 22:14
    Rob311 said...
    I have 2 available pins left on my stamp and want to drive a stepper motor. Any sugestions?

    Being fundamentally lazy, tongue.gif I like to off-load this type of busy work to a co-processor. I like Serial LCDs, serial Motor controllers, serial relay boards etc. For this application, a very simple approach would be available directly from Parallax and would only use one pin:

    Stock#: 27938 Little Step-U Motor Controller Price: $69.00

    Hope this helps. smile.gif

    Vern

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Vern Graner CNE/CNA/SSE    | "If the network is down, then you're
    Senior Systems Engineer    | obviously incompetent so why are we
    Texas Information Services | paying you? Of course,if the network
    http://www.txis.com        | is up, then we obviously don't need
    Austin Office 512 328-8947 | you, so why are we paying you?" ©VLG
    
    
  • Rob311Rob311 Posts: 83
    edited 2006-04-20 22:18
    Ahh i see....
    you have to much money to burn =)
    if you wana pay $70 for one and mail it to me ill pay for shiping =)
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-04-21 06:57
    Rob -

    There are a number of ways to approach these logic gates you want to use. Here are a few of them. You could use a 2 => 4 decoder or demux (de-multiplerer), similar to this one:
    http://www.fairchildsemi.com/pf/74/74AC139.html

    Wangling the ENABLE pin on the IC above may or may not prove to be a problem, but the logic is correct.

    Another possible solution may be the use of a ripple counter or ring (Johnson) counter like this one: http://www.semiconductors.philips.com/pip/74HC_HCT4017_CNV_2.html

    The Johnson counter is really nothing more than a specialized shift register whose outputs appear singly, in sequence, and which rotates a high output bit back to the input after "n" iterations. Again it's probably a bit more than you need, but it's the simplicity of your needs that "causes" that.

    The most simplistic way I can think to do this is with 4 cascaded flip-flops which are essentially set up like the Johnson counter above. Each flip-flop SETs the next stage, and that next one RESETs the last one, essentially, and then rotates back to the beginning. I'm reasonably sure quad flip-flops (4 in one package) are available.

    That should give you a few different options. A decade counter may provide yet another solution.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
Sign In or Register to comment.