Shop OBEX P1 Docs P2 Docs Learn Events
Controlling 600ma motors — Parallax Forums

Controlling 600ma motors

ArchiverArchiver Posts: 46,084
edited 2001-02-09 20:47 in General Discussion
I know I (and many other people) have asked this type of question before...
I just got done reading some of the replies. So please forgive me if I
reiterate some old stuff. The whole reason for this post is to ask one
simple question: what are the three pins on a transistor for, and does it
matter which one ground and which one +5V is attached to? I bought 10 NPN
High Speed Switching transistors from Digi-Key to build an H-Bridgey type
thing, and I am unsure of what to attach to what. I wasn't planning on
following the schematics that have been flying around so much, because I
can't understand half of the parts on them (what, for instance, is the
diode-like symbol with the squiggly end?). On the diagram that I drew up, I
have 4 transistors per motor (with two left over to do cool stuff with after
I control my two motors...). There are two transistors on each lead to the
motor, one switching ground on and off and the other switching +6V. It
requires 4 pins to operate instead of two, like the other H-Bridges, but I
think it will work. I have some diodes randomly thrown in where they look
like they would do some good.

Hmmmmmmm. Time to go off on a tangent... How do pull-up or pull-down
resistors work? I think if I used a resistor to pull transisors in opposite
directions I could get the motor controller down to just using two pins. In
case that wasn't clear, I mean have one pin output to a transistor, and then
go through a pull-up or pull-down resistor to make the opposite transistor
be on or off... so they can't both be on at once. The same setup would be
on the other motor lead as well. I know that the pull-up and pull-down has
something to do with their placement in the curcuit, but exactly what it is
still eludes me.

Thanks for your help.


______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-02-09 14:19
    A good read might be Forest Mimms's books (pamphlets really) from
    radio shack. There's two larger (8x11) that go over most of your
    questions. Show the pins on transistors and explain how to connect
    them.

    In a very crude way, one of the basic functions of a transistor,
    especially in an H bridge, are very similar to a relay. One leg is
    input power, one leg is output power and the third is the signal line
    that tells it when to turn on and off. Forest goes over this pretty
    well.

    Good luck!

    ps: Never go past any words you don't understand. Some may be hard
    to get definitions for, but persist. It is not possible to
    understand technology when you don't understand the words. you can
    fake it an create you own definitions, but then they're your
    definitions, and not the ones the technology uses. I read a quote
    once, a long time ago, it was something like

    No one gives up a study until AFTER he goes past a misunderstood word.






    --- In basicstamps@y..., Yanroy <yanroy@u...> wrote:
    > I know I (and many other people) have asked this type of question
    before...
    > I just got done reading some of the replies. So please forgive me
    if I
    > reiterate some old stuff. The whole reason for this post is to ask
    one
    > simple question: what are the three pins on a transistor for, and
    does it
    > matter which one ground and which one +5V is attached to? I bought
    10 NPN
    > High Speed Switching transistors from Digi-Key to build an H-
    Bridgey type
    > thing, and I am unsure of what to attach to what. I wasn't
    planning on
    > following the schematics that have been flying around so much,
    because I
    > can't understand half of the parts on them (what, for instance, is
    the
    > diode-like symbol with the squiggly end?). On the diagram that I
    drew up, I
    > have 4 transistors per motor (with two left over to do cool stuff
    with after
    > I control my two motors...). There are two transistors on each
    lead to the
    > motor, one switching ground on and off and the other switching
    +6V. It
    > requires 4 pins to operate instead of two, like the other H-
    Bridges, but I
    > think it will work. I have some diodes randomly thrown in where
    they look
    > like they would do some good.
    >
    > Hmmmmmmm. Time to go off on a tangent... How do pull-up or pull-
    down
    > resistors work? I think if I used a resistor to pull transisors in
    opposite
    > directions I could get the motor controller down to just using two
    pins. In
    > case that wasn't clear, I mean have one pin output to a transistor,
    and then
    > go through a pull-up or pull-down resistor to make the opposite
    transistor
    > be on or off... so they can't both be on at once. The same setup
    would be
    > on the other motor lead as well. I know that the pull-up and pull-
    down has
    > something to do with their placement in the curcuit, but exactly
    what it is
    > still eludes me.
    >
    > Thanks for your help.
    >
    >
    > ______________________________________________
    > FREE Personalized Email at Mail.com
    > Sign up at http://www.mail.com/?sr=signup
  • ArchiverArchiver Posts: 46,084
    edited 2001-02-09 16:24
    > reiterate some old stuff. The whole reason for this post is to ask one
    > simple question: what are the three pins on a transistor for, and does it
    > matter which one ground and which one +5V is attached to?

    Transistors have many different uses. In your case, you want to use the
    transistor as a switch. For an NPN transistor used as a switch you'll
    typically see the following hookup:

    Base: Digital input (through a small resistor)

    Emitter: Ground

    Collector: Load (that is +V goes to your motor's "hot" lead and the other
    lead goes to the collector.

    So the idea is you complete the circuit by turning the transistor on which
    connects the emitter and collector, providing a ground return for the motor.
    For an inductive load like a motor or relay you'll probably need to put a
    diode with the band pointing towards +V and the other end connected to the
    collector. This protects the transistor from negative spikes.

    In general, transistors operate by current and have a parameter known as
    Beta. The base current times the Beta determines the collector current.
    However, for a switch you want to operate the transistor in saturation mode
    which means you put so much current in the Base that the transistor can't
    provide any more current on the collector. Let's see what that is.

    Say we have a transistor with Beta of 100 connected as described above.
    Instead of a motor, say you have a 10 ohm resistor and V+ is 10V. Now
    suppose you have a 1.7V input through a 1000 ohm resistor.

    The base-emitter junction of the transistor looks like a diode. So with one
    end grounded (the emitter), the base must be at .7V. You are putting 1.7V in
    at the input, so there is 1V across the 1000 ohm base resistor. That is a
    base current of 1mA (1/1000).

    Since Beta = 100, the collector current must be 1mA x 100 or 100mA. How much
    voltage is across a 10 ohm resistor (the load resistor) if the current is
    100mA (.1A)? Easy .1 x 10 = 1V, right? But there is 10V going into the
    resistor, so if there is only 1V across it, there must be 9V across the
    transistor since all the voltage drops must add up to 10V.

    So if you hooked a VOM to your circuit here are the voltages you'd see:

    E - 0V (hooked to ground, so of course).
    B - .7V (always as long as at least .7V is at the input)
    C - 1V (assuming 1.7V at base resistor)

    Notice that the E and B voltages never change (unless the input voltage
    drops so low that the transistor can't operate). Only C varies as the input
    to the base resistor changes.

    Now what happens if we up the input voltage to 12.7V? Now there is 12V
    across the base resistor and the base current is 12mA (a lot for a
    transistor's base). The Beta says the collector current should be 1.2A (a
    big transistor).

    But... how much voltage does the load resistor have across it? 10 x 1.2 =
    12V. But the collector voltage is only 10V to begin with. To do that, the
    transistor would have to drop -2V which is not possible (that would make it
    a battery!). So in this case an ideal transistor would hold the collector at
    0V and the current would only be 1A. The transistor is saturated. That is,
    it doesn't matter if you put 10.7V or 11V or 12V or 15V in the base
    resistor -- the current will still only be at 1A. It is saturated -- it
    can't go any higher no matter what you do to the base.

    Now... a real transistor isn't quite that perfect. In real life, the
    collector will not go all the way to 0V. It might go to .2V or so. So in our
    example, the real current would be less than 1A (about 980mA, can you
    compute why?).

    Want to know more. I have a write up about this in my Stamp book
    (http://www.al-williams.com/awce/sbook.htm). Also, the Art of Electronics is
    a great book (although not a quick read)
    http://www.al-williams.com/wd5gnr/books.htm

    Finally, if the ohm's law and voltage drop stuff is bothering you, have a
    look at http://www.al-williams.com/wd5gnr/basiccir.htm



    > High Speed Switching transistors from Digi-Key to build an H-Bridgey type
    > thing, and I am unsure of what to attach to what. I wasn't planning on
    > following the schematics that have been flying around so much, because I
    > can't understand half of the parts on them (what, for instance, is the
    > diode-like symbol with the squiggly end?). On the diagram that I
    > drew up, I
    > have 4 transistors per motor (with two left over to do cool stuff
    > with after
    > I control my two motors...). There are two transistors on each
    > lead to the
    > motor, one switching ground on and off and the other switching +6V. It
    > requires 4 pins to operate instead of two, like the other H-Bridges, but I
    > think it will work. I have some diodes randomly thrown in where they look
    > like they would do some good.
    >
    > Hmmmmmmm. Time to go off on a tangent... How do pull-up or pull-down
    > resistors work? I think if I used a resistor to pull transisors
    > in opposite
    > directions I could get the motor controller down to just using
    > two pins. In
    > case that wasn't clear, I mean have one pin output to a
    > transistor, and then
    > go through a pull-up or pull-down resistor to make the opposite transistor
    > be on or off... so they can't both be on at once. The same setup would be
    > on the other motor lead as well. I know that the pull-up and
    > pull-down has
    > something to do with their placement in the curcuit, but exactly
    > what it is
    > still eludes me.

    I'm not sure I follow you on this one. A pull up resistor sets a logic level
    high until something else pulls it low. The problem with trying this with an
    H-Bridge is that your transistor then not only has to pull down the motor
    current but also the pull up resistor. If the pull up resistor is supplying
    motor current it will have to be very small so you will need even bigger
    transistors. Many H-Bridges use MOS transistors because they turn on with
    very little loss (unlike the .2V saturation you'll see with transistors) and
    it is easy to bias pairs of them so one is on while the other is off and
    viceversa (that's how CMOS works). For bipolar transistors, you'd usually
    wind up using 1 transistor as an inverter to drive another transistor. There
    are several good h-bridge designs which have been discussed lately -- I'd
    use one of them instead of reinventing the wheel.

    Regards,

    Al Williams
    AWC
    * Floating point math for the Stamp, PIC, SX, or any microcontroller:
    http://www.al-williams.com/awce/pak1.htm
  • ArchiverArchiver Posts: 46,084
    edited 2001-02-09 20:47
    >I know I (and many other people) have asked this type of question before...
    >I just got done reading some of the replies. So please forgive me if I
    >reiterate some old stuff. The whole reason for this post is to ask one
    >simple question: what are the three pins on a transistor for, and does it
    >matter which one ground and which one +5V is attached to?

    Emitter, Base, Collector. For a switching application, the Base is driven
    into saturation, which allows current to flow from the collector to the
    emitter. You will need to bias this correctly in order for it to work
    without the transistors failing. I suggest you study the schematics, or at
    least look at a datasheet for a H-bridge IC, and duplicate the circuit for
    driving the transistors there. If these are bipolar junction transistors and
    not MOSFETs, they won't like be driven directly with logic level signals.

    Regards,

    Rob
    _________________________________________________________________
    Get your FREE download of MSN Explorer at http://explorer.msn.com
Sign In or Register to comment.