Alt-BEAM Archive

Message #02171



To: beam beam@spindle.corp.sgi.com
From: Ben Hitchcock ben@wollongong.apana.org.au
Date: Sun, 13 Dec 1998 19:03:10 +0000
Subject: [INFO] The H-bridge


------------------------------------------------------------------
The H-Bridge
Ben Hitchcock 13/12/98
------------------------------------------------------------------

The basic problem is this: We have a robot that loves to run around, seek
out light, avoid walls and wreak havoc with the sanity of any household
pets. The only problem is that as soon as the poor little robot runs
headlong into a wall, it is trapped. Then the pets have a field day dancing
around and proclaiming loudly to the world that they have caught a new and
interesting species of bug!
What we need is some way to make the robot back up, to really show the cat
who's boss. Unfortunately it takes more than one extra transistor. In
fact, it needs four.

The way it works is simple. Simply reverse the supply to the motor, and it
will spin backwards. So let's start with the basic motor driver circuit:

+ volts rail --------------------------------------o---------
|
|
Motor
|
|
n R1
p----/\/\/\---- input
N
|
0 volts rail --------------------------------------o---------

When the input is high, the motor will spin. So how can we make the supply
reverse itself? We need to put a ground connection on the wire that now has
the positive voltage, and a + voltage on the place where the ground is now.

The + part is easy, but the 0 volts is a bit harder: if we were to just put
0 volts on the part above the motor, we would blow up our power supply. So
we need another transistor thus:

+ volts rail --------------------------------------o---------
|
P R2
n----/\/\/\---- input1
p
|
Motor
|
|
n R1
p----/\/\/\---- input2
N
|
0 volts rail --------------------------------------o---------

So now to turn the motor on, we put a low on input 1, and a high on input 2.

But back to the problem: how do we reverse the motor? It takes two more
transistors. Here I will draw the motor sideways to make the drawing
easier:

+ volts rail -----------------------o---------------o---------
| |
R3 P P R2
input 3 --/\/\/---n n----/\/\/\---- input1
p p
| |
o------Motor----o
| |
| |
R4 n n R1
input 4 --/\/\/---p p----/\/\/\---- input2
N N
| |
0 volts rail -----------------------o---------------o---------

Where the capital letters represent the emitter of the transistor.
(See how the diagram looks sort of like a capital H? Try squinting at it!)

To make the motor spin, we need to turn two transistors on. Let's pick
input 1 and input 4. Now the current will flow through the transistor on
the top right hand side, flow right to left through the motor, and then flow
down through the transistor on the bottom left of the diagram. This means
that input 1 must be low, and input 4 must be high before anything will
happen. Now, to get the motor to spin the other way, we need to make the
current flow in the opposite direction: left to right.

We do this by switching on the transistor on the top left, and also the
bottom right.

An interesting problem arises here: what if the transistors at input 1 and
input 2 are both on at the same time? The current will flow down through
the first transistor, through the second, and out to ground with no load
being driven.

This is bad.

This is very bad.

If your battery is large, you might watch your transistors explode, if R1
and R2 are low enough. If it isn't large, you might see the battery itself
explode. This is definitely not recommended - so here is a solution:

+ volts rail -----------------------o---------------o---------
| |
R3 P P R2
.--/\/\/---n n----/\/\/\--.
| p p |
| | | |
| o------Motor----o |
| | | |
| | | |
| R4 n n R1 |
input 1 ----o--/\/\/---p p----/\/\/\--o-- input2
N N
| |
0 volts rail -----------------------o---------------o---------

Now, if the inputs are driven by CMOS logic (Or most other types of logic)
then you will never see your H-bridge smoke. You just pretend that the
inputs are the motor terminals: you make one high and the other low to make
the motor spin, and reverse them to make the motor spin in the other
direction.
If both are at the same level, then nothing will happen.

You can use CMOS chips to drive motors directly - two examples are the
74HC245 and the Z-bridge (I forget which chip that is). Anyway, here we are
being really naughty and just using normal logic chips to drive loads that
they weren't designed for. You can be tricky and use lots of gates to drive
the same input, so your motor can use a higher current than any one gate can
provide. This practice is often useful when you have a small motor, but for
anything larger than a pager motor you are often better off with an
H-bridge.







------------------------------------------------------------------------
eGroup home: http://www.eGroups.com/list/alt-beam
Free Web-based e-mail groups by eGroups.com

Home