+ All Categories
Home > Documents > CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

Date post: 12-Sep-2021
Category:
Upload: others
View: 18 times
Download: 0 times
Share this document with a friend
34
CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS 16.1 Introduction to the Chapter 16.2 Fuzzy Logic and Fuzzy Expert System - A Primer 16.3 Fuzzy Expert Systems as Controllers. 16.3.1. Systems for Nonlinear Mapping / Transformation 16.3.2. Limitations of Classical Fuzzy Controllers 16.3.3. Stability of Closed Loop Systems using Fuzzy Controllers Results from Classical Nonlinear Control Theory Sector Condition and Aizerman's Conjecture Popov's Criterion 16.4. Fuzzy Expert Systems & Neural Networks: Compare, Contrast & Merge 16.4.1. Digital Architecture of FESs & FCs for Real-Time Applications 16.4.2. Cerebellar Model Articulation Controllers (CMAC) Neural Network Vs Fuzzy Expert Systems. 16.5. Design of Stable Feedback Fuzzy Expert Systems and Stable closed Loop Systems with Feedback Fuzzy Controllers 16.5.1. Design of Stable Feedback Fuzzy Expert Systems 16.5.2. Design of Stable closed Loop Systems with Feedback Fuzzy Controllers Work to be completed: Below 16.25, we say power & energy concepts can be used .... We will see later.
Transcript
Page 1: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

CHAPTER 16FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

16.1 Introduction to the Chapter16.2 Fuzzy Logic and Fuzzy Expert System - A Primer16.3 Fuzzy Expert Systems as Controllers.

16.3.1. Systems for Nonlinear Mapping / Transformation16.3.2. Limitations of Classical Fuzzy Controllers16.3.3. Stability of Closed Loop Systems using Fuzzy Controllers

Results from Classical Nonlinear Control TheorySector Condition and Aizerman's ConjecturePopov's Criterion

16.4. Fuzzy Expert Systems & Neural Networks: Compare, Contrast & Merge16.4.1. Digital Architecture of FESs & FCs for Real-Time Applications16.4.2. Cerebellar Model Articulation Controllers (CMAC) Neural Network Vs Fuzzy Expert Systems.

16.5. Design of Stable Feedback Fuzzy Expert Systems and Stable closed Loop Systems with Feedback Fuzzy Controllers16.5.1. Design of Stable Feedback Fuzzy Expert Systems16.5.2. Design of Stable closed Loop Systems with Feedback Fuzzy Controllers

Work to be completed:Below 16.25, we say power & energy concepts can be used .... We will see later.

Page 2: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

16. FUZZY LOGIC, FUZZY EXPERTSYSTEMS & FUZZYCONTROLLERS

16.1 Introduction to the Chapter

In this chapter, we consider another emerging, hot area in intelligent systems -that of fuzzy logic (FL), fuzzy expert systems (FESs) and fuzzy controllers(FCs), mainly from the perspective of nonlinear systems. We first provide asimple and concise introduction to this area. We provide only the salient detailsabout functional and implementational aspects of fuzzy expert systems andfuzzy controllers and omit mathematical details as much as possible. Thissection will be of interest to those who want to learn about these areas from apractical perspective without having to spend an enormous amount of timestudying the underlying mathematical principles. The readers will find thatfuzzy logic casts in an analytical mode the approaches taken by human beings indealing with day-to-day problems which are nonlinear by nature and theresulting solutions. What will emerge from the discussions in this section is thatfuzzy logic and fuzzy expert systems are in fact excellent vehicles for specifyingmulti-input / multi-output (MIMO) static mappings. The beauty of fuzzy logiclies in the relatively simple and easy approach with which MIMO nonlinearfunctional mappings of practical relevance can be described and implemented.

The use of fuzzy logic in control applications is considered in section 16.3.We give some examples that illustrate how fuzzy logic can be used to designcontrol laws and discuss the performance of systems controlled by fuzzycontrollers. We will find from the examples that fuzzy controllers (based onsome appropriate knowledge) can indeed do a good job. Perhaps the importantpoint to learn is that since the controller is in general nonlinear, betterperformance can be obtained from different fuzzy controllers based on theknowledge from different experts. That is, the nonlinearity by itself makes itpossible to have more than one near-optimal control law and leads to controllaws that are robust. However, The nonlinear nature of the control law makesthe closed-loop system nonlinear even if the open-loop system is LTI, and it isvery difficult to prove the stability of such nonlinear systems. We present someresults from classical control theory to show the efforts that went into proving

the stability of such systems and the difficulties encountered. Further, asindicated earlier, fuzzy logic leads to static (memoryless) control laws withabrupt changes that may not be acceptable in practice. Also, when the number ofinputs is large, the design complexity also increases. Then, there is the questionof adaptability or learning in fuzzy expert systems.

In sections 16.4 and 16.5, we provide some solutions to these problems. Insection 16.4, we show how fuzzy logic can be combined with neural nets toretain the best of both worlds: use of experts’ knowledge and further adaptationbased on observed data. We also discuss a neural network architecture known asCerebellar Model Articulation Controllers (CMAC) Neural Network, which wasproposed independently some twenty five years ago, and its similarity to fuzzyexpert systems. In section 16.5, we show how the building block concept can beused to overcome the stability problem, introduce memory into otherwise staticfuzzy expert systems, and provide the ability to deal with a large number ofinput variables. The network approach thus leads to the next generation of fuzzycontrollers, called feedback or recurrent fuzzy controllers, and can find use in anumber of applications.

16.2 Fuzzy Logic and Fuzzy Expert System - A Primer

We will explain the basic concepts of fuzzy logic and fuzzy expert systemsthrough a common task encountered by most of us in real life - that of backingup a vehicle to a fixed location; for example a truck to a loading dock. Let usconsider how this problem will be handled by a classical control engineerassigned the task of designing an electronic controller that can carry out the taskof backing up a truck successfully and by a human being (the driver), perhapswith help from another person.

Both the control designer and the driver will start with some meaningfulassumptions to simplify the problem. For example, they will assume that thetruck is initially within the loading zone, and there is enough clearance betweenthe truck and the loading dock (Fig. 16.1a), so it is feasible to back up the truckunder normal circumstances. The driver will basically eyeball the position of thetruck and the distance left, and control the steering angle and speed properly. If ahuman helper is available to assist the driver1, he/she may give directions suchas a little more to the left, swing to the right etc. The driver will move a certaindistance before he/she eyeballs the position once again and/or seeks advice fromthe helper. He/She may feel that he/she is doing all or some of these thingscontinuously though in reality they may be taking place in a discrete manner.

1 This statement perhaps might lead the readers to wonder, "how many professors will it

take to back up a truck to a loading dock ?," !

Page 3: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

In the above paragraph, there are a number of key words that need ourattention: possible to back up under normal circumstances, control the steeringangle (and speed) properly, a little more to left etc. There is a lot of subjectivity

involved in those words meant for directions and the possible responses to thosedirections. In spite of all these ambiguities, normally (!), the job gets donesatisfactorily (!!)2.

The controller-designer will start with identifying the variables to bemeasured and made available to the controller, and the output(s) from thecontroller. He/She may decide if he/she needs a mathematical model of the plant(the truck) and assume a model for the controller (proportional-derivative orproportional-derivative-integral control or PD and PID control for short). In thisspecific problem, the position of the truck (x, y) with respect to the loading dockcoordinates, and the truck angle φ (with respect to the normal to the loading

dock) are the three input parameters that can be measured and input to thecontroller, and the speed and the steering angle θ can be the outputs of thecontroller (Fig. 16.1b). Next comes the task of identifying the range of thevariables and the resolution to which they can be and should be measured. The'can be' will depend upon the technology available and the cost associated withit. The 'should be' depends on the problem being solved and the minimumacceptable value for successfully solving the problem. The range of values forthe three input and the two output variables are:

φ = 0 360[ ]x = 0100[ ]y = 0100[ ]θ = [−30 30]

speed = 010[ ]

(16.1)

An analog or continuous representation within these range of values ordiscrete representation using, say, an eight- to 12-bits (256 to 4096 quantizationlevels) may be assumed for the five variables of the truck back-up problem.Thereafter, the sensors (and the A/D converter) will be assumed to providecorrect or precise measurements of the input variables. The key word here is'correct values', which differentiates the classical approach to engineering designand the humanistic approach. In the latter, approximate values or descriptors(such as a little more to left etc.) are used. In the classical approach toengineering design, we deal with the possibility for measurement error (andothers) through analytical approaches such as probability theory etc., andcounter the effects of erroneous measurements (and others) through redundancyin architecture etc.

Fuzzy Logic Theory, as indicated earlier, casts in concrete mathematical andanalytical framework the ability of human beings to describe/characterize

2 The key point to note here is that in such problems we have more than one near-

optimal solution each of which are acceptable.

loading dock (50,100)

(0,0)

rear (x,y)

front

θφ

y

x

(a)

(x,y) new = (x,y) old + (dx,dy)dx = r cos( φ + θ ), dy = r sin( φ + θ )

x,y,φController Truck

θ

Speedyd

φd

xd

(b)

(100, 100)

Figure 16-1. Specifications for the truck backup problem. a) The dock and thetruck; b) A closed-loop system involving the truck and a fuzzy expert system asa controller.

Page 4: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

information, events, and actions in approximate, and ambiguous linguistic termsand their ability to infer and deduce useful information, and or take actionsbased on them. Thus, approximate and ambiguous are the key terms here.Unfortunately the term 'Fuzzy' is selected to describe them. We say unfortunate,because when combined with the words logic and theory, leading to fuzzy logictheory, it gives a bad or funny feeling about the whole area3 and raises issuessuch as how can a theory be fuzzy etc. This is perhaps one major reason that theacceptance of fuzzy logic has been slow in the western society (where everything is expected to be crisply defined or when it comes to decisions, they haveto be binary outcomes; a case in point at the time of writing this chapter in thewake of the Oklahoma city bombing is the talk about- and outright denial byothers of- conspiracy theory of governments, corporations, and different ethnicgroups, trying to control the society. Anyone who has had experience with thepolitics at the work place will agree that the binary logic of true or false alone isinsufficient to deal with the real events taking place in this complex world.Fuzzy logic got its lift from the Japanese researchers and since then a cult hassprung in this country as well.

In addition to the use of the continuous and discrete signals (seen in theclassical set theory) with a range of values or domain {in a universe ofdiscourse} and their specific values at any time, fuzzy logic allows for a newcategory of signals known as fuzzy variables. In defining a fuzzy signal, theentire range of values of a variable is divided into smaller (five to seven),meaningful, mostly overlapping regions, denoted by corresponding linguisticterms. For example, the steering angle which has been restricted to the range -30to +30 degrees may be divided into seven smaller regions{−30 ° to − 15°, 25° to − 5° , etc. as shown in Table 16.14} or sets and denoted

by linguistic terms such as negative-zero {for values in the range -1 to 0} todescribe them. This division can thus be considered as coarse (or macro-level)quantization of the entire range as opposed to digital conversion where we uselarge number of quantization levels. The degree-of-belonging of a specificnumeric value within the entire range of values to the sets is denoted by afunctional relationship known as a membership function that is considered as afeature of the sets. By definition, the membership function has to lie within therange zero to one; the value zero implies that a particular numerical valuedoesn't belong to a given set at all whereas the value one implies that a particularvalue completely belongs or represented by that set and any value between zeroto one indicates partial belonging to that set. From this description, we can also

3 In fact, early researchers in this area have encountered jokes and tongue-in-cheek

comments about the term fuzzy logic from non-technical as well technicalpeople.

4 We show only the sets corresponding to the input variables x and φ and the output θsince the fuzzy controller will make use of these two inputs only and produceas output the steering angle.

infer that most membership functions have to be continuous or one with noabrupt changes (if a value x 0 belongs to a particular set with a membership

function of one, we can expect in practice the value x 0 ± ∆x 0 where ∆x0 is

small, to belong to that set with a membership function value close to one andnot close to zero).

Commonly used membership functions are triangular, trapezoidal, andGaussian. In Fig. 16.2, we show the division of the expected living age forhuman beings into six overlapping sets and their membership functions. Anumber of things are obvious from this figure. We have divided the entire rangeinto six sets, some of which are overlapping. The need for different shapes forthe membership functions is also obvious from this example. We may use asquare membership function for the fuzzy set ‘teen’. On the other hand, the set'over-the-hill' may use a smoothly changing function. The definition of this setmay vary from person to person and one society to other. Also note that aparticular person may belong to more than one set. For example, a nineteen yearold will be classified as belonging to the teen with a membership function of oneand to the set 'adult' with a membership function of 0.5 based on the chosenmembership functions. The sets (of values in the classical set theory sense)combined with their respective membership functions lead to what is known asfuzzy sets. Note that fuzzy sets, by definition, include sets defined in classical settheory as special cases, as is the case with the definition for the set, teen, here.Further, there is room for variations in the number of sets, the definitions of setsand their membership functions even with in a specific problem domain. Forexample, it is quite possible for some one else to come up with five (or perhapsseven) equally meaningful fuzzy sets for the variable, age. These features makefuzzy logic very robust. As example, consider the set ‘Young’. which may bedefined as ages between 0 to 35 in the classical or regular expert system domain,whereas it will be defined with a membership function as shown in Fig. 16.2under fuzzy expert systems. We can see what will happen in the case of theregular expert system when the actual age is supposed to be 34 and 1/2 but dueto operator or some error gets entered as 35 and 1/2, Vs. the effect of the sameerror in the case of the fuzzy expert system. In the former, the person is nolonger considered as belonging to the set, ‘young’, whereas in the latter, theperson will still belong to the set, ‘young’, with a membership function value ofsay 0.45 rather than say 0.55.

As we have been arguing again and again in this book, a system (withsuitable coding for inputs and outputs) performs simply the task I/O mapping.Using this line of thinking, fuzzy logic can handle all nine possibilities arisingfrom a combination of the three possibilities for the input and the output signals:

1) analog or continuos (non-fuzzy) signal;2) digital (including binary) signal (non-fuzzy); and3) fuzzy signal.

Page 5: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

In real world applications, we may start with input information that isalready in the form of fuzzy signals for application of the fuzzy logic theory, orstart with crisp values and convert them to fuzzy signals. The latter will be thecase in any controller implementation. In the implementation of the controllerfor backing up a truck, we may define fuzzy sets for the inputs and the output asshown in Fig. 16.3. The sensors will provide the values of the input variablesthat exist at any time. Denoting these values as x(t0 ), Φ(t0 ) as indicated in Fig.

16.3, the membership function values for all the fuzzy sets corresponding tothese values can be obtained from the definitions of the fuzzy sets. For x =x(t0 ) as shown in Fig. 16.3, we will have:

x(t) t= t0= x(t0 ) ∈

set LE with membership function value 0.0

set LC with membership function value 0.0

set CE with membership function value 0.2

set RC with membership function value 0.9

set RI with membership function value 0.0

(16.2)

Thus, in addition to one numerical value x(t0 ) , we have the data corresponding

to the five fuzzy sets of x(t). A similar statement applies to the other inputs.Fuzzy sets as defined above have a number of important properties. They can

be operated upon using well defined logical operators such as minimum,maximum etc. They can be combined in the form of a rule-base to indicate thecause and effect relationship between inputs and outputs expressed in the formof fuzzy sets. Thus, for the truck backer-upper problem, we can have statementsof the form:

IF {x(t) is CE} AND {y(t) is LV} AND { Φ(t) is LV} THEN {θ(t) is NS}

IF {x(t) is CE} AND {y(t) is LV} AND { Φ(t) is LV} THEN {θ(t) is MS}

(16.3)

The first rule states that if x(t) belongs to the fuzzy set CE (center),y(t)belongs to the fuzzy set LV (large value), and Φ(t) belongs to the fuzzy set LV,

then the steering angle θ(t) will belong to the fuzzy set NS (negative small).Similarly for the second rule. We can also use the union (OR) operator informing the rules. Thus, we have rules that connect fuzzy sets of inputs with thefuzzy sets of outputs. A collection of all the rules is known as a fuzzy rule baseor fuzzy associative memory (FAM). The latter term is used since fuzzy rulessimply indicate the association between input fuzzy sets and output fuzzy sets.Again, using the term fuzzy along with associative memory is perhaps a poorchoice, as there is no fuzziness in the association.

φ x θ

RB Right Below

RU Right Upper

RV Right

Vertical

VE Vertical

LV Left Vertical

LU Left Upper

LB Left Below

LE Left

LC Left Center

CE Center

RC Right Center

RI Right

NB Negative Big

NM Negative Medium

NS Negative Small

ZE Zero

PS Positive Small

PM Positive Medium

PB Positive Big

Table 16-1. Fuzzy sets for the variables φ , x, and θ of the truck backer-

upper problem.

1 2 13 18 20 30 35 40 100455

1

0.5

0

µOver −the −hill (Age)µ Kid (Age) µAdult(Age)

µYoung(Age)

µ Infant (Age) µToddler(Age)

µ Teenager(Age)

µ(Age)

Age

Figure 16-2. Fuzzy sets for the variable, age.

Page 6: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

A comparison of fuzzy rules with the rules used in classical expert systemsshould indicate the superiority of the fuzzy logic. For example, in a classical rulebase we will have rules such as:

IF X, then Y (16.4)

or

IF X, then Y with CF (confidence factor) = 0.8 (16.5)

In these rules, we use a membership function of one or zero with all thepossible causes and effects. That is, the conjectures are formed such that theyare either true or false and none in between. The addition of the confidencefactor simply adds information associated with the probability of that outcomebeing true. One effect of this kind of representation (yes or no) is the number ofrules will be enormously large. In fuzzy set theory, we normally incorporatemembership functions (that vary smoothly) which lead to a reduction in thenumber of rules.

In general, for a fuzzy expert system with M inputs, N outputs, m i fuzzy

sets for the i-th input (i = 1 to M) and n j fuzzy sets for the outputs (j = 1 to N),

we will have N fuzzy rule-base (one for each output) with each rule base havingm1 × m2 ×. . . × m M rules and each rule pointing to one of the n j possible fuzzy

sets of the outputs. Thus, the number of rules increases considerably, even forfuzzy expert systems, as the number of inputs increases. For example, a threeinput, two output system with 7 fuzzy sets for each input will lead to a rule basewith 2 × 73 = 686 rules. Also, the human experts, on whose knowledge theconcept of fuzzy systems is based, are also not capable of handling many inputsat the same time. Proponents of fuzzy systems will indicate that such situationsdo not occur in real life, or a solution to overcome this rule explosion is tocombine only the fuzzy sets of the inputs that interact to form the rule-base andomit other fuzzy sets that have minimal impact. It can be argued that theresulting system will not be an optimal one; however, such techniques arecommonly used in engineering to reduce the complexity and cost of systems,and fuzzy expert systems are no exceptions to this rule. Later in this chapter, wewill discuss a new method which takes care of this problem in a rather simplemanner and leads to what one may call fuzzy expert systems with memory.

In the case of the truck backer-upper problem, we will have a rule baseconsisting of 175 (5 × 5 × 7) rules per output variable if we use all the threeinput variables as inputs to the controller. We can neglect the input variable y(t)if we make the assumption that the truck will always start from a reasonabledistance. This will lead to 35 (5 × 7) rules/output variable. Similarly, we canassume that only θ(t) will be generated by the controller leading to just one rulebase. The rule base chosen is shown in Table 16.2. We can note that at anygiven time and the corresponding input values, only certain number of rules will

Fuzzy sets of the TBU Problem

Angle φ Steering Angle θx position

RB: Right BelowRU: Right UpperRV: Right VerticalVE: VerticalLV: Left VerticalLU: Left UpperLB: Left Below

LE: LeftLC: Left CenterCE: CenterRC: Right CenterRI: Right

NB: Negative BigNM: Negative MediumNS: Negative SmallZE: ZeroPS: Positive SmallPM: Positive MediumPB: Positive Big

90 180 270 360

1

050 100

1

0

0-10-20-30 10 20 30

θ (degrees)

φ (degrees)

1

0

m(φ)

m(θ)

x (feet)x(t 0 )

RU RV VE LV LU LB RB

LE LC CE RC RI

NB NM NS ZE PS PM PB

0.9

0.2

m(x)

Figure 16-3. Fuzzy sets and the corresponding membership functions for thevariables φ , x and θ of the truck backer-upper problem.

Page 7: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

be fired depending upon the way the fuzzy sets are defined. The more thenumber of overlapping fuzzy sets (for any input variable), the more the numberof fuzzy sets to which any given value can belong and hence the rules that willbe fired. Looking at Fig. 16.3, we can notice that a maximum of two fuzzy setsoverlap for any given values of x(t) and Φ(t). Thus, either one, two, or fourrules will be fired for any combination of the inputs.

Note that the fuzzy rule base uses the information as to whether an input fallsin the range of a fuzzy set or not, and not the degree of belonging or themembership function value corresponding to the input value. Similarly, it givesinformation about the output only in terms of the fuzzy sets (to which itbelongs) and not specific output values. In some applications, this informationmay be sufficient where as in others such as the truck backer-upper problem wewould like to get exact values for the output. For the latter, we will use themembership functions corresponding to the output fuzzy sets that got selected,and the membership function values of the sets of the inputs to which the inputsbelong to obtain a crisp value for the output(s). This process is known as the de-

fuzzification process and can be illustrated with the help of Fig. 16.4. In thatfigure, we assume that the input values x(t) and Φ(t) are such that two rules arefired. The first rule states that If Φ(t) is RV AND x(t) is CE, THEN θ(t) is PS.The second rule states that If Φ(t) is VE and x(t) is CE, THEN θ(t) is ZE. Weconsider the input fuzzy sets that triggered each rule and draw a vertical linefrom the input values existing at that time to intersect the membership functionwaveforms and obtain two values for the membership functions (which will bein the range 0.0 to 1.0). We need to convert this information into a singlenumber. Use of the minimum of these two values (MIN) is one commontechnique. A horizontal line is drawn from this minimum value to slice themembership function of the selected output fuzzy set. This results in an area thatis bounded by this horizontal line, the x axis and the membership waveform andis also shown in figure 16.4. We go through a similar procedure for the secondrule fired. We need to use these two areas (or other information from the clippedmembership functions) to obtain a crisp output value. In one approach, wesimply use the maximum (MAX) of the heights of the two clipped membershipfunctions as a scaled version of the output, leading to MIN-MAX De-fuzzification Method. An alternate approach to obtain a crisp output value isthrough a centroid calculation of the two clipped output membership functions(in the general case, the clipped membership functions of output fuzzy setsselected by the various rules that got fired). This approach is known as CentroidDe-fuzzification Method . If we denote by ˆ m s(θ) clipped membership functions

of outputs fuzzy sets that got selected by the fuzzy rule-base, the centroidcalculation is given by:

θcentroid =ˆ m s (θ) θ dθ

θ∫

s∑

ˆ m s(θ) dθθ∫

s∑

(16.6)

This crisp value for the steering angle is the final output of the fuzzy expertsystem or the fuzzy controller and will become the input to the truck. Thecomplete steps involved in the implementation of a general fuzzy expert systemis shown in Fig. 16.5 as a block diagram. Note the presence of three sub-blockscorresponding to three well-defined steps that we take:

1) crisp input values (from the sensors) existing at any given time to inputfuzzy set selection and the associated membership values;

2) Output fuzzy sets selection using the fuzzy rule-base;3) obtaining crisp output values from output fuzzy sets selected and the

input membership function values.We will use this block diagram in section 16.3 to obtain new architectures

for fuzzy expert systems.

PB

RU

VE

LV

LU

LB

RV

LE LC CE RC RI

PS

NS

NM

NM

NB

NB

NB

PM

PS

NS

NM

NM

NB

NB

PM

PM

PS

ZE

NS

NM

NM

PB

PB

PM

PM

PS

NS

NM

PB

PB

PB

PM

PM

PS

NS

X

Table 16-2. A fuzzy rule base for the truck backer-upper problem.

Page 8: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

In summary, there are five attributes associated with fuzzy expert systems:1) Input variables,2) Output variables,3) Subsets of the inputs and the outputs and the membership functions

corresponding to the various subsets leading to fuzzy sets,4) Rules connecting the input fuzzy subsets and the output fuzzy subsets

and5) Procedure (or methodology) for de-fuzzification of the output(s).

As indicated earlier, the fuzzy sets can be considered as extensions of sets asdefined in classical set theory, and their definition dramatically reduces thenumber of rules needed in a rule base. The definition of fuzzy sets and theselection of the fuzzy rule base can be accomplished through good knowledgeabout the problem or through experts in that particular field. Also, theapproximation or ambiguity involved and the variations in defining the fuzzysets and the fuzzy rule base lead to robustness in problem areas where fuzzylogic or fuzzy expert systems can be used.

16.2.1 Results of Fuzzy Controller for Truck backer-UpperProblem

We identified the input and output variables, the fuzzy sets of the inputs and theoutputs, and the rule base for the truck backer-upper problem. As indicatedearlier, we will assume that the fuzzy controller will output only the steeringangle, and the truck will be moved in a discrete manner for each control signalθ(t) at a fixed speed. That is, from its initial position xin, yin, Φ in , it will move

by a fixed distance (say 1 foot) with the steering angle set at a value specified bythe controller given the input values x in, yin, and Φ in ,. Once the truck has

moved to a new location, the new x, y, and φ values will be input to the

controller which will then produce a new steering angle θ . This process willcontinue until the truck reaches the loading dock (Final condition: x=50; y=100;φ =90).

Denoting the speed of the truck by s and the distance moved per each controlsignal by r, the truck movement is given by the following equations:

dx

dt= s cos φ(t) +θ (t)[ ]

dy

dt= s sin φ(t) + θ(t)[ ]

(16.7a)

from which the truck position after each move can be written as:

CE PS

VE CE ZE

Input φ(t) Input x(t)

RV

Output θ(t)

Example: R12: If φ(t) is RV And x(t) is CEthen θ(t) is PS

R17: If φ(t) is VE And x(t) is CEthen θ(t) is ZE

Figure 16-4. Crisp output from a fuzzy expert system using the Centroidapproach.

Inputs FuzzyAssociative

Memory

Pointers to output fuzzysets selected & theirmembership functions

OutputsDefuzzifi-cation

procedure

Pointers to inputfuzzy sets selected

Inputfuzzy sets

identification

Membership functionvalues of the fuzzysets selected

Figure 16-5. Three subsystems of a fuzzy expert system.

Page 9: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

x(n +1 T) = x(nT) + r cos φ+θ[ ]y(n + 1 T) = y(nT) + r sin φ +θ[ ]

(16.7b)

We can use these equations as the truck model and simulate backing up thetruck with the fuzzy controller for various starting values. The resultingtrajectories are shown in Fig. 16.6. We can observe that the chosen fuzzy expertsystem does a good job of backing up the truck to the dock.

We should compare the design of the fuzzy controller with the stepsinvolved in designing a controller using the classical control approach. Thisparticular problem falls under the category known as a Final Value problem,since we know only the final (end) values for the truck position. We need toassume a model for the controller (in addition to the model for the truck5), whichis really not needed using the fuzzy control approach, a mathematical model forthe trajectory (spline functions, for example) connecting the starting point to thefinal point, a suitable error function, and optimize the error function to arrive atthe controller parameters. Thus, the design becomes very complicated if aclassical control design approach is used. In contrast, we can handle suchproblems rather easily using fuzzy logic.

5 Note that the model for the truck has been used for simulation purposes only and not in

defining/building the fuzzy controller.

16.3 FuzzyExpert Systems asControllers.

16.3.1 Systems for Nonlinear Mapping/Transformation

From a systems' perspective, a fuzzy expert system simply performs the task ofI/O mapping or transformation from the input domain to the output domain. Forexample, the fuzzy controller for the truck backer-upper problem, implementsthe mapping θ[ Φ, x] given any value of the inputs Φ and x as shown in figure

16.7. Viewed as a digital controller, with perhaps 10 bits of resolution for eachof the input variables Φ and x and 8 bits of resolution for the output θ , this

x

y

(0, 0)

(100, 100)(50, 100)

(a)

(0, 0)

(100, 100)(50, 100)y

(b)

Figure 16-6. Truck trajectories for some initial positionsusing the fuzzy controller: a) For

x in = 20' , y in = 20' and φ in = 30 o ; b) For

x in = 30 ' , y in = 10' and φ in = 220 o ; c) For

x in = 30 ' , y in = 40' and φ in = −10 o .

(0, 0)

y

x

(100, 100)(50, 100)

(c)

Figure 16-6. Contd.

Page 10: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

fuzzy controller can be implemented as a 2 20 × 8 bit (10+10 address bitscorresponding to the inputs; 8 bit output) ROM look-up-table if the values ofθ[ Φ, x] are known for each and every input combinations. We do not really

have to go through the steps involved in implementing a fuzzy expert system. Sowhat is the real purpose of the fuzzy controller?

The ROM look-up-table could have been constructed by constraining themapping as proportional to the input variables (the errors, to be exact). That is:

θ[e Φ , e x ] = k1peΦ + k 2p ex (16.8)

where of course we need to come up with a design procedure to estimate thevalues of the two parameters k1p , k 2p . This task itself is not very simple and the

resulting mapping is still a restricted one: a linear mapping. The linearity impliesa large steering angle when the magnitude of the error(s) is (are) large,

something which is not feasible in real life. On the other hand, we can fill in the2 20 memory locations with randomly generated 8-bit numbers to arrive at themost complex mapping. But the controller may do a lousy job of controlling thetruck if it works at all! The fuzzy controller falls in between these two kinds ofmappings, in general a nonlinear mapping, that gets the job done nicely. Further,we may obtain two rule bases (based perhaps on entirely different fuzzy sets)that may vary from one to another from two experts, use them as fuzzycontrollers and find that each of them does a good job (assuming the expertsknow what they are talking about!). That is, we can have more than one nearlyoptimal nonlinear controller (as opposed to just one linear controller) and thefuzzy logic simply enables us to define/obtain those nonlinear mappings usingexperts' knowledge and well defined steps. This, in spite of the fact that we havelot of ambiguities in various intermediate steps such as the definitions for fuzzysets, their membership functions and so on. Thus, a major contribution of fuzzylogic is how to describe/obtain nonlinear mappings for problems of practicalimportance without having to spend enormous amounts of time and energy intheir design. This is especially important in applications involving a largenumber of inputs. This important practical aspect has been underemphasizedeven by the promoters of fuzzy logic.

16.3.2 Limitations of Classical Fuzzy Controllers

Looking at the mapping θ[ Φ, x] resulting from the use of the fuzzy expert

system for the truck backer-upper problem shown in Fig. 16.7, we can noticediscontinuities in the mapping. That is, we find the value for the steering angle,the command to the plant, changes abruptly as the input values are changed byvery small values and is a property of the present generation fuzzy controllers(use of triangular and trapezoidal membership functions and the procedure forde-fuzzification contribute to this). We can ask ourselves if such abrupt changesin the control inputs are really permissible? We find that in applications wherethe signal is multi-valued, mostly smooth control signals are needed. In the caseof steering, we really cannot have jerky movements. Thus, we need to choosesmooth membership functions and de-fuzzification procedures that will lead tomappings that are continuous.

From the I/O mapping perspective, it should be clear that fuzzy expertsystems and fuzzy controllers are static devices. That is, the output(s) at anyparticular time depends only on the input values at that time and not on the pastvalues of the inputs or outputs (which are readily available). The static nature ofthe mapping also contribute to the discontinuous nature of the output(s). Theoutput(s) can be made much smoother by incorporating past inputs and or pastoutputs as inputs to the fuzzy controller. We will learn in section 16.5 how thiscan be accomplished.

In the case of multi-input systems (with large number of inputs),implementation based on decomposing the system into a number of sub-systems

Figure 16-7. The mapping θ[ Φ, x] obtained from the fuzzy expert system for

the truck backer-upper problem. We can note that the mapping is monotone-nonlinear, saturates for large magnitudes of either of the two input variables (asthe steering value should be), and has discontinuities (an undesirable feature).

Page 11: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

is possible if and only if the mapping can be decomposed properly. That is, themapping becomes what is known as a separable mapping. It appears that manypractical problems belong to this category. Alternately, we can try to zoom-in orzoom-out at various regions and write down separate fuzzy sets and rule-base totake care of complex mappings. Again, this is not an easy or a good solution.We provide a better approach in section 16.5.

Finally, stability is a major issue in fuzzy expert systems used as controllers.We will discuss that problem now.

16.3.3 Stability of Closed Loop Systems using Fuzzy Controllers

Fuzzy expert systems and fuzzy controllers that we encountered so far are feed-forward, memoryless systems. Thus, they are inherently stable from a systems'perspective. However, when used with dynamic systems in feedback as shownFig. 16.1b, we end up with a closed-loop system. The stability of the closed-loopsystem, which consists of the plant (which can be linear or nonlinear, time-invariant or variant, open-loop stable or unstable) and the memoryless nonlineardevice (fuzzy controller in our case), has to be established beyond doubt beforefuzzy controllers find widespread applications where stability is a major issue.Unfortunately, there appears to be no mathematical approach through which thestability can be established beyond doubt. We describe two well known resultsfrom the classical control theory literature to illustrate the problem in provingthe stability of such systems.

16.3.3.1 Some Results from Classical Nonlinear Control Theory

16.3.3.1.1 Sector Condition and Aizerman's Conjecture

Consider Fig. 16.8 where we show a simple one input {u(t)}, one output {y(t)},linear time-invariant system with a memoryless nonlinearityφ[e(t) ≡ y d (t) − y(t)]. That is, the nonlinearity is a single input, single output

(SISO) mapping, a much simpler case than the fuzzy controller for the truckbacker-upper problem (two input and one output). Further, the open-loop systemis assumed to be stable (the matrix A is strictly Hurwitz). Now one can ask if theclosed-loop system with this simple but general SISO nonlinearity φ[e(t)] is

absolutely stable. In a book on nonlinear control published not long ago theauthors state []:

"If the feedback path simply contains a constant gain, i.e., ifφ[e(t)] = α e(t) , then the stability of the whole system, a linear

feedback system, can be simply determined by examining the eigenvalues of the closed-loop system matrix A −α bc 6. However, the

6 Here, b & c are the vectors associated with the state space representation of the linear

stability analysis of the whole system with an arbitrary nonlinearfeedback function φ •[ ] is much more difficult."

That is, we run into difficulty even under such a seemingly simple scenario.Thus, the implications for complex situations are obvious.

time-invariant system.

SISO LTI systemwith a transfer function

y(t)∑

-

+u(t) = φ e(t)[ ]

H(s) = c(sI − A)−1 b

φ e(t)[ ]φ •[ ]

yd (t)

e(t)

Figure 16-8. A closed-loop nonlinear system with a stable LTIsystem and a memoryless nonlinearity.

e(t)

φ[e(t)]

φ[e(t)]

Straight linewith slope k2

Straight linewith slope k1

Figure 16-9. A restricted mapping for the staticnonlinearity in fig. 8.

Page 12: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

We may ask next if the stability can be established if the nonlinear mappingfunction is constrained (though it may reduce the use of the mapping in practicalapplications). Thus, we may restrict φ •[ ] such that:

k1 ≤ φ[e(t)]≤ k 2 for e(t) ≠ 0, k1 , k 2 > 0 (16.9)

That is, the mapping is constrained to a sector in the first and third quadrants andpasses through the origin as shown in Fig. 16.9. We can note that the mappingselected is constrained to a subset of voltage-current mappings of nonlinearpassive resistors that we have seen in earlier chapters (However, theinterconnection here is based on flow-graph theory and not at the element level).The reasoning behind this choice is if the mapping falls between two linearfeedback mappings (that lead to stable closed loop systems), the resultingsystem will perhaps be stable as well. A conjecture along these lines dating backto 1949 has been made by a Soviet Scientist, M.A. Aizerman, as follows:

“If the matrix A − k bc is stable for all values of k, k1 ≤ k ≤ k 2 ,

then the nonlinear system is globally asymptotically stable.”Unfortunately, this conjecture was proved to be false through counter-examples.Later Popov imposed additional constraints as given below to arrive at asufficient condition for asymptotic stability:

16.3.3.1.2 Popov's Criterion

Let the linear time-invariant system as defined in Fig. 16.8 is such that:1) the matrix A is Hurwitz and the pair [A, b] is controllable;2) the nonlinearity is constrained as given in (16.9) with

k1 = 0, k 2 = k > 0 ;

3) there exists a strictly positive constant α such that for an arbitrarily

small ε > 0 , Real 1 + jαω( )H jω( )[ ] +1

k≥ ε for all ω ,

Then the origin, the equilibrium point of the closed-loop system, is globally,asymptotically stable.

Another criterion which is a direct generalization of the Nyquist criterionknown as Circle Criterion and which goes somewhat beyond Popov's criterionalso exists and can be found in the literature. We will not go into the details ofthem here. However, we should note here that these techniques are analyticallymotivated, take their lead from linear system theory tools such as Nyquistcriterion, lead mostly to sufficiency conditions and not necessary conditions, andadd constraints to the extent that the results are almost unusable in practice. All

these problems are of course due to the complex nature of nonlinear systems andthe methodology adopted to deal with such systems.

In summary, present generation fuzzy controllers are simple (from amappings' perspective) nonlinear static devices, and their use in feedbackcontrol can lead to questions about the stability of the resulting closed-loopsystems. Available analytical techniques fail miserably to provide a solution tothis problem. A technique that addresses this problem along with the ability toextend the mapping from static to dynamic will be of tremendous use. In section16.5 we describe one such approach obtained from the building block andreverse engineering approach of this book.

16.4 Fuzzy Expert Systems & Neural Nets: Compare,Contrast & Merge

It should be obvious from the descriptions in the previous chapter on neuralnetworks (specifically feed-forward networks) and the descriptions on fuzzyexpert systems in this chapter that there is very little difference (if any) betweenthe two types of systems from an outcome perspective. Both systems performthe same task of functional mapping given some input(s). It is true that theywere developed independently, the driving forces behind their developmentswere different, they use different approaches for the design and implementation,and so on. But the fact remains that if considered as black boxes with accessonly to the inputs and outputs, we will not be able to see any difference toidentify them exactly. Therefore, we may ask if we can analyze these systemsfurther with the goal of merging or fusing together their unique features to arriveat hybrid architectures. We present some material along those lines in thissection.

16.4.1 Digital Architecture of FESs & FCs for Real-TimeApplications

In this section, we will closely examine the steps involved in a digitalimplementation of fuzzy expert systems and fuzzy controllers. From that we willshow how a fuzzy expert system can be cast in the form of a neural architecture(implementation involving nonlinearities, multiplication and addition). Theapproach taken here will lead to a new architecture that is useful for real-timeapplications where the speed is critical. It will also show how we can developneuro-fuzzy architectures with the important features of both neural networks(ability to learn specific I/O mappings from large I/O data possibly corrupted bynoise without requiring any a-priori information, and the ability to adapt orcontinue learning) and fuzzy expert systems (ability to use experts' knowledgeand deal with fuzzy information and or incomplete/imprecise data in astructured, logical way).

Page 13: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

Let us consider the general case of an L input, N output fuzzy expert systemimplementing a mapping f: x → y . Let l i (i = 1 to L) be the number of

fuzzy sets for the input i and n j ( j = 1 to N) the number of fuzzy sets for the

output j. Let the original inputs be represented in a weighted, fixed-point binaryscheme using B-bits per input. These inputs can be converted to an unweightedbinary representation or distributed encoding (as defined in neural networks)with Q = 2B binary lines for each input (for a total of Q t = L × Q input bits and

only one bit 'on or one' for any input at any given time) as they become input tothe fuzzy expert system (Fig. 16.10). The first step in the implementation of afuzzy expert system (sub-block # 1 of Fig. 16.5) is to use the inputsx1 ( t) to xL (t) to identify the input fuzzy sets under which these input values

fall and the membership function values corresponding to the fuzzy setsselected. In a digital implementation, this step can be implemented byassociating one bit to each fuzzy set of each input ( l i bits for the i-th input for a

total of l = l ii=1

L∑ bits) such that a particular bit gets turned on if and only if

the input value falls under the range of values for that fuzzy set. we can callthese as input fuzzy set pointers ( IFSP i,l i

, i = 1 to L , for a total of l pointers).

The logic circuit for conversion from the input (encoded in distributedrepresentation) to the l pointers can be seen to be a collection of multi-inputOR gates ( l i gates for the i-th input) as shown in Fig. 16.10. The number of

inputs going into the OR gates will depend upon the number of quantizationlevels that fall under the range for that input fuzzy set pointer.

Denoting the membership functions' values of the fuzzy sets correspondingto the actual values of the various inputs by m j [x i (t)](i = 1to L; j = 1 to l i ) ,

we can implement this mapping from x i (t) to m j [x i (t)] as ROM look-up tables

( l ROMs in all) (omitted in the figure).The second step in the implementation of a fuzzy expert system is the

identification of the output fuzzy sets that get activated for any combination ofinput fuzzy sets and is given by the fuzzy rules or fuzzy associative memory(FAM). This step can be implemented in digital hardware by assigning bits toidentify if a particular output fuzzy set is activated or not and the conditions for

their activation. We will have n = n ii=1

N∑ output fuzzy set pointers, or OFSPs

for short. Therefore, a FAM operation simply corresponds to that of theoperation of an associative memory which, given the l -bits (the IFSPs),produces the corresponding n-bits (OFSPs). We therefore have a binary tobinary mapping and nothing really fuzzy here. In elementary digital logicdesign, we have learnt that any binary to binary mapping can be represented(and realized) using two-level sum-of-product or product-of-sum logic (usingAND , OR gates) or three levels (if we consider the operation of obtaininglogical "negative" of the inputs as one level). Thus, the transformation fromIFSPs to OFSPs can be realized using digital logic as shown in the figure. It is

worth noting here that one earlier demonstration of neural networks wasimplementing a two input, one output XOR binary mapping.

The third and the final step in implementing a fuzzy expert system, that ofde-fuzzification, makes use of the OFSPs, the membership function values ofthe inputs m j [x i (t)] , and the membership functions of the output fuzzy sets that

are selected and produces the exact output values (third block of figure 16.10)and in general involves nonlinear mappings. Though a simple digital logiccircuit for this operation cannot be identified, this block can be represented as athree-layer feed-forward neural network with the appropriate number of inputsand outputs and trained appropriately.

B to Q = 2B

line decoder OR gates.

B to Q = 2B

line decoder OR gates.

B to Q = 2B

line decoder OR gates.

Def

uzzi

fica

tion

B

B

B

B

B

B

Sum of products

logic circuits.

x 2

x1

l1

l1

l2

l2

lL

lLxL

IFSP1,1 toIFSP 1,l1

IFSP L,1 toIFSP L,l L

y 2

y1

yN

n 1

n 2

nN

Input values, input fuzzy set membership functions values and

output fuzzy set membership functions.

n = n ii∑( )

Figure 16-10. A digital implementation of the three specific steps in a fuzzy expertsystem leading to a neuro-fuzzy architecture.

Page 14: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

What do we gain from all this? The three sub-blocks in the architecture ofFig. 16.10 perform distinctive functions. The first block converts the inputs'values into fuzzy sets. The information needed to implement this block isrelatively easy to obtain. Anyone with some knowledge about the problem thatis being solved can come up with meaningful fuzzy sets. The second blockcorresponding to FAM can also be obtained from experts, and used in anyimplementation of fuzzy expert systems. If complete FAM information isunavailable, we can represent this block as a neural network and resort totraining. The third block corresponding to de-fuzzification is comparativelycomplex. And we may ask if the two currently used approaches for de-fuzzification, Min-Max and Centroid approach, are suitable for all applications ?The answer is definitely a no. Thus, we can instead denote the third block as afeed-forward neural network and train it using I/O data and information obtainedfrom experts and hence avoid using a pre-specified de-fuzzification procedure.The total architecture therefore corresponds to a new neuro-fuzzy architecture inwhich we make use of information such as fuzzy sets, membership functionsetc.7 and at the same time use the strength of neural networks, that of learningfrom examples. The given architecture can also be used as an alternative to asoftware based architecture (which implements the fuzzy logic expressions etc.)for real-time applications where the speed is very critical.

The steps involved in implementing a fuzzy expert system is the well known(in engineering design) 'divide and conquer' approach. Instead of representing awhole system (a controller in our case) by a two-layer neural net and trainingthat network, we represent the system as a number of sub-systems and reservethe training to one (or two simpler sub-systems). The beauty of this approach isthat we can carry this process further, especially with respect to the third block.Note that for the i-th output, we have n i (5 to 9 in practice) fuzzy sets and only

a certain number (1, 2, or 4) of them are activated for any given inputcombination. Therefore, we can replace the third sub-block by a number of sub-nets, one corresponding to each output fuzzy set, use the OFSPs as select orenable signals (from a digital systems perspective) for these sub-nets, and trainthese networks separately. A clear advantage of such an approach is the data thatneeds to be learnt becomes smaller and correspondingly the mapping expectedfrom each network simpler. A detailed representation of the third block is shownin Fig. 16.11. As shown there, the results from the sub-nets corresponding to theindividual OFSPs have to be combined together to form the final output(s). Thenetworks (N in all) for this operation can be simple networks performingaveraging etc.

7 This is in contrast to a narrow interpretation (by some) of the neural network paradigm

in which it is assumed that no knowledge is available, or even if available, theywill not be used, and training will take care of everything. The approachpresented here makes sense from the major thrust of neural networks, that oflearning, and imitating the adaptive behavior of the human brain.

The discussions and the architecture given here indicate that a fuzzy expertsystem can be considered equivalent to a number of multi-layer feed-forwardnetworks with structured interconnections between them8. Further, information(however fuzzy they may be) that is readily available and a divide and conquerapproach (that simplifies the design) are used in a fuzzy expert systemimplementation. Therefore, it is quite likely that a fuzzy expert system canprovide superior performance for functional mapping, compared to a single,

8 We will also discuss a neural network architecture known as CMAC in the next section

and show that it's implementation resembles that of a fuzzy expert system.

OFSP1,1 to IFSP1,n1

OFSP2,1 to IFSP 2,n2

OFSPN,1 to IFSPN,n N

n 1

n 2

n N

Subnet # 1,n1

Subnet # N,n N

Subnet # 1,1

B

B

B

y 2

y1

y N

N c

ombi

ning

Net

wor

ks

Values of the inputs and the input membershipfunction values for those input values.

OFSP1,1 (as enable signal)

OFSPN,1

Subnet # N,1

OFSPN,nN

OFSP1,n1

Intermediateoutputs

Figure 16-11. A detailed network representation of the third process, that of de-fuzzification process, in a fuzzy expert system implementation.

Page 15: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

two- or three-layer network9. Other researchers have arrived at similarconclusions through simulations comparing the performance of fuzzy expertsystems and neural networks.

In summary, we have identified a new architecture we call "Neuro-FuzzyArchitecture" with the following properties:

∗ A structure consisting of smaller networks that can be trained easily andfaster (a desirable property of neural networks);

∗ A structure in which available information can be incorporated (adesirable property of fuzzy expert systems);

∗ A structure that can be adapted using available I/O data (property ofneural networks);

∗ Since there is an one-to-one correspondence between the various blocksin the architecture and the tasks in a fuzzy expert systemimplementation, when the fuzzy rules are not available we can train thesub-net corresponding to FAM and extract the rules;

∗ An architecture that is suitable for hardware implementation. That is,rather than using a fuzzy language based processing (with the associatedMFLOPS or mega fuzzy logic operations per second rating), we can usethe new architecture as a digital or hard-wired implementation of afuzzy expert system. Such an implementation will have a tremendousedge in real-time applications since the number of rules increaseexponentially with a linear increase in the number of inputs. Forexample, if we assume that there are five fuzzy sets per input, thenumber of rules will be 3125, and for a ten input system, we will have9,765,625 rules. Perhaps due to this problem, fuzzy expert systemsconsidered in the literature are mostly two input systems, or inputseparability is assumed when there are more than two inputs.

∗ Easy of modeling of complex systems: By modeling the blockcorresponding to the rule-base by a three layer feed-forward neural netand the de-fuzzification block by a large number of neural nets, we willbe able to model more complex systems than is possible using otherapproaches.

16.4.1.1 Results Using the Trainable Neuro-Fuzzy Architecture

In this section, we present simulation results based on the new trainable neuro-fuzzy architecture. We use the same truck-backer-upper problem (designing thecontroller given the truck model) as this problem has been solved earlier usingclassical fuzzy expert systems (as explained before), and two-layer (with 26nodes in the hidden layer) neural network architecture. We assume that the

9 Theoretical results are available in the literature indicating that two- or three-layer

neural networks can approximate any nonlinear mapping. However, they do notreally consider the errors introduced by such approximation.

range of values for the fuzzy sets of the inputs and the outputs, and the fuzzyrules are known. Thus, there is no need to train the first two sub-blocks of theneuro-fuzzy architecture, and only the sub-networks corresponding to the thirdsub-block have to be trained. The desired outputs corresponding to a set ofinputs are generated using the centroid de-fuzzification approach and used asdata for training the networks.

We used two different approaches for training. In the first approach, datacorresponding to the inputs x, φ , and the IFSPs (for this we need to know only

the range for the fuzzy sets and not the actual membership functions) are used asthe inputs for training and the values of the steering angle θ generated by thefuzzy controller as the desired output. Thus, the membership functions of boththe inputs and the outputs are not used in the training. As more accurate resultsare needed when the truck is in or near the center , we selected more samples forthe x-position around the value 50, and less number of samples for x-values nearthe ends (0 and 100 feet). The sampling for φ is carried out similarly. This led

to 34 quantization levels for x-position, and 72 quantization levels for φleading to 2448 I/O samples. The y-position was not used by the controller (aswas the case in the fuzzy controller as well), thus simplifying the trainingprocess. There are seven networks corresponding to the seven output fuzzy sets.The I/O training set was divided into 7 sub-groups based on the outputclassification (to which output fuzzy set the output belongs). The largest groupcontained 826 training samples and the smallest one 271 samples. Some I/Osamples are used in more than one group due to the overlap of the output fuzzysets. This brought the total number of training samples for all the groups to3624.

The training samples were normalized to the range -0.5 to 0.5. We used atwo-layer architecture with 10 hidden layers for the seven networks, and theback-propagation algorithm for the training. The desired limit on the error(average squared error per sample) for convergence was set at 5.0 ×10 −4 for theinputs near the center and at 1.5 × 10−3 otherwise. The training converged in fewhundred iterations (for groups with small number of I/O samples) to fewthousands (for groups with large number of I/O samples). A truck trajectoryproduced using the trained neuro-fuzzy architecture is shown in Fig. 16.12a. Wecan note that the resulting trajectory is very smooth.

In the second approach, x, φ and the corresponding input membership

function values were used as inputs, and the steering angle θ as the desiredoutputs. The training was performed as explained for the first approach withsimilar results. A truck trajectory produced using this controller is shown in Fig.16.12b. For comparison, we have reproduced the resulting trajectories based ona two-layer neural network architecture for the whole controller as Fig. 16.12c.We can observe that the new architecture produces much smoother trajectories.Also, the trajectories produced by the new controller are very similar to the onesproduced by the original fuzzy controller, the teacher (Fig. 16.12d).

Page 16: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

16.4.2 Cerebellar Model Articulation Controller (CMAC) NeuralNetwork Vs Fuzzy Expert Systems

In this section, we describe another feed-forward neural network architectureknown as CMAC and show how the architecture looks similar to a fuzzy expertsystem. The CMAC neural network was developed independently in the early1970's and the name (Cerebellar model) clearly illustrates the motivation and the

drive behind that work. This architecture has recently been revived as a betteralternative to multi-layer feed-forward neural network architectures.

True to its origin, CMAC definitions and descriptions include terms such asinput sensors, receptive fields, input generalizations, state space detectors,multiple field detectors, etc. Considering Fig. 16.13, where we show a two inputCMAC architecture, we start with the two-dimensional input space in R 2 (Ndimensional space in the general case) and divide this space into a number ofoverlapping sub-spaces. For example, if a digital representation is assumed with256 quantization levels for the entire range of each input variable, the sub-spaces may span 16 × 16 points in that space (16 quantization levels on eachinput side) and a total of 31× 31 = 961 sub-spaces (assuming an overlap of 8bits). Thirty one sensors will be used for each input with each sensor producinga binary output of ON if the input falls with in the 16 quantization levelscovered by that sensor and an output of OFF otherwise. The input range coveredby those 16 quantization levels is called the receptive field of that sensor andthe value 16 is the width of the receptive field. The width of the receptive fieldproduces what is termed as input generalization while the offset between theadjacent fields (8 bits in our example) produces input quantization. The ratio ofgeneralization width to quantization width denoted as C (2 in our case) willnormally be in the range 32 to 256 for typical implementations and is also equalto the number of input sensors excited by each quantization level of each inputvariable.

The binary outputs of the input sensors are combined in a series of thresholdlogic units (called state space detectors) with the thresholds adjusted to producelogical AND functions (output ON only if all inputs are ON). Each of these unitsreceives one input from the group of sensors for each input variable, and thus itsinput receptive field is the interior of the N-dimensional sub-space. The numberof state space detectors would be very large if N is large (as will be the case inproblems of practical importance), and we go in for full interconnection (961 inour example). Therefore, the input sensor outputs will be connected to the statespace detectors in a sparse and regular fashion as follows: We assume there areC subsets of state space detectors (with the total number much less than valueneeded for full interconnection). The receptive fields of the units in each of thesesubsets are organized so as to span the input space without overlap. Each inputexcites one state space detector of each subset, leading to each input excitingexactly C state space detectors. Even under this constraint, there are many waysto arrange the receptive fields of the individual subsets. One possibility is tomake each of the subsets of state space detectors identical in organization, andoffset each subset (relative to others) by, say, the quantization width, alonghyper diagonals (along the diagonal in the N =2 case) in the input hyper space.

The organization as described above guarantees that a fixed number C ofdetectors is excited by any input. However, the total number of state spacedetectors can still be large for many practical problems. Thus, the outputs of the

(A) (B)

(C) (D)

Figure 16-12. Trajectory of the truck using: a) Neuro-fuzzy controller trained using inputfuzzy pointers; b) Neuro-fuzzy controller trained using membership functions; c) using atwo-layer neural net controller; d) Using the fuzzy controller (used as a teacher for theneural controllers).

Page 17: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

state-space detectors are connected randomly to a smaller set of threshold logicunits, called multiple field detectors, with the thresholds adjusted such that theoutput will be ON if any input is ON (a logical OR function). Since exactly Cstate-space detectors are excited by any input, at most C multiple field detectorswill be excited by any input. The convergence connections between the large setof state-space detectors and the smaller set of multiple field detectors arerefereed to as "collisions." In practice, the converging connections areimplemented by assigning a virtual address to each of the state-space detectors,and passing the addresses of the active state-space detectors through a randomhashing function.

Finally, the output of each multiple field detector is connected, through anadaptive weight, to an output summing unit. Thus, the output for a given input isthe sum of the weights selected by the excited multiple field detectors (since theoutputs of multiple field detectors are zero or one). While the number of inputsensors and state-space detectors is determined by the number of inputs, theirdynamic ranges, the level of quantization, and the degree of generalization, thenumber of multiple field detectors (and hence the number of adaptive weights) isan independent design parameter. This size (equivalent to the memory size forstoring the weights) is related to the size of the subset of the input space that islikely to be visited in a particular problem (i.e., the mapping from the inputs tothe output) rather than the total size of the inputs' sub-space. Thus, the simpleproblems in a many dimensional input space (N very large) will require onlysmall weight memories.

The network is trained based on observed training data pairs s 0 (input

vector) and f 0 (output vector) using a supervised learning technique such as the

least mean squares (LMS) algorithm. Since the learning is confined to the laststage with linear adaptive elements, CMAC training will take fewer iterationsthan back-propagation applied to a multi-layer neural network.

Now let us identify the similarities between CMAC networks and fuzzyexpert systems. The process of going from exact input values to input sensoroutputs (on or off) corresponds to using fuzzy sets with rectangular membershipfunctions (value one if inside the region and zero otherwise). Thus, the inputsensors’ outputs correspond to input fuzzy set pointers that we defined before.The differences are: 1) the fuzzy sets are uniformly placed and 2) the number offuzzy sets are comparatively large.

The merger of the various input sensor outputs through state space detectors(AND gates) and multiple field detectors (OR gates) is akin to theimplementation of a fuzzy rule-base. Thus, the outputs of the multiple fielddetectors are the output fuzzy set pointers. Again, the differences are: 1) CMACdoesn’t use logical complement of the input sensors. Thus, the logical sum ofproducts expressions that get implemented by the CMAC are not as general asthat of a fuzzy expert system; 2) The number of rules are in general large and 3)A large number of input fuzzy sets interact to produce output fuzzy set pointers.Thus, one can argue that the last two will compensate for any deficienciescaused by the first.

The final outputs are generated from the output fuzzy set pointers based on atrained linear network in CMAC, whereas de-fuzzification based on centroidmethod, a more complex nonlinear process, is used in fuzzy expert systems.

In a recent paper on extensions to CMAC, it is indicated that a triangularweighting be used for the output of the input sensors. Thus, the authors haveused some of the better features of fuzzy expert systems in their modifiedCMAC neural networks.

w 1

wN

w2

Multiple fielddetectors

Input # 1range

Receptive field ofinput sensor # 1,1

State spacedetectors

Input # 2range

Receptive field ofinput sensor # 2,1

Inputsensors

Figure 16-13. A simple example of a two input, one output CMAC neural network.

Page 18: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

16.5 Design of Stable Feedback Fuzzy Expert Systemsand Stable closed Loop Systems with Feedback FuzzyControllers

In previous sections, we learnt that present generation fuzzy expert systems andfuzzy controllers are simply static nonlinear mapping devices. Thus, theoutput(s) (in temporal dimension) may not be continuous as a) the inputs maychange abruptly (as in a step input), and b) the fuzzy mapping process itself maybe discontinuous. However, in problems such as control, we would like to havesmooth outputs from the controllers. Further, as noted earlier, the use of fuzzyexpert systems as controllers lead to closed loop systems with unknown stabilityproperties. In this section, we will describe approaches to overcome these twoproblems using the building block approach seen in the earlier chapters.

16.5.1 Design of Stable Feedback Fuzzy Expert Systems

Assuming an N-input, one-output fuzzy expert system, an obvious and simpleapproach to obtain a final output that is not just a function of the present inputsbut also past inputs and outputs (thereby making the output continuous) is topass the output of the expert system through a smoothing filter. This leads towhat is known as a cascade architecture . An example of this architecture isshown in Fig. 16.14a where we have a first-order lowpass filter as a smoothingfilter. The filter output is a function of the present value of the output from theexpert system as well as its past values. The parameter ‘a’ of this filter can bechosen appropriately to emphasize the present value more than the past (impulseresponse of short duration leading shorter memory or equivalently, a filter with awider bandwidth) or alternatively to emphasize the past values more than thepresent value (impulse response of longer duration or larger memory or a filterwith a smaller bandwidth). Of course, we don't have to restrict ourselves to afirst-order filter or continuous-domain filter. We can use higher ordercontinuous-domain filters or discrete-domain filters (FIR or IIR) as theapplications demand (Fig. 16.14b). However, the concept remains the same aslong as the filter used is linear and time-invariant.

We can use nonlinear and time varying filters in place of the linear filter ifthe problem so demands. For example, in control applications, we may requirethe controller output not only continuous (in time) but also bounded. A generaldescription of such a filter will be:

˙ x (t) = f x (t),y FES(t)[ ]y out (t) = g x (t),y FES(t)[ ]

(16.10)

where x is the state vector of size M, f •[ ] is a vector of nonlinear functions of

the state and the input yFES (t) , y out (t) is the final output and g •[ ] is a nonlinear

function such that − ymax ≤ y(t) ≤ ymax . In figure 16.15a, we depict the general

architecture corresponding to the above equations. We have seen in previouschapters how such filters with guaranteed stability property can be designed. InFig. 16.15b, we show an example of a nonlinear and time-varying filter based onthe ladder architecture. The architecture (the placement of the inductor andcapacitors) leads to a lowpass or smoothing filter; the nonlinear resistor at theoutput end with the characteristics shown in Fig. 16.15c constrains the outputwithin the specified bounds; the nature of the reactive elements (Fig. 16.15d)prevents much of the oscillations (and discontinuity) in the input reaching theoutput; the saturating nonlinear characteristics of the reactive elements basicallyincreases their filtering ability when the input signal is at the extreme levels; andfinally, the time-varying resistor helps to clip (so to speak) the input signalespecially when it is constant (DC). It is necessary since the inductive elementsbecome a short and the capacitor a open for DC input signal forcing all of theinput signal to appear across the time-varying resistor and the voltage that can

Fuzzy ExpertSystem

Static NonlinearSystem

A first-order lowpass filter

Dynamic Linear System

-a

∑u1 (t)

yFES(t)u2 (t) 1

s

(a)

y out(t)

Fuzzy ExpertSystem

u1 (t)yFES(t)

u2 (t)A higher-order LTIcontinuous or discretedomain filter

(b)

y out(t) or yout (nT)

uL (t)

uL (t)

Figure 16-14. A dynamic fuzzy expert system (one with memory) formed as acascade of classical (static) expert systems and LTI filters.

Page 19: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

appear across the nonlinear resistor is limited. The dynamics corresponding tothis architecture is given by:

˙ φ 1˙ q 1˙ φ 2

=−R in (t) ≥ 0 −1 0

1 0 −1

0 1 0

i L1[φ1 ]

vc1[q1 ]

i L2 [φ2 ]

−0

0

vR2 i L2 φ2[ ][ ]

+yFES(t)

0

0

(16.11)

where

R in (t) ≥ 0 and yout (t) + Rin (t)i DC = yFES (16.12)

will be used to fix the value of the time-varying resistor. Thus, we can see thatthe building block approach proposed in this book allows us to easily mixradically different paradigms, such as the rule-based fuzzy expert systems.Again, we should point out that the architecture is shown in the continuousdomain as the building block concept is based on power and energy principles,but can be changed to discrete form in actual implementation.

We can contrast the above approach with the approach based on flow-graphtechnique where the N outputs will be fed back to the input end. Since the fuzzyexert system is a static, instantaneous device, a differentiator or an integrator(the later preferred due to its low sensitivity property to noise) will beintroduced in the feedback for a continuous domain implementation or a delayelement for a discrete-domain implementation as shown in Fig. 16.16. Thefeedback leads to an increase in the number of inputs to the fuzzy mapping andhence the complexity. Also, we have to ask if the experts will be able to comeup with the rules when certain inputs are past outputs. A more serious problemis that the presence of feedback can make the system unstable. Considering thecontinuous case, we can write the dynamics as:

˙ y out (t) = ˆ y FES u(t), y out (nT)[ ] (16.13)

where u is the input vector of size L and ˆ y FES •[ ] represents the N new mappings

from the new fuzzy expert system with (L+N) inputs. As we learnt in chapter 4,it is not easy to constrain the mappings so that the expected equilibrium points(in the case of constant inputs) or the expected trajectories (in the case of time-varying inputs) of the outputs are stable. The severity of the problem can beappreciated by considering a simple one-input, one-output system (L = N = 1).The resulting system is a first-order system. If the expected output from thissystem is y d (t) when the input is u(t), in order the ascertain the stability of the

output we need to consider the system dynamics in the error domain. From(16.13), we can write:

Fuzzy ExpertSystem

Static NonlinearSystem

Dynamic Noninear System

u1 (t)y FES(t)u2 (t) 1

sIf[•] g[•]

yout

(t)x

yFES(t)

+ -+ -

R in (t)

yout(t) = vR

iR

iL1[φ1]

v c1[q1 ]

+

-

iL2 [φ2 ]

+

-

Buffer

(a)

(b)

vR

iR

− yMax

yMax iL[φ]{vc[q]}

φ{q}

(c) (d)

uL (t)

Figure 16-15. A dynamic fuzzy expert system formed by cascading aclassical (static) fuzzy expert system with a nonlinear filter. a) Generalarchitecture; b) Based on a ladder architecture for the nonlinear filter.

Page 20: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

˙ y out (t) − ˙ y d (t) ≡ ˙ e (t)

= ˆ y FES u(t),y out (nT)[ ] − ˙ y d (t)

= ˆ y FES u(t),e(t) − ˙ y d (t)[ ] − ˙ y d (t)

(16.14)

where e(t) is the error between the actual output and the desired output. Wefind that the system dynamics in the error domain is nonlinear and time-varying,and it is not easy to constrain the mapping ˆ y FES •[ ] for any given y d (t) {or

equivalently, u(t)} such that this NLTV dynamics is stable. If this is the case for

a simple SISO system, the implications for complex systems are obvious.Therefore, the general architecture shown in Fig. 16.15 (based on the networkprinciples) is superior to this architecture (which is based on flow-graphconcepts). Further, the network based architecture has the advantage of retainingthe original fuzzy expert system (that depends on the inputs only) derived fromthe experts, without any modification.

16.5.2 Design of Stable closed Loop Systems with FeedbackFuzzy Controllers

In this section, we discuss a new approach for the design of fuzzy expertsystems with memory (or feedback fuzzy expert systems, also known asrecurrent fuzzy controllers, especially when implemented in discrete domain) foruse as controllers. The method is based on the building block approachadvanced in this book and guarantees the stability of the closed loop systemconsisting of the plant and the fuzzy controller. We will try to keep thedescription concise, easy to understand by non-electrical engineers, and somewhat self contained; use plants that can be described by first- and second-orderLTI models, and later the truck model, to describe the approach. Additionaldetails can be found in the chapters on control.

Let us first consider a plant described by a first-order LTI model given by:

˙ x (t)+ ax(t) = au(t) (16.15)

where u(t) is the input, x(t) is the output, and ‘a’ is one parameter associatedwith the plant. In the Laplace domain, the plant is described by the systemtransfer function:

T(s) =X(s)

U(s)=

a

s + a(16.16)

and we can note that the plant will be stable if a > 0, and unstable if a < 0. Beinga first-order system, the only signal that we can measure and use in control is theoutput, x(t). The task of the feedback controller is to stabilize the plant (if itwere unstable) and improve the performance (mostly, in the time-domain) of theplant. If the desired output, x d (t) , is a constant and if we expect the plant output

to reach that value in a reasonable amount of time and stay there even if somedisturbances are present in the system, we have what is known as a asymptoticstabilization and set-point control. On the other hand, if x d (t) is a smoothly

varying function with finite, higher-order derivatives, and we expect the plant tofollow the desired trajectory, we have a tracking control, a more complex

(a)

Fuzzy ExpertSystem with L+Ninputs & N outputs

N

N

u 1(t)u 2 (t)

uL (t)

ˆ y FES(t) y out (t )1

sI

(b)

Fuzzy ExpertSystem with L+Ninputs & N outputs

N

N

u 1(nT)u 2 (nT)

uL (nT)

ˆ y FES(nT) y out (nT)

z−1

I

Figure 16-16. Flow-graph based approach for building fuzzy expert systemswith memory: a) Continuous feedback fuzzy expert system; b) Discretefeedback (or recurrent) fuzzy expert system.

Page 21: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

problem 10. Considering the latter, the architecture for control will be as shownin Fig. 16.17a where we 1) Use a controller which acts on the differencebetween the actual plant output x(t) and the desired signal x d (t) {the error

signal e(t) = x(t) − x d (t) } to stabilize and control the plant; 2) Use a filtered (by

the inverse of the plant model) version of the desired signal x d (t) as additional

input to achieve perfect tracking. For example, with a proportional control, thedynamics of the closed loop system corresponding to this figure will be:

˙ x (t) = −ax(t) + au(t)

= −ax(t) + aa1

ae(t) +

˙ x d (t) + axd (t)

a

|← for control →|→ for tracking →|

(16.17)

or

˙ x (t)− ˙ x d (t) = ˙ e (t)

= − a − a1( ) e(t)(16.18)

Equation (16.17) can be re-written as:

˙ x (t) = −(a − a1 )x(t) + a˙ x d (t) + (a − a1 )x d (t)

a

(16.19)

which points to a slightly different architecture for tracking as shown in Fig.16.17b. According to this figure, we add the feedback a1x(t) a to stabilize and /

or move the poles to desired locations and add a filtered (by the inverse modelof the closed loop system) version of x d (t) to achieve tracking. For LTI plants

and LTI controllers, both architectures are equivalent, whereas it is not so fornonlinear plants and / or nonlinear control. The first architecture has to be usedfor nonlinear control as: 1) we express the function of a fuzzy controller basedon the error (and its derivatives) and 2) as we learnt in the chapter on nonlinearcontrol, to achieve stability or set-point control or perfect tracking, the closed-loop system dynamics (plant plus the controller) expressed in terms of the errorstate (and not the system state) should correspond to a dynamics with the originas the stable equilibrium point. Further, the dynamics should not have any other

10 The truck backer upper problem is in a sense set-point control as we expect the plant to

reach the dock. However, it is a much more complex problem as we also expectthe trajectory taken by the truck to be smooth and we do not per say define thetrajectory as we will have number of starting points and a number of acceptabletrajectories for each starting point.

stable equilibrium points if control or tracking has to be possible with anyarbitrary starting value.

The application of the classical fuzzy controller to this first-order plant willlead to a nonlinear mapping f FES e[ ] of the error function e(t) and the dynamics

in the error domain:

˙ e (t) = − a − a1( ) e(t) + fFES[e(t)] (16.20)

x(t)LTI System

Hp(s) = a

s + a

Pre-shaping Filterfor Tracking Input

u t(t) ∑+∑ Proportional

Controller+

-

+

H f (s) = Hp−1(s)

u t(t)

xd(t)

u t(t) x(t)LTI System∑

+ +u c(t)

Hp(s) =a

s + a

Feedback

H cls(s)|← →|

Pre-shaping Filterfor Tracking Input

H f (s) = Hcls−1 (s)

xd(t)

(a)

(b)

Figure 16-17. Two different architectures for tracking control (using LTIcontrollers) of a first-order LTI system.

Page 22: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

and the control input given by:

u(t) = 1

aa1e(t) + f FES[e(t)]{ } + 1

a˙ x d (t) + ax d (t){ }

|← for control →| |← for tracking→|(16.21)

It is easy to see that the closed loop system will be stable if the combinedmapping(a − a1 )e − fFES e[ ] of the independent variable e(t) is confined to the

first- and third-quadrant and passes through the origin11. Thus, stability is a not abig issue here. But the fuzzy mapping, f[e], is a static mapping and may havediscontinuities.

To design the new dynamic controller, we first associate a new statevariable, k(t), with the fuzzy expert system and modify the control law to:

u(t) = 1

aa1e(t) + k(t) − k∞( )f FES[e(t)]{ } + 1

a˙ x d (t) + ax d (t){ }

|← for control →| |← for tracking →|(16.22)

where k∞ is some pre-determined value that k(t) is expected to take as

e(t) → 0 . That is, the new fuzzy controller output is given byk(t) − k∞( )f FES[e(t)] a . The multiplication by the new state variable k(t)

introduces memory into the new fuzzy controller output or makes the fuzzycontroller mapping a dynamic one. This particular form (and others givenbelow) for the new fuzzy controller is (are) obtained from an understanding ofthe dynamics that result from networks made of various passive nonlinearelements. The dynamics of the first-order plant with the new control law willchange to:

˙ e (t) = −(a − a1 )e(t) + k(t) − k∞( ) fFES[e(t)] (16.23)

The next task is to choose the dynamics for the control state variable k(t).Obviously, we need to make k(t) change, based on the error and perhaps basedon its past value. More importantly, the combined dynamics, that of the plantwith the new control law and that of the control state variable, should have theorigin {e = k = 0} as a globally, absolutely stable equilibrium point. In thisparticular case, the closed loop system has two state variables, e(t) and k(t), andwhen we say that the origin should be absolutely stable it implies that thisdynamics has to correspond to the dynamics of a passive nonlinear (and perhapstime-varying) network with two reactive elements (linear, nonlinear, or time-varying) with the origin as the origin as the relaxation point. Further, global

11 The control signal, a 1e(t) a , could easily be made a part of the fuzzy controller output

or mapping. We keep it separately for reasons that will become obvious soon.

stability implies that there should not be any other relaxation point, as well aspoints where the stored energy becomes a minimum. Using this paradigm, andsome experience with dynamics that come from such networks, we can write ageneral form of the closed loop dynamics as:

˙ e (t)˙ k (t)

= −

a − a1 − f FES e(t)[ ]f FES[e(t)] b

e(t)

k(t) − k∞

;

a − a1 > 0

b > 0(16.24)

This dynamics corresponds to the passive network shown in Fig. 16.18a andinvolves LTI dynamic elements and resistors, a nonlinear lossless gyrator, and astrategically placed voltage source (The description of the various elements canbe found in the earlier chapters). The second-row basically gives the update lawfor k(t). The passive nature of the circuit implies that e(t) → 0

or x(t) → x d (t){ } and k(t) → k∞ as t →∞ . That is, we now have a dynamic

fuzzy controller that uses the classical fuzzy controller as a sub-system and aclosed-loop dynamics that is absolutely stable.

By making the passive resistor associated with the second-port nonlinear(Fig. 16.18b), we can obtain another closed-loop dynamics as:

˙ e (t)˙ k (t)

= −

a − a1 − f FES e(t)[ ]f FES[e(t)] 0

e(t)

k(t) − k∞

0

iR k(t) − k∞[ ]

(16.25)

where i R •[ ] is a mapping confined to the first- and third-quadrant and passes

through the origin. This dynamics uses the same control law but has a differentupdate equation for k(t) and hence will lead to a different performance. We canuse power and energy concepts to define / optimize this mapping, as we will seelater.

A more general dynamics is possible by changing the capacitor associatedwith the state variable k(t) to a nonlinear one (Fig. 16.18c). With this change,k(t) will be the charge in that nonlinear capacitor, ˙ k (t) the current and v c k(t)[ ]the voltage which is a mapping confined to the first- and the third-quadrant. Ifwe expect the state variable k(t) → k∞ as t →∞ a certain current source also

has to be connected as discussed in earlier chapters to keep the total circuitpassive and as shown in the figure. The resulting closed-loop dynamics is:

˙ e (t)dvc

dk˙ k ( t )

= −a −a 1 −f FES[e(t)]

fFES e(t)[ ] 0

e(t)

vc k(t)[ ] − vc k ∞[ ]

−0

iR v c k(t)[ ] −v c k∞[ ][ ]

(16.26)

Page 23: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

which leads to a new fuzzy controller output vc k(t)[ ] − v c k∞[ ]{ } f FES e(t)[ ] a

and a different update law for k(t). From the update equation, we can note thatdv c dk has to have the same sign and should not be equal to zero for all values

of k. That is, v c •[ ] has to be a monotonically increasing function.

We can summarize the procedure with the aid of the block diagram shown inFig. 16.19. For a given plant (sub-block # 1), we add the stabilizing and ortracking control input (sub-block # 2). On top of this, we add the dynamic fuzzycontrol law (sub-block # 3). The dynamic fuzzy control law is simply amodulation (or product) of the classical fuzzy control law by a new statevariable or a proper mapping of that state variable. Finally, the dynamics of thecontrol law state variables (sub-block # 4) is chosen such that the total system(block # 5) or to be exact, the dynamics of the total system, corresponds to thedynamics of a properly connected nonlinear passive network formed of welldefined nonlinear elements. We will discuss the advantages and disadvantages(if any) of such an approach after we present few more concrete examples.

+

-

+

-

+

-

C=1+

-

+

--

+

k(t)

˙ k (t)

Lossless NonlinearGyrator

YG =0 −fFES e[ ]

fFES e[ ] 0

C=1 F

e(t)

˙ e (t)

−(k − k∞)fFES e[ ]

k − k∞

(a − a1)mho

k∞

efFES

e[ ]

b mho

(a)

+

-

+

-

+

-

C=1+

-

+

--

+

k(t)

˙ k (t)

Lossless NonlinearGyrator

YG =0 −fFES e[ ]

fFES e[ ] 0

C=1 F

e(t)

˙ e (t)

−(k − k∞)fFES e[ ]

k − k∞

(a − a1)mho

k∞

ef FES e[ ]

+

-

iR •[ ]

(b)

+

-

Lossless NonlinearGyrator

e(t)

−(k − k∞)fFES

e[ ]

YG =

0 −fFES e[ ]fFES e[ ] 0

+

-

k − k∞

ef FES e[ ]

+

-

+

-

+

--

+

˙ k (t)

dvc

dk−1

˙ k

v c[k]

v c[k∞ ]

iR •[ ]+

-C=1

˙ e (t)(a − a1)mho

(c)

A two-terminal lossless unit

Figure 16-18. Three network architectures that lead to three different dynamic fuzzycontrollers to control a first-order LTI plant. Note that the classical (static) fuzzyexpert system is used as a sub-system within the architecture.

Stabilizing & TrackingControl Input

Plant Dynamic FuzzyController

(Nonlinear DynamicController)

Dynamics of the Fuzzy Controller Variable(s)

1

2 3

4

Figure 16-19. A block diagrammatic representation of the dynamic fuzzy controllerdesign.

Page 24: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

Let us now consider a plant represented by a second-order LTI model:

˙ ̇ x (t)+ b ˙ x (t) + ax(t) = au(t) (16.27)

or

˙ x (t)

˙ x 1 (t)

=

0 1

−a − b

x(t)

x1 (t)

+

0

au(t)

(16.28)

where the coefficients, a and b, must be positive for the plant to be stable.Therefore, we have two state variables, x(t) and x1 (t) = ˙ x (t) , with their desired

values given by x d (t) and x1d (t) = ˙ x d (t). Based on the classical fuzzy

controller design approach, we will use the two error functions e(t) ande1 (t) = ˙ e (t) and a mapping of these two functions, f FES e, ˙ e [ ] , obtained from a

fuzzy expert system to write the control law as:

u(t) = 1

aa1e(t) + b1

˙ e (t) + fFES[e, ˙ e ]{ } + 1

a˙ ̇ x d (t) + b ˙ x d (t) + ax d (t){ }

|← for control →| |→ for tracking →|(16.29)

leading to the closed loop dynamics:

˙ e (t)

˙ e 1 (t)

=

0 1

−(a − a1 ) −(b − b 1 )

e(t)

e1(t)

+

0

fFES[e, ˙ e ]

(16.30)

with the corresponding closed loop system as shown in Fig. 16. 20a. However,as we discussed earlier in this chapter, it is very difficult to show the stability ofthis system.

Using the new approach, similar to the first-order plant control, we willchange the control law to:

u(t) = 1a

a1e(t) + b1˙ e ( t) + k(t) − k∞( ) fFES[e, ˙ e ]{ } + 1

a˙ ̇ x d (t) + b ˙ x d(t) + a xd (t){ }

|← for control →| |→ for tracking →|

(16.31)

with k(t) a state variable associated with the controller and write the dynamicsfor k(t) to make the closed loop dynamics mimic that of a passive network. Onepossible closed loop dynamics is given by:

(a)

Pre-shaping Filterfor Tracking Input

∑+

H f (s) = Hp−1

(s)

u t(t)

∑ Proportional, DerivativeController

ClassicalFuzzy

Controller

xd(t), ˙ x d (t)

xd (t)

e(t), ˙ e (t)a1e + b1

˙ e

a

fFES

[e,˙ e ]

a

+

+

+

-

x(t), ˙ x (t)

LTI Systemx(t), ˙ x (t)

Hp(s) =

a

s2 + bs + a

(b)

fFES[e,˙ e ]a

Pre-shaping Filterfor Tracking Input

∑+

H f (s) = Hp−1(s)

u t(t)

∑ Proportional, DerivativeController

xd(t), ˙ x d (t)

xd(t)

e(t), ˙ e (t)a1e + b1

˙ e a

+

+

+

-

x(t), ˙ x (t)ClassicalFuzzy

Controller

˙ k (t)

ˆ f e,˙ e ,k,k ∞[ ]1

s∑ k∞

×

+ -

Dynamic FuzzyController

LTI Systemx(t), ˙ x (t)

Hp(s) =

a

s2 + bs + a

Figure 16-20. Flowgraph representation of the tracking control architecture for a second-order LTI plant; a) Using classical fuzzy control; b) Using dynamic fuzzy controlobtained using the building block approach.

Page 25: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

˙ e (t)

˙ e 1 (t)˙ k (t)

=0 1 0

a1 − a b1 − b fFES[e, ˙ e ]

0 − fFES[e, ˙ e ] 0

e(t)

e1 (t)

k(t) − k∞

−0

0

i R k(t) − k∞[ ]

(16.32)

with the corresponding flowgraph representation as shown in Fig. 16.20b. Thisclosed loop system dynamics corresponds to the passive network of Fig. 16.21aif (a − a1 ) and (b − b1 ) are greater than zero. The equivalent circuit has three

state variables (three reactive elements), a three-port nonlinear lossless gyratorand other elements. Similar to the first-order plant example, we can make thecapacitor associated with the control state variable k(t) nonlinear (Fig. 16.21b)or the linear derivative feedback b 1˙ e (t) into a nonlinear feedback term

b 1˙ e (t) + f1 ˙ e (t)[ ] (Fig. 16.21c). We can also force the dynamics to have time

varying terms that correspond to time-varying passive resistors. For example,equation (16.32) can be modified to:

˙ e ( t )˙ e 1 ( t )˙ k (t)

=0 1 0

−(a − a1 ) −(b − b1 )− ˆ f (t) f FES[e, ˙ e ]+ k1ˆ f (t)

0 −f FES[e, ˙ e ]+ k 1̂ f (t) − ˆ f (t)

e

e1

k − k ∞

−0

0

iR k −k ∞[ ]

(16.33)

where k1 ≤ 1 and ˆ f (t) > 0 for al t. In control applications, we will make ˆ f (t) a

function of the error state.Referring back to equation (16.32) and the corresponding figure 16.21a we

can make some important observations about this approach. We do not have toknow the exact values of the plant parameters a and b. Based on someknowledge about their minimum and maximum values, we can select the valuesof the coefficients a1 and b 1 such that the conditions (a − a1 ) and (b − b1 ) > 0

are satisfied. A deviation in the plant parameter ‘a’ from the assumed nominalvalue will simply change the value of the capacitor, and a deviation in theparameter ‘b’ will change the value of the resistor in the equivalent network andtheir effect on the system performance can be easily explained from networkconsiderations. Basically, they will have some effect on the rise and fall time ofthe response.

+

-

Lossless NonlinearGyrator

e(t)a − a1( ) F

a − a1

( )˙ e +

-1 F

˙ e (t)b − b1( ) mho

˙ k (t)k − k∞

C=1k∞

+ -

iR

•[ ]

+

-

Lossless NonlinearGyrator

e(t)a − a1( ) F

a − a1( )˙ e +

-1 F

˙ e (t)

iR •[ ]

+ +--v c k[ ] v c k∞[ ]

dvcdk −1

˙ k

+

-

Lossless NonlinearGyrator

e(t)a − a1( ) F

a − a1( )˙ e +

-1 F

˙ e (t)

iR •[ ]

+ +--v c k[ ] v c k∞[ ]

dvcdk − 1

˙ k

+

-

f1 •[ ]

(a)

(b)

(c)

YG =0 a1 − a 0

a − a1 0 −f FES

0 f FES 0

YG =0 a1 − a 0

a − a1 0 −f FES

0 f FES 0

YG =0 a1 − a 0

a− a1 0 −f FES

0 f FES 0

Figure 16-21. Three network architectures leading to three different dynamic fuzzycontrollers for the second-order LTI plant. The classical (static) fuzzy expert system andother nonlinear blocks are used as a sub-systems within the architecture. The nature ofthe various mappings will be determined by the elements that they represent.

Page 26: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

Let us now consider how this approach can be applied to complex systemsand situations where we have a large number of error variables to be monitoredand used in control. We will arrive at general conclusions by considering aspecific system that is fairly complex. In figure 16-22, we show the networkequivalent of a fourth-order system with two inputs that can be used for thecontrol. The open-loop system will be lossy (and hence stable) if the resistancesG1 and R 2 are lossy (doesn’t matter if linear, nonlinear, or time-varying). On

the other hand, if either G1 or R 2 is active, the system can become unstable.

Thus, the equivalent network representation (as opposed to an arbitrarymathematical model) shows clearly the element(s) that can lead to instability.

The open-loop system is described by a fourth-order dynamics given by:

L1˙ i L1

c2 ˙ v c2

L3˙ i L3

c4 ˙ v c4

=

0 −1 0 0

1 −G1 −1 G1

0 1 0 −1

0 G1 1 −G1 − G2

i L1

vc2

i L3

vc4

+

vs

is

0

−is

(16.34)

We can see the second input, i s(t), directly affects the two state equations. Let

the desired values of the four state variables be i L1d, v c2d , iL3d and vc4d with the

corresponding errors defined as e1 = i L1 − i L1d, e2 = v c2 − vc2d , e3 = iL3 − iL3d

and e4 = v c4 − vc4d . If we were to use the classical fuzzy controller approach, we

would have to design a fuzzy expert system that leads to an optimal mapping ofthe four error variables, f FES e1 ,e 2 ,e 3 ,e 4[ ] , which is not an easy task. Further,

the control function is still static, and it is difficult to establish the stability of theclosed-loop system.

It will be much easier to generate a number of mappings, f FES_i,j e i ,e j[ ],

i = 1 to 3, j = i + 1 to 4 than obtaining the single mapping, f FES e1 ,e 2 ,e 3 ,e 4[ ] ,

and in fact, that is what we do when we assume that the interactions will belimited to certain variables when implementing a fuzzy expert system with largenumber of inputs. Using the network approach, we will use two (or more) statevariables, k1 (t) and k 2 (t), for the control law leading to the following

expressions for the inputs, v s(t)and i s(t), as:

vs (t) = −a1 (iL1 − iL1d ) + k 1 (t)f FES_1,2 e1 ,e 2[ ] + k2 (t)f FES_1,3 e1 ,e 3[ ]|← Input for control →|

→| stabilizing / |← Nonlinear, dynamic fuzzy control →|

pole placement

+L1˙ i L1d + v c2d

|← tracking →|

(16.35a)

is (t) = −a2 (v c2 − vc2d) + a 3(v c4 − vc4d ) + k1 − k1d( ) f FES_1,4 e1 ,e 4[ ] + k2 − k2d( ) fFES_2,3 e2 ,e 3[ ]|← input for control →|

+ c2˙ v c2d − iL1d + G1vc2d + iL3d − G1 vc4d

|← inputfor tracking →|

(16.35b)

where a1 , a 2 and a3 are three LTI control parameters chosen to stabilize the

plant and or place the poles at the desired locations. Based on this control lawand the network approach, and observing:

i s_Steady_state = c2 ˙ v c2d − i L1d + G1v c2d + i L3d − G1vc4d

= −c4 ˙ v c4d + G1v c2d + iL3d − G1 + G2( )v c4d

(16.36)

we can write the error dynamics for the closed-loop system as:

L1˙ i L1 − ˙ i L1d( )

c2 ˙ v c2 − ˙ v c2d( )L3

˙ i L3 − ˙ i L3d( )c4 ˙ v c4 − ˙ v c4d( )

k1 − ˙ k 1d

k 2 − ˙ k 2d

=

L1˙ e 1

c2 ˙ e 2L 3 ˙ e 3c4

˙ e 4˙ e 5˙ e 6

=

−a1 −1 0 0 f FES_1,2 e1 ,e 2[ ] fFES_1,3 e1 ,e3[ ]1 −G1 − a2 −1 G1 + a 3 f FES_1,4 e1 ,e 4[ ] f FES_2,3 e2 ,e3[ ]0 1 0 −1 0 0

0 G1 + a2 1 −G1 − G 2 −a 3 −fFES_1,4 e1,e 4[ ] −fFES_2,3 e2, e3[ ]−f FES_1,2 −f FES_1,4 0 fFES_1,4 0 0

−f FES_1,3 −fFES_2,3 0 f FES_2,3 0 0

e1

e2

e3

e4

e5

e6

(16.37)

where k1d and k2d are the desired values for the control state. The last two

equations provide the update law for k1 (t) and k 2 (t).

By including the controller state variables, k1 (t) and k 2 (t) in the control

law, we have indeed made the control nonlinear as well as dynamic. Though themappings f FES_3,4 e3 ,e 4[ ], fFES_2,4 e 2 ,e 4[ ] are not used in the above dynamics, we

could have easily inserted them by adding more controller state variables. Forexample, if we decide to incorporate all combinations of the fuzzy errormappings into the expression for v s(t) , the resulting expression will be:

Page 27: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

v s(t) = −a1(i L1 − i L1d ) + L1˙ i L1d + vc2d +

k 1(t)f FES_1,2 e1,e 2[ ] + k2 (t)f FES_1,3 e1,e 3[ ] + k 3 (t)f FES_1,4 e1 ,e 4[ ]+ k4 (t)f FES_2,3 e2 ,e 3[ ] + k 5 (t)f FES_2,4 e2 ,e 4[ ]+ k 6 (t)f FES_3,4 e3 ,e 4[ ]

(16.38)

Similarly for the other control input i s(t). Thus, we are able to generate a

nonlinear mapping of a large number of inputs through the use of mappings ofjust two variables. Also, as the controller state changes, based on the plant andthe controller error state, we get not only a static mapping of a large number ofinputs, but one which changes (or adapts) based on the system dynamics. Theanalogy with the passive network ensures that the adaptation will proceed in theproper direction.

Another key point worth noting, is that through the dynamic controllerapproach we have increased the coupling between various state variables in thesystem which can help to improve the system performance12. This has to becontrasted to attempts in control design where we try to de-couple the system asmuch as is possible (aircraft control is a classical example).

The variables that are involved in the update law for the controller state arei L1(t), vc2 (t)and v c4 (t) {or i L1(t) and v c2 (t) − vc4 (t) }, respectively the current

drawn from the voltage source v s(t) and the voltage across the current source

i s(t). Together they define the power delivered by the control sources to the

plant and should be available in real-world systems.The examples given above are LTI systems13. However, the same concept

can be applied to nonlinear and / or time-varying systems as discussed in thechapters on control. Of course, it cannot be applied to arbitrarily chosen modelsof nonlinear systems. But again, a key message of this book is that a real worldsystem has a built in structure that carry information as to its constituentelements and the interconnections which is not included in an arbitrarily writtenmathematical model.

12 A key argument in the area of neural networks is that by increasing the connectivity

(or equivalently the coupling between various nodes) which leads to improvedinteractions among various signals we make the system robust.

13 We will soon show how this approach can be applied to the truck backer-upperproblem.

16.5.2.1 Simulation Results

In this section, we present some simulation results and compare them with theresults obtained using the classical fuzzy controller. We first consider a second-order plant, as given in (16.27) and (16.28) with both the coefficients, a, b, set toone. The plant is therefore stable with an impulse response,h(t) = e−0.5t cos 0.866t[ ]. Since the system is LTI, this represents the general

form of the response. That is, the system is an under-damped one with a time-constant of 2 seconds, which may not be acceptable.

We can use the classical fuzzy controller to improve the performance. Weshow the fuzzy matrix linguistic definitions and the fuzzy rule-base developedby Macvicar and Whelan and used in the simulation, in table 16.3. This fuzzylinguistic code is converted to numerical values using the conversion valuesshown in table 16.4. The corresponding fuzzy control matrix used in simulationis shown in table 16.5. The simulation result for some initial value x(0) ≠ 0 andx desired = 0 is shown in Fig. 16.23a. We can see a good improvement in the

transient performance (no oscillation) and a much reduced time constant.The same plant controlled by a nonlinear dynamic controller with one

controller state variable will have a dynamics as shown in (16.32) and repeatedbelow.

+

-

v s(t)

+

-

i L1(t)

v c2 (t)

v c4 (t)

i s(t)

(b)

+

-

+

-

L1 L3

c2 c4

R1

R 2

+

-

i L1(t)

v c2 (t)

i L3 (t)

v c4 (t)

+

-

v s(t)

+ -

i s(t)

(a)

Figure 16-22. a) The network analog of a fourth-order LTI plant; b) A black boxrepresentation with the variables needed for nonlinear dynamic control.

Page 28: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

˙ e (t)

˙ e 1 (t)˙ k (t)

=0 1 0

a1 − a b1 − b fFES[e, ˙ e ]

0 − fFES[e, ˙ e ] 0

e(t)

e1 (t)

k(t) − k∞

−0

0

i R k(t) − k∞[ ]

(16.39)

where a = b = 1 and we assumed a1 = b 1 = 0 (no change to open-loop

poles). For one simulation, we assumed i R k(t)[ ] = 5k(t) , a linear mapping, and

k∞ = 10. The simulation result is shown in Fig. 16.23b. We can observe some

improvement in the performance. But the important point is the performancewill remain almost the same even if the plant parameters change (robustness). Infigures 16.23c and d, we show simulation results when 1)i R k(t)[ ] = 4 π( ) tan−1 k(t) , a nonlinear function, and 2) i R k(t)[ ] = k(t) +4 π( )tan−1 k(t) . Again, we find some improvement in the performance.

Next, we consider the application of this approach to the truck backer-upperproblem. The continuous domain model for the truck as used by otherresearchers is given in (16.7) and can be re-written in a matrix form to conformto the network based approach as given below. Sincex desired = 50 , y desired = 100 ,

φdesired = 90 o , we will use the error variables ex (t) = x(t) − xdesired ,

ey (t) = y(t) − φdesired and eφ (t) = φ(t) − φdesired , and a new state variable k(t) with

a desired final value of zero in our representation. If θ = θFES ex (t),e φ (t)[ ] is the

output from the classical fuzzy controller, the dynamics is:

˙ e x ( t)

˙ e y ( t)

˙ e φ ( t)

− sin eφ (t) + φ desired[ ] ˙ e φ˙ k ( t)

=

0 0 −s. sin φ[ ] s.cos φ[ ] 0

0 0 s.cos θ[ ] s.sin θ[ ] 0

s.sin φ[ ] −s. cos θ[ ] 0 0 g1 (t)

−s.cos φ[ ] −s.sin θ[ ] 0 0 g 2 ( t)

0 0 −g 1(t) −g2 ( t) −A

×

e x (t)

e y (t)

sin eφ + φ desired[ ]cos eφ + φdesired[ ]

k(t)

(16.40)

e e L M S O O S M L

L O S M L L L L L

M S O S M M M L L

S M S O S S S M L

O M M S O O S M M

O M M S O O S M M

S L M S S S O S S

M L L M M M S O O

L L L L L L M O O

\∆ − − − − + + + +

− + + − − − − − −

− + − − − − − − −

− + + − − − − − −

− + + + + − − − −

+ + + + + − − − −

+ + + + + + + − −

+ + + + + + + + +

+ + + + + + + + +

L Large- Negative Change

+ Positive Change

O ZeroS Small

M Medium

Table 16-3. Macvicar-Whelan Fuzzy Matrix Linguistic Definition and thecorresponding fuzzy matrix.

+

-

0

positive change

negative change

zero

1

2

3

Extra-small

small

medium

4

5

6

big

small

extra-large

4

5

6

Table 16-4. Fuzzy control linguistic code.

Page 29: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

Here the first two rows correspond to the plant dynamics ˙ x (t) and ˙ y (t) written

to bring them in the particular form necessary for identification with networkdynamics. The third row basically corresponds to the plant dynamics ˙ φ (t) = θ if

we calculate g1 (t) from:

g1 ( t )k( t ) = θ− s.e x (t)sin φ[ ] + s.e x (t)cos θ[ ] (16.41)

e \ ∆e -6 -5 -4 -3 -2 -1 -0 +0 +1 +2 +3 +5 +6

-6

-5

-4

-3

-2

-0

+0

+1

+2

+3

+4

+5

+6

+6

+6

+5

+5

+4

+3

+3

+2

+2

+1

0

0

0

+6

+5

+5

+4

+4

+3

+2

+2

+1

+1

0

0

0

+5

+5

+4

+4

+3

+2

+2

+1

+1

0

0

0

-1

+5

+4

+4

+3

+3

+2

+1

+1

0

0

0

-1

-1

+4

+4

+3

+3

+2

+1

+1

0

0

0

-1

-1

-2

+4 +3 +3 +2 +2 +1 0 0

+3 +3 +2 +2 +1 +1 0 0

+3 +2 +2 +1 +1

0

0 0 0 -1

+2 +2 +1 +1 0 0 0 -1 -1

+2 +1 +1 0 0 0 -1 -1 -2

+1 0 0 0 -1 -1 -2 -3

0 0 0 -1 -1 -2 -2 -3 -3

0 0 -1 -1 -2 -2 -3 -3 -4

0 -1 -1 -2 -2 -3 -3 -4 -4

-1 -1 -2 -2 -3 -3 -4 -4 -5

-1 -2 -2 -3 -3 -4 -4 -5 -5

-2 -2 -3 -3 -4 -4 -5 -5 -6

-2 -3 -3 -4 -4 -5 -5 -6 -6

-1 +4 +3 +3 +2 +2 +1 +1 0 0 0 -1 -1 -2 -2

-2

+4

+1

Table 16-5. Fuzzy control matrix used in simulation.

t (msec.)

x(t)

t (msec.)

x(t)

(a) (b)

t (msec.)

x(t)

t (msec.)

x(t)

(c) (d)

Figure 16-23. Response of a second-order plant controlled by: a) classical fuzzy expertsystem; b) dynamic fuzzy controller with a linear feedback term in the controllerdynamics; c) dynamic fuzzy controller with a nonlinear feedback term; d) dynamic fuzzycontroller with linear plus nonlinear feedback term.

Page 30: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

The left hand side of fourth row is simply the differential of the fourth statevariable cos eφ + φdesired[ ] and the term g 2 (t) is simply introduced to reconcile

this equation with that of the third equation. That is,

− sin eφ(t) +φ desired[ ] ˙ e φ

= − sin eφ(t) + φdesired[ ] s.sin θ[ ]ex (t) − s.cos θ[ ]ey (t) + g1 (t) k(t){ }|← From third row →|

= −s.cos θ[ ]ex (t) − s.sin θ[ ]ey (t) + g2 (t) k(t)

|← From fourth row →|

(16.42)

Finally, k(t) is updated using the equation in fifth row. The closed-loopdynamics may reach the desired state ex (t) = eφ (t) = k(t) = 0 if we let

g1 (t) → 0 when we solve for its value using (16.41).

Notice we have said the dynamics may (and not will) reach the desired state.The reason is that the dynamics doesn’t really correspond to a complete passivenetwork, since the third state variable is eφ (t) and the corresponding

transformed variable sin eφ (t) +φ desired[ ] {and not sin eφ (t)[ ]} do not correspond

to a lossless element. This problem is due to the plant dynamics used, whichimplies ˙ y (t) = s as the dock is reached. That is, the truck will ram through the

dock, unless the driver slams the brake as and when the dock is reached. Thisproblem can be solved by using a proper model for the plant in which the speedis a function of the plant state or s(t) = s ex (t),e y (t)[ ] with s 0,0[ ] = 0 ; that is,

making s(t) a new state variable that varies based on ex (t), ey (t) . Using the

network approach alone (that is, no fuzzy expert system is involved), we canwrite a stable closed-loop dynamics as:

˙ e x (t)

˙ e y (t)

˙ s (t)

˙ e φ(t)˙ k (t)

=

0 0 cos φ +θ[ ] 0 0

0 0 sin φ+θ[ ] 0 0

− cos φ +θ[ ] − sin φ+ θ[ ] −A 0 g(t)

0 0 0 −B f(t)

0 0 −g(t) −f(t) −C

ex (t)

e y (t)

s(t)

e φ(t)

k(t)

(16.43)

where A, B and C are positive constants, θ = −Be φ(t) − f(t)k(t) is the steering

angle, and f(t) and g(t) are real functions of time or more appropriately,functions of the error state. This dynamics corresponds to a fully passivenetwork with the origin as the only stable equilibrium point and hence we can be

certain that ex (t) , ey (t) , s(t), eφ (t) and k(t) will go to zero as time progresses

from any initial condition.With the above dynamics, we still face many problems. The speed, being a

state variable, can become very large. By varying the function f(t) properly orusing other techniques, we can prevent this from happening. Also, the speed canbecome positive as well as negative before the truck reaches the dock, implyinga number of forward and reverse movements of the truck which is of courseunacceptable. One possible solution for this problem is to make the speed aneven power of a state variable. Assuming speed = s2 (t) , the system dynamics in(16.43) will change to:

˙ e x (t)

˙ e y (t)

˙ s (t)

˙ e φ(t)˙ k (t)

=

0 0 s(t)cos φ + θ[ ] 0 0

0 0 s(t)sin φ + θ[ ] 0 0

−s(t)cos φ + θ[ ] −s(t)sin φ +θ[ ] −A 0 g(t)

0 0 0 − B f(t)

0 0 −g(t) −f (t) −C

ex( t)

ey( t)

s(t)

eφ( t)

k(t)

(16.44)

Unfortunately with this change, the origin is no longer the only equilibriumpoint. The values, s(t) = eφ (t) = k(t) = 0, and ex (t), ey (t) arbitrary, as well

become the equilibrium points of the new dynamics. We cannot overcome thisproblem completely for the given plant dynamics. However, we will shortlydiscuss a solution that seems to solve the problem for all practical purposes.

We should also realize that the system state may wander all over before itreaches the origin. That is, the truck may enter the dock (!) before it pulls backand perhaps do so a couple of times. We need to adjust the parameters A, B andC and the functions f(t) and g(t), so this doesn’t happen for any reasonable initialcondition. Alternatively we can use intelligent techniques such as fuzzy expertsystems as part of the dynamics as we will see now.

Another problem is the large dynamic range of the state variables {ex (t) ∈−50 to + 50;e y (t) ∈−100 to 0 } and its effect on the system derivatives.

This can make it difficult to optimize the performance with the parametersavailable. Nonlinear mappings selected based on network principles can help toovercome this and other problems. A solution for the truck backer upperproblem that uses network concepts, fuzzy logic and other intelligent techniqueswill be presented now. We retained e x ey s eφ k[ ] as the state. However,

we used transformed state, tanh ex( ) tanh e y( ) tanh s( ) tanh eφ( ) tanh k( )[ ],

whose values are limited to the range -1 to 1, and a valid mapping from anetworks’ perspective, in defining the derivatives of the state variables. Thissolves the large dynamic range problem nicely. Letting θFES ex ,e φ[ ] as the

original steering angle obtained from the fuzzy expert system, in our controller

Page 31: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

the actual steering angle is defined as θ = C θFES e x ,e φ[ ]tanh k(t)[ ] where C is a

constant. Letting d(t) = ex2 (t) + ey

2 (t), the square of the distance from the dock,

D0 t( ) = d t( ) 1 + d t( )( ) a positive function that is almost a constant (equal to one

for large values of the distance and small to zero as the truck reaches the dock14),the speed is selected as:

speed = D1 tanh s t( )( ) = 4D 0 tanh 256 s t( )( ) + D0( )tanh s t( )( ) (16.45)

The multiplication by the function D0 t( ) makes sure that the speed is

reduced as the truck moves closer to the dock and becomes zero when the dockis reached. The term tanh 256 s t( )( ) + D0 rather than a function of s(t) alone is

selected to avoid the problem of unwanted equilibrium points mentioned beforeand the steep mapping provided by tanh 256 s t( )( ) along with a large positive

initial value for s(t) eliminates the possibility for the speed to change sign inpractical situations. With these choices and based on network principles, we canwrite down a closed-loop dynamics as:

˙ e x (t)

˙ e y (t)

˙ s (t)

˙ e φ(t)˙ k (t)

=

0 0 D1 cos φ +θ[ ] 0 0

0 0 D1 sin φ+θ[ ] 0 0

− D1 cos φ+θ[ ] −D1sin φ+ θ[ ] −A ex ,e y[ ] 0 0

0 0 0 0 C θFES

0 0 0 −C θFES −B

×

tanh ex (t)[ ]tanh ey (t)[ ]tanh s(t)[ ]

tanh eφ(t)[ ]tanh k(t)[ ]

(16.46)

where A ex ,e y[ ] = 8 2 + d t( )( ) 1+ 2d t( )( ) is selected as a distance-dependent

damper (A = 4 when the distance is large; A = 8 when the distance is one; A =16 when the distance is zero) to control the state variable s(t) associated with thespeed and B is a positive constant. The above dynamics may look like twouncoupled sub-systems, the first involving the first three state variables and thesecond involving the last two state variables. However, there is good coupling orinteraction between the two sub-systems, since the distance that comes from thetwo state variables affect the damping variable A associated with the fourth state

14 In fact, in our simulations, we made D0 (t) = 0 when d(t) became sufficiently small.

equation, and the steering angle coming from the fourth equation affects the firstthree equations. Also, the readers may notice that the origin is only one of many

stable equilibrium points given by e x ey s eφ k[ ]t =

arbitrary 0 0 0 0[ ] t which seems to be unavoidable given the plant model.

We will discuss later discuss how this problem gets eliminated by the use of thefuzzy expert system.

We implemented the classical fuzzy expert system producing the mappingθFES ex ,e φ[ ] as a look-up-table as shown in table 16.6. As indicated in the table,

the error in x is quantized to 15 levels and the error in the truck angle to 17levels leading to a 17 × 15 matrix representation for θFES ex ,e φ[ ] . The entries

into this matrix are made somewhat arbitrarily by (literally) staring at the fuzzysets as we have lost the program that implements the fuzzy expert system, anddidn’t feel it necessary to implement it exactly (The use of proper dynamics asobtained from network considerations compensates for it). We show the resultsof simulation for four initial conditions in Fig. 16.24. In Fig. 16.24a, we showthe values of ex (t) and ey (t) as time progresses. We can note that both the

variables reach the value zero. In Fig. 16.24b, we show ex (t) and ey (t) in a

phase-plane plot. Though we show the truck at any time as just a dot, the anglethe truck makes at any given time and the nice way it turns so the back of thetruck faces the dock, are obvious from the plots. In Fig. 16.24c, we show thestate variable s(t) associated with the speed and the actual speed. We can seethat the speed is nicely maintained at 8 feet/sec, the value that we selected,doesn’t become negative (once it drops, but recovers quickly), and becomes zeroas the truck reaches the dock. Finally, in Fig. 16.24d, we show the truck errorangle, eφ (t) , and the state variable k(t). We can see that eφ (t) becomes a

smoothly varying function (unlike the case when only a classical fuzzy expertsystem is used) tends to zero as the truck moves to the dock.

As indicated earlier, the origin is only one of many (in fact, infinite)equilibrium points for the dynamics. However, the fuzzy expert system providesproper direction for the truck to move which along with the nonlinear dynamicsforces ex (t) and eφ (t) to decrease in magnitude. Thus, when ex (t) and eφ (t)

become zero, the remaining dynamics forces ey (t) and s(t) to become zero.

We also simulated the dynamics in (16.46) after replacing the functionθFES ex ,e φ[ ] provided by the fuzzy expert system by an arbitrary constant. Since

the origin is only one of many stable equilibrium points, the lack of goodsteering direction (coming out of the fuzzy expert system) makes the truck go toand settle at some value ex ≠ 0 with all other variables becoming zero. Thus, we

find that, by mixing different paradigms properly, we achieve superior results.The fuzzy expert system paradigm leads to a good mapping of the steering angleas a function of the x-distance and the truck angle. The stable nonlinear

Page 32: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

dynamics using network principles uses the fuzzy expert system as a sub-systemand leads to a stable dynamics.

-25 -25 -24 -23 -22 -21 -20 -20 20 -19 -18 -17 -16 -15 -15

-25 -25 -24 -23 -21 -19 -17 15 -14 -12 -10 -8 -6 -5 5

-25 -15 -14 -13 -12 -11 -10 -8 -4 -2 -1 1 3 5 15

-24 -14 -13 -12 -11 -10 -9 -5 -3 -2 1 2 4 6 1

-23 -13 -12 -11 -10 -9 -6 -4 -3 2 2 3 5 7 17

-22 -12 -11 -10 -9 -7 -5 -4 1 2 2 4 6 8 18

-21 -11 -10 -9 -7 -6 -4 -1 1 1 3 5 7 9 19

-20 -10 -9 -8 -6 -4 -2 -1 0 2 4 6 8 10 20

-20 -10 -9 -7 -5 -3 -1 0 1 3 5 7 9 10 20

-20 -10 -8 -6 -4 -2 0 1 2 4 6 8 9 10 20

-19 -9 -7 -5 -3 -1 -1 1 4 6 7 9 10 11 21

-18 -8 -6 -4 -2 -2 -1 4 5 7 9 10 11 12 22

-17 -7 -5 -3 -2 -2 3 4 6 9 10 11 12 13 23

-16 -6 -4 -2 -1 2 3 5 9 10 11 12 13 14 24

-15 -5 -3 -1 1 2 4 8 10 11 12 13 14 15 25

-5 5 6 8 10 12 14 15 17 19 21 23 24 25 25

5 15 15 16 16 17 18 19 20 21 21 22 23 24 25

30 45 46 47 48 49 49.8 50.2 51 52 53 54 55 70 100

270

180

135

95

94

93

92

91

90.1

89.9

89

88

87

86

85

45

0

φ(t)

x(t)

Table 16-6. The original steering angle θFES ex ,e φ[ ] coming from a fuzzy expert

system and expressed as a look-up-table.

0 4 8 12 16 20

-40

0

40

0 4 8 12 16 20

-80

-40

0

t

t

ey (t)

ex (t)

(a)

Figure 16-24. Results of simulation of backing up the truck using a nonlinear dynamicsfuzzy controller. a) The values ex (t) and ey (t) as time progresses. b) ex (t) and ey (t)

in a phase-plane plot. The angle that the truck makes at any given time and the nice wayit turns so that the back of the truck faces the dock are obvious from the plots. c) Statevariable s(t) that controls the speed and the actual speed. We can see that the speed isnicely maintained at 8 feet/sec, the value that we selected, doesn’t become negative (onceit drops, but recovers quickly), and becomes zero as the truck reaches the dock; d) Truckerror angle, eφ (t) , and the state variable k(t). We can see that eφ (t) becomes a

smoothly varying function (unlike the case when only a classical fuzzy expert system isused) tends to zero as the truck moves to the dock.

Page 33: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

16.6 Summary

In this chapter, we considered another emerging/hot area in intelligent systems -that of fuzzy logic (FL), fuzzy expert systems (FESs) and fuzzy controllers(FCs), mainly from the perspective of nonlinear systems. We first provided asimple and concise introduction to this area. We provided only the salient detailsabout functional and implementational aspects of fuzzy expert systems andfuzzy controllers and omitted mathematical details as much as possible. Weargued that the fuzzy logic casts in an analytical mode the approaches taken byhuman beings in dealing with day-to-day problems which are nonlinear bynature and the resulting solutions and fuzzy logic and fuzzy expert systems areexcellent vehicles for specifying multi-input / multi-output (MIMO) staticmappings. The beauty of fuzzy logic lies in the relatively simple and easyapproach with which MIMO nonlinear functional mappings of practicalrelevance can be described and implemented.

ey (t)

-40 0 40-100

-80

-60

-40

-20

0

ex (t)

(b)

4 8 12 16 20

40

80

4 8 12 16 200

4

8

0

s(t)

speed(t)

t

t

(c)

Figure 16.24 Contd.

0 4 8 12 16 200

10

20

t

k(t)

0 4 8 16 20-4

0

4

8

12

t

eφ (t)

(d)Figure 16.24. Contd.

Page 34: CHAPTER 16 FUZZY LOGIC, FUZZY EXPERT SYSTEMS & FUZZY CONTROLLERS

The use of fuzzy logic in control applications is considered in section 16.3.We gave some examples that illustrate how fuzzy logic can be used to designcontrol laws and discuss the performance of systems controlled by fuzzycontrollers. We found from the examples that fuzzy controllers (based on someappropriate knowledge) can indeed do a good job. Perhaps the important pointto learn is that since the controller is in general nonlinear, better performancecan be obtained from different fuzzy controllers based on the knowledge fromdifferent experts. That is, the nonlinearity by itself makes it possible to havemore than one near-optimal control law and leads to control laws that are robust.However, The nonlinear nature of the control law makes the closed-loop systemnonlinear even if the open-loop system is LTI and it is very difficult to prove thestability of such nonlinear systems. We presented some results from classicalcontrol theory to show the efforts that went into proving the stability of suchsystems and the difficulties encountered. As indicated earlier, fuzzy logic leadsto static (memoryless) control laws with abrupt changes that may not beacceptable in practice. Also, when the number of inputs is large, the designcomplexity also increases. Then, there is the question of adaptability or learningin fuzzy expert systems.

In sections 16.4 and 16.5, we provided some solutions to these problems. Insection 16.4, we showed how fuzzy logic can be combined with neural nets toretain the best of both worlds: use of experts’ knowledge when available andadapt further based on observed data. We also discussed a neural networkarchitecture known as Cerebellar Model Articulation Controllers (CMAC)Neural Network which was proposed independently some twenty five years agoand its similarity to fuzzy expert systems. In section 16.5, we showed how thebuilding block concept can be used to overcome the stability problem, introducememory into otherwise static fuzzy expert systems and provide the ability todeal with large number of input variables. The network approach thus leads tothe next generation of fuzzy controllers called feedback or recurrent fuzzycontrollers and can find use in a number of applications. We provided results ofsimulation for the truck backer-upper problem using the new nonlinear dynamicfuzzy controller. We found that the controller moves the truck to the dock fromany reasonable initial condition even though the plant model used leads to adynamic system with essentially infinite number of equilibrium points.


Recommended