Presentation is loading. Please wait.

Presentation is loading. Please wait.

Stanisław H. Żak School of Electrical and Computer Engineering

Similar presentations


Presentation on theme: "Stanisław H. Żak School of Electrical and Computer Engineering"— Presentation transcript:

1 Fuzzy Logic---Another Tool in Our Control Toolbox to Cope with Uncertainties
Stanisław H. Żak School of Electrical and Computer Engineering ECE 675, Spring 2016

2 Fuzzy Logic=Computing With Words
The term Fuzzy Set introduced by Lotfi A. Zadeh in his paper “Fuzzy Sets” published in Information and Control, Vol. 8, No. 3, pp , June 1965 The motivation for the notion of a fuzzy set---to provide a framework for “a natural way of dealing with problems in which the source of imprecision is the absence of sharply defined criteria of class membership rather than the presence of random variables.”

3 What is a Set? A set is a collection of objects. An element belongs to the set or it does not Example If x greater than 6, then x belongs to the set X, otherwise x does not belong to the set Unambiguous set boundary

4 Characteristic Function
Characteristic function of a set---If an element belongs to the set, then the function value is 1, if an element does not belong to the set, then the function is 0 Can represent a set X, using its characteristic function, as a set of ordered pairs (x,0) or (x,1), where (x,0) means while (x,1) means An ordinary set can be represented as a collection of ordered pairs

5 Crisp Set Crisp set (“ordinary” set)---a collection of objects. An element is a member of the set or it is not An example of a crisp set---fast cars

6 Zadeh’s Definition of Fuzzy Set
“A fuzzy set is a class of objects with a continuum of grades of membership. Such a set is characterized by a membership (characteristic) function which assigns to each object a grade membership ranging between zero and one.”---L.A. Zadeh, 1965, p. 338

7 Example of Fuzzy Set Fuzzy sets allow for partial membership in a set
Example of a fuzzy set---fast cars

8 Crisp versus Fuzzy Notation: ---collection of objects, universe
---membership function Crisp set Fuzzy set

9 Formal Definition of Fuzzy Set
Denote a generic element of the universe A fuzzy set in is a set of ordered pairs:

10 Fuzzy Set Example---Text, p. 395
Discrete universe Fuzzy set---”a number close to 6”

11 Possible Membership Functions

12 Special Types of Fuzzy Sets
A fuzzy set F is convex if for any x, y from the universe X and for any we have

13 Convex and Nonconvex Fuzzy Sets

14 Normal Fuzzy Set and Fuzzy Number
A fuzzy set is normal if there is a point in the universe such that A fuzzy number is a fuzzy set that is both normal and convex

15 Linguistic Variable Linguistics variable---a variable whose values are fuzzy numbers Examples of linguistic variables: (i) SPEED---it can take its values from the set of fuzzy numbers {very slow, slow, medium, fast, very fast} (ii) TEMPERATURE---possible values {cold, cool, warm, hot}

16 More Examples of Linguistic Variables
ERROR {LN, SN, ZE, SP, LP} LN---large negative SN---small negative ZE---zero SP---small positive LP---large positive

17 Another Example of a Linguistic Variable
CHANGE-IN-ERROR {LN, SN, ZE, SP, LP} LN---large negative SN---small negative ZE---zero SP---small positive LP---large positive

18 Fuzzy Rules A fuzzy IF-THEN rule IF x is A THEN y is B Examples:
(i) IF speed is low THEN brake is zero (ii) IF error is large negative THEN control action is large positive

19 Linguistic Description of Control Action
Instead of a math model of the plant we may have available fuzzy IF-THEN rules: RULE 1: IF error is ZE and change-in-error is SP then u is SN RULE 2: If error is SN and change-in-error is SN THEN u is SP Use the given linguistic description in the form of the IF-THEN rules to design a controller

20 Defuzzification: Moving From Fuzzy Rules to Numbers
Computing with words--- Convert the given fuzzy IF-THEN rules into controller action Inference engine, or defuzzifier, uses fuzzy rules to generate crisp numbers Center average defuzzifier (product inference rule)

21 Center average defuzzifier (product inference rule)
1 1 1 Rule 1 product 1 1 1 Rule 2 e Δe Center average defuzzification Input variables Control action

22 Defuzzifier for q Inputs
Center average defuzzification for q input controller q is the number of inputs m is the number of fuzzy rules where

23 Center-of-Gravity Defuzzifier

24 Center-of-Gravity Defuzzifier
min 1 1 1 Rule 1 min 1 1 1 Rule 2 e Δe Center average defuzzification Input variables Control action

25 Computing With Words---Example
Our example uses data from the paper by Y.F. Li and C.C. Lau, “Development of fuzzy algorithms for servo systems,” IEEE Control Systems Magazine, pp , April 1989 Rule #1: IF the error is ZE and the error change is SP THEN the control is SN Rule #2: IF the error is ZE and the error change is ZE THEN the control is ZE Rule #3: IF the error is SN and the error change is SN THEN the control is SP Rule #4: IF the error is SN and the error change is ZE THEN the control is LP

26 Defuzzification: Moving From Fuzzy Rules to Numbers
Contribution of Rule #1 Center-of-gravity---0.6×(-2) Center average defuzzifier ×0.8×(-2)

27 Defuzzification: Contribution of Rule #2
Center-of-gravity---0.2×0 Center average defuzzifier × 0.2×0

28 Defuzzification: Contribution of Rule #3
Center-of-gravity---0×2 Center average defuzzifier ×0×2

29 Defuzzification: Contribution of Rule #4
Center-of-gravity---0.2×4 Center average defuzzifier ×0.2×4

30 Combining All Contributions Together
Center-of-gravity Center average defuzzifier (product inference rule)

31 Designing a Fuzzy Logic Controller for DC Motor---Control Objective
Design a controller that forces the closed loop system output x(t) to track a given reference signal xd(t) Force the tracking error e(t) = x – xd to asymptotically decay to 0

32 Fuzzy Logic Controller (FLC) in the Loop
Disturbance Fuzzy Logic Controller u x Plant xd e Reference signal

33 FLC Design Algorithm Identify ranges of the controller inputs
Identify ranges of the controller output Create fuzzy sets for each input and output Translate the interaction of the inputs and outputs into IF-THEN rules, and then form the rules matrix Decide on the defuzzifier, and then use it to generate the control surface Implement the controller, test it, and modify it if necessary

34 Fuzzy Logic Tracking Control of a DC Motor
DC motor schematic---Text, p. 101

35 More On the Control Objective and the Plant
DC motor--- Electro-Craft Corporation MOTOMATIC system Control objective---design a simple fuzzy logic tracking controller, simulate the dynamical behavior of the closed-loop and test the design in the lab Math model of the DC motor needed for simulations

36 Tracking Error Fuzzy Sets

37 CHANGE-IN-ERROR Fuzzy Sets

38 Control Action Fuzzy Sets

39 Rules Matrix Change-in-error LN N ZE P LP Error Large Negative (LN) LN LN LN N ZE Negative (N) LN LN N ZE P Zero (ZE) N N ZE P P Positive (P) N ZE P LP LP Large Positive (LP) ZE P LP LP LP

40 Center Average Inference System
product 1 1 1 Rule 1 product 1 1 1 Rule 2 e Δe Center average defuzzification Input variables Control action

41 Defuzzifier Center average defuzzifier for a two-input controller
where is the centroid of the control action fuzzy set and is the number of fuzzy rules

42 Control Surface

43 FLC in SIMULINK

44 Simulation Results

45 Improving the Performance of FLC
Excessive overshoot Fine tune the controller Good results when changed the error range of the tracking error from to

46 New Tracking Error Fuzzy Sets

47 FLC Improved Performance

48 Summary Fuzzy Logic Control:
incorporates linguistic description of the controller action, rather than a mathematical plant model, to compute the control action--- computing with words different ways to achieve high controller performance---use a two-range controller consisting of coarse and fine parts to regulate the large tracking error an small tracking error use more fuzzy sets, this in turn requires more fuzzy rules


Download ppt "Stanisław H. Żak School of Electrical and Computer Engineering"

Similar presentations


Ads by Google