AI CS 364 Fuzzy Logic Fuzzy Control 17

  • Slides: 21
Download presentation
AI – CS 364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan

AI – CS 364 Fuzzy Logic Fuzzy Control 17 th October 2006 Dr Bogdan L. Vrusias b. vrusias@surrey. ac. uk 17 th October 2006 Bogdan L. Vrusias © 2006

AI – CS 364 Fuzzy Logic Contents • • Definitions Controllers Fuzzy Logic Controller

AI – CS 364 Fuzzy Logic Contents • • Definitions Controllers Fuzzy Logic Controller Example 17 th October 2006 Bogdan L. Vrusias © 2006 2

AI – CS 364 Fuzzy Logic Fuzzy Control • Fuzzy logic control or simply

AI – CS 364 Fuzzy Logic Fuzzy 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. 17 th October 2006 Bogdan L. Vrusias © 2006 3

AI – CS 364 Fuzzy Logic Fuzzy Control • The term control is generally

AI – CS 364 Fuzzy Logic Fuzzy 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. 17 th October 2006 Bogdan L. Vrusias © 2006 4

AI – CS 364 Fuzzy Logic Conventional Control • Conventional control is typically based

AI – CS 364 Fuzzy Logic Conventional 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. 17 th October 2006 Bogdan L. Vrusias © 2006 5

AI – CS 364 Fuzzy Logic Conventional Feedback Control • Feedback control is thus

AI – CS 364 Fuzzy Logic Conventional 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. w e C u S y • 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. 17 th October 2006 Bogdan L. Vrusias © 2006 6

AI – CS 364 Fuzzy Logic Controllers • Often, a control strategy that is

AI – CS 364 Fuzzy 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. 17 th October 2006 Bogdan L. Vrusias © 2006 7

AI – CS 364 Fuzzy Logic Controllers • By a fuzzy logic controller (FLC)

AI – CS 364 Fuzzy 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. 17 th October 2006 Bogdan L. Vrusias © 2006 8

AI – CS 364 Fuzzy Logic Controllers • Logical rules with vague predicates can

AI – CS 364 Fuzzy 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. 17 th October 2006 Bogdan L. Vrusias © 2006 9

AI – CS 364 Fuzzy Logic Vs Conventional Controllers Conventional Control System w e

AI – CS 364 Fuzzy Logic Vs Conventional Controllers Conventional Control System w e C y S D u(t) FLC Internal Structure e(t) -1 u D e(t) Z u(t) -1 Z Fuzzy-logic based Control 17 th October 2006 Bogdan L. Vrusias © 2006 10

AI – CS 364 Fuzzy Logic Controller • A fuzzy controller is a device

AI – CS 364 Fuzzy 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. 17 th October 2006 Bogdan L. Vrusias © 2006 11

AI – CS 364 Fuzzy Logic Controller • A typical fuzzy logic controller is

AI – CS 364 Fuzzy 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 – 1) 17 th October 2006 Bogdan L. Vrusias © 2006 12

AI – CS 364 Fuzzy Logic Fuzzy Control Architectures • There are two main

AI – CS 364 Fuzzy Logic Fuzzy Control Architectures • There are two main fuzzy control architectures: – Low-level direct control – High-level supervisory control 17 th October 2006 Bogdan L. Vrusias © 2006 13

AI – CS 364 Fuzzy Logic Low-level direct control 17 th October 2006 Bogdan

AI – CS 364 Fuzzy Logic Low-level direct control 17 th October 2006 Bogdan L. Vrusias © 2006 14

AI – CS 364 Fuzzy Logic Fuzzy Control Architectures 17 th October 2006 Bogdan

AI – CS 364 Fuzzy Logic Fuzzy Control Architectures 17 th October 2006 Bogdan L. Vrusias © 2006 15

AI – CS 364 Fuzzy Logic Fuzzy Control Architectures • The low-level fuzzy logic

AI – CS 364 Fuzzy Logic Fuzzy Control Architectures • The low-level fuzzy logic controller generates the lowlevel 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. 17 th October 2006 Bogdan L. Vrusias © 2006 16

AI – CS 364 Fuzzy Logic Example • Consider the task of driving a

AI – CS 364 Fuzzy Logic Example • 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/show. Article. jhtml? article. ID=10700619) 17 th October 2006 Bogdan L. Vrusias © 2006 17

AI – CS 364 Fuzzy Logic Example • When we finally get around to

AI – CS 364 Fuzzy Logic Example • 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 throttle angle in order to speed up the vehicle appropriately. 17 th October 2006 Bogdan L. Vrusias © 2006 18

AI – CS 364 Fuzzy Logic Example • If both current error and error

AI – CS 364 Fuzzy Logic Example • 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 throttle angle by a larger amount to achieve the desired speed. [Current Error] ----------------------------------------[Error Change] | Negative Zero Positive Negative | Large Negative Zero | Negative Zero Positive | 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 throttle. 17 th October 2006 Bogdan L. Vrusias © 2006 19

AI – CS 364 Fuzzy Logic Example • Suppose current error is -5 mph

AI – CS 364 Fuzzy Logic Example • 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 throttle change. • We measure the new speed and we accordingly change the inputs. 17 th October 2006 Bogdan L. Vrusias © 2006 20

AI – CS 364 Fuzzy Logic Closing • • Questions? ? ? Remarks? ?

AI – CS 364 Fuzzy Logic Closing • • Questions? ? ? Remarks? ? ? Comments!!! Evaluation! 17 th October 2006 Bogdan L. Vrusias © 2006 21