You are on page 1of 20

DC Motor Control: Theory and Implementation

By Chung Tan Lam


CIMEC Lab.
I. Introduction
A DC motor speed drive
The mathematical model of dc motor (permanent magnet type) can be expressed by these equations
where
a
V
: Armature voltage [V]
a
i
: Armature current [A]
e
T
: Electromagnetic torque [N.m]
L
T : Load torque [N.m]
a
L
: Armature inductance [H]
a
R
: Armature resistance [ ]
K : Coupling coefficient [N.m/A]
J : Momen of inertia [Kg.m
2
]
m
B
: Damping coefficient
The block diagram of a cascade closed-loop speed control of the dc motor is shown below.
DC MOTOR MODEL
1
CASCADE SPEED CONTROL OF A DC MOTOR DRIVE
Typical dynamic responses are also shown. The motor is initially at standstill and
at no load when a step command in speed is applied; when steady-state conditions are
reached, a reversal of speed is commanded followed by a step load application.
The system is highly nonlinear due to the introduction of saturation needed to limit
both the current delivered and the voltage applied to the motor. The system is in the
saturation mode when the errors are large; as a consequence, the controller functions as a
constant current source, that is torque, resulting in the ramping of the speed since the load
in this example is a pure inertia. The inclusion of saturation limits on the PI integrator is
therefore necessary to provide antiwindup action. The presence of the signum function in
the torque expression is required in order to insure that the load is passive whether the
speed is positive or negative (as is the case here).
2
1. DC Motor Transient Running Operation
This demo simulates the running of a DC motor with constant field or pm
excitation (5 hp 240V 1200 rpm) rated torque Tr = 30 N.m

BLOCK DIAGRAM MODEL OF A DC MOTOR
3
MOTOR TRANSIENT RUNNING OPERATION
Electrical system equation:
va = Ra.ia + La.dia/dt + ea
where ea = K.wm

Mechanical system equation:
Te = J.dwm/dt + Tl.signum(wm) + f(wm)
where Te = K.ia
Simulation Results
MOTOR SPEED [rad/s]
4
MOTOR CURRENT [A]
2. DC Motor with bipolar PWM excitation
This demo simulates the running of a DC motor with PWM (bipolar) excitation (5
hp 240V 1200 rpm) rated torque Tr = 30 N.m
5
DC Motor With Bipolar PWM Excitation
DC Motor Model
Simulation Results
6
Voltage Average Applied To Motor
MOTOR SPEED (rad/s)
Motor Current (A)
3. DC Motor with unipolar PWM excitation
7
This demo simulates the running of a DC motor with PWM (unipolar) excitation (5
hp 240V 1200 rpm) rated torque Tr = 30 N.m
DC Motor Model
Simulation Results
8
Voltage Average Applied To Motor
Motor Speed (Rad/S)
Motor Current (A)
4. Automatic Starter of a DC Motor
9
This demo simulates the starting of a DC motor with automatic starter
(5 hp 240V 1200 rpm) rated torque Tr = 30 N.m
The starter is simulated by a speed-dependent effective armature resistance using a look-up table.
Mathematical model of the dc machine

'

+ +
+ +
a e
m a
L m
m
e
a a a
a
a a
Ki T
K e
T B
dt
d
J T
e i R
dt
di
L V

where
a
V
: Armature voltage [V]
a
i
: Armature current [A]
e
T
: Electromagnetic torque [N.m]
L
T : Load torque [N.m]
a
L
: Armature inductance [H]
a
R
: Armature resistance [ ]
K : Coupling coefficient [N.m/A]
J : Momen of inertia [Kg.m
2
]
m
B
: Damping coefficient
Simulation Results
10
MOTOR SPEED
MOTOR CURRENT
11
H-BRIDGE DRIVER MODULE
12
T i t l e
S i z e D o c u m e n t N u m b e r R e v
D a t e : S h e e t o f
A - 0 1 1 . 0
F u l l B r i d g e D r i v e r
A 4
1 1 W e d n e s d a y , M a y 1 1 , 2 0 0 5
R 5
1 K
A N 1
1
C T
2
C 1
8
E 1
7
A N 2
3
C T
4
E 2
5
C 2
6
U 7 P C 8 1 7
A N 1
1
C T
2
C 1
8
E 1
7
A N 2
3
C T
4
E 2
5
C 2
6
U 6 P C 8 1 7
1
2
3
4
5
6
7
8
9
1 0
1 1
1 2
1 3
1 4
J 5
C O N 1 4
O u t 2
O u t 1 O u t 1 O u t 1
1
2 3 4 5
C
R 1 3
4 x 4 7 0
D 1
R C 0 / T 1 C K I
C 6
1 0 3
V c c
1
I N
2
C O M
3
L O
4
V b
8
H O
7
V s
6
N C
5
U 1
I R 2 1 0 5
D 5 _ P W M 1
2 4 V D C
1 5 V D C
R 6
5 0 K
O u t 1
D 7 _ P W M 2
2 4 V D C
1 5 V D C
O u t 2
H O 1
H O 1
R C 2 / C A P 1
3
2
1
8
4
-
+
U 3 A
L M 3 5 8
5
6
7
8
4
-
+
U 3 B
L M 3 5 8
V s 1
1
2 3 4 5
C
R 2 4
4 x 4 7 0
D 1 3
D 0
D 1
D 1 4
D 2
D 3
D 1 5 D 1 6
L O 1
+ C 1 2
3 3 u F - 6 4 V
D 5
C 1
1 0 4
H O 2
R E 2
V s 2
1
2 3 4 5
C
R 1 4
4 x 2 2 K
L O 1
L O 2
5 V D C
I n 4
I n 3
D 6
V s 1
L O 2
5 V D C
I n 2
D 7
I n 1
+ C 1 3
3 3 u F - 1 6 V
5 V D C
R 1 5 4 7 K
S e n s i n g
D 8
I n 1
R E 1
5 V D C
D 2
D 1
C 9
1 0 4
D 4
D 3
D 6
D 5 _ P W M 1
R 1 6 4 7 K
R C 4 / S D I
D 7 _ P W M 2
R B 0 / I N T 0
R B 4
R B 1 / I N T 1
R C 5 / S D O
I n 2
A N 0
R E 2
R E 1
R B 5
2 4 V D C
G N D
R C 1
R C 2 / C A P 1
1
2
3
4
5
6
7
8
9
1 0
1 1
1 2
1 3
1 4
J 1
C O N 1
1
2
3
4
5
6
7
8
9
1 0
1 1
1 2
1 3
1 4
J 2
C O N 1
P O R T V C C
R C 0 / T 1 C K I
V C C _ I O
E X T V C C
R E 0 / R D
R E S E T #
R C 3 / S C K
D 0
I n 3
R 1 7 4 7 K
S e n s i n g S e n s i n g S e n s i n g S e n s i n g S e n s i n g S e n s i n g
I n 4
R 1 8 4 7 K
A N 0
D 2
V c c
1
I N
2
C O M
3
L O
4
V b
8
H O
7
V s
6
N C
5
U 2
I R 2 1 0 5
C 2
1 0 4
H O 2
I N
1
O U T
3
G
N
D
2
U 4 K I 7 8 1 5
V s 2
1
2
3
4
5
J 3
E n c o d e r
R B 0 / I N T 0
1
2 3 4 5
C
R 1 9
4 x 4 7 0
2 4 V D C
1
2 3 4 5
C
R 2 0
4 x 1 5 0
R B 5
1
2 3 4 5
C
R 2 1
4 x 2 . 2 K
1 5 V D C
1
2 3 4 5
C
R 2 2
4 x 4 7 0
A N 1
1
C T
2
C 1
8
E 1
7
A N 2
3
C T
4
E 2
5
C 2
6
U 5 P C 8 1 7
R B 4
D 4
D 3
O u t 2 O u t 2
C 7
1 0 4
O u t 1 O u t 1 O u t 1 O u t 1 O u t 1 O u t 1
5 V D C
R 4
1 K
R B 1 / I N T 1
R C 1
5 V D C
(H-Bridge Driver + 2 output +4 input + 4 Indicator LEDs)
T i t l e
S i z e D o c u m e n t N u m b e r R e v
D a t e : S h e e t o f
A - 0 2 1
H - B r i d g e P o w e r M O S F E T
A
1 1 W e d n e s d a y , M a y 1 1 , 2 0 0 5
G N D
O u t p u t 2
O u t p u t 1
I n p u t 3
G N D 3
I n p u t 4
G N D 4
1
2
3
4
5
6
7
8
9
1 0
1 1
1 2
1 3
1 4
J 3
T o H - B r i d g e D r i v e r
O u t 2
O u t 1
V s 1
H O 1
V s 2
H O 2
L O 1
I n p u t 4
L O 2
I n p u t 1
I n p u t 2
I n p u t 3
C u r r A m p
2
1
3
T 1
I R F 5 4 0
2
1
3
Q D
I R F 5 4 0
O u t p u t 1
O u t 1
2
1
3
Q C
I R F 5 4 0
M 1
C 3
1 0 4
V S 1
V S 2
H V
H V
2
1
3
Q B
I R F 5 4 0
+
C 4
1 0 0 0 u F - 6 4 V
2
1
3
T 2
I R F 5 4 0
O u t p u t 2
O u t 2
2
1
3
Q A
I R F 5 4 0
R 1
0 . 0 1 - 1 W
+ C 5
3 . 3 u F - 6 4 V
F 1
F U S E
1
2
3
4
5
6
7
8
J 1
O u t p u t 1
1
2
3
4
5
6
7
8
J 2
O u t p u t 2
M 2
H V
G N D
H V
C 6
1 0 4
R 2
0 . 0 1 - 1 W
C u r r A m p
R 3
1 0
R 4
1 0
R 5
1 0
R 6
1 0
H O 1
L O 1
H O 2
L O 2
I n p u t 1
G N D 1
I n p u t 2
G N D 2
13
Power MOSFET Module
T i t l e
S i z e D o c u m e n t N u m b e r R e v
D a t e : S h e e t o f
U S B C A N C o n t r o l l e r - U S B C A N . o p j 1 . 1
C A N _ U S B I n t e r f a c e
A 4
1 1 W e d n e s d a y , J u l y 2 8 , 2 0 0 4
D B 2
D B 1
P O R T V C C
E X T 5 V
D B 4
D B 3
1 2
J P 2
U S B 5 V
D B 6
D B 5
1 2
J P 3
E x t . 5 V
D B 7
R C 4 / S D I
R B 4
R C 1
R B 0 / I N T 0
R C 5 / S D O
V C C
R B 1 / I N T 1
( 1 1 , 1 2 , 1 3 , 1 4 ) : O n l y f o r U S B C o n t r o l l e r
1
2
3
C N 1 3
A D 2
V C C
A N 2
C 7
1 0 4
M C L R
R E 2 / C S
R e s e t _ S W
A N 0
1
2
3
C N 1 1
A D 0
R B 5
R E 1 / W R
R C 0
S W 2
S t a r t
1
2
3
C N 1 4
A D 3
V C C
A N 3
C 8
1 0 4
1
2
3
4
C N 5
A u x _ P o w e r
M C L R
( 1 0 ) : V + = 1 2 o r 2 4 V D C d e p e n d o n E x t e n d e d b o a r d
R 6
1 0 K
R C 3 / S C K
1
2
3
4
5
6
C N 1 0
I C D 2
V C C
1
2
3
C N 1 5
A D 4
V C C
A N 4
C 9
1 0 4
R 7
1 5 0
1
2
3
C N 7
E x t _ 5 V
R B 3 / C A N R X
P o w e r M a n a g e m e n t
R C 3 / S C K
A N 3
R B 2 / C A N T X
R A 4
1
2
5 6
9
1 0
R L Y 1
R e s e t
R A 4
V +
A N 4
R E 0 / R D
R 1
1 0 K
T X D
1
G N D
2
V C C
3
R X D
4
R s
8
C A N H
7
C A N L
6
V r e f
5
U 2
M C P 2 5 5 1
V C C
V C C
S W 1
R e s e t
1
2
3
4
5
C N 8
S P I
C 2
1 0 4
V C C
E X T 5 V
V C C
V C C
R C 7 / R X
R C 2 / P W M 1
S D O
E X T 5 V
S D I
V C C
S C K
R E 1 / W R
R C 3 / S C K
R E 2 / C S
R B 4
C A N L
C A N H
C 4
1 0 4
C A N L
C A N H
R B 0 / I N T 0
R e s e t _ S W
R A 0 / A N 0
2
R A 1 / A N 1
3
R A 2 / A N 2
4
R A 3 / A N 3
5
R A 4
6
R A 5 / A N 4
7
R B 0 / I N T 0
3 3
R B 1 / I N T 1
3 4
R B 2 / C A N T X
3 5
R B 3 / C A N R X
3 6
R B 4
3 7
R B 5 / P G M
3 8
R B 6 / P G C
3 9
R B 7 / P G D
4 0
R C 0
1 5
R C 1
1 6
R C 2 / C C P 1
1 7
R C 3 / S C K
1 8
R C 4 / S D I
2 3
R C 5 / S D O
2 4
R C 6 / T X
2 5
R C 7 / R X
2 6
G N D
3 1
V D D
3 2
M C L R
1
O S C 1
1 3
O S C 2
1 4
V D D
1 1
G N D
1 2
R E 0 / R D / A N 5
8
R E 1 / W R / A N 6
9
R E 2 / C S / A N 7
1 0
R D 0 / P S P 0
1 9
R D 1 / P S P 1
2 0
R D 2 / P S P 2
2 1
R D 3 / P S P 3
2 2
R D 4 / P S P 4
2 7
R D 5 / P S P 5
2 8
R D 6 / P S P 6
2 9
R D 7 / P S P 7
3 0
U 1
P I C 1 8 F 4 5 8
V C C
8
O U T
5
G N D
4
N C
1
Y 2
O S C 4 0
V C C
D 1
L E D
R 2
1 2 0
R B 1 / I N T 1
D B 2
D B 3
D B 4
C 3
1 0 4
D B 5
D B 6
1
2
C N 1
R e m o t e C P U R e s e t
D B 7
R 3
3 3 0
R C 7 / R X
R B 2 / C A N T X
1
2
3
4
C N 2
R S 2 3 2
R C 4 / S D I
R 4
1 5 0
S C K
D B 0
1
2
J P 1
J U M P _ 1
R B 3 / C A N R X
D B 1
R 5
1 5 0
S D I
1
2
3
4
5
C N 6
S P I
V C C
R X
S D O
T X
A N 0
A N 1
V +
C 1
1 0 4
A N 2
V C C
G N D
R C 4 / S D I
V C C
1
2
3
4
C N 4
C A N _ O U T
R B 5
V C C
V +
1
2
3
4
C N 3
C A N _ I N
G N D
R B 7
A N 0
R C 6 / T X
R C 5 / S D O
E X T 5 V
1
2
3
4
C N 9
A u x _ P o w e r
G N D
V +
R e s e t _ S W
R C 6 / T X
E X T V C C
R C 5 / S D O
R B 6
R C 2 / P W M 1
C 5
1 0 4
R C 1
1
2
3
4
5
6
7
8
9
1 0
1 1
1 2
1 3
1 4
J 1
C O N 1 4
1
2
3
4
5
6
7
8
9
1 0
1 1
1 2
1 3
1 4
J 2
C O N 1 4
R B 7
R C 4 / S D I
R C 0
R E S E T #
G N D
R C 5 / S D O
E X T V C C
P O R T V C C
R E S E T #
V C C _ I O
R B 6
1
2
3
C N 1 2
A D 1
R E 0 / R D
V C C
A N 1
C 6
1 0 4
V C C _ I O
D B 0
R C 3 / S C K
Motor Controller (PIC18F458 + 5ADs + CAN Comm.)
14
MEASURING MOTOR PARAMETERS
These are the motor parameters that are need:
Motor voltage constant e
K
(volts-sec/rad)
Motor torque constant
T
K
(lb-in/amp)
Motor armature resistance a
R
(ohms)
Motor inductance a
L
(Henries)
Motor inertia m
J
(
2
sec in lb )
Load inertia reflected to the motor armature shaft load
J
(
2
sec in lb )
Total inertia= load m
J J +
Total
J
(
2
sec in lb )
Note that the above values are stated for a single winding with dc motors, and are
the phase values for a BLDC motor. Brushless dc motors (BLDC) are usually 3 phase
synchronous motors used in a configuration to be treated as dc drives. Also note, it is
assumed that dc motors being discussed have a permanent magnet field supply. Wound
field motors are not part of this discussion.
MOTOR RESISTANCE
For the winding resistance use an ohmmeter. For a DC motor measure the armature
resistance between the 2 armature wires. The ohmic value of the armature resistance will
be very small, thus a high sensitivity ohmmeter will be needed. If it is a WYE connected
BLDC motor, the armature resistance is the line-to-line resistance. Thus divide the
resistance (l-l) by 2 to get the phase resistance. The ohmic value will also be very small.
MOTOR VOLTAGE CONSTANT
e
K
To measure e
K
of the motor, put the motor shaft in a machine lathe and rotate the
shaft at some speed [rpm] such as 1000rpm. With a dc motor, use a DC voltmeter to
measure the armature voltage. The e
K
is then the voltage you read divided by the speed in
rad/sec. Convert rpm to rad/sec as
] [
] [
or
sec] / [
] [
sec sec 60
min radias 2
min
rpm speed
v Volts
rad speed
v Volts
K
rad
x
rev
x
rev
e

]
]
]

With a BLDC motor use an ac voltmeter to measure the voltage between any 2
wires of the 3 motor wires and then convert the line-to-line voltage to the phase voltage
value by dividing the line-to-line voltage by 73 . 1 3 .
15
73 . 1
) (
) (
line to line K
phase K
e
e

MOTOR TORQUE CONSTANT


T
K
The motor torque constant (
T
K
) can be computed from the voltage constant ( e
K
)
as-
]
]
]

]
]
]


rpm
volts
K
amp
in lb
K
l l
e
T
) (
00684 . 0
The derivation for the above equation is Equate Electrical Power to Mechanical
Power converted to Watts
356 . 1 x
12
T
x x
60
2
x x 3 N I E

Where
T
: lb-in
I
: Amps
E
: Volts rms(line-to-line)
N
:rpm
Rearranging terms and simplifying:
I
T
N
E
x 00684 . 0
Where
]
]
]

,
`

.
|


A
in lb
K
I
T
rpm
volts
K
N
E
T
l l rms
e
constant, Torque
constant, emf Back
) (
Converting rpm to rad/sec
]
]
]
]
]

]
]
]
]
]

]
]
]
]
]

sec
554 . 9
2 x
sec
60 x
min x 2
min
sec 60 x x ) (
rad
v
rad
v
rev
rev v
K
l l
e

Thus
16
]
]
]
]
]

]
]
]

sec
8 . 1396
00684 . 0
554 . 9
00684 . 0 554 . 9
) (
rad
v
K
amp
in lb
K
K K
K K
l l
e T
e T
T e
MOTOR INERTIA
m
J
Motor rotor inertia can be measured by making an experiment. The inertia can be
calculated from the equation
[ ]
]
]
]


2
2
sec
rad
on accelerati x sec - in - lb Inertia ] [ on torque Accelerati in lb
Also (rearranging terms)
[ ]
2
sec
on accelerati
torque accel
Inertia in lb
DC MOTORS
To do this test it is necessary to measure the acceleration of the motor rotor and the
acceleration torque of the motor rotor. These two parameters are described as follows:
ACCELERATION This parameter is determined by putting a step in current into the
motor winding to bring the motor up to rated speed. The motor will accelerate
exponentially. The acceleration is a measure of the rate of change of velocity over a
period of time. To make this test, a dc tachometer should be connected to the motor shaft.
The output of the tachometer should be connected to a strip chart recorder. When a step
input in current is applied to the motor winding, the chart recorder will plot the rate of
change of the motor shaft velocity as a function of the tachometer output voltage. The
tachometer calibration can be used to convert volts to rpm. The acceleration is therefore
the change in velocity for the linear part of the exponential curve (sometimes refered to
as the 66% response of the exponential change in velocity) divided by the time elapsed
for the detected rate of change in velocity. The resulting calculation of the acceleration
must have the dimensions changed to be in units of rad/sec2.
TORQUE- An ammeter must be inserted in series with the motor input winding. When
the step in input current is applied to the motor input, the maximum value of current
should be noted. This current must be converted to torque. The torque is equal to the
maximum value of current observed multiplied by the motor torque constant. Torque
[lbin]= amps[a] x KT [lb-in/a]. The inertia is then the acceleration torque divided by the
acceleration - Inertia= Accel torque[lb-in]/acceleration[rad/sec2]=lb-in-sec2
17
BLDC MOTORS- The tests described thus far must be modified for a bldc motor. A
bldc motor must be tested with its servo amplifier. The step input will be a step in dc
voltage to the servo amplifier input. The voltage step should be large enough to cause the
motor to reach rated speed. With bldc motors it is not possible to measure the high
frequency phase current in a WYE connected motor. Thus some other procedure must be
used to measure the current or torque and velocity. Commercial bldc servo amplifiers
have two dc output test points. One output is a dc voltage proportional to velocity with a
given calibration. The voltage can be directly connected to a strip chart as described
previously to measure the motor acceleration, A second test output provides a dc voltage
proportional to torque or a percentage of rated torque. This calibrated voltage can also be
recorded with a stripchart recorder to observe its maximum value for a step voltage input
to the servo amplifier. The inertia can thus be calculated as done previously.
MOTOR INDUCTANCE L
This procedure assumes a model as a series equivalent R L circuit. To measure the
motor inductance uses a very low voltage ac source to the motor winding. The resistance
and inductance will be very small values. For a magnetic flux field dc motor, apply the ac
voltage to the armature winding. For a BLDC motor apply the ac voltage to one pair of
the three wires. In both cases measure the voltage and the current.
Remember that the BLDC motor is usually connected in WYE. Thus the readings
will be line-to-line. You want the phase values for the voltage, so divide the voltage by 2.
The impedance of the dc motor or the BLDC motor phase winding is then-
2 2
2 2
tan impedance s] var reactance[
] [ tan reacctance impedance The
] [
[amps] current line
[volts] voltage phase or voltage Armature
Impedance
ce resis
ohms ce resis
ohms

+

Solve for the reactance from this equation. Note that the phase resistance was
measured previously and will be small in value. The inductance can than be calculated
from
inductance x frequency x 2 s] var Reactance[
The frequency is probably going to be from the ac source at 60 Hz. Thus
Hz] frequency[ x 2
s] var reactance[
[henries] Inductance

18
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
:
:
:
lowercase Zeta
lowercase Psi
lowercase Xi
lowercase Omega
lowercase upsilon
lowercase Tau
lowercase igma AlternateS
lowercase Sigma
lowercase Rho
lowercase heta AlternateT
lowercase Theta
lowercase mega alternateO
lowercase Pi
lowercase Omicron
lowercase Nu
lowercase Mu
lowercase Lambda
lowercase kapa
lowercase Iota
lowercase Eta
lowercase Gamma
lowercase hi AlternateP
lowercase Phi
lowercase epsilon
lowercase delta
chi
beta
alpha


) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
) ( :
uppercase Zeta
uppercase Psi
uppercase Xi
uppercase Omega
uppercase Upsilon
uppercase Tau
uppercase Sigma
uppercase Rho
uppercase Theta
uppercase Pi
uppercase Omicron
uppercase Nu
uppercase Mu
uppercase Lambda
uppercase Kappa
uppercase Iota
uppercase Eta
upercase Gama
uppercase phi
uppercase epsilon
uppercase delta
uppercase chi
uppercase Beta
uppercase Alpha

19
20