ai – cs364 fuzzy logic fuzzy control 17 th october 2006 dr bogdan l. vrusias...

21
AI – CS364 AI – CS364 Fuzzy Logic Fuzzy Logic Fuzzy Control Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias [email protected]

Upload: augustus-cox

Post on 12-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

Fuzzy ControlFuzzy Control

17th October 2006

Dr Bogdan L. [email protected]

Page 2: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 2

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

ContentsContents• Definitions

• Controllers

• Fuzzy Logic Controller

• Example

Page 3: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 3

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

Fuzzy ControlFuzzy Control• Fuzzy logic control or simply "fuzzy control" belongs to

the class of "intelligent control," "knowledge-based control," or "expert control." Fuzzy control uses knowledge-based decision-making employing techniques of fuzzy logic in determining the control actions.

Page 4: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 4

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

Fuzzy ControlFuzzy Control• The term control is generally defined as a mechanism used to guide or

regulate the operation of a machine, apparatus or constellations of machines and apparatus.

• Often the notion of control is inextricably linked with feedback: a process of returning to the input of a device a fraction of the output signal.

• Feedback can be negative, whereby feedback opposes and therefore reduces the input, or feedback can be positive whereby feedback reinforces the input signal.

Page 5: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 5

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

Conventional ControlConventional Control• Conventional control is typically based on "modelling" the plant (or

process) that is to be controlled. If the model is not accurate the performance of the controller may not be acceptable.

• Furthermore, these conventional controllers rely on a complete set of data, including sensory information and parameter values, to produce control actions, and indeed, program instructions and data are conventionally combined into the same memory of the controller. If the model parameters and other necessary data are not completely known, say unexpectedly as a result of sensing problems, then appropriate estimates have to be made.

• Furthermore, if the available information is fuzzy, qualitative, or vague, these "crisp" controllers that are based on such incomplete information will not usually provide satisfactory results.

Page 6: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 6

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

Conventional Feedback ControlConventional Feedback Control•  Feedback control is thus a mechanism for guiding or regulating the

operation of a system or subsystems by returning to the input of the (sub)system a fraction of the output.

• The machinery or apparatus etc., to be guided or regulated is denoted by S, the input by W and the output by y, and the feedback controller by C. The input to the controller is the so-called error signal e and the purpose of the controller is to guarantee a desired response of the output y.

C S ye uw

Page 7: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 7

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

Fuzzy Logic ControllersFuzzy Logic Controllers• Often, a control strategy that is based on "soft knowledge" such as

human "experience" in operating the plant, heuristics, common sense, or expert opinion can provide the remedy to these problems.

• An intelligent controller may be interpreted as a computer-based controller that can somewhat "emulate" the reasoning procedures of a human expert in the specific subject area (control in the present context), to generate the necessary control actions.

• "Soft" intelligent control in general is more appropriate in some applications of process control, for example when the process is complex and incompletely known, and when the control procedure cannot be expressed as a crisp algorithm.

Page 8: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 8

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

Fuzzy Logic ControllersFuzzy Logic Controllers• By a fuzzy logic controller (FLC) we mean a control law that is

described by a knowledge-based system consisting of IF...THEN rules with vague predicates and a fuzzy logic inference mechanism.

• The rule base is the main part of the FLC. It is formed by a family of logical rules that describes the relationship between the input e and the output u of the controller.

• The main difference between a conventional control system and a fuzzy logic controlled system is not only in the type of logic (Boolean or fuzzy) but in the inspiration.– The former attempts to increase the efficiency of control algorithms;

– the latter is based on the implementation of human understanding and human thinking in control algorithms.

Page 9: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 9

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

Fuzzy Logic ControllersFuzzy Logic Controllers• Logical rules with vague predicates can be used to derive inference

from vaguely formulated data.

• The idea of linguistic control algorithms was a brilliant generalisation of the human experience of using linguistic rules with vague predicates in order to formulate control actions.

• The main paradigm of fuzzy control is that the control algorithm is a knowledge-based algorithm, described by the methods of fuzzy logic.

Page 10: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 10

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

Fuzzy Logic Vs Conventional ControllersFuzzy Logic Vs Conventional Controllers

C S ye uwConventional Control System

FLC Internal

Structure

Z-1

Z-1

e(t)e(t)

e(t)

u(t) u(t)

Fuzzy-logic based Control

Page 11: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 11

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

Fuzzy Logic ControllerFuzzy Logic Controller• A fuzzy controller is a device that is intended to manage some vaguely

known or vaguely described process.

• The controller can be used with the process in two modes:– feedback mode when the fuzzy controller will act as a control device;– feedforward mode where the controller can be used as a prediction device.

• All inputs to, and outputs from, the controller are in the form of linguistic variables. In many ways, a fuzzy controller maps the input variables into a set of output linguistic variables.

Page 12: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 12

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

Fuzzy Logic ControllerFuzzy Logic Controller• A typical fuzzy logic controller is described by the relationship

between change of control u(t), at a given time t, on the one hand

u(t) = f(e(t), e(t))

and the change in the error e(t)

e(t) = e(t) – e (t – 1)

Page 13: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 13

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

Fuzzy Control Architectures Fuzzy Control Architectures • There are two main fuzzy control architectures:

– Low-level direct control

– High-level supervisory control

Page 14: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 14

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

Low-level direct controlLow-level direct control

Page 15: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 15

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

Fuzzy Control Architectures Fuzzy Control Architectures

Page 16: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 16

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

Fuzzy Control Architectures Fuzzy Control Architectures • The low-level fuzzy logic controller generates the low-

level direct control signals. This approach has some drawbacks with respect to speed, accuracy, and sensitivity and may not be appropriate.

• A more desirable architecture is the high-level hierarchical structure. This is a supervisor control architecture where low-level direct control is done using conventional crisp techniques, while supervisory tasks such as process monitoring, performance assessment, tuning, adaptation, and restructuring are done by upper levels.

Page 17: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 17

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

ExampleExample• Consider the task of driving a car. As you drive along, you notice that

the stoplight ahead is red and the car in front of you is braking. Your (very rapid) thought process might be something like this: "I see that I need to stop. The road is wet because it's raining. The car is only a short distance in front of me. Therefore, I need to apply significant pressure to the brake pedal immediately." This reasoning takes place subconsciously, of course, but that's the way our brains work—in fuzzy terms.

• Human brains do not base such decisions on the precise distance to the car ahead or the exact coefficient of friction between the tires and the road, as an embedded computer might. Likewise, our brains do not use a Kalman filter to derive the optimal pressure that should be applied to the brakes at a given moment. Our brains use common-sense rules, which seems to work pretty well.

(from http://www.embedded.com/showArticle.jhtml?articleID=10700619)

Page 18: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 18

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

ExampleExample• When we finally get around to pressing the brake pedal, we apply an

exact force, let's say 23.26 pounds. So although we reason in fuzzy terms, our final actions are considerably less so.

• Let's think about how a fuzzy cruise control system might work. The cruise controller maintains a constant vehicle speed in spite of neverending changes in road grade, wind resistance, and other variables. The controller does this by comparing the commanded speed with the actual speed. We can call the difference between commanded and actual speed current error. The error change is the difference in error from one sample period to the next.

• If the current error is a small positive number—vehicle speed is slower than commanded—the controller needs to slightly increase the throttle angle in order to speed up the vehicle appropriately.

Page 19: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 19

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

ExampleExample• If both current error and error change are positive, the vehicle is going

too slowly and decelerating. In this case, the controller needs to increase the throttle angle by a larger amount to achieve the desired speed.

[Current Error]--------------------------------------------------------------------------------[Error Change] | Negative Zero PositiveNegative | Large Negative Negative ZeroZero | Negative Zero PositivePositive | Zero Positive Large Positive

• The controller inputs are the variables current error and error change. The output represents a fuzzy specification of how much to change the throttle.

Page 20: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 20

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

ExampleExample• Suppose current error is -5 mph and error change is -1 mph/s. We

might define a speed error of -5 mph as 75% "negative" and 25% "large negative." Similarly, we might define an error change of -1 mph as 50% "zero" and 50% "negative".

• We then follow the 4 standard Fuzzy Inference steps to calculate the throttle change.

• We measure the new speed and we accordingly change the inputs.

Page 21: AI – CS364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b.vrusias@surrey.ac.uk

17th October 2006 Bogdan L. Vrusias © 2006 21

AI – CS364AI – CS364Fuzzy LogicFuzzy Logic

ClosingClosing

• Questions???

• Remarks???

• Comments!!!

• Evaluation!