Complexity Fuzzy Logic
Complexity Fuzzy Logic
www.elsevier.com/locate/fss
Abstract
This paper analyzes the number of operations and parameters of general fuzzy logic control algorithms. And limitations
of loop controllers to implement the fuzzy logic control are investigated in terms of computation time and required memory.
Using analysis of general fuzzy logic control algorithms, it is shown that general fuzzy logic control algorithms are not
suitable for loop controllers. A simpli ed fuzzy logic control for loop controllers is presented using a xed control table
with mapping parameters. This simpli ed fuzzy logic control is shown to be suitable for a loop controller with regard to the
computation time and the required memory. For easy programming of the simpli ed fuzzy logic control, a fuzzy logic control
block is suggested as a speci c block for general graphical block diagram editors. Experiments show that the simpli ed
fuzzy logic control overcomes the limitations of loop controllers and provides good performance. ? 2000 Elsevier Science
B.V. All rights reserved.
0165-0114/00/$ - see front matter c 2000 Elsevier Science B.V. All rights reserved.
PII: S 0 1 6 5 - 0 1 1 4 ( 9 7 ) 0 0 4 0 9 - 0
216 Y.H. Kim et al. / Fuzzy Sets and Systems 111 (2000) 215–224
Fig. 1. Minimum inference. where vj ’s are support values with the maximum mem-
bership value of fuzzy sets. The required number of
operations in this defuzzi cation is
of the input could be evaluated with the following methods of each part of fuzzy logic control. The
equation: number of operations is obtained along the ow of
the program by dynamic measurement. The result is
ajL x0 + bjL if xm 6 x0 6 xc
shown in Table 2. Apart from the simple move in-
Aj (x0 ) = ajR x0 + bjR if xc ¡x0 6 xM (12) struction, the number of operations such as addition,
subtraction, multiplication, division, and compare
0 otherwise; is also obtained individually, as in Table 3. These
tables show that the number of rules and that of dis-
where ajL ; bjL ; ajR , and bjR are parameters to specify cretization of the universe of discourse greatly a ect
each fuzzy set. And xm ; xc , and xM are the minimum, the number of operations. From Table 2, the infer-
center, and maximum values of the triangular fuzzy ence speed of a general fuzzy logic control can be
set, respectively. Each fuzzy set has four parameters predicted. For example, assume that the non-speci c
except the fuzzy sets at the end of the universe of dis- shaped fuzzy sets, the minimum inference method,
course. There are two parameters for each fuzzy set at and the center of gravity defuzzi cation are used. If
the end of the universe of discourse. If the parameters there are 2 inputs, 5 fuzzy sets for each input, and 32
are stored in 4 bytes of memory, the required memory discretization levels of the universe of discourse, then
usage is the number of operations used for the fuzzy logic con-
trol is estimated at about 94 000. If it is assumed that
16(NIF − 1):
fuzzy logic control is implemented in the hardware
with an MC68000 CPU in 16 MHz clocks and that
2.2.2. Non-speci c fuzzy sets
the execution of one instruction takes 10 clocks on
When non-speci c shaped fuzzy sets are used for
average, then one inference takes about 59 ms. Thus,
the premise part of the control rules, the membership
with the implementation, fuzzy logic control cannot
values (NID ) for each fuzzy set (NIF ) should be stored
be used in a loop controller with a 50 ms sampling
for the entire range of the universe of discourse. Thus,
period. In this case, hardware with a faster processor
the required memory usage is
or another implementation method is needed. An es-
4NIF NID timation of the inference speed from Tables 2 and 3
can be applied to the hardware of other processors,
if the membership value is stored in 4 bytes of even though the tables are made from the analysis of
memory. a program of MC68000 assembly language. This is
because the program changes little when a general
2.2.3. Rule table CISC processor is used. Operations should be counted
The control rule should be converted to a set of as subroutines when the number of instructions is
numbers to be stored in memory. The simplest method computed only if there are no instructions for multi-
is to convert the fuzzy sets to an index number. Each plication and division, as in RISC processors. In such
rule then requires NI numbers for the premise part a case, Table 3 gives a closer estimation. With this
and one number for the consequence part. Thus, the method, the inference speed of fuzzy logic control
required memory usage is can be estimated when the control is implemented
in speci c loop controller hardware. Table 4 could
2L(NI + 1): give estimations for some CPUs with di erent clock
speeds. In Table 4, the instruction cycles indicate the
It is assumed that the index numbers are stored in 2
average values for the instructions to be executed. If
bytes of memory.
inference speed does not meet the required sampling
rate of a loop controller, the on-line inference method
2.3. Inference speed cannot be implemented on the loop controller. In this
case, fuzzy logic control has to use the control table
In the above subsection, the required number method, a kind of o -line inference method that will
of operations is estimated for two representative be described in the next section.
220 Y.H. Kim et al. / Fuzzy Sets and Systems 111 (2000) 215–224
Table 2
Number of operations in fuzzy logic controller
Method Operations
Table 3
Number of each operation in fuzzy logic controller
Table 4
Inference speed of CPUs
a Is in the case of NI = 2; NIF = 5; MID = MOD = 32; L = 25, non-speci c, minimum, and COA.
b Means that the instruction is implemented in a subroutine.
3. A simpli ed fuzzy logic control for loop trol is to be implemented. The MC68302 processor
controllers is called an integrated multi-protocol processor. Its
function is divided into three parts: the core part of
In this section, a loop controller and a simpli ed an MC68000 microprocessor, the system integrated
fuzzy logic controller for the loop controller are block (SIB), and the communication processor. Put
presented. simply, the processor is an MC68000 processor with
a communication function. The CPU works at 16 MHz
3.1. Limitations of a loop controller clock speed, and the loop controller has 256 kbytes of
system memory.
A 16 bit microprocessor MC68302 is used for the The function block of a control is de ned, as shown
CPU of the loop controller in which fuzzy logic con- in Table 5. The parameters are passed to a control
Y.H. Kim et al. / Fuzzy Sets and Systems 111 (2000) 215–224 221
3.3. Control table where N1 and N2 denote the numbers of fuzzy sets for
input 1 and 2, respectively.
O -line fuzzy logic control uses a control table to (
produce outputs. The control table has pre-computed 0 Ni − 1 if Ni is odd;
Ni = (16)
output values of fuzzy logic control in accordance with Ni if Ni is even:
222 Y.H. Kim et al. / Fuzzy Sets and Systems 111 (2000) 215–224
Table 7
Control table in the case of 9 discretization output levels
− Large(−2) +4 +3 +2 +1 0
− Medium(−1) +3 +2 +1 0 −1
Zero(0) +2 +1 0 −1 −2
+ Medium(1) +1 0 −1 −2 −3
+ Large(2) 0 −1 −2 −3 −4
In this scheme, the characteristics of the fuzzy logic First, fuzzy logic controls using on-line inferences
control rule can be changed by varying weights in- and the control table were compared with regard to
stead of determining all fuzzy logic control rules. The speed. Each fuzzy logic control was implemented in
control output is also scaled appropriately such as the loop controller (Fig. 4) and the inference speed was
measured. The design parameters of the fuzzy logic
u → w4 u: (19)
control are presented in Table 8, and the result is given
This mapping parameter also plays a role in changing in Table 9. The inference time was measured for each
the characteristics of fuzzy logic control. 1000 and 10 000 inferences, respectively. The result
shows that the control table method used in the simpli-
ed fuzzy logic control is 1:4 ms=Inf, which is about
4. Experiments 41 times faster than the on-line inference method used
in general fuzzy logic control. Therefore, the control
4.1. Fuzzy logic control block table method is appropriate for loop controllers with
a short sampling period. It is noted that the result is
In this subsection, a fuzzy logic control block is similar to that of Sections 2 and 3.
suggested as a general function block for graphical Next, the performance of the fuzzy logic control
block diagram editors. Fig. 3 shows a block diagram with mapping parameters was examined for a well-
Y.H. Kim et al. / Fuzzy Sets and Systems 111 (2000) 215–224 223
" 2 #
−Ft − NID l˙ sin
g sin + cos
mc + NID
= ; (20)
4 NID cos2
l −
3 mc + NID
where g = 9:8 m=s2 (gravitational acceleration), mc =
1:0 kg (mass of the cart), NID = 0:1 kg (mass of the
pendulum), l = 0:5 m (length of pole), and Ft is the
control input measured in Nt. A block diagram of
simpli ed fuzzy logic control for the loop controller
is shown in Fig. 3. The design parameters of the
fuzzy control are presented in Table 10. Control ob-
jectives are to maintain the pole in an upright position,
which means that should be maintained as 0. Distur-
bances are applied to at 3 s and 15 s with magnitude
Fig. 4. Loop controller with a simpli ed fuzzy logic control. ±0:5 rad. Experimental results using the fuzzy logic
control and the PID control are presented in Fig. 5.
In the experiment, a control table like Table 7 is used
Table 9 without using plant-speci c control rules. The experi-
The speed of inference ment shows that the fuzzy logic control with mapping
parameters can be tuned so that it provides good per-
On-line inference Control table inference
formance even with simple and xed control rules, and
58 ms=Inf. 1:4 ms=Inf. that the simpli ed fuzzy logic control is appropriate
for loop controllers.
5. Conclusion
known inverted pendulum. The dynamics of the in-
verted pendulum are given in the following equation In this paper, the number of operations and re-
of motion. quired memory for general fuzzy logic control were
224 Y.H. Kim et al. / Fuzzy Sets and Systems 111 (2000) 215–224
References