You are on page 1of 6

DC MOTOR CONTROL USING FUZZY LOGIC

CONTROLLER
Rahul Malhotra
Department of Electronics & Communication Engineering
Bhai Maha Singh College of Engineering
Muktsar, India
e-mail : blessurahul@gmail.com
Tejbeer Kaur
Department of Electronics & Communication Engineering
Adesh Institute of Engineering & Technology
Faridkot, India
e-mail : er.tejbeerbrar@gmail.com
Gurpreet Singh Deol
Department of Electrical Engineering
Adesh Institute of Engineering & Technology
Faridkot, India
e-mail: gsdeolaiet@gmail.com

AbstractConventional PID controllers were used as a control
strategy for various industrial processes from many years due to
their simplicity in operation. They used mathematical models to
control the plant for different process control applications. Fuzzy
logic based control systems were introduced by Lotfi Zadeh to
optimize the process control parameters in better way. In this
paper, we have implemented a DC motor control strategy with
the help of PID controller and then optimized with the help of
fuzzy logic controller. The fuzzy logic control strategy shows the
improvement in various control parameters like maximum
overshoot, settling time for the DC motor control as compared
with PID control strategy. This shows the superiority of fuzzy
logic controller over proportional integral derivative controller.
Keywords- fuzzy logic controller, PID controller, DC motor
I. INTRODUCTION
PID (proportional integral derivative) control is one of the
earlier control strategies. Its early implementation was in
pneumatic devices, followed by vacuum and solid state analog
electronics, before arriving at todays digital implementation of
microprocessors. It has a simple control structure which was
understood by plant operators and which they found relatively
easy to tune. Since many control systems using PID control
have proved satisfactory, it still has a wide range of
applications in industrial control. PID control has been an
active research topic for many years. Since many process
plants controlled by PID controllers have similar dynamics it
has been found possible to set satisfactory controller
parameters from less plant information than a complete
mathematical model. Fuzzy logic is a method of rule-based
decision making used for expert systems and process control
that emulates the rule-of-thumb thought process used by human
beings. Due to these properties, fuzzy logic can be used to
control a process that a human can control manually with
expertise gained from experience. The linguistic control rules
that a human expert can describe in an intuitive and general
manner can be directly translated to a rule base for a fuzzy
logic controller. In this paper DC motor is first tuned using
fuzzy logic controller and then optimized using fuzzy logic
controller to improve the various process parameters follow.
II. PROPORTIONAL INTEGRAL DERIVATIVE
CONTROLLER
The PID controller is the most common form of feedback.
It was an essential element of early governors and it became
the standard tool when process control emerged in the 1940s.
In process control, more than 95% of the control loops are of
PID type, most loops are actually PI control. PID controllers
are today found in all areas where control is used. The
controllers come in many different forms. There are
standalone systems in boxes for one or a few loops, which are
manufactured by the hundred thousands yearly. PID control is
an important ingredient of a distributed control system. The
controllers are also embedded in many special purpose control
systems. PID control is often combined with logic, sequential
functions, selectors, and simple function blocks to build the
complicated automation systems used for energy production,
transportation, and manufacturing. Many sophisticated control
strategies, such as model predictive control, are also organized
hierarchically. PID control is used at the lowest level; the
multivariable controller gives the setpoints to the controllers at
the lower level. It is an important component in every control
engineers tool box. PID controllers have survived many
changes in technology, from mechanics and pneumatics to
microprocessors via electronic tubes, transistors, integrated
circuits. The microprocessor has had a dramatic influence on
the PID controller. Practically all PID controllers made today
are based on microprocessors. This has given opportunities to
provide additional features like automatic tuning, gain
scheduling, and continuous adaptation.
Controllers are designed to eliminate the need for continuous
operator attention. Cruise control in a car and a house
thermostat are common examples of how controllers are used
to automatically adjust some variable to hold the measurement
(or process variable) at the set-point. The set-point is where
Rahul Malhotra*et al. / (IJAEST) INTERNATIONAL JOURNAL OF ADVANCED ENGINEERING SCIENCES AND TECHNOLOGIES
Vol No. 8, Issue No. 2, 291 - 296
ISSN: 2230-7818 @ 2011 http://www.ijaest.iserp.org. All rights Reserved. Page 291
I
J
A
E
S
T
you would like the measurement to be. Error is defined as the
difference between set-point and measurement.
error = set-point - measurement
The variable being adjusted is called the manipulated variable
which usually is equal to the output of the controller. The
output of PID controllers will change in response to a change
in measurement or set-point. Manufacturers of PID controllers
use different names to identify the three modes. These
equations show the relationships:
P (Proportional) = 100/gain
I (Integral) = 1/reset (units of time)
D (Derivative) = rate = pre-act (units of time)
Depending on the manufacturer, integral or reset action is set
in either time/repeat or repeat/time. One is just the reciprocal
of the other. Note that manufacturers are not consistent and
often use reset in units of time/repeat or integral in units of
repeats/time. Derivative and rate are the same. Choosing the
proper values for P, I, and D is known as PID Tuning.
A. Proportional Band
First, With proportional band, the controller output is
proportional to the error or a change in measurement
depending on the controller.
controller output = error*100/P band

Proportional controller offset, that is, deviation from set-
point is present. Increasing the controller gain will make the
loop go unstable. Integral action was included in controllers to
eliminate this offset.
B. Integral
The integral action, the controller output is proportional to
the amount of time the error is present. Integral action
eliminates offset.
Controller Output =

Integral action gives the controller a large gain at low
frequencies that results in eliminating offset and "beating
down" load disturbances. The controller phase starts out at 90
degrees and increases to near 0 degrees at the break frequency.
This additional phase lag is what you give up by adding
integral action. Derivative action adds phase lead and is used to
compensate for the lag introduced by integral action.
C. Derivative
Derivative action, the controller output is proportional to
the rate of change of the measurement or error. The controller
output is calculated by the rate of change of the measurement
with time.
Controller Output =
Where m is the measurement at time t.
Some manufacturers use the term rate or pre-act instead of
derivative. Derivative, rate, and pre-act are the same thing.
Derivative = Rate = Pre Act
Derivative action can compensate for a changing
measurement. Thus derivative takes action to inhibit more
rapid changes of the measurement than proportional action.
When a load or set-point change occurs, the derivative action
causes the controller gain to move the "wrong" way when the
measurement gets near the set-point. Derivative is often used
to reduce overshoot.
Derivative action can stabilize loops since it adds phase
lead. Generally, with the help of derivative action, more
controller gain and reset can be obtained integral action
III. FUZZY LOGIC CONTROLLER
Fuzzy logic is a method of rule-based decision making used
for expert systems and process control that emulates the rule-
of-thumb thought process used by human beings. The basis of
fuzzy logic is fuzzy set theory which was developed by Lotfi
Zadeh in the 1960s. Fuzzy set theory differs from traditional
Boolean (or two-valued) set theory in that partial membership
in a set is allowed. Traditional Boolean set theory is two-valued
in the sense that a member belongs to a set or does not and is
represented by 1 or 0, respectively. Fuzzy set theory allows for
partial membership, or a degree of membership, which might
be any value along the continuum of 0 to 1. A linguistic term
can be defined quantitatively by a type of fuzzy set known as a
membership function. The membership function specifically
defines degrees of membership based on a property such as
temperature or pressure. With membership functions defined
for controller or expert system inputs and outputs, the
formulation of a rule base of IF-THEN type conditional rules is
done. Such a rule base and the corresponding membership
functions are employed to analyze controller inputs and
determine controller outputs by the process of fuzzy logic
inference. By defining such a fuzzy controller, process control
can be implemented quickly and easily. Many such systems are
difficult or impossible to model mathematically, which is
required for the design of most traditional control algorithms.
In addition, many processes that might or might not be
modeled mathematically are too complex or nonlinear to be
controlled with traditional strategies. However, if a control
strategy can be described qualitatively by an expert, fuzzy logic
can be used to define a controller that emulates the heuristic
rule-of-thumb strategies of the expert. Therefore, fuzzy logic
can be used to control a process that a human can control
manually with expertise gained from experience. The linguistic
control rules that a human expert can describe in an intuitive
and general manner can be directly translated to a rule base for
a fuzzy logic controller.
IV. PROBLEM FORMULATION
A DC motor is taken as a case study and the control is
achieved using conventional PID controller and intelligent
fuzzy logic based controller. The comparison of both the
controller performance is analyzed.
V. MATHEMATICAL MODELING & CONTROLLER
DESIGN
The basic conventional feedback controller is shown in figure
1. In conventional PID controller the controller and the
process are in series where as a feedback from the output is
given to the input. DC motor is mathematically modeled using
Identify applicable sponsor/s here. If no sponsors, delete this text box.
(sponsors)
Rahul Malhotra*et al. / (IJAEST) INTERNATIONAL JOURNAL OF ADVANCED ENGINEERING SCIENCES AND TECHNOLOGIES
Vol No. 8, Issue No. 2, 291 - 296
ISSN: 2230-7818 @ 2011 http://www.ijaest.iserp.org. All rights Reserved. Page 292
I
J
A
E
S
T
experimental data available and the transfer function of the
system is achieved as
s B R K S BL J R Js L
K
s V
s
a
a a a
) ( ) ( ) (
) (
2 2 3
+ + + +
=
u

The stability analysis of the system is done and the bode plot
of the system is plotted which is shown in figure 2. The gain
margin is 20 db where as the phase margin is 56.2.

VI. PID CONTROLLER DESIGN AND TUNING
A feedback control system measures the output variable and
sends the control signal to the controller. The controller
compares the value of the output signal with a reference value
and gives the control signal to the final control element.
The characteristic equation obtained as below
3 2
6 5 0
cu
s s s K + + + =
(1)
The equation of ideal PID controller is


The real PID controller is
1 1
( ) ( )
1
i d
c
i d
s s
u s K e s
s s
t t
t ot
| || | + +
=
| |
+
\ .\ .

The PID controller is traditionally suitable for second and
lower order systems. It can also be used for higher order plants
with dominant second order behaviour. The Ziegler-Nichols
(Z-N) methods rely on open-loop step response or closed-loop
frequency response tests. A PID controller is tuned according
to a table based on the process response test. According to
Zeigler-Nichols frequency response tuning criteria
0.6
p cu
K K = , 0.5
i
T t = and 0.125
d
T t =
For the PID controller, the values of tuning parameters
obtained are K
p
=29,
i
=1.43,
d
=0.26 and
P= 26, I= 19.4, D=8.5
Usually, the initial design values of PID controller obtained
by all means needs to be adjusted repeatedly through computer
simulations until the closed loop system performs or
compromises as desired. This stimulates the development of
intelligent tools that can help the engineers to achieve the
control for entire operating envelops.
VII. DC MOTOR CONTROL USING FUZZY LOGIC
CONTROLLER
In classical control techniques PID controller was used as a
standard control structure.
Due to nonlinearities in the process the performance of the
industrial machinery is greatly distorted and the efficiency is
reduced. The new technique which uses fuzzy and PID
controllers is considered as the extension of the conventional
technique, because it preserves the linear structure of PID
controller. These controllers are designed using the basic
principle of fuzzy logic control to obtain a new controller that
possesses analytical formulas similar to digital PID controllers.
Fuzzy PID controllers have variable control gains in their linear
structure. These variable gains are nonlinear function of the
errors and changing rates of error signals. These variable gains
help in improving the overall performance due to their
characteristics features like self-tuned mechanism which can
adapt to rapid changes of the errors and rate of change of error
caused by time delay effects, nonlinearities and uncertainties of
the process.
In this paper we have considered different linguistic
variables and details of these variables are shown in table 1.
Designing a good fuzzy rule base is the key to obtain
satisfactory control performance for a particular operation.
Classical analysis and control strategy are incorporated in the
rule base. The rule base used in simulation is summarized in
Table II. Each rule has the form IF e(t) is NB AND e(t) is NB
THEN u(t) is NB. The control literature has worked towards
reducing the size of the rule base and optimizing the rule base
using different optimization techniques like GA, PSO for
intelligent controller. At last defuzzified output is obtained
from the fuzzy inputs. In this research work centroid method of
de fuzzification is used. It is given as below.
VIII. SIMULINK REPRESENTATION OF DC MOTOR CONTROL
USING FUZZY LOGIC CONTROLLER
Simulink is a software package for modeling, simulating,
and analyzing dynamical systems. It supports linear and
nonlinear systems, modeled in continuous time, sampled time,
or a hybrid of the two. DC motor control using simulink is as
given below.
A comparative study of PID and fuzzy logic controllers has
been given. In this work the steady state and transient state
parameters maximum overshoot, settling time have been taken
up for the study.
2
1
%
p
M e
t

= ,
2
1
p
n
t
t
e
=

,
2
1
2
1
tan
1
r
n
t

| |

|
|
\ .
=


IX. CONCLUSION
In this paper a DC motor is controlled using fuzzy logic and
PID controller. A mathematical model to control the DC motor
is developed and the motor is controlled using conventional
PID controller. The simulation results so obtained show that
the PID controller gives high overshoot and settling time.
Hence, fuzzy logic controller design was proposed and
implemented using the principles of artificial intelligence. The
fuzzy logic control is implemented and the response is
compared with conventional PID controller. The fuzzy logic
Rahul Malhotra*et al. / (IJAEST) INTERNATIONAL JOURNAL OF ADVANCED ENGINEERING SCIENCES AND TECHNOLOGIES
Vol No. 8, Issue No. 2, 291 - 296
ISSN: 2230-7818 @ 2011 http://www.ijaest.iserp.org. All rights Reserved. Page 293
I
J
A
E
S
T
control shows a better control of motor parameters as
compared with the conventional PID controller.
A. Tables and Figures
Table 1: Linguistic variable of fuzzy logic control
Error
e(t)
Change in error e(t) Controller output u(t)
NB NB NB
NM NM NM
NS NS NS
ZO ZO ZO
PS PS PS
PM PM PM
PB PB PB

Table 2: IF-THEN rule base for fuzzy logic control


Table 3: Comparison of Maximum overshoot and settling time
for PID and FLC controllers
S.
No
Controller Maximum
Overshoot
Settling Time
1
PID Controller 44.6% 11.42 sec
2
Fuzzy logic controller 7.21% 7.78 sec

Table 4: Comparison of Integral of Absolute Error and
Integral of Time and Absolute Error for PID and FLC
controllers

S.
No
Controller IAE ITAE
1
PID Controller 0.92 1.84
2
Fuzzy logic controller 16.23 96.47



Figure 1: Block diagram of classical control architecture


Figure 2: Frequency domain analysis of the system

Figure 3: Architecture of fuzzy control


Figure 4: Mamdani fuzzy inference system developed for
fuzzy controller


Figure 5: Triangular and trapezoidal input membership
function for input (error)


Figure 6: Triangular and trapezoidal input membership
function for input (cherror)

Rahul Malhotra*et al. / (IJAEST) INTERNATIONAL JOURNAL OF ADVANCED ENGINEERING SCIENCES AND TECHNOLOGIES
Vol No. 8, Issue No. 2, 291 - 296
ISSN: 2230-7818 @ 2011 http://www.ijaest.iserp.org. All rights Reserved. Page 294
I
J
A
E
S
T

Figure 7: Triangular and trapezoidal input membership
function for output (contr)

Figure 8: Rule viewer for fuzzy inference system

Figure 9: Surface view of FIS

Figure 10: Step response of process with feedback PID
controller


Figure 11: Graph for error signal


Figure 12: Step response of system with fuzzy logic controller


Figure 13: Comparison between pid controller and fuzzy
controller
REFERENCES
[1] [1] Erdal Kayacan and Okyay kaynak, An Adaptive Grey Fuzzy PID
Controller With Variable Prediction Horizon, SCIS&ISIS2006 @
Tokyo, Japan (September 20-24, 2006); 760-765
[2] B.G. Hu, G.K.I Mann and R.G Gosine, New methodology for
analytical and optimal design of fuzzy PID controllers, IEEE
Transaction of fuzzy systems, vol. 7, no. 5, pp. 521-539, 1999
[3] Awang N.I. Wardana, PID-Fuzzy Controller for Grate Cooler in
Cement Plant, IEEE transaction of fuzzy system, no.7, vol. 32, 2005,
1345-1351.
Rahul Malhotra*et al. / (IJAEST) INTERNATIONAL JOURNAL OF ADVANCED ENGINEERING SCIENCES AND TECHNOLOGIES
Vol No. 8, Issue No. 2, 291 - 296
ISSN: 2230-7818 @ 2011 http://www.ijaest.iserp.org. All rights Reserved. Page 295
I
J
A
E
S
T
[4] Han-Xiong Li,Lei Zhang, Kai-Yuan Cai, And Guanrong Chen, An
Improved Robust Fuzzy-PID Controller With Optimal Fuzzy
Reasoning, IEEE Transactions On Systems, Man, And Cybernetics Part
B: Cybernetics, Vol. 35, No. 6, December 2005; 1283-1292
[5] Isin Erenoglu, Ibrahim Eksin, Engin Yesil and Mujde Guzelkaya, An
intelligent hybrid fuzzy PID controller, in Proceedings of 20
th
European
Conference on Modeling and Simulation, 2006.
[6] [6] Leehter Yao and Chin-Chin Lin, Design of Gain
Scheduled Fuzzy PID Controller, World Academy of Science,
Engineering and Technology 1 2005, 152-156
[7] [7] Zhen-Yu Zhao, Masayoshi Tomizuka, Satoru Isaka, Fuzzy
gain scheduling of PID controllers, IEEE transactions on
systems, man and cybernetics, vol. 23, no. 5, September/October
1993; 1392-1398.
[8] [8] B. Nagaraj, S. Subha, B. Rampriya, Tuning Algorithms for
PID Controller Using Soft Computing Techniques, IJCSNS
International Journal of Computer Science and Network
Security, VOL.8 No.4, April 2008; 278-281
[9] [9] Zeyad Assi Obaid, Nasri Sulaiman and M.N. Hamidon,
Developed Method of FPGA-based Fuzzy Logic Controller
Design with the Aid of Conventional PID Algorithm,
Australian Journal of Basic and Applied Sciences, 3(3): 2724-
2740, 2009
[10] [10] Zeyad Assi Obaid, Nasri Sulaiman, M. H. Marhaban and
M. N. Hamidon, Analysis and Performance Evaluation of PD-
like Fuzzy Logic Controller Design Based on Matlab and
FPGA, IAENG International Journal of Computer Science,
37:2
[11] [11] W. L. Bialkowski, Control of the Pulp and Paper Making
Process The Control Handbook (CRC Press, Boca Raton, FL,
USA), 1996, pp. 1219-1242.
[12] [12] K. J. strm, and T. Hagglund, PID Controllers: Theory,
Design and Tuning Triangle Park, NC, USA, 2nd Edition,1995.
[13] [13] Y. Bolat, Matlab-SIMULINK + PIC Tabanl Bulank
Mantk Denetleyici Tasarmi ve Gerek Zamanl Scaklk
Kontrol Uygulamasi, Master of science.
[14] [14] Stephen K. Park and Keith W. Miller. Random number
generators: Good ones are hard to find. CACM, 31(10):1192
1201, 1988.
[15] [15] C. R. Houck, J. Joines. and M.Kay, A genetic algorithm
for function optimization: A Matlab implementation, ACM
Transactions on Mathematical Software, 1996.
[16] [16] Cheong, F., Lai, R., Constraining the Optimization of
a Fuzzy Logic Controller Using an Enhanced Genetic
Algorithm, IEEE Transactions on Systems, Man and
Cybernetics-Part B: Cybernetics, Vol 30, No.1, Feb 2000.
[17] http://www.expertune.com/tutor.html
[18] http://www.siam.org/books
Rahul Malhotra*et al. / (IJAEST) INTERNATIONAL JOURNAL OF ADVANCED ENGINEERING SCIENCES AND TECHNOLOGIES
Vol No. 8, Issue No. 2, 291 - 296
ISSN: 2230-7818 @ 2011 http://www.ijaest.iserp.org. All rights Reserved. Page 296
I
J
A
E
S
T

You might also like