Soft computing Lecture 5

Slides:



Advertisements
Similar presentations
Numerical Methods in A.I.: Fuzzy Logic
Advertisements

Control Systems The elements of a control system
 Negnevitsky, Pearson Education, Lecture 5 Fuzzy expert systems: Fuzzy inference n Mamdani fuzzy inference n Sugeno fuzzy inference n Case study.
AI – CS364 Fuzzy Logic Fuzzy Logic 3 03 rd October 2006 Dr Bogdan L. Vrusias
Fuzzy Logic and its Application to Web Caching
Chapter 4: Basic Properties of Feedback
ME 322: Instrumentation Lecture 35 April 18, 2014 Professor Miles Greiner.
Fuzzy Logic CSE-435: A Presentation on Presented by Osama Ahmed Khan Dr. Hector Munoz-Avila.
Ratio Control Chapter 15.
LECTURE#08 PROCESS CONTROL STRATEGIES
Fuzzy logic Fuzzy Expert Systems Yeni Herdiyeni Departemen Ilmu Komputer.
Fuzzy Expert Systems. Lecture Outline What is fuzzy thinking? What is fuzzy thinking? Fuzzy sets Fuzzy sets Linguistic variables and hedges Linguistic.
The Proportional-Integral-Derivative Controller
GATE Reactive Behavior Modeling Fuzzy Logic (GATE-561) Dr.Çağatay ÜNDEĞER Instructor Middle East Technical University, GameTechnologies Bilkent University,
11 Inverted Pendulum Emily Hamilton ECE Department, University of Minnesota Duluth December 21, 2009 ECE Fall 2009.
Fuzzy Medical Image Segmentation
Chapter 18 Fuzzy Reasoning.
1 Chapter 18 Fuzzy Reasoning. 2 Chapter 18 Contents (1) l Bivalent and Multivalent Logics l Linguistic Variables l Fuzzy Sets l Membership Functions l.
Introduction What is Fuzzy Logic? HOW DOES FL WORK? Differences between Classical set (crisps) and Fuzzy set theory Example 1 Example 2 Classifying Houses.
Algebra Problems… Solutions
Teachers Name : Suman Sarker Telecommunication Technology Subject Name : Computer Controller System & Robotics Subject Code : 6872 Semester :7th Department.
Fuzzy Logic. Priyaranga Koswatta Mundhenk and Itti, 2007.
Static Pressure Control Loop The purpose of the static pressure control loop is to maintain an optimal static pressure in the ductwork. The control loop.
Copyright © Cengage Learning. All rights reserved. 1 Functions and Limits.
FUZZY LOGIC Babu Appat. OVERVIEW What is Fuzzy Logic? Where did it begin? Fuzzy Logic vs. Neural Networks Fuzzy Logic in Control Systems Fuzzy Logic in.
CPSC 386 Artificial Intelligence Ellen Walker Hiram College
Sci 701 Unit 6 As learned in Unit 5: Speed, Power, Torque, and DC Motors, a motor can generate a set amount of power. Introduction to Gears Since there.
CSE & CSE6002E - Soft Computing Winter Semester, 2011 Finish Fuzzy Sets and Logic Begin Rough Sets.
An Introduction to Programming and Algorithms. Course Objectives A basic understanding of engineering problem solving process. A basic understanding of.
8 th Grade Math Common Core Standards. The Number System 8.NS Know that there are numbers that are not rational, and approximate them by rational numbers.
Artificial Intelligence in Game Design Lecture 6: Fuzzy Logic and Fuzzy State Machines.
 Definition Definition  Bit of History Bit of History  Why Fuzzy Logic? Why Fuzzy Logic?  Applications Applications  Fuzzy Logic Operators Fuzzy.
 A line segment in a scene is defined by the coordinate positions of the line end-points x y (2, 2) (7, 5)
Fuzzy Systems Michael J. Watts
“Principles of Soft Computing, 2 nd Edition” by S.N. Sivanandam & SN Deepa Copyright  2011 Wiley India Pvt. Ltd. All rights reserved. CHAPTER 12 FUZZY.
Control Theory Control System Objectives  Establish a final condition  Provide safe operation  Eliminate the human element  Assure economical operation.
CSCI1600: Embedded and Real Time Software Lecture 12: Modeling V: Control Systems and Feedback Steven Reiss, Fall 2015.
Homework 5 Min Max “Temperature is low” AND “Temperature is middle”
Control systems KON-C2004 Mechatronics Basics Tapio Lantela, Nov 5th, 2015.
How To Experiment By Mr. Reiner. Observation You notice something, and wonder why it happens. You see something and wonder what causes it. You want to.
Algorithms and Pseudocode
1 Lecture 4 The Fuzzy Controller design. 2 By a fuzzy logic controller (FLC) we mean a control law that is described by a knowledge-based system consisting.
Lecture 9: PID Controller.
EXCEL DECISION MAKING TOOLS AND CHARTS BASIC FORMULAE - REGRESSION - GOAL SEEK - SOLVER.
October Fuzzy Expert Systems CS364 Artificial Intelligence.
The inference and accuracy We learned how to estimate the probability that the percentage of some subjects in the sample would be in a given interval by.
Aisha Iqbal (CT-084) Kanwal Hakeem (CT-098) Tehreem Mushtaq (CT-078) Talha Syed (CT-111)
S PEED CONTROL OF DC MOTOR BY FUZZY CONTROLLER MD MUSTAFA KAMAL ROLL NO M E (CONTROL AND INSTRUMENTATION)
Lecture Notes / PPT UNIT III
Week 2 Normal Distributions, Scatter Plots, Regression and Random.
Algorithms and Flowcharts
Virtual University of Pakistan
Digital Control CSE 421.
Introduction to Fuzzy Logic and Fuzzy Systems
Fuzzy Systems Michael J. Watts
FUZZY NEURAL NETWORKS TECHNIQUES AND THEIR APPLICATIONS
Fuzzy expert systems Fuzzy inference Mamdani fuzzy inference
Fuzzy Logic 11/6/2001.
Artificial Intelligence
Stanisław H. Żak School of Electrical and Computer Engineering
Fuzzy Logic and Fuzzy Sets
Homework 8 Min Max “Temperature is low” AND “Temperature is middle”
CSCI1600: Embedded and Real Time Software
Fuzzy logic Introduction 3 Fuzzy Inference Aleksandar Rakić
Dr. Unnikrishnan P.C. Professor, EEE
Dr. Unnikrishnan P.C. Professor, EEE
The Coordinate Plane; Graphs of Equations; Circles
Homework 9 Min Max “Temperature is low” AND “Temperature is middle”
Dr. Unnikrishnan P.C. Professor, EEE
Fuzzy Logic KH Wong Fuzzy Logic v.9a.
Presentation transcript:

Soft computing Lecture 5 Using of fuzzy logic in control systems

Fuzzy inference Mini-operation rule (Mamdani implication): Product-operation rule (Larsen implication):

Example of fuzzy inference

Example of linguistic variable

A hedge is an operation which modifies the meaning of the term:

During inference it is needed to execute two operations: Fuzzification Transformation from number to symbol value of linguistic variable and corresponding value of membership function 2. Defuzzification Transformation from symbol value to number

Methods of defuzzification

Features of fuzzy logic In fuzzy logic, exact reasoning is viewed as a limiting case of approximate reasoning In fuzzy logic, everything is a matter of degree In fuzzy logic, knowledge is interpreted a collection of elastic or, equivalently, fuzzy constraint on a collection of variables Inference is viewed as a process of propagation of elastic constraints Any logical system can be fuzzified

Advantages of fuzzy logic (systems) Fuzzy systems are suitable for uncertain or approximate reasoning, especially for the system with a mathematical model that is difficult to derive. Fuzzy logic allows decision making with estimated values under incomplete or uncertain information.

HOW IS FL DIFFERENT FROM CONVENTIONAL CONTROL METHODS? FL incorporates a simple, rule-based IF X AND Y THEN Z approach to a solving control problem rather than attempting to model a system mathematically. The FL model is empirically-based, relying on an operator's experience rather than their technical understanding of the system. For example, rather than dealing with temperature control in terms such as "SP =500F", "T <1000F", or "210C <TEMP <220C", terms like "IF (process is too cool) AND (process is getting colder) THEN (add heat to the process)" or "IF (process is too hot) AND (process is heating rapidly) THEN (cool the process quickly)" are used. These terms are imprecise and yet very descriptive of what must actually happen. Consider what you do in the shower if the temperature is too cold: you will make the water comfortable very quickly with little trouble. FL is capable of mimicking this type of behavior but at very high rate.

HOW DOES FL WORK? FL requires some numerical parameters in order to operate such as what is considered significant error and significant rate-of-change-of-error, but exact values of these numbers are usually not critical unless very responsive performance is required in which case empirical tuning would determine them. For example, a simple temperature control system could use a single temperature feedback sensor whose data is subtracted from the command signal to compute "error" and then time-differentiated to yield the error slope or rate-of-change-of-error, hereafter called "error-dot". Error might have units of degs F and a small error considered to be 2F while a large error is 5F. The "error-dot" might then have units of degs/min with a small error-dot being 5F/min and a large one being 15F/min. These values don't have to be symmetrical and can be "tweaked" once the system is operating in order to optimize performance. Generally, FL is so forgiving that the system will probably work the first time without any tweaking.

The World's First Fuzzy Logic Controller In England in 1973 at the University of London, a professor and student were trying to stabilize the speed of a small steam engine the student had built.   They had a lot going for them, sophisticated equipment like a PDP-8 minicomputer and conventional digital control equipment.   But, they could not control the engine as well as they wanted.   Engine speed would either overshoot the target speed and arrive at the target speed after a series of oscillations, or the speed control would be too sluggish, taking too long for the speed to arrive at the desired setting, as in Figure 1, below.

Professor Mamdani and the student, S. Assilian, decided to give fuzzy logic a try.   They spent a weekend setting their steam engine up with the world's first ever fuzzy logic control system ....... and went directly into the history books by harnessing the power of a force in use by humans for 3 million years, but never before defined and used for the control of machines. The controller worked right away, and worked better than anything they had done with any other method.   The steam engine speed control graph using the fuzzy logic controller appeared as in Figure 2, below.

To create a personal computer based fuzzy logic control system, we: Determine the inputs. Describe the cause and effect action of the system with "fuzzy rules" stated in plain English words. Write a computer program to act on the inputs and determine the output, considering each input separately.   The rules become "If-Then" statements in the program.   (As will be seen below, where feedback loop control is involved, use of graphical triangles can help visualize and compute this input-output action.) In the program, use a weighted average to merge the various actions called for by the individual inputs into one crisp output acting on the controlled system.   (In the event there is only one output, then merging is not necessary, only scaling the output as needed.)

Following is a system diagram, Figure 3, for a "getting acquainted with fuzzy“ project that provides speed control and regulation for a DC motor.   The motor maintains "set point" speed, controlled by a stand-alone converter-controller, directed by a BASIC fuzzy logic control program in a personal computer.

Parts List IBM or compatible personal computer equipped to run Microsoft Quick BASIC.   IBM is a registered trademark of IBM Corporation.   Microsoft and Quick BASIC are registered trademarks of Microsoft, Inc. 8 channel input; 8 bit, analog/digital converter with 8 on-off, digital output channels and one 8 bit digital/analog output channel. Signal conditioner (transistor amplifier to adjust levels as needed) Transistor - 2N3053. DC motor, 1.5 V to 3.0 V, 100 ma., 1100 Rpm to 3300 Rpm.

The steps in building our system are: Determine the control system input.   Examples:   The temperature is the input for your home air conditioner control system.   Speed of the car is the input for your cruise control. In our case, input is the speed in Rpm of the DC motor, for which we are going to regulate the speed.   See Figure 3 above.   Speed error between the speed measured and the target speed of 2,420 Rpm is determined in the program.   Speed error may be positive or negative.   We measure the DC output voltage from the generator.   This voltage is proportional to speed.   This speed-proportional voltage is applied to an analog input channel of our fuzzy logic controller, where it is measured by the analog to digital converter and the pesonal computer, including appropriate software. Determine the control system output.   For a home air conditioner, the output is the opening and closing of the switch that turns the fan and compressor on and off.   For a car's cruise control, the output is the adjustment of the throttle that causes the car to return to the target speed. In our case, we have just one control output.   This is the voltage connected to the input of the transistor controlling the motor.   See Figure 3. 3.   Determine the target set point value, for example 70 degrees F for your home temperature, or 60 Miles per hour for your car. In our case, the target set point is 2,420 Rpm. Choose word descriptions for the status of input and output.

For the steam engine project, Professor Mamdani used the following for input: Positive Big Positive Medium Positive Small Almost No Error Negative Small Negative Medium Negative Big Our system is much less complicated, so let us select only three conditions for input: Input Status Word Descriptions Too slow About right Too fast And, for output: Output Action Word Descriptions Speed up Not much change needed Slow down RULES: Rule 1: If the motor is running too slow, then speed it up. Rule 2: If motor speed is about right, then not much change is needed. Rule 3: If motor speed is to fast, then slow it down.

as can be seen in Figure 4 (three rules, hence three triangles). 5.   Associate the above inputs and outputs as causes and effect with a Rules Chart, as in Figure 4, below.   The chart is made with triangles, the use of which will be explained.   Triangles are used, but other shapes, such as bell curves, could also be used.   Triangles work just fine and are easy to work with.   Width of the triangles can vary.   Narrow triangles provide tight control when operating conditions are in their area.   Wide triangles provide looser control.   Narrow triangles are usually used in the center, at the set point (the target speed).   For our example, there are three triangles, as can be seen in Figure 4 (three rules, hence three triangles).

6.   Figure 4 (above) is derived from the previously discussed Rules and results in the following regarding voltage to the speed controller: a.   If speed is About right then Not much change needed in voltage to the speed controller. b.   If speed is Too slow then increase voltage to the speed controller to Speed up. c.   If speed is Too fast then decrease voltage to the speed controller to Slow down. 7.   Determine the output, that is the voltage that will be sent from the controller/signal conditioner/transistor to the speed controlled motor.   This calculation is time consuming when done by hand, as we will do below, but this calculation takes only thousandths of a second when done by a computer.

Assume something changes in the system causing the speed to increase from the target speed of 2,420 Rpm to 2,437.4 Rpm, 17.4 Rpm above the 'set point." Action is needed to "pull" the speed back to 2,420 Rpm.   Intuitively we know we need to reduce the voltage to the motor a little.   The "cause" chart and vertical speed line appear as follows, see Figure 5 below:                                                                                                                                                                               The vertical line intersects the About right triangle at .4 and the Too fast triangle at .3.   This is determined by the ratio of sides of congruent triangles from Plane Geometry: Intersect point / 1 = 11.6/29 = .4 Intersect point / 1 = 17.4/58 = .3

The next step is to draw "effect" (output determining) triangles with their height "h" determined by the values obtained in Step 7, above.   The triangles to be drawn are determined by the rules in Step 6.   Since the vertical 2,437.4 Rpm speed line does not intersect the Too slow triangle, we do not draw the Speed up triangle.   We draw the Not much change and the Slow down triangles because the vertical speed line intersects the About right and Too fast triangles.   These "effect" triangles will be used to determine controller output, that is the voltage to send to the speed control transistor.   The result is affected by the widths we have given the triangles and will be calculated.   See Figure 6, below.   The Not much change triangle has a height of .4 and the Slow down triangle has a height of .3, because these were the intersect points for their matching "cause" triangles; see Figure 4, above.                                      

The output, as seen in Figure 6 (above), is determined by calculating the point at which a fulcrum would balance the two triangles, as follows: The Area of the Not much change triangle is: 1/2 X Base X Height = .5 X .04 X .4 = .008.   Area of the Slow down triangle is .5 X .08 X .3 = .012. Compute the controller output voltage by finding the point on the output voltage, Vdc, axis where the "weight" (area) of the triangles will balance.   Assume all the weight of the Not much change triangle is at 2.40 Vdc and all the weight of the Slow down triangle is at 2.36 Vdc.   We are looking for the balance point. Find the position of the controller output voltage (the balance point) with the following calculation: (Eq.   1)   .008 X D1 = .012 X D2 (D1 is the fulcrum distance from 2.4 V. D2 is the fulcrum distance from 2.36 V.) (Eq.   2)  D1 + D2 = .04 (from Figure 6) D1 = .04 - D2 Solving the above by substituting (.04-D2) for D1 in Equation 1 gives D2 = .016 and D1 = .024, therefore the balance point is a voltage of 2.376 Vdc, and this is the voltage which we have determined should be applied to return speed to the target value.   See Figure 6, above.

The portion of the program for the above system which examines the input and performs the "triangle" calculations to arrive at a crisp output follows: 910 IF MS = 2420 THEN MIV = 2.4 : GOTO 5000 'MS-MEASURED SPEED, MIV-MOTOR INPUT VOLTAGE 920 IF MS < 2420 THEN 2000 ELSE 1000 1000 ' LINES 1010-1110; GREATER THAN 2420 RPM, SLOW DOWN 1010 IF MS > 2449 THEN MIV = 2.36 : GOTO 5000 1020 ' COMPUTE INTERSECT POINT, IPA, FOR 'ABOUT RIGHT' TRIANGLE 1030 IPA = (2449-MS) / 29 1040 IF IPA =< 0 THEN IPA = .0001 1050 ' COMPUTE INTERSECT POINT, IPS, FOR 'SLOW DOWN' TRIANGLE 1060 IPS = (MS-2420) / 58 1070 ' COMPUTE MOTOR (TRANSISTOR) INPUT VOLTAGE (MIV) 1080 AAR = .5 * .04 * IPA 'AAR - AREA OF 'ABOUT RIGHT' TRIANGLE 1090 ASD = .5 * .08 * IPS 'ASD - AREA OF 'SLOW DOWN' TRIANGLE 1100 D1 = .04 * (ASD / (ASD+AAR)) 1110 MIV = 2.4 - D1 : GOTO 5000 2000 ' LINES 2010-2110; LESS THAN 2420 RPM, SPEED UP 2010 IF MS < 2362 THEN MIV = 2.44 : GOTO 5000 2020 ' COMPUTE INTERSECT POINT, IPA, FOR 'ABOUT RIGHT 'TRIANGLE 2030 IPA = (MS-2391) / 29 2040 IF IPA =< 0 THEN IPA = .0001 2050 ' COMPUTE INTERSECT POINT, IPF, FOR 'SPEED UP' TRIANGLE 2060 IPF = (2420-MS) / 58 2070 ' COMPUTE MOTOR INPUT VOLTAGE (MIV) 2080 AAR = .5 * .04 * IPA 'AAR - AREA OF 'ABOUT RIGHT 'TRIANGLE 2090 ASU = .5 * .08 * IPF 'ASU - AREA OF 'SPEED UP' TRIANGLE 2100 D1 = .04 * (ASU / (ASU+AAR)) 2110 MIV = 2.4 + D1 5000 '

Applications