You are on page 1of 6

Design, Implementation, and Simulation of a

PLC Based Speed Controller Using Fuzzy Logic

A. M. Graham, Member, IEEE M.Etezadi-Amoli, Senior Member, IEEE


Departmentof Electrical Engineering Department of Electrical Engineering
The University of Nevada-Reno The University of Nevada-Reno
Reno, NV 89557 Reno, NV 89557

Abstract: Successful implementation of the Euzzy method for speed PLC as the primary cerebrum is a common practice in
control of a motor I generator set using a general-purpose industrial plants. However, in order to accomplish PID
programmable logic controller (PLC) is demonstrated in this paper. control from within a PLC, one frequently needs a PID
Speed control of DC motors via a changing armature voltage is a coprocessor that can be programmed in a language other than
common practice throughout industry at the present time. In
addition, general-purpose PLCs are the most common controllers
the standard PLC ladder logic. These coprocessors, which are
utilized in the control of power plants and industrial plants. often obtained from a company other than the PLC
However, this work suggests a method for increasing the utilization manufacturer, can add a significant amount to the overall PLC
level of an existing general-purpose PLC. In effect, the PLC is cost and therefore work against the goal of reducing the cost
requested to perform the additional task of speed control using the of the control system. In addition, the performance of the
elegant and effective fuzzy scheme. With a control scheme based on controller is still hindered by the limitations of PID control.
fuzzy methods, the speed control algorithm was accomplished from On the other hand, in highly nonlinear cases where the
within the standard PLC ladder-logic. In addition, simulations were process is relatively slow (changes take place on the order of
performed for a speed governor for a typical 11 MW steam turbine. milliseconds rather than microseconds), control schemes based
Keywords: Fuzzy Methods, Speed Control on fuzzy methods often allow much simpler controller design
than their classical PID counterparts. Accurate and responsive
I. INTRODUCTION control can be achieved using fuzzy control methods without
the need for highly involved mathematical modeling and an
In the majority of all applications involving rotating additional PID coprocessor module.
machinery, a speed controller must be present to govern the Thus the thought is to eliminate the need for these stand-
speed of the device. Currently, most speed control problems, alone controllers and implement the speed controllers from
rotational or linear, use a dedicated digital or microprocessor within the PLC using a control scheme other than PID. Due to
based controller implementing some combination of PID the inherently slow nature of most process type applications
control scheme. PID based controllers are typically very where a general purpose PLC is being utilized, fuzzy control
reliable, however, they often have several limitations that can methods offer a desirable alternative to PID controllers.
drastically reduce their performance. These limitations
include: n. FUZZY CONTROL
Most often the PID speed controllers are implemented Fuzzy control methods are based on the idea of fuzzy sets
using a dedicated controller, which can increase the cost brought about in 1965 by Lotfi Zadeh of the University of
of the overall control system. California, Berkeley [ 11. Fuzzy systems are knowledge-based
The response of standard PID controllers can be severely (or rule-based) systems that use a set of fuzzy rules of the IF-
limited in applications where the process environment is THEN form to determine the output of the controller given a
set of inputs. Unlike classical methods, the control system
constantly changing. An example of such an environment
engineer does not have to develop an extensive mathematical
is that of a steam turbine / generator, where temperatures,
model for the process of concern to design a successful
levels, and pressures are constantly changing the
controller. This is especially time saving when the plant
dynamics of the system.
model is highly nonlinear and the differential equations
The PID controllers are often limited in highly nonlinear describing the plant are not easily obtained. In fuzzy based
cases and do not respond with the required accuracy for control, instead of using mathematics to model the plant,
obtaining acceptable control. linguistic terms are used to create fuzzy subsets, a fuzzy rule-
The PID controllers require the system designer to base, and a fuzzy output. The fuzzy rule-base is developed
develop an extensive mathematical model of the control from one or more experts knowledge concerning the device
process, which is not always easily achieved. or process that is to be controlled.
For a general fuzzycontroller, one or more crisp inputs are
The need for a stand-alone device, one of the main brought into the controller and fuzzified, or mapped into the
downfalls of PID controllers, can easily be eliminated by fuzzy realm, using fuzzy membership functions. Once
implementing the control scheme from within a general- fuzzified, the inference engine applies the hzzy rule-base to
purpose programmable logic controller (PLC). Utilizing a the inputs to determine how the controller should react and a

0-7803-6420-1/00/$10.00(c) 2000 IEEE 2415


set of fizzy outputs is obtained. The fuzzy outputs are then
defuzzifiedto produce a final crisp output. Table 1. Fuzzy Rule Table
A typical fuzzy control scheme is broken down into several
different stages including the fuzzification process, the Speed Error
inference process, and the defuzzification process, as depicted E
w
in Fig. 1. a

m
Fuzzy .a
Rule-Base a

Apart from the main design characteristics, there are several


additional features that are incorporated into the fuzzy speed
controller that enhance the overall performance and flexibility
of the controller. For the triangle membership functions AAV,
SE, and ASE, the widths of the bases are left as variables.
These variables, nicknamed scaling parameters go, gl, and g2,
respectively, are to be specified by the operator and can
drastically effect the response of the controller. The
parameters give the operator the ability to change the
characteristics of the controller during any stage of the control
Fig. 1. Typical Fuzzy Control StruNCture. process. In effect, the parameters allow the operator to
redefine the characteristics of the fuzzy subsets that make up
111. FUZZY SPEED CONTROLLER DESIGN the AAV,SE, and ASE fuzzy sets.
In addition to the three scaling parameters, a parameter
The application of fuzzy methods to power systems and nicknamed fine is introduced for fine-tuning of the change
numerous other fields has recently become commonplace.

0-7803-6420-1/00/$10.00( c ) 2000 IEEE 2476


DC motor. The optical encoder is mounted such that it detects accurate and responsive controller is obtained.
a pulse every time a change (light to dark or vice-versa)
occurs. The number of pulseshecond is then counted by the V. LABORATORY RESULTS
high-speed counter module and converted to a r/min value.
This reading is used by the fuu;y algorithm as the speed The results of several experiments regarding the PLC-based
feedback signal. fuzzy speed controller are presented next. In each experiment,
The overall diagram of the setup for the fuzzy speed different values for the three fuzzy tuning parameters were
controller implementation is shown in Fig. 2. chosen. The remaining tuning parameter, fine, was set to
equal 1 if the Speed Error was greater than + 25 r/min. 0.1 if
conrtant
the Speed Erro; less than + 25r/min, and 0.01 if theSpeed
Comt + Excitation - Error less than + 5 r/min. The three membership function
+ Field - tuning parameters, go, gl, and g2, were varied in order to
determine their effect on the overall response of the fuzzy
Variable speed controller. Experiments were performed for four case
Driving studies as outlined in Table 2.
Table 2. PLC Speed Controller Case Studies Outline

20.0 10.0
50.0 10.0
20.0 50.0

Case #1 was determined to have the ideal response curve.


Therefore, each subsequent experiment is compared to this
case. For each experiment, the operator attempts to hold the
speed of the synchronous generator at 400 r/min for 30
seconds, 800 r/min for 30 seconds, and 1200 r/min for 120
seconds.

A. Case #1
Fig. 2. Motor Generator Set Implementation Setup
The response curve for the fuzzy speed controller for go =
The overall goal of the fuzzy speed controller was to allow 1.5, gl =: 20.0, and = 10.0 is shown in Fig. 3.
the operator to bring the driving motor, and hence the
1200 -
separate stages. For this application, a HMI panel was
constructed in order to allow the operator to communicate
1000.
with the PLC by changing certain control characteristics and
setpoints of the fiuzy speed controller without changing the ~o
PLC ladder logic program. The HMI communicates with the
PLC via an RS-232 serial communicationlink and can be used 1 Boo ..
to transmit and receive data to and from the PLC.
The HMI gives the operator the ability to change the desired v, 400 -.

speed of the fuzzy controller. The operator can use up to three


zoo
preset speeds, Slow Roll (400 r/min), Idle (800 r/min),
.I

and Rated (1200 r/min) to ramp up the motor speed. These 0 ,

0-7803-6420-1/00/$10.00(c) 2000 IEEE 2.477


B. Case #2 the desired value of 800 r/min. Increasing g l in effect widens
the width of the Speed Error membership functions, thereby
defining the interval between -25 and +25 (compared to -10
and +lo) as a Just Right Speed Error.

D. Case #4
1200 .
Case #4 demonstrates the effect of changing scaling
1000 . parameter g2. The response curve for the fuzzy speed
controller for go = 1.5, g l = 20.0, and g2 = 50.0 is shown in
800 ~. nb- Fig. 6.
.-C
g eo0 ..
8
3 400. -
200.

0 1 2 3 4 5
As shown in Fig. 4, increasing go drastically effects the
Time (seconds)
system response. The change produced overshoot at 400 and
1200 r/min, while it produced overshoot and a severe ripple at Fig. 6. Case #4 Fuzzy Response Curve
800 r/min. Increasing go in effect widens the width of the (go = 1.5, gl = 20.0, g2 = 50.0)
Change in Armature Voltage membership functions, thereby
speeding up the response of the controller, while at the same As shown in Fig. 6, changing g2 has little effect on the
time worsening the overshoot and settling time (ripple). speed response other than a slight undershoot at speeds of 400
r/min and 800 r/min. It must be understood however, that the
C. Case #3 effects of changing the scaling parameters are not to be
generalized. The effects are highly dependent on the number
of membership functions, the inputs and outputs, and the
mechanical characteristics of the process to be controlled.

VI.MATLAB SIMULATIONS
12w.
Upon successful implementation of the hzzy speed
1000.
controller on the laboratory motor / generator set, a more
practical application for which the environment changes more
-.a 800 .. was studied. This application deals with implementation of
the proposed PLC based fuzzy speed controller as a steam
,E
*
U
000. turbine govemor.
a
Cn 0
400
Several MATLAB simulations were performed for the
.. - fuzzy speed governor. In each simulation, a typical 1IMW,
4470 r/min turbine generator was chosen as the process to be
200 .
controlled. By increasing the percent open of the control
valve, more steam is let into the turbine, thereby causing the
0 1 2 3 4 5 shaft connecting the synchronous generator to the turbine to
Time (seconds) rotate faster. Therefore, the control is simulated using the
Fig. 5 . Case #3 Fuzzy Response Curve
equations of motion of the steam turbine, a typical 6 inch
(go = 1.5, g l = 50.0, g2 = 10.0) steam valve as the control valve, and the rotational speed of
the turbine as the feedback signal.
As shown in Fig. 5, changing g l also effects the response Again, several different simulations were performed.
when compared with Case #l. However, changing g l is not as However, only the effects of changing gl and fine were
severe as changing go. The increase in g l produced only a observed in these simulations. Experiments were performed
slight overshoot at 400 r/min, while the speed never reached for five case studies as outlined in Table 3.

0-7803-6420-1/00/$10.00 (c) 2000 IEEE 2478


Table 3. Turbine Speed Governor Case Studies Outline
-
4500

4000
I
.....................................
/
..... j ---- .... ......
I
1 1i
.; ..
..... r-,!
j 1 .. ..........,........... i.. .........
Simulation 3500 -................ ! ......... ..... .....
-
Nn
1
go
10.0
G1
20.0
g2
10.0
Fine
0.1
3000 _ .......... ........... ,
, . .

2 1.o 20.0 10.0 0.1


......... . i .....

3 20.0 20.0 10.0 0.1 .......... ....... .....


4 10.0 20.0 10.0 1.o
5 10.0 20.0 10.0 0.01 .......... ..... ..........

0 1 2 5 6 1
Timelseconds)
Fig. 8. Simulation #2 Fuzzy Speed Govemor Response Curve
(gO=1.0,gl=20.0,g2=10.0,fine=0.1)

As shown in Fig. 8, decreasing go drastically affects the


response of the speed governor. In effect, reducing go causes
the governor to be less responsive and thus severe overshoot,
as well as an increase in settling time (ripple) at a speed of
4470 dmin are introduced.

A. Simulation #1 C. Simulation #3

The response curve for the fuzzy speed govemor for go =


10.0, gl = 20.0, g2 = 10.0, and fine = 0.1 is shown below in
Fig. 7;

.-
h

,E
&

m
5000.

4500
4000:-

35OD.

3 3000 -
-@ 2 5 0 0 . -
-g ZODO
- -1!-;:
i
!
-
I
-- --
:
.
3
-_+ - - -
irT
I

,
- - .
*
I
- 4
I
I

8 IS00 .... I! . ;. . ~ - - .; i
1000- ....... I
1 1 ,
- !- .
s e 7
500 -- 1 ,
0 1 2
Time ?seconds) 0 -
0 1 2
Fig 7. Simulation #1 Fuzzy Speed Governor Response Curve
(go = 10.0, gl = 20.0,g2 = 10.0, fine = 0.1)

As shown Fig. 7, the speed of the turbine rises to 1200


r/min where the controller maintains this speed for As seen in Fig. 9, increasing go makes the controller more
approximately 60 seconds. The speed is then ramped up to responsive and produces a response curve that is as good or
2500 r/min where the controller once again maintains this better than the base case. However, this is not a realistic
speed for approximately 60 seconds. Finally, the controller adjustment because the control valve has limits on how much
allows the turbine to reach the rated speed of 4470 r/min. it can move in a certain amount of time (5% / looms in the
There exists only slight overshoot and ripple, which is due to case of the 6 control valve). Clearly, unrealistic values
the added error. should not be assigned to scaling parameters.

B. Simulation #2 D.Simulation #4
Simulation #2 demonstrates the effect of decreasing Simulation #4 demonstrates the effect of increasing scaling
parameter go. The response curve for the fizzy speed parameter fine. The response curve for the hzzy speed
governor for go = 1.0, g l = 20.0,g2 = 10.0, and fine = 0.1 is govemor for go = 10.0, gl = 20.0, g2 = 10.0, and fine = 1.0 is
shown in Fig. 8. shown in Fig. 10.

0-7803-6420- 1/00/$10.00 (c) 2000 IEEE 2479


motors via a changing armature voltage is a common practice
throughout industry at the present time. In addition, general-
purpose PLCs are the most common controllers utilized in the
control of power plants and industrial plants. However, this
work suggests a method for increasing the utilization level of
an existing general-purpose PLC.
Previously, the main disadvantage to PLC based speed
controllers was the fact that a special coprocessor module was
needed to implement a more complicated control scheme, such
as PID,than could be achieved through regular relay ladder-
logic. With a control scheme based on fuzzy methods, the
0 1 2 3 4 5 6 ?
Time (seconds) speed control algorithm was accomplished from within the
Fig. 10.Simulation #4 Fuzzy Speed Governor Response Curve standard ladder-logic.
(go = 10.0,gl = 20.0,g2 = 10.0,fine = 1.0)
VIII. ACKNOWLEDGMENTS
Increasing the fine tuning parameter allows the controller
to be more responsive to change when the actual speed is The authors wish to gratefully acknowledge the
within + 10 r/min. However, increasing fine too much can contributions of David L. Mendive of Geothermal
cause the controller to be too responsive and hunt back and Development Associates for his insight in the overall control
forth around the desired speed. This hunting is system design as well as Kenneth Hunter of the University of
demonstrated in Fig. 10 when the controller reaches the Nevada, Reno Graduate School for his support.
desired speed of 4470 and a small ripple is present.
IX.REFERENCES
E. Simulation #5
L.A. Zadeh, Fuzzy Sets, Informat. Control, 8:338-353,1965.
B.J. Lah4eres and M.H. Nehrir, Fuzzy Logic Based Voltage
Simulation #5 demonstrates the effect of decreasing scaling Controller for a SynchronousGenerator, IEEE Computer Applications
parameter fine. The response curve for the fuzzy speed in Power Systems, vol. 12,no. 2, April 1999,pp 46-49.
govemor for go = 10.0, g l = 20.0, g2 = 10.0, and fme = 0.01 is N. Golea, A. Golea, and K. Benmahammed, Fuzzy Direct Adaptive
shown in Fig. 11. Control of Permanent Magnet Synchronous Motor Drive, Proceedings
of Powercon 98,vol. 1, April 1998,pp. 600-604.
so00 G. Peiyuan, F. Shihong, P. Xiangan, Z. Yongwang, and B. Man,
> j ! Fuzzy Logic Controller for Generator Excitation Control,
4500 f 1 -
Proceedings of Powercon 98,vol. 1,April 1998,pp. 800-803.
..... .-: . . . . . . .i .;I ..{........l .......... M.G. Na, Design of a Genetic Fuzzy Controller for the Nuclear Steam
I l
Generator Water Level Control, IEEE Transactions on Nuclear
Science, vol. 45, no. 4, August 1998, pp. 2261-2271.
J. Talaq and F. AI-Basri, Adaptive Fuzzy Gain Scheduling for Load
Frequency Control, IEEE Transactions on Power Systems, vol. 14,no.
1, February 1999,pp. 145-150.
.............. ........
........... ....... .................. X.BIOGRAPHIES

I
..... ;..................1..
I
.........,................... .... -..i
......
Aidan M. Graham was bom in Nampa, Idaho, on March 8, 1974. He
I
!
I
.
received the BSEE in 1998 and MSEE in 1999 from the University of Nevada,
4
;.-...............
I
OD 1 2 5 6 7
Time ?seconds) Reno. He is currently working as a Power System Engineer at Cutler-
Fig. 11. Simulation #5 Fuzzy Speed Governor Response Curve Hammer Engineering Services, a division of the Eaton Corporation. He is
(gO=10.0,gl=20.0,g2=10.0,fine=0.01) responsible for performing power system studies regarding short circuit and
coordination,load flow, motor starting, and power quality and harmonics. His
present areas of interest include, power system studies, power system control,
Decreasing the fine tuning parameter now causes the fuzzy methods, and genetic algorithms. He is a member of the IEEE, Tau
controller to be less responsive to change when the actual Beta Pi, and Eta Kappa Nu honor societies.
speed is within + 10 r/min. Similar to the case where the
fine tuning parameter was set too high, the controller Mehdi Etezadi-Amoli received the BSEE in 1970, MSEE in 1972 and
Ph.D. degree in 1974 fromNew Mexico State University. From 1975-1979,
hunts back and forth around the desired speed. The hunting he worked as an assistant professor of Electrical Engineering at New Mexico
is more severe in this case and a small ripple is present at all State and the University of New Mexico. From 1979-1983,he worked as a
three desired speeds. Senior Protection Engineer at Arizona Public Service Company in Phoenix,
AZ. In 1983,he joined the faculty of the Electrical Engineering Department
at the University of Nevada, Reno where he is responsible for the power
VII. CONCLUSION system program. His present interest is in power system protection, large-
scale systems, and neural network applications. Dr. Etezadi is a Registered
Successful implementation of the fuzzy method for speed Professional Engineer in the states of Nevada and New Mexico.
control of a motor / generator set using a general-purpose PLC
has been demonstrated in this paper. Speed control of DC

0-7803-6420-1/00/$10.00 (c) 2000 IEEE 2480

You might also like