Motor Drives:
Unipolar Pulse Width Modulation ----------:
(Suitable when it is not necessary to be able to reverse motor direction)
When there is a need for controlling the speed of a DC motor in an
efficient manner (using Pulse Width Modulation), driver circuitry
can be rather simple, as shown below. The motor drive circuit ground must of
course, be tied to the microcontroller ground for the circuit to work.
The 1k gate resistor is used to add some
degree of isolation of the motor drive (w. possible damaging back EMF transient
spikes) from the 68HC1x output pin. The Zener diode (optional) adds extra
protection. But if you really want to do it right, put an optoisolator between
the 68HC1x output and the motor drive circuit.
Typical unipolar DC motor drive circuit
Bidirectional DC motor speed control using Pulse Width Modulation:
The simplest method of implementing microcontroller controlled H-bridge drive of
a reversible DC motor is to buy one of many commercial H-bridge IC's availible on the
market. These can be purchased separately as an H-Bridge with a separate H-Bridge
controller IC, or as an all-in-one IC. Unfortunately, there are several hurdles that
sometimes frustrate this approach. Students often find these devices hard to find, as
they are apparently in high demand. Secondly, many of these devices have limited
current drive ability, such that larger DC motors end up running sluggish or stalling
easily. One option is to build your own H-bridge from discrete parts, as shown
below.
The following system illustrates a typical H-bridge design which utilizes
discrete components. This approach allows the user to select N-channel MOSFET
devices suitable for driving high current motors. The MAX620 device is availible from
MAXIM, and is known as a "Quad, High-Side MOSFET
Driver", designed specifically
for this application. Due to my inability to create good quality schematics, I have
omitted some of the detail on the MAX620 chip (pin numbers etc.). The user should
download the Specification Sheets from MAXIM,
avialible in acrobat format(*.pdf).
Typical Discrete Component H-bridge circuit.
Comments: Use of the MAX620, (which converts +5V inputs to +16V outputs) allows the
"High-Side" (Top) N-channel MOSFETs to be successfully turned on and off. Without this
scheme, the only way one could switch all the MOSFETS with (0V,+5V) logic signals would
be to use P-Channel MosFets on the top and N-channel MOSFETs on the bottom (i.e. an
unmatched set of MOSFETs). Note that it is not necessary to run the low side logic
signals (driving the bottom pair of MOSFETs) through the MAX620, and you needn't do
this although we show it this way. The 0.1uF disk capacitor across the motor helps absorb
the noisy back-EMF spikes that are emitted by the motor. Also, the NOR-gate logic shown
precludes the user from accidently turning on all four MOSFETS (by simultaneoulsy
asserting forward and reverse signals). Should this ever happen, the motor supply
battery would see a short circuit, and no doubt the current would "Fry" the MOSFETs.
Although not shown explicitly, the microcontroller, MAX620, and H-bridge circuitry must share a
common ground for the circuit to work. The NOR gate logic and MAX620 (Vcc) should be driven
by a separate +5V supply (such as the +5V availible from the microcontroller supply).
Although many MOSFETs contain an internal "freewheeling" diode to shunt back-EMF
currents from the motor, we show external diodes across each MOSFET. Use of external
diodes is advised (even if the MOSFETs have internal diodes) as the internal MOSFET
diodes (if any) may not be heavy duty and could undergo failure.
Although not shown, the user might also consider using optoisolation of the
forward/reverse signals that come from the microcontroller. Also note that the micro-
controller may pulse-width-modulate the forward and reverse signals as a means to
control motor speed. The logic for the forward/reverse tables is as follows:
Forward=0 Reverse=0 | Motor Stopped (Idle)
Forward=1 Reverse=0 | Motor goes forward
Forward=0 Reverse=1 | Motor goes in reverse
Forward=1 Reverse=1 | Bozo NoNo -- will blow up circuit unless NOR* logic used
* - The NOR logic shown will protect against this condition. In this case the motor
would go forward when Forward=1 and Reverse=1.
Finally, this circuit does not protect against excessive motor current (as in the
case of a stalled motor! Some integrated H-Bridges offer this feature. Perhaps
this could also be addressed, e.g. by placing a suitable "fast-blow" fuse in series
with the motor supply battery. Also, when reversing direction (going from forward
to reverse or vice-versa), its advisable to implement a short delay in your code that
turns all the MOSFETs off briefly. E.g. (1) You go forward. (2) You turn both the forward
and reverse signals off briefly (say 0.5 sec). (3) You then assert the reverse
signal. In this way, you make sure that the one pair of MOSFETs has had more than
enough time to completely turn off, and you help avoid problems with stripping
gears (by suddenly reversing the motor direction).
Note: The following *.pdf file requires "Adobe Acrobat Reader" in order to view:
A simpler relay-based bidirectional speed controller
Back to Home Page