c
American
Society for Engineering Education, 2011
PWM
Stage
Drive
stage
Feedback
Sensors
In a typical design, the system components, the pulse width modulator (PWM) stage, drive stage,
motor, load and sensor gain in the feedback loop are modeled. The controller is designed based
on these models such that the closed loop system will meet the specific design requirements. The
software simulation of the entire closed loop model is used to observe all system performance
criteria. After all performance criteria are achieved, the controller is implemented in hardware.
DC motor control using a PI controller is popular in many industries due to its simplicity and
accuracy. However, the most difficult and time consuming part is the tuning of the controller
parameters for operation with loads. Proper tuning of the PI controller parameters makes the
motor energy efficient. This paper discusses the modeling and simulation of a PMDC motor and
the fuzzy logic based autotuning of the control parameters. This paper is a result of an
undergraduate selfstudy in Applied Control under the direction of a faculty advisor.
2. Simulink Modeling
The physical components, like the PMDC motor, power processing unit (PPU), load, and sensor
cannot be used for the computer simulation directly. These components need to be represented
by the simulation tool, which is called modeling. This section details the Simulink2 model of all
components in the motor control system.
2.1 PMDC Motor Modeling
A PMDC motor is shown in Fig. 2. The equivalent circuit diagram of the PMDC motor is shown
in Fig. 3, and includes the armature resistance Ra , armature inductance La , back electromotive
force (emf) e a , and motor inertia J m . The DC voltage source va and mechanical load inertia J L
are shown in Fig. 3. The motor and load friction are Bm and B L , respectively. The
electromagnetic torque is Tem , load torque is T L , and motor speed is .
N
Armature
Commutator
B
r
u
s
h
text
B
r
u
s
h
Conductor
DC Supply
Ra
ia (t )
vL (t )
La
+
va (t )
ea (t ) M

J m Bm
Tem (t )
(t )
Load
JL
TL
BL
The electrical current and mechanical torque relationship for the PMDC motor can be written as,
1
ia (t )
(Va ea (t ) i a (t ) Ra )dt ,
(1)
La
Tem (t ) k t ia (t ) ,
(2)
where k t is a torque constant. Equation (1) and (2) are represented by a Simulink block diagram
1
in Fig. 4. The block is used to obtain the integration . The mechanical system and back emf
s
equations of the PMDC motor are
1
(t ) (Tem (t ) TL B (t )) d (t ) ,
(3)
J
ea (t ) k e (t ) ,
(4)
where k e is a electrical constant, the total inertia is J J m J L , and the total friction is
B Bm BL .
The Simulink model of the complete PMDC motor, based on equations (1) through (4), is shown
in Fig. 5.
1
ia
1
Va
1
s
K
kt
ia
T_em
1
s
1/J
2
w
B
iaRa
Ra
Ra
ea
ke
k_E
2
TL
(7)
(8)
S1
D2
vL (t )
Vs
A'
S2
La
ia (t )
Ra
va (t )
D1
ea (t )
J m Bm
d(t)
PWM
Tem (t )
Load
TL
(t ) J L
BL
Ref . Speed
w1(t)
err
out
i_ref
e1
Speed Controller
err
out
d(t)
Vs
Current controller
Voltage
Va
ia
TL
ia(t)
PPU
w(t)
DC MOTOR
ia1(t)
Load
Current in Amps
Via (t)
ia1(t)
1/100 s+1
CL_LPF
Scope
Speed in RPM
0.2
Scaling _CL
w1(t)
CS
Vw(t)
0.2
1/300 s+1
SL _LPF
Scaling _SL
SS
w(t)
5. Simulations
After the modeling is completed, two PI controllers are selected for the speed control and current
control loops. The Simulink model of a PI controller is shown in Fig. 8. The proportional and
integral gains of the PI controller are chosen arbitrarily. In this paper, we implement a fuzzy
logic based algorithm to autotune the PI gains, which allows the designer to avoid the
complexities in the controller design process.
1
err
1
s
ki_w
Gain 1
Integrator
Saturation
1
out
kp_w
Gain
500
rad/sec
400
300
200
100
4
Second
Fig. 9: Speed of the motor for noload to 1 Nm load transition with fixed parameter PI Controller
Amperes
20
10
10
4
5
Second
Voltage of the Motor
Volts
100
50
4
Second
Fig. 10: The armature voltage and current for noload to 1 Nm load transition with fixed parameter PI Controller
The second set of simulations changed the load from 1 Nm to 0 Nm. Fig. 11 and 12 show the
results of the simulation. Fig. 11 shows that the initial transient overshoot reaches 470 rad/sec,
which is lower than the no load initial transient and the motor reaches the steady state of 376
rad/sec within 2.50 seconds. When load changes from 1 Nm to no load at 4th second, the
overshoot reaches 440 rad/sec and undershoot reaches 360 rad/sec. The motor reaches the steady
state within 1.60 seconds after the disturbance. Fig. 12 shows changes in current and voltage due
to the load change.
Speed of the Motor
500
400
rad/sec
300
200
100
100
4
Second
Fig. 11: Speed of the motor for 1 Nm to noload transition with fixed parameter PI Controller
logicbased autotuning. The speed error, which we take as the difference between reference
speed (denoted sref ) and measured speed (denoted smeas ), and its derivative are used as the
principal signals for the adjustment of gains in speed controller. Let,
e sref smeas
(9)
R
e eprev
.
(10)
Ts
In these equations, e is the error between reference speed and measured speed, R is the error
rate, and Ts is the sampling time.
Current of the Motor
15
Amperes
10
5
0
5
4
5
Second
Voltage of the Motor
Volts
100
50
4
Second
Fig. 12: The armature voltage and current for 1 Nm to noload transition with fixed parameter PI Controller
KP
To Current
Controller
Error
KI
Error
Error Rate
I_ref
1/s
KP
Fuzzy AutoTuning
Algorithm
KI
The inputs E and R are fuzzified into three sets: positive, zero and negative, which are denoted
P, Z, and N, respectively. The input membership functions are considered as triangular and
trapezoidal as shown in Fig. 14(a). A membership function is a curve that defines how each point
in the input space is mapped to a degree of membership between 0 and 1. The input space is
referred to as the universe of discourse. A fuzzy set can be defined as4:
(11)
A {x X  A (x)}
where, X is the universe of discourse, its elements are denoted by x , and A (x) is the
membership function of x in A . Different defuzzification methods are available to derive the
crisp output from a fuzzy logicbased controller. Here, the most commonly used defuzzification
method, namely the centroid method, is considered, where the center of gravity is chosen as the
final output.
The output is expressed as,
mi zi
K
(12)
mi
where, mi is the membership grade of the i th output fuzzy set, and zi is the numerical value of
the output for which the membership grade for the i th fuzzy set is one. The output membership
functions are shown in Fig. 14(b). The gain update process can be expressed as
K I ,next K I K I
(13)
K P,next K P K P
where, KP and KI are the fixed PI controller gains, K I and K P are the outputs of the fuzzy
logicbased controller, and K is the final gain for the controller. The proportional gain KP, and
integral gain KI, are the same as the fixed parameter PI controller. The K is from 50% to 50%
of the fixed PI controller gain for both proportional and integral gain. The fuzzy logic rules for
tuning the PI controller gain are shown in Table I5.
LN
MN
MP
LP
0
(b)
0
(a)
Fig. 14. Membership functions (a) input membership functions (error and error rate) (b) output membership
functions ( Kp and KI)
Table I
Fuzzy Rules Implementation
LN large negative, MN medium negative, LP large positive, MP: medium positive, and Z zero, P positive,
N negative.
Error
Error rate
P
Z
N
LP
MP
MN
MP
Z
MP
MN
MP
LP
Noload to 1 Nm load
Without Fuzzy
With Fuzzy
500 rad/sec
465 rad/sec
2.50 seconds
1.10 seconds
396 rad/sec
380 rad/sec
320 rad/sec
340 rad/sec
1.6 seconds
0.5 seconds
Initial Overshoot
Initial Settling Time
Overshoot due to load change
Undershoot due to load change
Settling time after load change
1 Nm load to Noload
Without Fuzzy
With Fuzzy
470 rad/sec
430 rad/sec
2.50 seconds
1.2 seconds
440 rad/sec
410 rad/sec
360 rad/sec
Negligible
1.60 seconds
0.50 seconds
rad/sec
300
250
200
150
100
50
0
4
Second
Fig. 15: Speed of the motor for noload to 1 Nm load transition with fuzzy autotuning
6. Conclusions
This paper is a result of an undergraduate selfstudy in Applied Control. The selfstudy presented
the modeling of a DC motor and its motor speed controller and also investigated the fuzzy logic
based autotuning of the controller parameters. The simulation results presented in this paper
showed that the fuzzy tuning improved the dynamic performance of the motor speed responses.
The student gained experience in modeling, system controller design, and the application of
fuzzy logic based autotuning of a PI controller.
Amperes
10
5
0
5
4
5
Second
Voltage of the Motor
Volts
100
50
4
Second
Fig. 16: The armature voltage and current for noload to 1 Nm load transition with fuzzy autotuning
Speed of the Motor
450
400
350
300
rad/sec
250
200
150
100
50
0
50
4
Second
Fig. 17: Speed of the motor for 1 Nm load to noload transition with fuzzy autotuning
Amperes
10
5
0
5
4
5
Second
Voltage of the Motor
Volts
100
50
4
Second
Fig. 18: The armature voltage and current for 1 Nm load to noload transition with fuzzy autotuning
7. References
[1] Ned Mohan, Electric Drives An integrated approach, 2000 Edition, MNPERE, Minneapolis.
[2] Using Simulink, Version 6, The MathwWorks Inc, 2004
[3] R. Krishnan, Electric Motor Drive, Modeling, Analysis, and Control, 1st Edition, Prentice
Hall, 2001.
[4] Fuzzy Logic Toolbox User's Guide (The Mathworks, Natick, MA, 2004).
[5] Kala Meah, A.H.M. Sadrul Ula, Simple Fuzzy SelfTuning PI Controller for Multiterminal
HVDC Transmission Systems, Electric Power Components and Systems, Vol. 36, No. 3,
March 2008, pp 224238.