Anda di halaman 1dari 6

Fuzzy Logic Controller Design and Implementation

for Industrial Applications


Lucian Mastacan and Cătălin-Constantin Dosoftei
Dept. of Automatic Control and Industrial Informatics
Faculty of Computer Engineering and Automatic Control
“Gheorghe Asachi” Technical University, Iaşi, Romania
(lmastacan; cdosoftei)@ac.tuiasi.ro

Abstract— Fuzzy logic controllers (FLCs) utilize fuzzy logic to - the fuzzy rules. For a successfully work the number of
convert the linguistic control strategy based on expert knowledge parameters to be tuned should be as small as possible [3]. The
into an automatic control strategy. The dynamic of nonlinear paper presents a practical method to achieve FLCs with
processes can be easy controlled using FLCs. The paper presents decision tables that can to solve the control problems in the
a method to design the structure of a fuzzy logic controller (FLC)
based on decision tables. To achieve the proposed FLC the
real time industrial applications.
mathematical models of the nonlinear processes are not
necessary. All the FLC parameters can be on-line tuned. The II. DESIGN PROBLEMS OF THE FLCS
performances of the proposed FLC are validated by experimental
results on controlled processes with fast and slow dynamics. The FLCs can be achieved similarly with the linear classic
controllers [4]. The linear conventional PI algorithm is
Keywords- Fuzzy logic Controller; Nonlinear processes;

⎛ 1 ⎞
I. INTRODUCTION u( t ) = K P ⎜⎜ e( t ) + ∫ e( t )dt ⎟⎟ = K P e( t ) + K I ∫ e( t )dt (1)
⎝ Ti ⎠
It is hard to control nonlinear processes with linear classic
controllers. A linear conventional controller can be tuned for a
nonlinear process if a linearization method is introduced in e( t ) = y sp − y( t ) (2)
close vicinity of a working point. If the nonlinear process
working point changes all the conventional controller
parameters must be modified in order to keep the control where u( t ) is the controller command, e( t ) is the control
performance. An interesting approach is to use fuzzy logic system error, y sp is the control system set point, y( t ) is the
controllers (FLCs) to control nonlinear processes [1]. control system output, K P is the controller gain, Ti is the
Applying fuzzy logic in the designing of the FLCs the
control knowledge of the operators can be used to obtain the integral time, and K I = K P / Ti is the controller integral
necessary fuzzy rule bases in the control strategies. The fuzzy constant. Deriving (1) the following is obtained
rule bases consist of linguistic rules that give full details of the
FLCs actions to achieve good performances for the controlled u( t ) = K P e( t ) + K I e( t ) (3)
nonlinear processes. To implement a fuzzy logic controller
(FLC) a fuzzy inference reasoning method must be used to
activate the fuzzy rule base. The sensory data from process go where u( t ) is the derivative of the controller command and
to the FLC input through an analog – digital interface and then e( t ) is the derivative of the control system error.
through a fuzzification block that converts the crisp numerical Equation (3) is used in the form (4) for the PI type FLC to
data into fuzzy data. These fuzzy data fire some rules from obtain the conditional linguistic rules.
FLC rule base and from each fired rule a value of a fuzzy
control output is obtained. The final fuzzy control output is
computed applying a fuzzy inference reasoning method over Δ u k = K P Δe k + K I e k (4)
all simultaneously fuzzy control output obtained from the fired
rules. Then the final fuzzy control outputs go through a In (4) k is the discrete time, Δu k is the fuzzy command
deffuzification block to be converted from fuzzy to crisp change of the FLC, ek is the fuzzy error of the control system
numerical signals and through a digital - analog interface to be
and Δek is the fuzzy error change of the control system.
converted into an analogue control signal [2].
The FLC must contain a number of sets of parameters that In the PI type FLC the fuzzy error change Δek and the
can be altered to modify the controller performance. These fuzzy command change Δu k have the following meanings
parameters are:
- the scaling factors for each variable; Δek = ek − ek −1 (5)
- the fuzzy set representing the meaning of linguistic values;
Δu k = u k − u k − 1 . (6) y

The rule base of the PI type FLC is activated at the k time


by the fuzzy error ek and fuzzy error change Δek . From a ysp
fired rule at the k time a value of the FLC fuzzy command
change Δu k is obtained.
An addition block must be introduced to realize this effect.
Starting from (4) and (6) the PI type FLC can be symbolic
represented as

ΔU k = ( Ek × ΔEk ) D RF (7) 1 2 3 4 5 6 7 8 9 10 11 12 t
e + - - + + - - + + - - +
Δe - - + + - - + + - - + +
U k = U k − 1 + ΔU k (8) Δu + - - + + - - + + - - +

In (7) and (8) k is the discrete time, Ek is the fuzzy error, Figure 1. The behavior of a control system to the step variation of the set
point.
ΔE k is the fuzzy error change, U k is the FLC command and
ΔU k is the FLC command change. The fuzzy relation RF of The value of the error e means how far is y(t) from the set
the FLC is applied over the “if-then” linguistic fuzzy rule base point ysp while the value of the error change Δe is a measure
represented by the Cartesian product × using the inference of the speed variation of y(t). The sign and the value of the
rule D . The most used inference rules are Larsen rule, command change Δu depend on the interval where is located
Mamdani rule and Takagi-Sugeno rule. Any fuzzy inference y(t) regarding y sp . Table 1 contains a summary of the signs of
reasoning method is applied to compute the FLC command the fuzzy variables e , Δe , and Δu in their intervals as
change ΔU k there are time consuming. The computation time presented in fig. 1.
of the inference reasoning can be decreased using decision
tables. In this case (7) is simple reduced to TABLE I. THE SYGNS OF THE FUZZY VARIABLES
Interval
i ∈ {0,1,2,..., n} 1+4i 2+4i 3+4i 4+4i
Δuk = ΔU ( ek , Δek ) . (9)
e + - - +
Δe - - + +
where ΔU is the decision table and ek , Δek , and Δuk are
Δu + - - +
singleton fuzzy signals. The fuzzy command change Δuk is
obtained as the element of the decision table ΔU depending With this control knowledge a skilled operator can to
on the pair ( ek ,Δek ) . The integral action of the PI type FLC is elaborate the fuzzy rule base of the FLC.
obtained because the fuzzy command u k is computed as The second problem is concerning to the size and the
quantization of the universes of discourse of the fuzzy
variables e , Δe , and Δu . The operator must to decide how
u k = u k − 1 + Δu k (10) large or small can be these universes of discourse and then to
choose the number of the quantized intervals of the universes
of discourse. If the universes of discourse of the fuzzy
The FLC with decision table hasn’t the defuzzification
variables e , Δe , and Δu , are each quantized into N
block because from the decision table ΔU the command
intervals, then the decision table ΔU is in the form of a
change Δuk is obtained as fuzzy singleton signal and then it matrix, with N rows and N columns, which contains N
must be multiplied only with a constant to obtain the
defuzzified control change signal. When a decision table (9) is values of the command change Δu distributed in N 2 places.
used to obtain the command signal of the FLC some problems Because the values of the command change Δu must to
must be solved. First question is how fuzzy rule base can be have both positive sign and negative sign equal distributed
elaborate using the control knowledge of the operators. beside Δu = 0 it follow that the decision table ΔU will
The answer is clear looking to the response of a control contain N 2 values of the command change Δu formed by
system to the step variation of the set point as presented in N −1 N −1
fig. 1. The behavior of control system output y(t) can be negative values of the Δu , Δu = 0 and
analysed with the signs and the values of the pair signals 2 2
positive values of the Δu . For example if N = 15 the decision
( e ,Δe ) . The transient response is divided in intervals when
table will contain 225 values of the command change Δu
y(t) cross the set point y sp and the error e = 0. The signs of from which are Δu = 0 and only 7 negative value and 7
the pair (e, Δe) locate y(t) regarding to set point ysp as position positive values of the Δu . It is evident that with only a single
and evolution sense (increasing or decreasing). decision table it is hard to obtain good fuzzy control
performance especially to the steady-state regime. Δek < Δe* < Δek + 1 (12)
To solve this problem the behavior of the control system
output y(t) must be divided in two working regimes. The first where e j , j ∈ { 1, 2 , 3, ..., N } , are the quantized values of the
is characteristic of the transient regime when the process error
e is big and to decrease the time response big values of control system error e distributed as rows in the decision table
command change Δu are necessary and the second is and Δek , k ∈ { 1, 2 , 3, ..., N } , are the quantized values of the
characteristic of the steady-state regime when the process error control system error change Δe distributed as columns in the
is small and to obtain e ≈ 0 small values of command change decision table. Depending on how close the measured values
Δu are necessary. These two different working regimes of the e * and Δe * are near the quantized values e j or e j + 1 ,
control system can be better controlled if two decision tables
respectively Δek or Δek +1 , the control change Δu * takes
are introduced. The first, ΔUtr , named transient decision
table, is for the transient regime control and the second ΔUss , only a value from the four quantized values
named steady-state decision table, is for the steady-state
regime control. The decision tables ΔUtr and ΔUss have the Δu A ( e j ,Δek ) ; Δu D ( e j ,Δek + 1 ) ;
same dimensions N × N . The N values of command change
Δu from the steady-state decision table ΔUss are much Δu B ( e j + 1 ,Δek ) ; ΔuC ( e j + 1 ,Δek + 1 ) . (13)
smaller than those N which belong to the transient decision
table ΔUtr . The performance of the FLC with decision tables Equation (14) represents the value of the command change
can be improved if the command change Δu increases in the Δu * computed with the interpolation method when the
number of values over N . quantized values (13) from the fig. 2 are activated
Starting from the N fixed values of the decision table and
introducing a linear interpolation between them a method to e j + 1 − e * Δek + 1 − Δe *
compute an infinite number of control values in the finite Δu* = ⋅ Δu A ( e j ,Δek ) +
e j + 1 − e j Δek + 1 − Δek
universe of discourse of the fuzzy control variable is presented
[5]. The decision table ΔU is a N × N matrix where the N e j +1 − e* Δe * −Δek
⋅ Δu D ( e j ,Δek + 1 ) +
fixed values of the command change Δu( e , Δe ) are disposed e j +1 − e j Δek + 1 − Δek (14)
2 e * −e j Δe − Δe *
in N places. In fig. 2 is presented only the portion of the
⋅ k +1 Δu B ( e j + 1 ,Δek ) +
decision table where the pair of the control system measured e j + 1 − e j Δek + 1 − Δek
values ( e*, Δe * ) places in the space e × Δe × Δu the e * −e j Δe * −Δek
corresponding command change Δu * inside four fixed ⋅ ΔuC ( e j + 1 ,Δek + 1 ).
command change values of this decision table. e j + 1 − e j Δek + 1 − Δek

ΔU The value of the command change Δu * acquired with (14)


ΔU depends to the quantized values (13) and to the position of the
C measured values e * and Δe * in the intervals between e j and
ΔU2
e j + 1 , respectively Δek and Δek +1 . In this way the values
ΔU*
ΔUB ΔUD number of the command change Δu * increases because beside
ΔU1
ΔUA the N quantized values of the fuzzy command change from
Δek Δe* Δe the decision table ΔU a bigger number of other command
k+1
Δe change values can be obtained. Fig. 3 presents the computing
method with (14) of the control change value in a plane
e A AD* D representation of the decision table.
j

e* AB* CD*
W
ej+1
B BC* C

Figure 2. Command change computing in the space e × Δe × Δu .

In fig. 2 the measured values e * and Δe * have the


following properties

e j < e* < e j +1 (11)


Figure 3. Control change computing in a plane decision table.
III. THE IMPLEMENTATION OF THE FLC WITH DECISION The universes of discourse of the FLC input and output
TABLES variables, fuzzy error e , fuzzy error change Δe , and fuzzy
The configuration of the FLC with decision tables is command change Δu are quantized for N = 11 intervals.
presented in fig. 4. Both the transient decision table and the steady-state
decision table have 121 values of command change Δu .
Fig. 6 presents an example of the transient decision table
Operator Rule base with its command change Δu big values from the Front Panel
of the PI type FLC. Fig. 7 presents an example of the
corresponding steady-state decision table with its command
Δe Look-up u change Δu smaller values from the Front Panel of the PI type
θ∗ + e Quantization
tables FLC. The quantized fuzzy error e values and the quantized
- fuzzy error change Δe values are also implemented on the
Fuzzy logic controller
FLC front panel. The implemented PI type FLC presents as
θ facility the manual tuning on the Front Panel of the following
PLANT controller variables: universe of discourse of the fuzzy error e
and its quantized values, universe of discourse of the fuzzy
error change Δe and its quantized values, universe of discourse
Figure 4. The block diagram of the FLC. of the fuzzy command change and its quantized values.
The algorithm of the PI type FLC with decision tables is
realized in LabVIEW graphical programming language on a
laptop Compac nc8430 with type II PCMCIA slot.
The interface with the control system is realized with the
following devices from National Instruments:
- PCMCIA - 6024E data aquisition card ;
- SC–2345 data aquisition and signal conditioning shilded
carrier equiped with modules for input and output analogue
signals and configurabile conectors;
- SHC68-68-EP connector cable.
The PI type FLC with decision tables is implemented in
the graphical programming language LabVIEW as Virtual
Instrument with Front Panel and Block Diagram. A portion
from the Front Panel of the PI type FLC with displays for the
process behaviour recording and for the FLC comand values
recording is presented in fig. 5.

Figure 6. Transient decision table and its fuzzy error and fuzzy error change
quantized values from the FLC Front Panel.

Figure 5. FLC Front Panel. Figure 7. Steady-state decision table and its fuzzy error and fuzzy error
change quantized values from the FLC Front Panel.
The PI type FLC algorithm from (9) and (10) is IV. EXPERIMENTAL RESULTS
implemented as graphical programming language in the Block The PI type FLC was implemented to control different
Diagram of the Virtual Instrument. Fig. 8 presents the Block processes with fast dynamic (level of a tank; speed of a DC
Diagram code for the quantization of the fuzzy error e in its motor) or slow dynamic (temperature of an electric oven).
universe of discourse and for the quantization of the fuzzy To control the tank level the input pump liquid flow rate is
error change Δe in its universe of discourse both for the regulated by the modification of its servo motor electric voltage
transient decision table and the steady-state table. supply U. The quantified sets Q of the universes of discourse of
the level error E (cm), level error change ΔE (cm) and the
control change ΔU (Volts) are presented in the fig. 10 for the
transient level fuzzy control and in the fig. 11 for the steady-
state level fuzzy control.

Figure 10. E, ΔE and ΔU universes of discourse for transient


level fuzzy control.

Figure 8. Block Diagram code of the PI type FLC for the error and error
change quantization.

The interpolation algorithm (14) for the transient decision


table and the steady-state decision table is presented in the
fig. 9 as Block Diagram code.

Figure 11. E, ΔE and ΔU universes of discourse for steady-state


level fuzzy control.

The fuzzy control of the tank level is presented in fig. 12.


The results of the interpolation algorithm (14) between the
fuzzy control values, especially in the steady-state decision
table, can be observed in the recorded values of the PI type
FLC comand. The fuzzy control system performance of the
tank level is good. The PI type FLC with decision tables and
interpolation algorithm was implemented to control the speed
of a DC motor. The experimental results of the fuzzy control of
the DC motor speed are presented in the fig. 13. The FLC
parameters were tuned and good performance of the speed
fuzzy control was achieved. The PI type FLC is useful to
control processes with slow dynamics. Fig. 14 presents the
Figure 9. Block Diagram code for the interpolation algorithm in the good performance obtained when the PI type FLC was
transient and steady-state decision tables. implemented to control the temperature of an electric oven.
Figure 14. Temperature fuzzy control of an electric oven.

V. CONCLUSIONS
Figure 12. Fuzzy control of a tank level. The proposed PI type FLC with decision tables and
interpolation algorithm is implemented to control processes
with fast or slow dynamics. Using LabVIEW graphical
programming language the PI type FLC is achieved as Virtual
Instrument on a laptop. The PI type FLC parameters can be
tuned on the Front Panel of the realized Virtual Instrument.
The good performances of the experimental results of the
different fuzzy control systems validate the FLC efficiency.
REFERENCES

[1] H. J. Zimmermann, Fuzzy set theory – and its applications, Springer-


Verlag, Berlin, 2001.
[2] A. Zilouchian, and M. Jamshidi, Intelligent control systems using soft
computing methodologies, CRC Press, New York, 2001.
[3] L. Mastacan, “New methods to improve fuzzy logic controllers
performance,” Bulletin of the Polytechnic Institute of Iasi -
Electrotehnics, Powers, Electronics, LIV (LVIII), 4, pp. 629 – 634,
2008.
[4] Xu, J. X., Hang, C. C., Liu, C. Parallel structure and tuning of a fuzzy
PID controller, Automatica, Vol. 36, page 673-684, 2000.
Figure 13. DC motor speed fuzzy control. [5] L.T. Kóczy and K. Hirota, “Approximate reasoning by linear rule
interpolation and general approximation,” Int. J. Approx. Resoning, vol.
9, pp. 197-225, 1993.

Anda mungkin juga menyukai