Overview of Motor Drivers and Control

parkagendaElectronics - Devices

Nov 2, 2013 (3 years and 11 months ago)

65 views

Overview of Motor Drivers and Control


Driving Loads

At some point in a Mechatronics device, one will want to turn on a motor or other
such device that uses more electrical power than can be provided directly from a
microprocessor. Driving any load over a
few milliamps cannot be done directly
from a digital output. There are two general options:




Relays: A mechanical switch activated by an electromagnet

o

Old and reliable technology

o

Relatively slow compared to transistors

o

Can only be on/off, no intermediate
level of control

o

No voltage drop across it (i.e. provides full voltage to load)

o

You can recognize a relay by the “click” it makes when the contacts
close, which you hear when headlights are turned on or off in a car.




Transistors: A semiconductor which can

either conduct or not conduct
(hence the name semiconductor), based upon a small amount of input
current. The action of a transistor is represented by “Transistor Man”
below who monitors a small current on the left, and adjusts a large current
on the rig
ht.

o

Fast on/off times

o

Level of power can be adjusted (see PWM below)

o

Does have a voltage drop so not 100% of voltage used to drive
load.

o

Dominant method of real
-
time control, and the one addressed
throughout the rest of this document.


Transistor Man

Driv
ing Inductive Loads (don’t forget the diode!)

A simple way of connecting a transistor is shown below as an emitter follower.
When V
in
is applied to the base of the transistor that is 0.6 V higher than ground,
then current will flow through the transistor i
n the direction of the arrow. Only a
small amount of current will flow into the base, thus allowing the transistors to be
driven directly from a microprocessor.

With a little of help of choosing the right microprocessor (see Art of Electronics by
Horowtiz

and Hill), one can be off and running driving loads. However, if a motor
was connected to the circuit above, one would find that the circuit would work
one time and then burn out. The problem is due to the inductance in the
electromagnetic of the motor. W
hen the transistor is shut off, the energy in the
inductor creates an inductive kick back through the transistor. To solve this
problem a diode is placed in parallel to the inductive load (e.g. motor) as shown
in the right. The diode absorbs the inductive
kick. Most motor drivers come with
protection diodes, but if you are making your own driver do not forget them!



Emitter follower for driving a regular
resistive load.

With a diode protection for an inductive
load.


Note that the power for that flows
through the load comes from a separate power
source, which is different than the logic level power source that provides the
voltage into the base of the transistor. Good design practice is to separate logic
power and motor driver power; this prevents fluct
uations in the logic power as the
motor starts and stops.

Modulating Power

A key advantage of transistor control is that one can adjust the amount of power
sent to a motor or other load, thus allowing speed or torque control There are two
fundamental metho
ds of modulating the power:



Op Amp/Linear Control. An op
-
amp provides a continually varying output,
however it has significant heat loss in the electronics. Op
-
amp are using in
audio amplifiers for high fidelity, but the components are expensive heavy
and
large. Most control applications have been replaced by PWM (see
below).



Pulse Width Modulation (PWM) takes advantage of characteristic of
semiconductors. There is much less heat loss in a transistor when it is all
the way on or all the way off. The PWM app
roach turns the voltage on and
off very quickly (thousands of times a second). Since the motor cannot
start and stop that quickly the net effect is that the power to the motor is
based on the percent duration that the voltage is on, i.e. the width of the
pulse as shown below:



Types of Motors for Motion Control



Hobby Servos. Low cost but no ability to control gain and generally limited
customization.



Industrial Servos. High level of customization but expensive. Common in
machines such as CNC mills.



Stepp
ers. Useful for position control, but generally lower dynamic
performance then servos.



Design your own. This is the Mechatronics approach, and allows for low
cost and customization to the specific need of the project.


Direction Control of a Motor

A DC mo
tor can change directions by reversing the voltage. A convenient way to
do this is with an H
-
Bridge design, which has 4 transistors that are controlled in
pairs. When transistors Q1 and Q3 are active then the current flows in one
direction, and when Q2 and

Q4 are activated the current flows the other
direction. One typically purchases an H
-
Bridge motor driver such as the
L298
.



One input pin on the H
-
Bridg
e controls direction, while the enable pin can be
controlled in a PWM fashion to modulate the power to the motor. It is a good
practice to initialize the motor driver to zero power at the beginning of a program
to make sure a device does not start spinning

on power on.


MotoMaster Motor Driver

There are many motor drivers on the market with a tradeoff between easy of use
and amount of customization one has. The
MotoMaster motor driver

was built by
Alex Simpkins and MAE156A TA and PhD student in control. It has the
advantage that has an on
-
board microprocessor and thus allows a high level of
customized control yet is easy to use. Its key featu
res are:



Serial communication. This allows one to send a command to the
MotoMaster with desired motor direction and voltage level, and then let
the MotoMaster take care of the PWM implementation.



Handy screw terminals for high power (motor driving circuit)

and logic level
power.



A
L298
H Bridge that allows bi
-
directional control of two motors



A Darlington Array (
ULN2803A
), which provides 8 pins unidirectional
transistor control with diode protection. Each pin can provide 500 mAmp of
power, but they can be connected in parallel.



An on
-
board microprocessor that is i
n a continual loop. In each loop it
checks for serial input, and then adjusts the pulse width of the H
-
Bridge
and Darlington array appropriately.


Control Methods

Control is large area of engineering, and this overview just touches on some
basic implementa
tion issues. In the broadest sense some methods for control
are:



Open loop on/off
. This is the least accurate method, where a motor is
turned on for a set period of time and then shut off. It is easy to implement
but only suitable where low accuracy is suf
ficient, or accuracy can be
achieved through other methods such as a mechanical stop or limit switch.



Open loop ramp
-
up and ramp
-
down
. With this method speed is ramped
up at the beginning of motion and then ramped down near the end of
motion. This approac
h smoothes out the jerks that accompanies the on/off
approach, but fundamentally does not provide the highest level of dynamic
performance.



Linear Control
. This is the topic of most undergraduates control courses,
and the most common method of implementing

“dynamic” control. A
common approach is Proportional
-
Derivative
-
Integral (PID) control, where
three gains are adjusted to achieve a tradeoff between high speed,
stability, and accuracy.



Linear Control with Saturation.

Purely linear control may require low

Proportional gain levels to avoid saturation when the position error is
large. It is often desirable to operate a motor at its peak voltage when the
position is far from the desired postion,and then switch to linear control
when the motor is close to the
target postin. This can be easily
implemented with if statements, but one should be aware that linear
simulations will no longer match hardware performance.



Non
-
Linear Control Methods
. There are numerous non
-
linear control
methods, such as bang
-
bang contro
l, and friction compensation that can
provide higher level performance than linear control.


Digital Control Implementation

Digital Control differs from traditional linear control theory in the following:



Discretation errors occur in sensor measurement and

command output



There is a delay in implementation the feedback loop due to the
microprocessor computation.

Thus digital control can have lower performance than the corresponding analog
control. But when the microprocessor speed is high and the A/D convers
ion, and
PWM implementation are high resolution, digital control approaches linear
control. For practical implementation of PID control see section 11.3.4 and 11.3.5
of Introduction to Mechatronics by Alciatore and Histand.