WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
Multiple-valued Logic Approach to Fuzzy Controllers Implementation
V. VARSHAVSKY, V. MARAKHOVSKY1, I. LEVIN2, H. SAITO3
1,3
The University of Aizu
Aizu-Wakamatsu City, Fukushima Prefecture, 965-8580
JAPAN
[email protected],
[email protected]
2
Tel Aviv University
Ramat Aviv, Tel Aviv 69978
ISRAEL
[email protected]
Abstract: - This paper offers a new technique for designing fuzzy controllers as analog hardware devices on
bases of CMOS implementation of multi-valued logical functions. This approach is based on using a summing
amplifier with saturation as a building block that can be considered as a multi-threshold logical element. The
functional completeness in an arbitrary-valued logic of a summing amplifier with saturation is proven. This fact
gives a theoretical background for an analog implementation of fuzzy devices. In contrast with the traditional
software approach to fuzzy controller implementations based on explicit fuzzification, fuzzy inference, and
defuzzification procedures, hardware implementations of fuzzy controllers as analog devices have advantages
of higher speed, lower power consumption, smaller die area and more. Universal and proper design methods for
such type of hardware are offered. The paper illustrates design examples for real industrial fuzzy controllers
and provides SPICE simulation results of their functioning.
Key-Words: - Fuzzy Logic, Fuzzy Controller, Fuzzy rules, Fuzzy inference, Fuzzification and Defuzzification,
Multi-Valued Logic, Multi-threshold Element, Functional Completeness, Summing Amplifier.
1 Introduction
Fuzzy logic control is a methodology bridging 1. The fuzzification is a transformation of analog
artificial intelligence and traditional control theory. (continuous) input variables to linguistic ones, e.g.,
This methodology is usually applied in the only transformation of temperature into the terms cool,
cases when accuracy is not of high necessity or warm, hot or transformation of speed into the terms
importance. On the other hand, as it is stated in [1], negative big (NB), negative small (NS), zero (Z)”,
“Fuzzy Logic can address complex control positive small (PS), positive big (PB). Such
problems, such as robotic arm movement, chemical transformation is realized by introduction of so-
or manufacturing process control, antiskids braking called membership functions, which define both a
systems or automobile transmission control with range of value and a degree of membership. For
more precision and accuracy, in many cases, than linguistic variables it is important not only which
traditional control techniques … . Fuzzy Logic is a membership function a variable belongs to, but also
methodology for expressing operational laws of a a relative degree (weight) to which it is a member.
system in linguistic terms instead of mathematical A variable can have a weighted membership in
equations.” several membership functions at the same time.
Wide spread of the fuzzy control and high 2. The fuzzy inference maps input linguistic
effectiveness of its applications in a great extend is variables onto output linguistic variables on the base
determined by formalization opportunities of a system of fuzzy rules of the type “IF A THEN B”
necessary behavior of a controller as a “fuzzy” For instance: “IF the temperature is worm THEN the
(flexible) representation. This representation usually speed is Positive Small (PS)” or “IF the speed is
is formulated in the form of logical (fuzzy) rules Negative Big (NB) THEN force is ZERO”. Since
under linguistic variables of a type “If A then B”. input linguistic variables are weighted, the output
The Fuzzy Logic methodology [2, 3] comprises linguistic variables can be obtained weighted as
three phases: well. Traditional fuzzy logic approach comprises
Mamdani-type and Sugeno-type inference methods.
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
109
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
The Mamdani-type method is more intuitive and This work shows that for a sufficient wide set of
assumes the output variables as a fuzzy set. Fuzzy applications, fuzzy controllers can be implemented
rules in it contain a fuzzy precondition part (after IF) as rather simple CMOS devices, which can be used
and a fuzzy consequence part (after THEN). The in embedded systems or as an IP core. What is the
Sugeno-type method expects the output variables to basic idea of the proposal?
be singletons or dealing with consequents that are A fuzzy controller is a deterministic device, for
equations. So it is better suited for mathematical which one and only one value of the output analog
analysis, nonlinear system modeling and variable corresponds to each value combination of
interpolation. the input analog variables. It means that the fuzzy
3. In the defuzzification phase, the weighted values controller should realize an analog
of output linguistic variables obtained as a result of 1
function Y = f ( x1 , x2 ,..., x n ) .
fuzzy inference have to be transformed to analogue There are two important questions:
(continuous) variables. This procedure is also based 1. How to transit from a standard specification of a
on membership functions. Two major methods are fuzzy logic function to the specification of
used for defuzzification: corresponding analog function?
– The maximum defuzzification method, wherein an 2. How to transit from an analog function
output value is determined by the linguistic specification and/or from a standard specification
variable with the maximum weight; of a fuzzy logic function to corresponding CMOS
– The centroid calculation defuzzification method, implementation?
wherein an output value is determined by the First of all, let us address to membership
weighted influence of all the active output functions. In most cases [2 – 4], membership
membership functions. functions have a triangle or trapeze form (see Fig.1).
As a rule, or at least in a great part of
applications, a fuzzy controller is a transformer of α
input analog signals into an analog output signal. A A B C D E F G
1
linguistic variable is a subjective characteristic of an
input analog variable, values of which are
transformed on bases of given membership
functions into a set of weighted values of T
corresponding linguistic variables. This procedure is Fig.1 Types of membership functions.
called a fuzzification and it contains as its composite
part the analog-digital transformation. In Fig.1 linguistic points (variables) A and B are
A set of combinations of weighted linguistic cold, C is fresh, D and E are worm, F and G are hot.
variables corresponds to each value combination of These points determine the connection of the
input analog variables. On bases of a system of linguistic variables with values of the analog
fuzzy inference rules it is possible to receive the set variable T (T is temperature). Relatively to these
of weighted output linguistic variables. Using these points and similar points for other analog input
variables and their membership functions, with help variables we can compose a table of fuzzy rules
of one of well known defuzzification methods it is connecting combinations of input linguistic
possible to form values of the analog output variables with output linguistic variables.
variable. The defuzzification procedure also On bases of membership functions we can put
includes digital-analog transformation. into accordance to the input and output linguistic
At present the most wide-spread way of fuzzy variables a set of integer numbers splitting by
logic control implementation is using the appropriate way all diapason of changing of
programmable fuzzy controllers, which are available corresponding analog variables. Then the table of
on the market together with the means of computer fuzzy rules will to determine by obvious way the
aided programming (e.g. Motorola’s 8-bit 68HC11 function of multi-valued logic, values of which
and 16-bit 68HC12 microcontrollers or specialized define the digit representation of the output
fuzzy processors of Siemens 80C517/80C535
families). However, in spite of the implementation
evidence and fuzzy controllers’ accessibility this
approach to controller implementation possesses 1
It should be noticed that in suppressing majority of
some disadvantages, e.g. such as high cost and low publications on fuzzy controllers, this function is given as
throughput (that is especially important when fuzzy a response surface and practically without exception this
control in the control contour is used) etc. surface has a piecewise linear form.
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
110
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
linguistic variable on chosen value combinations of
multi-valued input variables.
In other words, according to our concept, for a
broad class of fuzzy controller specifications it is
possible to construct corresponding tables
connecting input and output membership functions.
Frequently membership functions evenly divide the
ranges of output variables’ variations. If it is not so,
the membership functions can be brought to even
scale by increasing the number of gradations or, as it
will be shown later, by introducing a certain
equalization procedure for logical levels. Therefore,
specification tables represent nothing but tables
Fig.2 Summing amplifier: a) general designation,
determining a specific multi-valued logical function.
b) CMOS implementation using symmetrical
And what is more, for a number of implementations
invertors.
it is possible to neglect weighting and determining
input linguistic variables and simply to use Vout
a)
continuous-valued variables. Vdd
The above idea was in the focus of our research.
We dealt with searching for simple basic multi-
valued functions, which, from the one hand, would
present a complete functional basis in the multi- Vdd / 2
valued logic, and from the other hand, could be
∑
n
− Vdd / 2 R0 V
efficiently implemented by CMOS technology. Rj
(V j − dd )
2
j =1
b) y
k
2 Hardware Implementation of Fuzzy ∑ω x
n
j j
Controllers −k k
j =1
−k
2.1 Summing Amplifier as a Multi-Valued
Logical Element Fig.3 Summing amplifier’s behavior: a) within
Summing amplifier’s behavior, accurate to the voltage coordinates; b) within multi-valued
members of the infinitesimal order that is variable coordinates.
determined by the amplifier’s gain factor in
disconnected condition (Fig.2), is described as Let us split the source voltage Vdd on m = 2k + 1
follows: voltage levels. Then replacing the input voltages
V j − Vdd / 2 by m-valued logical variables
⎧ n R V V
⎪Vdd if ∑ 0
j=1 R j
(V j − dd ) ≤ − dd
2 2
x j = ( 2 ⋅V j − Vdd )k /Vdd and the output voltage Vout
⎪
⎪ by m-valued variable y and designating R0 / R j = ω j
⎪V n R V
Vout = ⎨ dd − ∑ 0
(V j − dd ) in other cases (1) the system (1) can be represented as (2).
⎪ 2 j =1 R j 2 n
⎪ V n R V y ( X ) = S ( ∑ω j ⋅ x j ) =
⎪0
⎪
if dd ≤
2
∑ 0
j=1 R j
(V j − dd )
2
j =1
⎩ ⎧ n
⎪+ k if ∑
ω j ⋅ x j ≤ −k
where Vdd is the supply voltage, V j is the voltage ⎪ j =1
(2)
⎪ n n
on jth input, R j is the resistance of jth input, R0 is ∑ ∑
= ⎨− ω j ⋅ x j if k > ω j ⋅ x j > -k
the feedback resistance, and Vdd / 2 is the midpoint ⎪ j =1 j =1
⎪ n
of the supply voltage. Dependence of Vout on ⎪− k if ∑
ω j ⋅ x j ≥ +k
⎩ j =1
∑j=1 RR0 ⋅ (V j − V2dd ) is shown in Fig.3 (a).
n
Graphical view of (2) is shown in Fig.3 (b).
j
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
111
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
Later on, we will call the functional element, f a ( x ) = −maj( x,− a,−k ) + a + k
whose behavior is determined by the system (2), a
multi-valued threshold element. When as it follows from Fig.4, hence
ω j = 1, j = 1, 2, 3 , we will call it a majority element f a ( x ) = −maj ( −maj ( x,− a,−k ), a, k ) . (5)
and designate as maj ( x1 , x 2 , x3 ) .
Taking into consideration
− maj (a , b, c ) = maj ( − a,−b,− c ) ,
2.2 Functional Completeness of the
it follows from (5) that
Threshold Element
The basic operation (or a set of basic operations) is max( x1 , x 2 ) = maj ( maj ( x1 ,− x 2 ,− k ),− x 2 ,− k ) . (6)
called functionally completed in arbitrary-valued
logic, if any function of this logic can be represented Now let us consider the representation of the
as superposition of the basic operations. function y = ( x + 1) mod m , x ≥ 0, 0 ≤ y ≤ m-1 through
There are some known functionally complete sets threshold functions. First of all we designate
of functions. It is clear, that for proving the m = 2k + 1 and change the beginning of coordinates
functional completeness of a certain new function it so that the function will have a form
is sufficient to show that every function of the y = ( x + k + 1) mod( 2 k +1) − k , x ≥ − k , - k ≤ y ≤ + k . To
known functionally complete set can be represented
implement this function on threshold elements let us
as a superposition of the considered function. One
turn to the sequence of pictures in Fig.5.
of functionally complete functions in m-valued logic
is the Webb’s function [8]: y y
a) k-1 b) k-1
w( x , y ) = [max( x, y ) + 1]mod m . (3)
Therefore, for proving functional completeness
of the threshold operation in multi-valued logic it is x x
sufficient to show how the Webb’s function can be 1-k 1-k
represented through this operation [5 – 7].
y = ( x + k + 1) mod( 2 k +1) − k ϕ1 ( x ) = −maj( x,1,0)
First, let us represent the function max( x1 , x 2 )
c) y d) y
by threshold functions. To do this let us consider the k-1 k-1
function f a ( x ) , such as
⎧a if a≥x x x
f a ( x ) = max( x , a ) = ⎨ ,
⎩x if x>a (4) 1-k 1-k
| x |≤ k , | a |≤ k . ϕ 2 ( x ) = − maj( x,1 − k ,− k ) ϕ 3 ( x ) = k ⋅ maj(ϕ 2 ( x ), k ,0)
The diagram of this function is shown in Fig. 5 Implementation of the function
Fig.4(a). y = ( x + k + 1) mod( 2 k +1) − k .
a) y b) y It is easy to see that
k k
fa (x) ( x + k + 1) mod( 2 k +1) − k = ϕ1 ( x ) + 2ϕ 3 ( x )
a a
k k and obviously, this function can also be
-k x -k x implemented on threshold elements as
-k -k y = maj ( maj ( x ,1,0), k ⋅ maj ( maj ( x ,1 − k ,− k ), −k ,0),
a -maj(x,-a,-k) a
k ⋅ maj (maj ( x,1 − k , −k ), − k ,0)).
Fig. 4 Diagrams of the functions a) f a (x ) and
Hence, the functional completeness of the
b) − maj ( x ,− a,−k ) .
summing amplifier in arbitrary-valued logic is
shown. The proof procedure of functional
The − maj ( x,−a ,− k ) function diagram is shown completeness naturally does not give information
in Fig.4(b). Actually, as far as x<a about methods of effective synthesis. Some methods
x − a − k < −k and − maj( x,−a,−k ) = −k . Note of a circuit design in the proposed basis will be
that for all values of x , developed later.
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
112
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
2.3 Fuzzy Devices as Multi-Valued and controllers’ behaviour as (7) and a plenty of
Analog Circuits publications contain piecewise-linear
Conventional implementation of fuzzy devices approximations of the corresponding surfaces.
usually has the structure shown in Fig.6. Analog The apparent conclusion can be made from the
variables X = {x1 , x 2 ,..., x n } enter the fuzzy device things mentioned above: if a fuzzy controller is
represented as (7), it can be implemented as
input. Fuzzifier converts a set of analog variables
superposition of multi-valued threshold elements. In
x j into sets of weighted linguistic (digital) this case, owing linear behavior of the threshold
variables A = {a1 , a 2 ,..., a n } . element in the zone between the saturation levels
((2) and Fig.3 (b)), natural piecewise linear
approximation appears between the discrete points
Defuzzifier of specification.
Inference
Fuzzifier
X A B Y
Fuzzy
analog digital digital analog In the last subsection of this section some
illustrations will be given to show that for a number
of real applications the offered approach can
Fig.6 Conventional structure of a fuzzy device provides simple and efficient circuits of controllers.
implementation.
Fuzzy Inference block generates based on the 2.4 Fuzzy Controller Implementations as
fuzzy rules a set of weighted linguistic variables Circuits from Threshold Elements
values B = {b1 , b2 ,..., bk } .
Defuzzifier converts sets of weighted linguistic
(digital) variables B = {b1 , b2 ,..., bk } into a set of 2.4.1 Example 1
output analog variables Y = { y1 , y 2 ,..., y k } . Let us consider the example, which is taken from [9,
pp. 81 – 86]: “Design of a Rule-Based Fuzzy
As a rule, fuzzifier and defuzzifier include AD
Controller for the Pitch Axis of an Unmanned
and DA (analog-digital and digital-analog)
Research Vehicle”.
converters and are implemented on both levels
The fuzzy control rules for the considered device
(hardware and software). Fuzzy inference is usually
depend on the error value e = ref − output and
implemented on the level of microprocessor
software. old e − new e
changing of error ce = . Fuzzifier
It is easy to see that each set of values of output sampling period
analog variables unambiguously corresponds to gives seven linguistic variables for each of input
some set of input analog variable values; hence a analog variables (NB – negative big; NM – negative
fuzzy device could be specified as a functional middle; NS – negative small; ZO – zero; PS –
analog of a signal converter positive small; PM – positive middle; PB – positive
Y ( X ) = { y1 ( X ), y 2 ( X ),..., y k ( X )} big). The output has the same seven gradations.
and its output Y determines a system of n- Corresponding 49 fuzzy rules are represented in
dimensional surfaces. In cases of sufficient simple Table 1.
membership functions (in known publications such Table 1: Table of Fuzzy Rules
functions are in majority), for fuzzy controller e
implementations as analog devices it is sufficient to NB NM NS ZO PS PM PB
provide a piecewise-linear approximation between a NB ZO PS PM PB PB PB PB
couples of points calculated as adjacent values of a NM NS ZO PS PM PB PB PB
multi-valued logic function. NS NM NS ZO PS PM PB PB
ce ZO NB NM NS ZO PS PM PB
Let m = 2k + 1 linguistic variables a j ( a j ∈ A )
PS NB NB NM NS ZO PS PM
correspond to values of analog variable xj PM NB NB NB NM NS ZO PS
( x j ∈ X ). Then basing on a system of fuzzy rules, PB NB NB NB NB NM NS ZO
we can specify a system of m-valued logic Let us split evenly the source voltage (e.g. 3.5V)
functions, as follows: onto seven logical levels corresponding to linguistic
B( A) = {b1 ( A), b2 ( A),..., bk ( A)} . (7) levels and enumerate them with integer numbers
Note that most publications describing fuzzy from -3 to +3. Then Table 2 will represent Table 1
controllers contain tables specifying fuzzy as the function of seven-valued logic.
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
113
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
Table 2: The Seven-Valued Function them is the operational force sensor Fh ; the other is
e “the environmental force sensor” ω . Each of input
0 -3 -2 -1 0 1 2 3 and output variables of the manipulator controller is
-3 0 1 2 3 3 3 3 represented with three linguistic variables – S
-2 -1 0 1 2 3 3 3 (small), M (middle) and B (big). The controller has
-1 -2 -1 0 1 2 3 3 five fuzzy rules, as it follows:
ce
0 -3 -2 -1 0 1 2 3 If ω = S then Output=B;
1 -3 -3 -2 -1 0 1 2 If ω = B then Output=S;
2 -3 -3 -3 -2 -1 0 1 If ω = M and Fh = S then Output=S;
3 -3 -3 -3 -3 -2 -1 0 If ω = M and Fh = M then Output=M;
It is seen from Table 2 that the function is If ω = M and Fh = B then Output=B;
symmetric with respect to “North-West – South- The controller Output is three-valued logic
East” diagonal and its values can be calculated as function specified in Table 3.
e − ce . This dependency is shown in Fig.7.
Table 3: The ternary function
3
Output Fh
2 −1 0 +1
1
-6 -5 -4 -3 -2 -1 e-ce −1 +1 +1 +1
1 2 3 4 5 6
-1 ω 0 −1 0 +1
-2
-3
+1 −1 −1 −1
Fig.7 Graphical representation of the function
specified by Table 2. It can be simply proved by trivial substitution
that Output = maj ( 2ω , − Fh , 0) and СMOS
It apparently follows from comparison of Fig.3 implementation coincides with the circuit shown in
(b) and Fig.7 that in order to reproduce the function Fig.8, if make substitutions Ve = VFh , Vce = Vω and
specified by Table 2 it is sufficient to have one two-
input summing amplifier and one one-input change the weight of the input Vω to 2.
amplifier that will be called inverter.
Note that inversion of logic variables lying
within − k ÷ + k interval is the operation of 2.4.3 Example 3. Fuzzy Controller for Washing
diametric negation x = − x ; the operation Machine
This example is taken from Aptronix Incorporated
Vout = Vdd − Vin corresponds to it in the terms of (http://www.aptronix.com/fuzzynet).
summing amplifier’s input and output voltages.
Thus CMOS circuit containing 12 transistors and 5 A. Controller specification
resistors, which implements our function, is shown Input variables:
in Fig.8. Dirtiness of clothes: Large (L), Medium (M), and
S1 Small (S);
Vdd-Ve S2
1 1 Vout Type of dirtiness: Greasy (G), Medium (M), and Not
1 Greasy (NG).
Ve Vce Output variable is washing time (minutes): Very
Fig.8 Implementation of the fuzzy controller Long (VL), Long (L), Medium (M), Short (S), and
specified by Table 2. Very Short (VS).
Fuzzy rules are represented in Table 4.
2.4.2 Example 2 Table 4: Matrix of linguistic variables
This example is taken from [9, pp. 168 – 172]: Dirtiness of clothes
Wash. time
“Manipulator for Man-Robot Cooperation (Control S M L
Method of Manipulator/Vehicle System with Fuzzy NG VS S M
Inference)”. Type of dirt. M M M L
In the considered example the experimental G L L VL
manipulator has two force/torque sensors. One of
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
114
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
According to our approach Table 4 can be ( wash. time) = S (ϕ 3 (Y ) − 0.5 ⋅ X − 2 − ϕ 2 ) .
transformed into the table of multi-valued logic
variables (Table 5). Now let us introduce the function:
0, − 2, − 2
Table 5: Matrix of multi-valued variables
Dirtiness of clothes (Y) ϕ 4 ( X , Y ) = S ( X + Y + 4) = − 2, − 2, − 2 (11)
Wash. time − 2, − 2, − 2
−2 0 +2
−2 −2 −1 0
Type of dirt. and form the second intermediate sum:
0 0 0 +1
(X)
+2 +1 +1 +2
+ 1, 0, 0
In this table the output variable Wash. time has 5 0.5 ⋅ ϕ 4 ( X , Y ) + 1 = 0, 0, 0 = −ϕ 2 . (12)
logical levels but input variables X and Y have only 0, 0, 0
three. Because of change ranges of the output and Finally
input variables should be the same in the Table 5
logical levels of input variables X and Y are −2, 0, ( wash time ) = S [ϕ 3 (Y ) − 0.5 ⋅ X − 1 +
and +2. 0.5 ⋅ ϕ 4 ( X ,Y )] = S 4 [ S1 (0.5Y − 2) + (13)
0.5 ⋅ S 2 ( X + Y + 4) + 0.5 ⋅ S 3 ( X ) − 1]
B. Functional decomposition
Let us represent the washing time matrix as a sum of
two matrices: In Fig.9 the CMOS implementation of the
wash time ϕ1 ϕ2 expression (13) is presented. The circuit is
implemented as the superposition of four multi-
− 2 −1 0 −1 −1 0 −1 0 0 valued threshold elements.
(8)
0 0 +1 = 0 0 +1 + 0 0 0
+1 +1 + 2 +1 +1 + 2 0 0 0 S1
Y 0.5
or ( wash. time) = S ( −ϕ1 − ϕ 2 ) were S is the 1
S4
function of summing amplifier with saturation. S2 1 Vout
0.5
Let us take into consideration a function of one Y 1 0.5
X 1 0.5
variable PWR 2
ϕ 3 (Y ) = S (0.5 ⋅ Y − 2) = + 2 + 2 + 1 . (9) S3
In (9) Y corresponds to the dirtiness of clothes and X 1
varies from –2 to +2 as follows
Fig.9 CMOS implementation of fuzzy controller
Y =| −2 0 + 2 | . for washing machine.
Now the following intermediate sum is
introduced: The result of the SPICE simulation of the circuit
in Fig.9 is shown in Fig.10 in the form of response
+ 1, + 1, 0 surface.
ϕ 3 (Y ) − 0.5 ⋅ X − 2 = 0, 0, − 1 . (10) In Fig.10 all variables are represented in voltages.
The correspondence of logical values to voltages is
− 1, − 1, − 2
shown in Table 6. It is easy to see that the controller
Here X corresponds to the type of dirtiness and output signal represented by the surface in Fig.10
varies also from –2 to 2 as follows has linear approximation between adjacent logical
levels.
−2
Table 6: Correspondence voltages to logical levels
X = 0 . -2 -1 0 1 2
+2 0V 0.875V 1.75V 2.625V 3.5V
From (8) and (10) it is easy to see that (10) is
− ϕ1 and
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
115
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
note that equations (14) and (15) represent multi-
valued functions in a piecewise-constant manner.
An example of a 7-valued function is given in
Fig.11(a).
a) b)
3 3
2 2
1 1
1 2 3 1 2 3
−3 −2 −1 −3 −2 −1
−1 −1
−2 −2
−3 −3
Fig.10 Results of SPICE simulation for the Fig.11 Example of a seven-valued function:
controller in Fig.9. a) piecewise-constant representation;
b) piecewise-linear representation.
3 Universal Method of Implementing Taking into account fuzzification and
Fuzzy Inference Rules defuzzification procedures in fuzzy logic,
It was shown in 2.2 and [5, 6] that a summing corresponding multi-valued logic function should
amplifier with saturation is a functionally complete has at least piecewise-linear approximation between
element in any multi-valued logic (of an arbitrary adjacent logical levels. Fig.11(b) gives an example
value). Thus it may serve as a basis for hardware of such a representation of the function with evenly
implementation of fuzzy devices. distributed logical values of the input and the output
The study subject is design techniques for analog in the range of corresponding voltages.
CMOS circuits implementing fuzzy controller
multi-valued functions.
Without departing from the general character of 3.1 Masking Inputs of Summing Amplifiers
the study, let us suppose that the logic has odd value Let us rewrite the definition (2) of the inverting
( m = 2k + 1 and − k ≤ x j ≤ + k ) . Let’s also assume summing amplifier with saturation in the following
L
that X = {x1 , x 2 , , x n } is a set of input multi-
form:
⎧ n
valued variables and y = F ( X ) is the output ⎪ + k if ∑
i =1
α i ⋅ xi + β ≤ − k
variable. Then for a function of multi-valued logic it ⎪ n
⎪
is possible to build an analog of the Shannon’s S ( A ⋅ X ; β ) = ⎨ − ∑α i ⋅ xi − β in other cases (16)
decomposition in the binary logic: ⎪ i =1
⎪ n
y i = Fi ( X ) = ⎪ −k if + k ≤ ∑α i ⋅ xi + β
⎩ i =1
+k (14)
= U [if x j = α then y = F ( x j = α , X \ x j )]. where A = {α1 ,α 2 ,..., α n } is a set of weight
α =−k
coefficients, X = {x1 , x2 ,..., xn } is a set of analog or
Equation (14) can be further expanded so that it
would be possible to build an realizing circuit using multi-valued variables, β is a constant symbolizing
the variables exclusion method. To this effect, we a threshold, and ± k is a saturation value (in the
need a sub-circuit implementing the function: case of m-valued logic, m = 2k + 1 ).
Let us introduce a masking function M α (x ) by
if Z = A then y = F ( Z = A, X \ Z ) (15)
the next way:
where Z ⊂ X and A is a value combination of the
variable set Z .2 ⎧+ k if x ≤ α −1
⎪
Having a basic element (sub-circuit realizing M α ( x ) = ⎨k (α − x ) if α −1< x < α +1 (17)
(15)), we can implement a fuzzy device directly ⎪− k if α +1 ≤ x
⎩
according to the system of fuzzy rules. However,
where α ( − k ≤ α ≤ k ) is a fixed value of the
2
It is possible to add else in (15) that can be defined by variable x . It can be easily seen that when x = α ,
circuit requirements.
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
116
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
a) M (x) b)
M α (α ) = 0 . Fig.12 illustrates an example of the -1
3
-M-1 (x)
3
function M −1 ( x ) for m = 7 . 2 2
S(-M -1(x);2) S(M -1 (x);2)
3
M-1(x) 1 1
2 -3 -2 -1 1 2 3 x -3 -2 -1 1 2 3 x
-1 -1
1
1 2 3 -2 -2
−3 −2 −1 x -3 -3
−1
c) y
−2 3
−3 2
Fig.12 M −1 ( x ) diagram for m = 7 . 1
-3 -2 -1 1 2 3 x
Taking into account that the source voltage -1
Vdd has the logical value equal to +k and the ground -2
-3
potential Vgnd has the logical value equal to –k, the
mask-function can be easily implemented on bases Fig.14 Implementation example of the rule (19).
of summing amplifier as
⎧ S ( kx; − α ⋅ Vdd ) if α < 0 3.2 Mask-Functions of Other Types
⎪ To decrease the number of variables, which an m-
M α ( x ) = ⎨ S ( kx ) if α = 0 (18)
⎪ S ( kx; α ⋅ V ) if α > 0 valued logical function depends on, by one using the
⎩ gnd
analog of Shannon’s decomposition (14) we need to
where x ( Vgnd ≤ x ≤ Vdd ) is measured in voltages. implement m rules of the type (19) and to find m
components F ( x = α , Y ), -k ≤ α ≤ + k of the
Using the mask-function M α (x ) it is possible to decomposition. Sometimes the number of rules can
implement the rule be reduced, if the function F ( x , Y ) doesn’t change
if x = α then y = F ( x = α ,Y ) else y = 0 , (19) on some interval of changing logical values of the
variable x. A single rule can correspond to such
which extracts the value of the function interval of the variable x and the conditional part of
F ( x = α , Y ) in the point x = α , using the circuit this rule can have one of three forms: α ≤ x ≤ β ,
from summing amplifiers shown in Fig.13. x ≤ β , α ≤ x where − k ≤ α < β ≤ + k . For the
condition α ≤ x ≤ β let us construct the following
F(x=α ,Y)
mask-function:
1 1 y
Mα (x) 1 1
1
M α ,β ( x ) =
1 ⎧+ k if x ≥ β + 1
⎪ (21)
1 1
-Mα(x) ⎨ − M α −1 ( x ) − M β +1 ( x ) if α − 1 < x < β + 1
⎪
Fig.13 Implementation of the rule (19). ⎩− k if x ≤ α − 1
This implementation can be written in analytical It is easy to see (Fig.15(b)) that on the interval
form as α ≤ x ≤ β this function takes the value 0.
In the case when α = −k or β = k , this mask-
y = S{S [ M α ( x ); F ( x = α ,Y )]; S [ S ( M α ( x ));
(20) function will have one of the forms:
F ( x = α ,Y )]; F ( x = α ,Y )}.
⎧+ k if x ≥ β + 1
For example, in the case when α = −1 , M −k , β ( x ) = ⎨ or (22)
F ( x = −1, Y ) = 2 , and m = 7, the behavior of the ⎩+ k − M β +1 ( x ) if x < β + 1
circuit in Fig.13 can be represented by Fig.14. ⎧− M α -1 ( x ) − k if α − 1 < x
Analyzing the implementation of the rule (19) it M α ,+k ( x ) = ⎨ (23)
⎩− k if x ≤ α − 1
is possible to see that in it the condition x = α is
realized as the condition M α ( x ) = 0 . and represents conditions x≤β or α≤x
respectively.
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
117
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
Mask-functions (21), (22), and (23) can be 3.3 An Application Example of Interval
implemented on bases of summing amplifiers as Masking
M α ,β ( x ) = S [ M α −1 ( x ); M β +1 ( x )] , (24) For further explanation of the matter discussed in
3.2, let us recall an example from [4, pp. 123 – 128]
M −k ,β ( x ) = S [Vgnd ; M β +1 ( x )] , (25) “A Fuzzy Logic Force Controller for a Stepper
M α ,k ( x ) = S [ M α −1 ( x );Vdd ] . (26) Motor Robot”.
The fuzzy controller implements the function of
Let us look how the masking can be performed two analog variables: position error and force error,
for a wider scope of the variable changes, such as: which will be designate as x and y respectively.
if α ≤ x ≤ β then y = F (α ≤ x ≤ β ,Y ) = Φ (Y ) Each of the variables x and y is represented with
(27)
else y = 0. 7 linguistic variables: NL, NM, NS, ZE, PS, PM,
Using the mask-function M α ,β ( x ) it is possible PL, and their membership functions are shown in
Fig.16.
to transform the rule (27) into the following form:
NL NM NS ZE PS PM PL
if M α,β ( x ) = 0 then y = F (α ≤ x ≤ β ,Y ) = 1
(28)
degree of membership
= Φ (Y ) else y = 0. 0.8
The rule (28) can be implemented with the circuit 0.6
shown in Fig.13, if to change in it the inputs M α ( x )
0.4
and F ( x = α , Y ) with the inputs M α ,β ( x ) and
0.2
Φ (Y ) respectively. This implementation is
0
represented analytically as -3 -2 -1 0 1 2 3
universe of discourse
y = S{S [ M λ ,δ ( x ); Φ (Y )]; S [ S ( M λ ,δ ( x ));
(29) Fig.16 Fuzzy sets for force error and position
Φ (Y )]; Φ (Y )}. error inputs.
The sequence of pictures in Fig.15 illustrates the
The Inference Engine Rule Matrix for the output
implementation of the rule
linguistic variable from the cited work looks as it is
if − 2 ≤ x ≤ +1 then y = −2 else y = 0 shown in Table 7.
for the case of ( m = 9 )-valued logic. Table 7: Rule matrix of the inference engine
position error (x)
a) 4 b) 4
NL NM NS ZE PS PM PL
3 M+2(x) 3
NL NM NL NL NL NL NL NM
2 2 NM NS NM NM NM NM NM NS
M-2,+1(x) =
1 S(M-3(x);M+2(x)) 1 force NS ZE NS NS NS NS NS ZE
error ZE ZE ZE ZE ZE ZE ZE ZE
-4 -3 -2 -1 1 2 3 4 x -4 -3 -2 -1 1 2 3 4
x
-1 -1 (y) PS ZE PS PS PS PS PS ZE
-2 -2 PM PS PM PM PM PM PM PS
M-3(x) -3 -3 PL PM PL PL PL PL PL PM
-4 -4
Let us transform the Table 7 into the Table 8
c) y
4 d) 4 taking into account that we are going to produce
3 3 fuzzy inference calculating values of the
2 2
corresponding multi-valued logic function.
1 1
Table 8 comprises only two different columns
-4 -3 -2 -1
-1
1 2 3 4
x -4 -3 -2 -1
-1
1 2 3 4 x defining two functions depending on the variable
-2 -2 force error (Table 9).
S(S(M-2,+1(x));-2) S(M-2,+1(x);-2) S(S(S(M (x));-2);S(M (x);-2);-2) Fig.17 illustrates graphs of these functions. It is
-3 -2,+1 -2,+1
-4 -4 easy to see that the function F1 ( y ) looks like mask-
Fig.15 Example of mask-functions application. function M −1,1 ( y ) but has different slops of the
lines. By analogy with (17), (18), (21), (24),
Fig.15(a), and Fig.15(b), it is possible to construct
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
118
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
the function F1 ( y ) in accordance with graphics in if NM ≤ x ≤ PM then Output = F2 ( y )
or
Fig.18. else Output = F1 ( y );
Table 8: Matrix of the multi-valued logic function if − 2 ≤ x ≤ +2 then Output = F2 ( y )
position error (x)
(31)
else Output = F1 ( y ).
-3 -2 -1 0 1 2 3
-3 -2 -3 -3 -3 -3 -3 -2 It is possible to split the rule (31) into two rules
-2 -1 -2 -2 -2 -2 -2 -1 and represent them as:
force -1 0 -1 -1 -1 -1 -1 0
error 0 0 0 0 0 0 0 0 if M -2,+2 ( x ) = 0 then Output = F2 ( y )
(32)
(y ) 1 0 1 1 1 1 1 0 else Output = 0;
2 1 2 2 2 2 2 1
3 2 3 3 3 3 3 2 if M -2, +2 ( x ) ≠ 0 then Output = 0
(33)
else Output = F1 ( y ).
Table 9: Two different functions of the force error
force error (y) The rule (32) can be implemented in accordance
-3 -2 -1 0 1 2 3 with (29) and (30) and (24) as
F1 ( y ) -2 -1 0 0 0 1 2
⎧ M −2, +2 ( x ) = S 4 ( M −3 ( x ); M +3 ( x )),
F2 ( y ) -3 -2 -1 0 1 2 3 ⎪
⎪− M −2, +2 ( x ) = S 5 ( M −2, +2 ( x )),
⎨
⎪Φ 1 = S11{S 6 [ M −2, +2 ( x ); F2 ( y )]; S 7 [− M −2, +2 ( x );
a) b) ⎪ F2 ( y )]; F2 ( y )}.
F1(y)
3
F2(y)
3
⎩
2 2 It is easy to check that the rule (33) can be
1 1 implemented in accordance with the structural
-3 -2 -1 1 2 3 y -3 -2 -1 1 2 3 y scheme shown in Fig.13, in which the output
-1 -1 amplifier has the weight equal to 2 of the input
-2 -2 F1 ( y ) :
-3 -3
Φ 2 = − S10 {S 9 [ M −2, +2 ( x ); F1 ( y )]; S8 [ − M −2, +2 ( x );
Fig.17 Components of the function defined by F1 ( y )];2 F1 ( y )}.
Table 8 and decomposed relative to variable x.
Finally the output of the controller can be
a) b)
3
F1 ( y ) = S 3 ( 23 S1 ; 23 S 2 )
3
calculated as
S 2 ( 32 y; 32 Vgnd ) Output = Φ 1 + Φ 2 .
2 2
1 1 For producing this summation it is possible to use
-3 -2 -1 1 2 3 y -3 -2 -1 1 2 3 y summing amplifier S11
-1 -1
-2 -2
Output = S11 ( −Φ1 ;−Φ 2 ).
S1 ( 23 y; 23 Vdd )
-3 -3
Fig.19 illustrates the structural scheme of the
controller implementation with elements containing
Fig.18 Constructing of the function F1 ( y ) .
designations of input weights.
As a result, the functions F1 ( y ) and F2 ( y ) can Vdd M −3( x)
3
S4 S6 1 S11
be implemented as x 3 1
1
1 Vout
1
1 1
3 S5 S7 1
F1 ( y ) = S 3 [ 23 S 2 ( 23 y ; 32 V gnd ); 23 S1 ( 23 y ; 32 Vdd )], 3 M +3 ( x)
1
(30) 1 1
F2 ( y ) = y. S1 S3 S8
3/2 2/3 1 S10
y 3/2
2/3
1 1
It is seen from the Table 7 and Table 8 that the S2 S9 1
2
3/2 1
behaviour of the controller's output in the 3/2 1
decomposition by variable x has the form:
Fig.19 Structural diagram of the controller.
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
119
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
The controller circuit has been constructed from into component matrices with relatively simple
three-stage push-pull CMOS operational amplifiers configuration of elements allocation, for which
with 1-MegOhm resistors in the feedback (Fig.2 rather simple implementations can be find. The
(b)). It’s functioning has been checked with SPICE topologies of valuable elements inside of such
simulation (MSIM 8). MOSIS BSIM3v3.1, level 7 component matrices can be specified as
model of 0.4μm transistors has been used. In this symmetrical, diagonal, matrixes with linear
paper, all other SPICE simulation experiments with configurations of elements, with elements located
designed circuits of controllers have been executed along rows and columns, matrices containing single
under the same conditions. valuable element, and others.
In the experiments with the controller presented The best way to introduce particular design
in Fig.19, source voltage was 3.5V, input variable x methods is to show possible matrix decomposition
changed linearly from 0V to 3.5V, input variable y into a set of implementable matrices on bases of a
changed discreetly in accordance with its logical real design example.
values and kept constant value within one cycle of x Let us take the description of the rather complex
changing. fuzzy controller from the patent [10] of Toyota
For the controller constructed from 3-stage Motors Corporation. The controller calculates a
elements results of SPICE simulation are shown in regeneration time decision coefficient R on the base
Fig.20. It is possible to see that the functioning of on a differential pressure coefficient K p and total
the controller is correct (logical values of the circuit
fuel consumption Q f . The set of fuzzy rules in
output depend on the logical values of the input
variables in accordance with Table 7 and 8). terms of linguistic variables is represented in Table
10. Transformations of the input and output analog
signals are performed in accordance with
corresponding membership functions.
Table 10: Fuzzy rules for regeneration time
decision coefficient R.
Kp
NB NM NS ZO PS PM PB
NB NB NB NM NS ZO PB PB
NM NB NM NS NS ZO PB PB
NM NM NS ZO ZO PS PB
Q f NS
ZO NM NS ZO ZO PS PM PB
PS NS ZO ZO PS PS PM PB
PM ZO ZO PS PM PM PM PB
Fig.20 SPICE simulation results for the controller PB PS PS PM PM PM PB PB
constructed from 3-stage summing amplifiers.
Analysis of the membership functions in [10] of
linguistic variables representing input and output
4 Particular Methods of Fuzzy analog signals shows that the linguistic variables
Inference Implementation having maximum weight are evenly distributed
The universal method of implementing multi-valued within the change ranges of corresponding analog
logic functions proposed in the previous section can signals. It means that without losing the accuracy of
be always used but often can give inappropriate representation, these linguistic variables can be
results due to its universality. For this reason some replaced with logical values as it is shown in Table
particular design methods for fuzzy inference part of 11.
controllers were developed. These methods utilize Table 11: The 7-valued logical function
specific properties of certain multi-valued logical x\y -3 -2 -1 0 1 2 3
function descriptions corresponding to sets of fuzzy -3 -3 -3 -1 -1 0 3 3
inference rules. -2 -3 -2 -1 -1 0 3 3
According to the approach described above, an -1 -2 -2 -1 0 0 1 3
initial set of fuzzy rules is represented in the form of 0 -2 -1 0 0 1 2 3
a matrix or matrices defining multi-valued logical 1 -1 0 0 1 1 2 3
functions. As a rule these matrices cannot be 2 0 0 1 2 2 2 3
directly implemented. They must be decomposed 3 1 1 2 2 2 3 3
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
120
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
In this table, signals Q f and K p are changed with To implement the function f1 ( z ) let us represent
7-valued logic variables x and y respectively. it as a sum of 5 subfunctions α j ( z ) shown in
Fig.22.
4.1 Extracting a Symmetrical Component 3
Matrix 2
Let the Table 11 of the controller is represented as
initial matrix M, which, in its turn, can be 1
represented as sum of two component matrixes (M1 α3 α4 α5
and M2). -3 -2.5 -2 -1.5 -1 -0.5 0.5 1 1.5 2 2.5 3
M z=(x+y)/2
α1 -1
− 3 − 3 − 2 −1± 0 + 3 + 3 α2
− 3 − 2 −1−1± 0 + 3 + 3 -2
− 2 − 2 −1± 0 ± 0 +1+ 3
-3
− 2 −1± 0 ± 0 +1+ 2 + 3 =
Fig.22 Five components of the function f1 ( z ) .
−1± 0 ± 0 +1+1+ 2 + 3
± 0 ± 0 +1+ 2 + 2 + 2 + 3 It is easy to see, that
5
+1+1+ 2 + 2 + 2 + 3 + 3
f1 ( z ) = ∑j α j ( z ) . (34)
M1 M2 =1
− 3− 3− 2 − 2 −1± 0 ± 0 ≤ 0 ≤ 0 ± 0 +1+1+ 3 + 3 Let us consider formation of α j (z ) using
− 3− 2 − 2 −1± 0 ± 0 +1 ≤ 0 ± 0 +1± 0 ± 0 + 3 ≥ 2 summing amplifiers on the example of α1 ( z ) . For
− 2 − 2 −1± 0 ± 0 +1+1 ± 0 ± 0 ± 0 ± 0 ± 0 ± 0 ≥ 2 this let us address to Fig.23.
− 2 −1± 0 ± 0 +1+1+ 2 + ± 0 ± 0 ± 0 ± 0 ± 0 +1 ≥ 1 3
−1± 0 ± 0 +1+1+ 2 + 2 ±0±0±0±0±0±0 ≥1
β1 2
± 0 ± 0 +1+1+ 2 + 2 + 3 ± 0 ± 0 ± 0 +1± 0 ± 0 ≥ 0
± 0 +1+1+ 2 + 2 + 3+ 3 +1± 0 +1± 0 ± 0 ≥ 0 ≥ 0 1
δ1
Matrix M1 corresponds to a symmetrical component
-3 -2.5 -2 -1.5 -1 -0.5 0.5 1 1.5 2 2.5 3
and M2 corresponds to nonsymmetrical residual z=(x+y)/2
component. -1
Matrix M1 is symmetrical relative to the side
diagonal. Its components can be represented as a -2
function f1 ( z ) of one variable z = ( x + y ) / 2 . After -3
performing the linear approximation between Fig.23 Representation of the function α1 ( z ) .
adjacent logical levels this function will has the
form shown in Fig.21.
The function β1 ( z ) in Fig.23 can be implemented as
3
f1(z) β1 ( z ) = − S ( k1 ⋅ z + a1 ) . For z = −2.25 , β1 = 0 then
a1 = 2.25 ⋅ k1 . Taken into account that
2
k1 = 6 / 0.5 = 12 , we receive a1 = 27 and
1 β1 ( x, y ) = − S (6 ⋅ x + 6 ⋅ y + 27) ,
z=(x+y)/2 δ 1 ( x , y ) = 16 ⋅ β 1 ( x , y ) .
-3 -2.5 -2 -1.5 -1 -0.5 0.5 1 1.5 2 2.5 3 Finally
-1
α1 ( x , y ) = δ 1 ( x , y ) − 0.5 = 16 ⋅ β1 ( x , y ) − 0.5 . (35)
-2 In the same way it is possible to find
-3 α 2 ( x, y ) = 13 β 2 ( x, y ) − 1 =
Fig.21 Graph of the function f1 ( z ) . − 13 S (3 ⋅ x + 3 ⋅ y + 6) − 1;
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
121
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
α 3 ( x, y ) = 16 β 3 ( x , y ) + 0.5 = logical value less than a and more than b
respectively. Let us split the matrix M2 in two
− 16 S (6 ⋅ x + 6 ⋅ y − 3) + 0.5; matrices (M3 and M4) and try to implement the
α 4 ( x , y ) = 16 β 4 ( x , y ) + 0.5 = matrix M3. The matrix M4 is a new residual matrix.
(36) Let us address to Fig.24. It is easy to see that the
− 16 S (6 ⋅ x + 6 ⋅ y − 15) + 0.5;
matrix M3 consists of elements with two different
α 5 ( x, y ) = 16 β 5 ( x, y ) + 0.5 = values, which can be separated with help of two
− 16 S (6 ⋅ x + 6 ⋅ y − 27) + 0.5. parallel lines: x − 3 y + 8 = 0 and x − 3 y + 8 = 1 . A
new variable is introduced
The function f1 ( z ) can be calculated in
w = x − 3y + 8 . (38)
accordance with (34) on one summing amplifier.
Finally taking into account mutual compensation of Value of the variable w in the point with
constants, we have coordinates ( x , y ) is proportional to the distance of
f1 ( x, y ) = S{− 16 ⋅ [ β1 ( x, y ) + 2 ⋅ β 2 ( x, y ) + this point from the line. In all points lying on and up
(37) of the line, w ≤ 0 , and in all points lying on and
β 3 ( x, y ) + β 4 ( x, y ) + β 5 ( x, y )]}. down of the dashed line ( x − 3 y + 7 = 0 ), w ≥ 1 .
Thus, the implementation of the function
f1 ( x, y ) , which represents the matrix M1, consists
-3
of six summing amplifiers.
-2
-1 x-3y+8=0
4.2 Extracting a Matrix with Elements
Separated by a line -3 -2 -1 0 1 2 3
y
This method is applicable for realization of matrices 1
composed from two types of elements, which can be
separated with a line. 2
After extracting the symmetrical component the
residual matrix is M2. 3
x
M2 Fig.24 Separating valuable elements of
≤ 0 ≤ 0 0 +1+1 + 3 + 3 the matrix M3.
≤ 0 0 +1 0 0 + 3 ≥ 2 It is easy to see, that the matrix M3 representing
0 0 0 0 0 0≥2 the function f 2 ( x, y ) can be implemented as
0 0 0 0 0 +1 ≥ 1 =
f 2 ( x, y ) = S{S [3( − x + 3 y − 8)] − 3} . (39)
0 0 0 0 0 0 ≥1
0 0 0 +1 0 0 ≥ 0 In this implementation all valuable matrix elements
are equal to “3”.
+1 0 +1 0 0 ≥ 0 ≥ 0
M3 M4
0 0 0 0 0 + 3+ 3 ≤ 0 ≤ 0 0 +1+1≥ 0 ≥ 0 4.3 Extracting a Matrix with Rectangular
Configuration of Valuable Elements
0 0 0 0 0 + 3+ 3 ≤ 0 0 +1 0 0 ≥ 0 ≥ 0 Let us introduce a Pyramid Function that is the
0 0 0 0 0 0+3 0 0 0 0 0 0≥0 function, which corresponds to a matrix with a
0 0 0 0 0 0+3 + 0 0 0 0 0 +1 ≥ 0 single valuable element and represents a rule of the
type
0 0 0 0 0 0+3 0 0 0 0 0 0≥0
if ( x = a ) & ( y = b) then f ( x, y ) = c
0 0 0 0 0 0 0 0 0 0 +1 0 0 ≥ 0 (40)
else f ( x, y ) = 0.
0 0 0 0 0 0 0 +1 0 +1 0 0 ≥ 0 ≥ 0
This function is shown in Fig.25.
This matrix has some elements of types ≤ a The Pyramid Function has some fixed value c
and ≥ b . This means that instead of values a ( −k ≤ c ≠ 0 ≤ + k ) at the point (a , b) and at the rest
and b of the elements it is possible to substitute any of the space bordered by points neighboring to
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
122
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
(a , b) this function is zero. The transition from c to γ (x)
zero is linear. Neighborhood is defined by k
coordinate increments Δ x = ±1 and Δ y = ±1 .
f(x,y) x
-k a-1 a a+1 k
y
x -k
Fig.27 Graph of the function γ (x ) .
The function γ ( x , y ) equals to “0” when
Fig.25 A pyramid function.
( x = a ) & ( y = b) and equals to “+ k ” for all other
Let's turn to Fig.26 to construct the pyramid matrix points.
function. Now it is easy to construct the pyramid function
with height “c” presented in Fig.25:
Ma+1(x) -Ma-1(x) c
k f ( x, y ) = S [γ ( x , y ) − k ] . (45)
k
A pyramid of an arbitrary height is obtained by
simple input gain factor scaling of the next
amplifier. The pyramid sign can be elementarily
a-1 a+1 x changed at the stage of component mask-function
-k a k constructions.
We anticipate some complications in the case
when it is needed to receive good "sewing"
pyramids with already implemented functions. The
-k pyramid function f ( x, y ) (45) of Fig.25 type has
Fig.26 Component functions of the pyramid intersections with the flats y = {b, b ± 5, b ± 1} and
projection onto the flat y = b ; c = k . with the flats x = {a , a ± 0.5, a ± 1} shown in Fig.28.
The figure shows two component mask-functions a)
f b)
f
y=b x=a
M a +1 ( x ) and − M a −1 ( x ) those are implemented for y = b ± 0.5 x = a ± 0 .5
(2 ⋅ k + 1) -valued logic ( − k ≤ x ≤ + k ) as: y = b±1 x = a ±1
M a +1 ( x ) = S [k ⋅ ( x − a − 1)], a x b y
(41)
− M a −1 ( x ) = S [k ⋅ ( − x + a − 1)].
Similarly component functions of the pyramid Fig.28 Graph of the pyramid function a) by
projection onto the flat x = a for the case c = k can coordinate x and b) by coordinate y.
be constructed as:
M a +1 ( y ) = S [k ⋅ ( y − b − 1)], When “sewing” a pyramid function with other
(42)
− M a −1 ( y ) = S [k ⋅ ( − y + b − 1)]. functions to get monotonous piece-linear
It is easy to check that the function approximation between adjacent logical values the
view of the pyramid function by each of its
γ ( x ) = S [ M a +1 ( x ) − M a −1 ( x ) − 2k ] (43)
coordinate can be changed to one of variants shown
has the form shown in Fig.27; γ (x ) equals to “0” in Fig.29.
when x = a and equals to “ + k ” for all other To construct a pyramid function with graphs by
integer argument values. coordinates x and y of the Fig.29(a) type (center
In a similar manner, we can construct the trapeze), it is sufficient to substitute in the functions
following function of 2 variables: (41) – (45) instead of original variables x, y new
γ ( x, y ) = S [ M a +1 ( x ) − M a −1 ( x ) + variables z = x + y , w = x − y and instead of points
(44)
M b+1 ( y ) − M b−1 ( y ) − 4k ]. a, b points c = a + b , d = a − b respectively.
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
123
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
a)
f b)
f c)
f It is easy to see that the function
y=b y=b y=b f ( x, y ) = ϕ [ x, ξ ( y )] + ψ [ x, ξ ( y )] has the right-hand
y = b ± 0.5 y = b ± 0.5 y = b ± 0.5
y = b ±1 y = b ±1 y = b ±1 trapeze form along the axis x (Fig.29(b)). If the
a x a x a x function ξ ( y ) has a triangle form, ξ (b) = ± k , and
ξ ( y < b − 1) = ξ ( y > b + 1) = 0 , the function f ( x, y )
is a pyramid function. The way of constructing the
Fig.29 Possible graphs of a pyramid function by
function f ( x, y ) with left-hand trapeze form along
one of coordinates: a) center trapeze,
b) right trapeze, c) left trapeze. the axis x (Fig.29(c)) now is obvious.
It is not difficult to check that the functions
It means the transition to the pyramid function ϕ ( x , ξ ( y )) and ψ ( x, ξ ( y )) can be implemented as
shown in Fig.30, which is implemented by analogy
ϕ [ x, ξ ( y )] = S [ M a −1 ( x ) + 2k − ϕ ( y )] , (47)
f(x,y)
ψ [ x, ξ ( y )] = S [ − M a +1 ( x ) + 2k − ϕ ( y )] +
y (48)
2k − ϕ ( y ).
z
The pyramid function approach is not limited to
rules with point condition (40) and may be extended
x to rules with interval condition of the type
if (a1 ≤ x ≤ a 2 and b1 ≤ y ≤ b2 )
(49)
w then f ( x, y ) = k else f ( x, y ) = 0.
Fig.30 A pyramid in coordinates z = x + y Interval conditions can be implemented by simple
and w = x − y . changing constants in mask-functions. The rule (49)
represents matrices with rectangular configurations
with (41) – (45) as of valuable elements. Such matrices can be
implemented as truncated pyramids.
f ( x, y ) = S{S [ S (k ( x + y − a − b − 1)) + Note that the function similar to (44) may be
S (k ( − x − y + a + b − 1)) + constructed for an arbitrary number of variables.
(46) Implementation of a pyramid function of two
S (k ( x − y − a + b − 1)) + variables requires 6 amplifiers. Introducing each
S (k ( − x + y + a − b − 1)) − 4k ] − k }. additional variable requires two additional
amplifiers.
For implementing a function that has graphs
along one of its variables (e.g. x) of the right trapeze
type (Fig.30(b)) or left trapeze type (Fig.30(c)), let 4.4 Extracting a Matrix with Valuable
us introduce two intermediate functions ϕ [ x , ξ ( y )] Elements Laying on a Diagonal
and ψ [ x, ξ ( y )] shown in Fig.31. Let us split the matrix M4 on two matrices (M5 and
M6) and try to implement the matrix M5. Matrix M6
a) ϕ (x,ξ(y)) b) ψ (x,ξ(y)) ξ(y)=0
is the next residual matrix.
k
k M4
0< ξ(y)<k
≤ 0 ≤ 0 0 +1+1≥ 0 ≥ 0
a-1 a ξ(y)=k x ξ(y)=k x ≤ 0 0 +1 0 0 ≥ 0 ≥ 0
-k k -k a-1 a a+1 k 0 0 0 0 0 0≥0
0< ξ(y)<k
0 0 0 0 0 +1 ≥ 0 =
-k ξ(y)=0 0 0 0 0 0 0≥0
-k
Fig.31 Intermediate functions a) ϕ [ x, ξ ( y )] , 0 0 0 +1 0 0≥0
b) ψ [ x, ξ ( y )] . +1 0 +1 0 0≥0≥0
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
124
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
M5 M6 Fig.30. Substitution of the variables z and w in
0 0 0 0 0 0 0 ≤ 0 ≤ 0 0 +1+1 ≥ 0 ≥ 0 formula (46) instead of x+ y and x− y
0 0 0 0 0 0 0 ≤ 0 0 +1 0 0 ≥ 0 ≥ 0 respectively, a = +1 , b = +1 , k = 3 , and changing
the sign of the function gives
0 0 0 0 0 0 +1 0 0 0 0 0 0≥0
0 0 0 0 0 +1 0 + 0 0 0 0 0 0≥0 f 32 ( z, w) = S{S [ β 6 ( z ) + δ 6 ( z ) +
0 0 0 0 0 0 0 0 0 0 0 0 0≥0 β 7 ( w) + δ 7 ( w) + 12] + 3}
0 0 0 +1 0 0 0 0 0 0 0 0 0≥0
where β 6 ( z ), δ 6 ( z ) are already implemented and
0 0 +1 0 0 0 0 +1 0 0 0 0≥0≥0
β 7 ( w) = S (3w + 3), δ 7 ( w) = S ( −3w + 3).
In its turn, the matrix M5 can be composed from
two matrices Finally, the function f 3 ( x, y ) corresponding to the
M 51 M 52 matrix M5 can be implemented as
0 0 0 0 0 0 0 0 0 0 0 0 0 0
f 3 ( x, y ) = 13 S{β 6 ( x, y ) + δ 6 ( x, y ) +
0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0+3 0 0 0 0 0 0 0
S [ β 6 ( x, y ) + δ 6 ( x, y ) + (50)
1 1 β 7 ( x, y ) + δ 7 ( x, y ) + 12] + 9} + 1
0 0 0 0 0+3 0 + 0 0 0 0 0 0 0
3 3
0 0 0 0+3 0 0 0 0 0 0 -3 0 0 where
0 0 0+3 0 0 0 0 0 0 0 0 0 0
β 6 ( x, y ) = S (3x + 3 y − 3),
0 0+3 0 0 0 0 0 0 0 0 0 0 0
δ 6 ( x, y ) = S ( −3x − 3 y + 9),
and represented as the sum of corresponding β 7 ( x, y ) = S (3x − 3 y + 3),
functions f 3 ( x, y ) = 13 [ f 31 ( x, y ) + f 32 ( x, y )] . δ 7 ( −3x + 3 y + 3).
In the matrix M51, elements with the value “+3”
lay on the line x + y − 2 = 0 . This matrix can be
described by the function of one variable 4.5 Implementation of the Matrix M6
f 31 ( z = x + y ) , which is defined by the rule Let us split the matrix M6 on two matrices (M7 and
if z = 2 then f 31 ( z ) = 3 else f 31 ( z ) = 0. M8) and try to implement the matrix M7. The new
residual matrix is M8, all elements of which are
The function f 31 ( z ) can be constructed as it is
defined.
shown in Fig.32.
M6
a) β6 , δ6 b) α6 , f31
3
3 ≤ 0 ≤ 0 0 +1+1≥ 0 ≥ 0
2 β6 δ6 2 ≤ 0 0 +1 0 0 ≥ 0 ≥ 0
f31
1 1 0 0 0 0 0 0≥0
z=x+y 2 z=x+y 0 0 0 0 0 0≥0 =
-6 -4 -2 0 2 4 6 -6 -4 -2 0 4 6
0 0 0 0 0 0≥0
-1 -1
α6 0 0 0 0 0 0≥0
-2 -2
+1 0 0 0 0 ≥ 0 ≥ 0
-3 -3
Fig.32 Functional representations of the M7 M8
matrixes M5. 0 0 0 +1+1+1+1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 +1 0 0 0 0
It is easy to see from this figure that
0 0 0 0 0 0 0 0 0 0 0 0 0 0
f 31 ( z ) = α 6 ( z ) + 3, α 6 ( z ) = S [ β 6 ( z ) + δ 6 ( z ) + 6], 0 0 0 0 0 0 0+ 0 0 0 0 0 0 0
β 6 ( z ) = S (3z − 3), δ 6 ( z ) = S ( −3z + 9). 0 0 0 0 0 0 0 0 0 0 0 0 0 0
For good “sewing” the function f 32 with f 31 0 0 0 0 0 0 0 0 0 0 0 0 0 0
and the function f 3 with f1 the function f 32 has to 0 0 0 0 0 0 0 +1 0 0 0 0 0 0
be implemented as pyramid function of variables
z = ( x + y ) / 2 and w = ( x − y ) / 2 as it is shown in
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
125
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
The matrix M7 has one rectangular component with (46) but the following approach, which is
and can be represented as the function f 4 ( x, y ) that shown in Fig.34, gives better implementation.
is defined by the rule
a) −Μ3(x) b) −Μ−3(y)−3
if ( x = −3 ) & ( y ≥ 0 ) then f 4 ( x, y ) = 1 3 3
else f 4 ( x, y ) = 0. 2 2
By analogy with constructing formulas (41) – (45) 1 1
1 2 3 -3 -2 -1
let us compose two auxiliary functions: γ 1 ( x ) for x y
-3 -2 -1 -1 -1 1 2 3
the condition x = −3 and γ 1 ( y ) for the condition
-2 -2
y ≥ 0 . These functions are represented in Fig.33 -3 -3
and can be constructed as Fig.34 Auxiliary functions: a) − M 3 ( x ) and
γ 1 ( x ) = S [ − M −3 ( x )], γ 1 ( y ) = S [ M −1 ( y ) + 3] .
b) M − 3 ( y ) − 3 .
a) γ1(x) b) γ1(y)
3 3 Now it is not difficult to construct the function
2 2
1 1 f 5 ( x, y ) = 13 {S [− M −3 ( y ) − 3 − M 3 ( x )] − M 3 ( x )}
x -3 -2 -1
y and finally the function f 5 is implemented as
-3 -2 -1 -1 1 2 3 -1 1 2 3
-2 -2 f 5 ( x, y ) = 13 S [ S ( −3 y − 9) + S ( −3x + 9) − 3] +
-3 -3 1
(52)
S ( −3x + 9).
Fig.33 Two auxiliary functions: 3
a) γ 1 ( x ) for the condition x = −3 and As experiments showed, the monotonic
b) γ 1 ( y ) for the condition y ≥ 0 . piecewise-linear approximation between the logical
level in the point (-2,-1) and logical levels in the
adjacent points of the functions f1 ( x, y ) and
Based on the functions γ 1 ( x ) and γ 1 ( y ) it is
possible to construct the function of two variables f 4 ( x, y ) will be obtained, if the pyramid function
γ 1 ( x, y ) = S [− M −3 ( x ) + M −1 ( y ) + 3]. f6 in the point (-2,-1) is implemented in
Taking into account that for k = 3 accordance with the formula (46).
- M −3 ( x ) = S ( −3x − 9), M −1 ( y ) = S (3 y + 3) f 6 ( x, y ) = 13 S{S [ S (3x + 3 y + 6) +
it is not difficult to find
( −3 x − 3 y − 12) + S (3 x − 3 y ) +
f 4 ( x , y ) = S [ S ( −3x − 9) + S (3 y + 3) + 3] + 1 . (51)
1
3 S ( −3x + 3 y − 6) − 12] − 3}.
The residual matrix M 8 has only two nonzero After some transformations providing the
elements with coordinates ( x = +3, y = −3) and possibility to save one summing amplifier this
( x = −2, y = −1) . Let us designate the functions, function looks as follows
with help of which the controller function can be
f 6 ( x, y ) = 13 S [ S ( −3x − 3 y − 6) +
corrected in these points, as f 5 and f 6 ,
respectively. Depending on coordinates of a S (3x + 3 y + 12) + S ( −3x + 3 y ) + (53)
valuable element and conditions of good “sewing” S (3x − 3 y + 6) + 12] + 1.
its function with already implemented fragments
different implementation methods can be used.
The function f 5 ( x, y ) is equal to 0 everywhere 4.6 Implementation of the Controller
except the point ( x = +3, y = −3) , at which Correctness of the designed controller and its
f 5 ( x, y ) = 1 . For monotonic piecewise-linear functioning has been checked with SPICE
simulation (MSIM 8). In simulation experiments
connection of this function with the function
MOSIS BSIM3v3.1 level 7 models of 0.4μm
f1 ( x, y ) , graphs of the function f 5 ( x, y ) along transistors have been used.
each of its arguments must have the form of Fig.29 As building blocks for the controller circuit two
(a) or (b). The function f 5 ( x, y ) can be types of summing amplifiers were used (ordinary
implemented as pyramid function in accordance and powerful). They are built on bases of three-
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
126
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
Fig.36 The controller schematic for experiments.
stage push-pull CMOS operational amplifier3 with Analytical description of the controller schematic
1.5-MegOhm resistor in the feedback. Examples of can be derived on bases of the function
such summing amplifiers are shown in Fig.35. implementations (35) – (37), (39), (50) – (53) and
Transistors in this figure are marked with two has the following form
numbers, which designate transistor dimensions
(length and width). f1 ( x, y ) = S 9 [ 16 S 3 (6 x + 6 y + 27) +
The controller schematic for experiments is 1
3 S 4 (3 x + 3 y + 6) + 16 S 5 (6 x + 6 y − 3) +
represented in Fig.36. Two powerful elements PHS1 1
S 6 (6 x + 6 y − 15) + 16 S 7 (6 x + 6 y − 27)];
and PHS2 of the controller produce signals -y and -x 6
respectively. Other elements are ordinary. f 2 ( x, y ) = S9 ( S8 ( −3 x + 9 y − 24) − 3) ;
f 3 ( x, y ) = 13 S12 {S10 (3x + 3 y − 3) +
3
The operational amplifier of this type is the simplest S11 ( −3 x − 3 y + 9) + S15 [ S10 (3x + 3 y − 3) +
and is chosen only with the purpose of simplifying
SPICE simulation.
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
127
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
the functioning of the controller is correct because
of logical values of the circuit output depend on the
logical values of the input variables in accordance
with the Table 11.
Fig.37 The response surface of the controller.
Fig.35 Operational amplifier with feedback:
a) ordinary, b) powerful. Moreover, the controller output signal has
monotonic piecewise-linear approximation between
S11 ( −3 x − 3 y + 9) + S14 (3 x − 3 y + 3) + adjacent logical levels. Thus the designed controller
S13 ( −3 x + 3 y + 3) + 12] + 9} + 1; can be used as an analog device, which has analog
f 4 ( x, y ) = 13 S18 [ S 16 ( −3 x − 9) + S17 (3 y + 3) + 3] + 1 ; inputs and produces an analog output signal.
f 5 ( x, y ) = 13 S 21[ S19 ( −3x + 9) +
S 20 ( −3 y − 9) − 3] + 13 S19 ( −3x − 9); 5 Transformation of Analog Signals
f 6 ( x, y ) = S 26 [ S 23 ( −3x − 3 y − 6) +
1
3
into Multi-valued Logic Variables
S 22 (3x + 3 y + 12) + S 25 ( −3x + 3 y ) + In previous sections functions of multi-valued logic
were specified by tables of fuzzy rules over
S 24 (3x − 3 y + 6) + 12] + 1; linguistic variables. It was implicitly assumed that
6 values of analog signals, which corresponded to
F ( x, y ) = ∑j =1 f j ( x, y ) = S 28 [S 27 ( S9 + 13 S12 + linguistic variables, were evenly distributed in the
range of voltages representing analog signals.
1
S18 + 13 S19 + 13 S 21 + 13 S 26 + 3)].
3 Otherwise by artificial means the number of
Enumeration of summing amplifiers in this linguistic variables can be increased that leads to
description corresponds to enumeration of elements growing the implementation complexity.
in the controller circuit. The controller contains 28 In this section a procedure of transforming input
amplifiers and 86 resistors. Resistor values have analog variables into multiple-valued logic variables
been calculated as R j = R0 / w j where w j is logical with evenly distributed logical levels is suggested.
This procedure in some sense is analogous to the
weight of the jth element input signal. procedure of fuzzification in fuzzy controllers.
In experiments, source voltage was 3.5V. Input Because of using a fuzzy control description for
variable x changed linearly from 0V to 3.5V, input implementation of controllers as multi-valued
variable y changed discreetly and kept constant logical functions the same term “fuzzification” for
value within one cycle of x changing. The voltage the suggested procedure of logical levels
range was evenly divided onto seven logical levels equalization for input variables will be used.
so that the logical levels “-3” and “+3” The same procedure is supposed to be used when
corresponded to voltages Vgnd and Vdd respectively. output multi-valued variables with evenly
Results of SPICE simulation of the controller distributed logical levels demand backward
schematic are represented in Fig.37. This figure has transformation to an analog form with not evenly
been constructed by using GNUplot and illustrates distributed voltages corresponding to logical levels.
the response surface in the coordinates X, Y. In this case the term “defuzzification procedure”
Analyzing the surface it is possible to conclude that will be applied.
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
128
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
5.1 Fuzzification Procedures OVERLAP (N&Z, Z&P, typically about 50% of
Let us examine more attentively the fuzzification width but can be less)”. 4
procedure for the case of linear membership Fig.38 illustrates the features of the triangular
functions or membership functions, which membership function, which is used in the
sufficiently simply can be represented as piecewise- following example.
linear, and propose sufficiently simple universal The procedure of fuzzification and constructing
method. Here the standard determination of a corresponding diagram is examined on an example
membership function is used. The membership of the Container Crane fuzzy Controller,
function determines the weight of the corresponding membership functions for which are given in
linguistic variable b for each value of an analog Fig.39.5
variable X: It is assumed, without disrupting the generality
wb = F (b, X ); 0 ≤ wb ≤ 1 . of reasoning, that with changing the angle within
The simplest example of membership functions is the limits ( − 90o ÷ +90o ) and the distance in the
given in Fig.38. limits (-10 ÷ +30) yards the corresponding analog
voltages vary within the range (0÷3.5) V. The source
voltage of the controller circuit is also 3.5V.
Fig.38 The simplest type of membership functions.
“The membership function is a graphical
representation of the magnitude of participation of Fig.39 Membership functions for the Container
each input. It associates a weighting with each of the Crane Fuzzy Controller: a) for the angle
inputs that are processed, define functional overlap and b) for the distance.
between inputs, and ultimately determines an output
response. The rules use the input membership Table 12 determines the function of fuzzification for
values as weighting factors to determine their the piecewise-linear membership functions of the
influence on the fuzzy output sets of the final output variable angle shown in Fig.39(a). It contains
conclusion. Once the functions are inferred, scaled, linguistic variables, corresponding to them angle
and combined, they are defuzzified into a crisp values and voltages, and also logical values evenly
output which drives the system. There are different distributed within the voltage range. Linearity the
memberships functions associated with each input membership functions gives the possibility to
and output response. Some features to note are: connect the points of logical values by straight lines.
SHAPE - triangular is common, but bell, The corresponding fuzzification (equalization)
trapezoidal, haversine and, exponential have been function is given in Fig.40. In this figure the
used (More complex functions are possible but variations of voltages from the average
require greater computing overhead to implement.); (equilibrium) point of summing amplifier are plotted
HEIGHT or magnitude (usually normalized to 1); along the axes.
WIDTH (of the base of function);
SHOULDERING (locks height at maximum if an 4
Citation is taken from “Fuzzy Logic – an Introduction”,
outer function. Shouldered functions evaluate as 1.0 part 4, by Steven D. Kaehler,
past their center);
http://www.seattlerobotics.org/encoder/mar98/fuz/fl_part
CENTER points (center of the member function 4.html
shape); 5
http://www.fuzzytech.com/e/e_a_pfd.html
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
129
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
Table 12: Angle membership functions. ϕ1 (α ) = −0.5S ( 4.5α );
neg_big neg_small zero pos_small pos_big ϕ 2 (α ) = − S (1.125α + 2.19);
-90°÷-60° -20° 0° 20° 60°÷90°
(0÷0.58)V 1.361V 1.75V 2.139V (2.917÷3.5)V
ϕ 3 (α ) = − S (1.125α − 2.19);
(54)
-2 -1 0 +1 +2 F1 (α ) = S ( −ϕ 1 (α ) − ϕ 2 (α ) − ϕ 3 (α )) =
0V 0.875V 1.75V 2.625V 3.5V S ( 12 S ( 4.5α ) + S (1.125α + 2.19) +
S (1.125α − 2.19)).
Vout -1.75V
1.75V or +2(pos_big)
Now let us show how to construct and implement
the fuzzification function for the input variable
distance. As can be inferred from Fig.39(b), the
0.875V or +1(pos_small)
membership functions are characterized, first, by
asymmetry of the measured distance ((-10 ÷ +30)
Vin -1.75V yards) and, second, by the explicit asymmetry of the
-1.167V 0 (zero) 1.167V
linguistic variable positions along the distance axis.
-1.75V -1V -0.39V 0.39V 1V 1.75V
It assumed that the complete range of the measured
-0.875V or -1(neg_small) distance corresponds to the complete range of the
supply voltages (0V ÷ 3.5V) or (-1.75V ÷ +1.75V) in
deviations from the middle point of amplifiers. For
-1.75V or -2(neg_big) this case, the fuzzification function is determined by
Table 13.
Fig.40 Piecewise-linear function for fuzzification
of the variable angle. Table 13: Distance membership functions
neg_close zero close medium far
For implementation of the function ≤ -5 yards 0 yards 3 yards 10 yards ≥ 20 yards
Vout = F1 (Vin ) shown in Fig.40 three auxiliary ≤ 0.4375V 0.875V 1,1375V 1.75V ≥ 2.625V
-2 -1 0 +1 +2
functions should be introduced. These functions are
0V 0.875V 1.75V 2.625V 3.5V
represented in Fig.41. Their sum with saturation on
the levels ± 1.75V determines the fuzzificated input In this table the linguistic variable close corresponds
function for the controller fuzzy inference part, to value “log.0” and the linguistic variable zero
which, as it has been already proved in previous corresponds to the value “log.-1”. The balance point
sections, can be implemented as a multi-valued of the amplifier input voltage corresponds to
logic function. linguistic variable medium.
Corresponding function Vout (Vin ) = F2 (Vin ) is
1.75V
ϕ 2 (α ) given in Fig.42. For implementation of this function
0.875V
ϕ1 (α ) Vout -1.75V
+2 (far) 1.75V
-1.167V -0.389V 0.389V 1.167V
-1.75V -1V 1V 1.75V +1 (medium) 0.875V
-0.875V Vin -1.75V
-1.3125V -0.875V 0 (close)
-1.75V -1V -0.6175V 0V 0.875V 1V 1.75V
ϕ 3 (α )
-1.75V
-0.875V -1 (zero)
Fig.41 Component functions for the function
represented in Fig.40. -1.75V -2 (neg_close)
Fig.42 Piecewise-linear fuzzification function for
In Fig.41 the angle α and functions ϕ j (α ) are the variable distance.
represented in positive and negative voltages. These
component functions and the fuzzifier output it is necessary to realize four auxiliary functions,
function F1 (α ) can be implemented by the whose sum with saturation on the levels ±1.75V will
following way: give the desired result. The auxiliary functions are
given in Fig.43. Their values and value of the
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
130
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
Manuscript received Nov. 12, 2007; revised Feb. 18, 2007
variable d (distance) are represented in negative and a)
−ϕ1
positive voltages. 4.25
1.75V
ψ j (d )
α 1.125 −ϕ2 0.5 F1 (α)
1
1.25
ψ 1 (d ) Vdd 1
1.125 −ϕ3
0.875V
1.25
0.4375V ψ 2 (d )
d b)
-1.3125V -0.875V
d 2 −ψ 1
-1.75V -1V -0.6175V 0V 0.875V 1V 1.75V 2
-0.4375V
-0.875V 13.6
−ψ2
1
Vdd 5.8
0.25 F2 (d)
5.67 −ψ3 0.25
-1.75V 1 1
1 −ψ4
ψ j (d )
1.75V 1
Fig.44 Fuzzifiers of the variables a) angle and
0.875V b) distance.
ψ 3 (d )
0.4375V
-1.3125V -0.6175V 0.875V 1.75V d Summing amplifiers used in the schematics are
-1.75V -1V 0V 1V
constructed on the bases of three-stage push-pull
-0.4375V
CMOS operational amplifier in accordance with
-0.875V
Fig.35(a).
ψ 4 (d )
-1.75V
Fig.43 Component functions for the function
represented in Fig.42.
The ways of forming the component functions
given in Fig.43 and the function F2 (d ) are shown
below:
ψ 1 (d ) = − S ( 2 ⋅ d + 3.5);
ψ 2 (d ) = −0.25S (13.6 ⋅ d + 10.14);
ψ 3 ( d ) = −0.25S (5.67 ⋅ d + 1.75);
ψ 4 (d ) = − S ( d − 1.75); (55)
F2 ( d ) = S ( −ψ 1 ( d ) −ψ 2 ( d ) −ψ 3 ( d ) −ψ 4 (d )) =
S [ S ( 2 ⋅ d + 3.5) + 0.25S (13.6 ⋅ d + 10.14) +
0.25S (5.67 ⋅ d + 1.75) + S ( d − 1.75)].
5.2 Fuzzifier Implementations
For the completion of the fuzzifier design it only
remains to determine the values of the input
resistances of summing amplifiers and to conduct
SPICE simulation for checking correctness of the
implementations (54) and (55). These
implementations are represented graphically in Fig.45 Fuzzifier schematics a) for the angle and
Fig.44(a) and Fig.44(b) respectively. Their b) for the distance.
schematics, which have been used for SPICE
simulations, are shown in Fig.45 (a) and Fig.45 (b). Results of SPICE simulation of the fuzzifiers for
variables angle and distance are shown in Fig.46
and Fig.47 respectively.
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
131
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
simulation using the summation operation with
restrictions.
In all examples of controllers presented in the
paper, the push-pull summing amplifier containing
three CMOS invertors is used. Obviously this
amplifier circuit is the simplest among operational
amplifiers of other types but unfortunately it has the
worst characteristics. It was chosen only by two
reasons: first, to simplify SPICE simulation of
designed controllers and second, to show that using
even such primitive and imperfect building block
gives rather appropriate characteristics of designed
Fig.46 Output of the fuzzifier shown in Fig.45(a) controllers. Certainly in real projects of controllers it
and derived by SPICE simulation. is better to use another types of operational
amplifiers, e.g., a differential amplifier.
Someone may object that summing amplifiers in
all examples of controllers designed with help of
suggested methodology contain resistors of large
values and it is very difficult to implement these
resistors in CMOS VLSI technology. Indeed it is
correct. In our case p-well resistors (1-10K
Ohms/sq.) or pinch resistors (5-20K Ohms/sq.) can
be used. These resistors are compatible with CMOS
technology but occupy very large die area, possess
bad accuracy, and have big temperature and voltage
coefficients. By these reasons the possibility of
creating a dynamical model of the summing
Fig.47 Output of the fuzzifier shown in Fig.45(b) amplifier with saturation using capacitors instead of
and derived by SPICE simulation. resistors has been considered. This consideration
gave positive results and perhaps will be published
It is easy to see that the simulation plots are in the future.
exactly the same as it is required for fuzzification of The proposed methodology has been applied for
the input variables angle (Fig.40) and distance designing several devices specified as fuzzy
(Fig.42). This proves the correctness of the fuzzifier controllers, showed high efficiency and gave very
implementations. economical implementations. Techniques of
It should be noted that in the case of software synthesizing fuzzy devices in the offered base
implementation of the fuzzification and should get further developing and problems of
defuzzification functions, their component functions implementability under the conditions of real
may be chosen not only piecewise-linear but production should be resolved in the nearest future.
providing any reasonable approximations.
References:
6 Conclusion [1] Implementation of Fuzzy Logic, Texas
It was shown that all parts of fuzzy controllers can Instruments, SPRA028, January 1993.
be effectively implemented on bases of summing [2] An Introduction to Fuzzy Logic Applications in
amplifiers with saturation in accordance with the Intelligent Systems, by Ronald R. Yager, Lotfi
proposed methodology. This methodology is A. Zadeh (Editor), Kluwer International Series
oriented to hardware implementation of fuzzy in Engineering and Computer Science, 165, Jan.
controllers as analog devices. In comparison with 1992, 356 p.
software implementation of the controllers, their [3] Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems, by
hardware implementation have advantages of better George J. Klir (Editor), Bo Yuan (Editor),
response time and reliability, low power Selected Papers by Lotfi A. Zadeh (Advances in
consumption, smaller die area, etc. It should be Fuzzy Systems - Applications and Theory),
noticed that the methodology also admits software World Scientific Pub Co.; Vol. 6, June 1996,
implementation of the controllers by means of 826 p.
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
132
WSEAS TRANSACTIONS on ELECTRONICS V. Varshavsky, V. Marakhovsky, I. Levin, H. Saito
[4] Fuzzy Logic Technology and Applications, by [14] V. Varshavsky, V. Marakhovsky, I. Levin,
Robert J. Marks II (Editor), IEEE Technology and N. Kravchenko, Fuzzy Controller CMOS
Update Series, Selected Conference Papers, Implementation, WSEAS Transactions on
1994, 575 p. Circuits and Systems, Issue 9, Vol. 3, November
[5] V. Varshavsky, V. Marakhovsky, I. Levin, and 2004, pp.1762 − 1769.
N. Kravchenko, Fuzzy Device, Japanese Patent [15] V. Varshavsky, I. Levin, V. Marakhovsky,
Application No. 2003-190073, filed to Japan’s A. Ruderman, N. Kravchenko, Fuzzy Decision
Patent Office, July 2nd, 2003. Diagram Realization by Analog CMOS
[6] V. Varshavsky, V. Marakhovsky, I. Levin, and Summing Amplifiers, Proceedings of the 11th
N. Kravchenko, Summing Amplifier as a Multi- IEEE International Conference on Electronics,
Valued Logical Element for Fuzzy Control, Circuits and Systems (ICECS 2004), Tel Aviv,
WSEAS Transactions on Circuit and Systems, December 2004, pp. 286-289.
Issue 3, Vol. 2, July 2003, pp. 625 – 631. [16] V. Varshavsky, V. Marakhovsky, I. Levin,
[7] V. Varshavsky, I. Levin, V. Marakhovsky, A. CMOS Fuzzification Circuits for Linear
Ruderman, and N. Kravchenko, CMOS Fuzzy Membership Functions, WSEAS Transactions on
Decision Diagram Implementation, WSEAS Systems, Issue 4, Vol. 4, April 2005, pp.238 –
Transactions on Systems, Issue 2, Vol. 3, April 243.
2004, pp. 615 – 620. [17] V. Varshavsky, V. Marakhovsky, I. Levin, I
[8] Post E., Introduction to a general theory of and N. Kravchenko, Multi-Valued Logic Device,
elementary propositions, Amer. J. Math., 43, Japanese Patent Application No. 2004-087880,
1921, pp. 163 – 185. filed to Japan's Patent Office, March 24th, 2004.
[9] Fuzzy Control Systems, Abraham Kandel [18] V. Varshavsky, V. Marakhovsky, I. Levin,
(Edited by), Lotfi A. Zadeh (Foreword by), CRC and N. Kravchenko, Functional Device,
Press LLC, Sept. 1993, pp. 81 – 86, pp. 168 – Japanese Patent Application No.
172. PCT/JP2004/9442, filed to Japan's Patent
[10] K. Kimura, T. Kawawa, Exhaust Emission Office, July 2, 2004.
Control Device for Internal Combustion Engine, [19] V. Varshavsky, V. Marakhovsky, I. Levin,
Toyota Motor Corp., Patent of Japan No. 05- and N. Kravchenko, Median Circuit and Fault-
312020, Date of publication: 22.11.1993. Tolerant Circuit, Japanese Patent Application
[11] Mori Takakazu, Hamada Eiichi, Nishiyama No.2004-235239, filed to Japan's Patent Office,
Kunio, Controller for Vehicle Seat, Toyota August 12, 2004.
Motor Corp., Patent of Japan No. 05-085235, [20] V. Varshavsky, V. Marakhovsky, I. Levin,
Date of publication: 06.04.1993. and N. Kravchenko, Fuzzification Circuit,
[12] Design of Analog Fuzzy Logic Controllers Defuzzification Circuit and Fuzzy Functional
in CMOS Technologies, by C. Dualibe, M. Circuit, Japanese Patent Application No. 2005-
Verleysen, P.G.A. Jespers, Kluver Academic 51291, filed to Japan's Patent Office, Feb. 25th,
Publishers, 2003. 2005.
[13] V. Varshavsky, V. Marakhovsky, I. Levin, [21] V. Varshavsky, V. Marakhovsky, I. Levin,
and N. Kravchenko, Functionally Complete CMOS Fuzzification Circuits for Linear
Element for Fuzzy Control Hardware Membership Functions, WSEAS Transactions on
Implementation, the 2004 47th IEEE Midwest Systems, Issue 4, Vol. 4, April 2005, pp.238 –
Symposium on Circuits and Systems, Hiroshima, 243.
Japan, July 25-28, Vol. 3, 2004, pp. 263 − 266.
ISSN: 1109-9445 Issue 6, Volume 4, June 2007
133