1 / 32

Soft computing Lecture 5

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.

huela
Download Presentation

Soft computing Lecture 5

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Soft computingLecture 5 Using of fuzzy logic in control systems

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

  3. Example of fuzzy inference

  4. Example of linguistic variable

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

  6. 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

  7. Methods of defuzzification

  8. 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

  9. 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.

  10. 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.

  11. 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.

  12. 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.

  13. 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.

  14. 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.)

  15. 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.

  16. 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.

  17. 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.

  18. 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.

  19. 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).

  20. 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.

  21. 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 = .4Intersect point / 1 = 17.4/58 = .3

  22. 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.                                      

  23. 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.

  24. 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 '

  25. Applications

More Related