You are on page 1of 13

AC 2011-1439: FUZZY LOGIC-BASED PMDC MOTOR CONTROLLER AN UNDERGRADUATE STUDENT PROJECT

Kala Meah, York College of Pennsylvania


Kala Meah received the B.Sc. degree from Bangladesh University of Engineering and Technology in
1998, the M.Sc. degree from South Dakota State University in 2003, and the Ph.D. degree from the
University of Wyoming in 2007, all in Electrical Engineering. From 1998 to 2000, he worked for several
power companies in Bangladesh. Currently, Dr. Meah is an Assistant Professor in the Electrical and Computer Engineering, Department of Physical Science, York College of Pennsylvania. His research interest
includes electrical power, HVDC transmission, renewable energy, energy conversion, and engineering
education.
Anh Ngo Viet Nguyen
2007-2010 Electrical Engineering student at York College of Pennsylvania, York, PA 2010-Now Work as
design engineer at Qualastat Electronics Inc. in Chandler, AZ
Patrick Martin, York College of Pennsylvania
K Vaisakh, Andhra University, AP,India
Dr.K.Vaisakh received the B.E degree in electrical engineering from Osmania University, Hyderabad, India in 1994, M.Tech degree from JNT University, Hyderabad, India in 1999, and Ph.D. degree in electrical
engineering from the Indian Institute of Science, Bangalore, India in the year 2005.
Currently, he is working as a professor in the department of electrical engineering, AU College of engineering, Andhra University, Visakhapatnam, AP, India. His research interests include optimal operation
of power system, voltage stability, FACTS, power electronic drives and power system dynamics.

c
American
Society for Engineering Education, 2011

Fuzzy Logic-Based PMDC Motor Controller - an Undergraduate Student


Project
Abstract: Applied control is the second course in the control sequence after the traditional
automatic control systems course. Interested students take applied control to experience the
practical applications of control theories and to explore the other branches in control systems. In
this offering of the course, a student completed a project as an independent study under the
supervision of the faculty. The student studied the implementation of a fuzzy logic-based PMDC
motor controller; additionally, the student modeled the motor and the power processing unit,
controller implementation, as well as simulated the final system design. During the project, the
student gained experience in modeling the physical quantities such as motor, sensors, and DCDC converter and representing them using the mathematical equations and Simulink blocks.
Furthermore, the student designed the controller for the systems and included the fuzzy logicbased auto-tuning for the controller. Simulation results presented in this paper compare the fixed
parameter based controller performance with the fuzzy logic-based auto tuning controller.
Key Words: Fuzzy Tuning, PMDC Motor Controller, and Simulink Model.
1. Introduction
The purpose of using electric drives in the field of motor control is the precise control of the
motor (the speed, the torque, and the position of the shaft) and saving energy. A recent study by
the United States Department of Energy points out that the conservation methods using electric
drives can save energy equal to the annual electricity use by the entire state of New York1.
Typically, two types of motors are used in the industry: alternating current (AC) motors and
direct current (DC) motors. The AC motors are often used in industrial application because of
their capability to handle large power. The DC motors are often used in applications like electric
vehicles where AC supply is not readily available. The DC motor has a simple mechanical
structure and offers simple mechanisms for accurate control of speed and/or torque. However,
the design of electric motor drives for either DC or AC motors is relatively complicated. Fig. 1
shows the basic blocks of a typical closed-loop control system of an electric motor. The most
important component in the design and implementation of a motor drive is the controller.
Ref.
Command
Controller

PWM
Stage

Drive
stage

Feedback

Sensors

Fig. 1: Typical motor control system

Motor and Load

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 auto-tuning of the control parameters. This paper is a result of an
undergraduate self-study 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

Fig. 2: PMDC motor

Ra

ia (t )

vL (t )

La
+

va (t )

ea (t ) M
-

J m Bm

Tem (t )

(t )

Load

JL

TL

BL

Fig. 3: Equivalent circuit diagram of the PMDC motor

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 .

Fig. 4: Block diagram of electrical current and mechanical torque equation

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

Fig. 5: Simulink model of the complete PMDC motor

3. Modeling of Power Processing Unit and Sensors


The principle of speed control for the DC motor is developed from the basic emf equation of the
motor. Two control inputs are available via the field and armature of the motor. The motor speed
is inversely proportional to field current and proportional to the armature voltage, which is
indicated by the following expression3.
(V i R )
(5)
a a a
if
where, = speed of the motor in rad/sec, Va = armature supply voltage, i a = armature current
Ra = armature resistance, and i f = field current. In the case of the PMDC motor, i f is constant,
and i a depends on Va and the load, resulting in speed being proportional to the armature voltage
alone. Varying the magnitude of applied armature voltage changes the speed. Reversing the
applied armature voltage changes the direction of rotation of the motor. A two-quadrant chopper
circuit is used in this project to control the dc supply to the armature because the motor will be
operated only in the forward direction. The power processing unit (PPU) or electric drive is
shown in Fig. 6 along with the PMDC motor and PWM. The applied armature voltage can be
written as,
v a (t ) Vs d (t )
(6)
where, Vs is the dc supply and d(t) is the duty ratio of the PWM device. Current and speed
sensors are modeled as a gain factor and can be expressed as:
Current Sensor Gain =
Speed Sensor Gain =

Current Sensor Output Voltage


Current Sensor Input Current

Speed Sensor Output Voltage


Speed Sensor Input Speed

(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

Fig. 6: Power processing unit and motor

4. Complete model of the PMDC motor with feedback loop


The complete Simulink model of the PMDC motor with an inner current control loop, and an
outer speed control loop with compensator is shown in Fig. 7. The PMDC motor is represented
here as the DC MOTOR sub block. The current and speed sensors gain factors were considered
as 0.2 and multiplied by a scaling factor 5.0 to make the feedback loop gain 1.0. The reference
speed (Ref. Speed) is in rad/sec, and the load (Load) is in Nm for the Simulink simulation.
Voltage
w_ref
e

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

Fig. 7: Complete Simulink model of the PMDC motor with controllers

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 auto-tune 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

Fig. 8: Simulink model of a PI controller

5.1 Simulations without Fuzzy Auto-Tuning


We performed two sets of simulations without the fuzzy auto-tuning algorithm: 1) start the motor
at no-load and change the load to 1 Nm at 4th second, 2) start the motor at 1 Nm and change the
load to no-load at 4th second. The reference speed for the simulation is 376 rad/sec. Fig. 9 and 10
show the speed of the motor and the armature voltage and current for the first set of the
simulation. Fig. 9 shows the initial overshoot is up to 500 rad/sec and the motor takes 2.50
seconds to reach steady state. We increased the load from 0 Nm to 1 Nm at 4th second and the
speed undershoot dropped to 320 rad/sec in response to the load increase and the overshoot
reached 396 rad/sec. The controllers acted on it and reached a steady state value of 376 rad/sec
within 1.60 seconds. Fig. 10 shows the changes in current and voltage with respect to load
change as expected.
Speed of the Motor
600

500

rad/sec

400

300

200

100

4
Second

Fig. 9: Speed of the motor for no-load to 1 Nm load transition with fixed parameter PI Controller

Current of the Motor

Amperes

20

10

-10

4
5
Second
Voltage of the Motor

Volts

100

50

4
Second

Fig. 10: The armature voltage and current for no-load 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 no-load transition with fixed parameter PI Controller

5.2 Fuzzy Logic Based Auto-Tuning of the PI Controller


For this portion of the simulation, we combine the speed controller with the fuzzy logic-based
controller to update the PI controller parameters according to the diagram in Fig. 13. The
proportional gain, KP, and integral gain, KI, are continuously updated on-line through fuzzy

logic-based auto-tuning. 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 no-load transition with fixed parameter PI Controller

KP

To Current
Controller

Error
KI
Error
Error Rate

I_ref

1/s

KP
Fuzzy AutoTuning
Algorithm

KI

Fig. 13. Schematic diagram of fuzzy logic-based self-tuning PI controller

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 de-fuzzification methods are available to derive the
crisp output from a fuzzy logic-based controller. Here, the most commonly used de-fuzzification
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
logic-based 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

5.3 Simulations with Fuzzy Auto-Tuning


Fig. 15 and 17 show the simulation results of the motor speed with fuzzy auto-tuning for two
different scenarios. Fuzzy logic based auto-tuning has the ability to adjust the controller gain
values on-line to improve the system performance. Fig. 16 and 18 show the respective changes in
current and voltage due to the load change. A comparison of speed responses of the motor
between the fixed parameter controller and fuzzy-auto tuning controller is shown in Table II. It
can be seen from the Table II that fuzzy logic based auto-tuning improved the motor speed
responses by minimizing transient overshoot, undershoot, and settling time.
Table II: Comparison of motor speed responses
Parameter

No-load 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 No-load
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

Speed of the Motor


500
450
400
350

rad/sec

300
250
200
150
100
50
0

4
Second

Fig. 15: Speed of the motor for no-load to 1 Nm load transition with fuzzy auto-tuning

6. Conclusions
This paper is a result of an undergraduate self-study in Applied Control. The self-study presented
the modeling of a DC motor and its motor speed controller and also investigated the fuzzy logic
based auto-tuning 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 auto-tuning of a PI controller.

Current of the Motor


15

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 no-load to 1 Nm load transition with fuzzy auto-tuning
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 no-load transition with fuzzy auto-tuning

Current of the Motor


15

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 no-load transition with fuzzy auto-tuning

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 Self-Tuning PI Controller for Multi-terminal
HVDC Transmission Systems, Electric Power Components and Systems, Vol. 36, No. 3,
March 2008, pp 224-238.

You might also like