360 likes | 629 Vues
By: Hoo Wai Lam WEK070049 Lim Chern Hong WEK070063. Numerical Methods in A.I.: Fuzzy Logic. Introduction – Fuzzy Logic. Fuzzy Logic is a problem-solving control system methodology that lends itself to implementation in systems
E N D
By: HooWai Lam WEK070049 Lim Chern Hong WEK070063 Numerical Methods in A.I.:Fuzzy Logic
Introduction – Fuzzy Logic • Fuzzy Logic is a problem-solving control system methodology that lends itself to implementation in systems • ranging from simple, small, embedded micro-controllers to large, networked, multi-channel PC or workstation-based data acquisition and control systems. • Provides a simple way to arrive at a definite conclusion based upon vague, ambiguous, imprecise, noisy, or missing input information. • Can be implemented in hardware, software, or a combination of both. (from: http://www.seattlerobotics.org/Encoder/mar98/fuz/flindex.html)
Introduction – Fuzzy Logic • Fields applying theory of fuzzy sets and fuzzy logic : • taxonomy; topology; linguistics; logic; automata theory; game theory; pattern recognition; medicine; law; decision support; Information retrieval; etc. • Recent fuzzy machines that have been developed: • automatic train control; tunnel digging machinery; washing machines; rice cookers; vacuum cleaners; air conditioners, etc.
Introduction – Fuzzy Logic • Fuzzy logic makes understanding using knowledge that is imprecise rather than precise possible. • There are many decision-making and problem-solving task which are too complex to be understood quantitatively • Fuzzy set theory generate decisions by resembling human reasoning in its use of approximate information and uncertainty with the help of natural language processing. • It was specifically designed to mathematically represent uncertainty and vagueness using mathematical approach and dealing with the imprecision intrinsic to many problems by designing formalized fuzzy-logic-based tools.
Introduction – Fuzzy Logic • “As the complexity of a system increases, it becomes more difficult and eventually impossible to make a precise statement about its behavior, eventually arriving at a point of complexity where the fuzzy logic method born in humans is the only way to get at the problem.” (Originally identified and set forth by Lotfi A. Zadeh, Ph.D., University of California, Berkeley) • http://www.fuzzy-logic.com/
Literature Review • Fuzzy logic, or multi-valued logic, was introduced in the 1930s by Jan Lukasiewicz, a Polish philosopher. • introduced logic that extended the range of truth values to all real numbers in the interval between 0 and 1, compared to classical logic which operates with only two values: 1 (true) and 0 (false). • This implies an inexact reasoning technique called possibility theory. • For example, the possibility that a man 181 cm tall is really tall might be set to a value of 0.86. It is likely that the man is tall.
Literature Review • In 1965 LotfiZadeh, published his famous paper “Fuzzy sets”. • extended the work on possibility theory into a formal system of mathematical logic • introduced fuzzy logic to represent and manipulate fuzzy terms by applying natural language.
Literature Review • The term fuzzy logic is used in two senses: • Narrow sense • Fuzzy logic is a branch of fuzzy set theory, which deals with the representation and inference from knowledge. • Unlike other logical systems, it deals with imprecise or uncertain knowledge. • Broad Sense: • fuzzy logic is synonymous to fuzzy set theory
Literature Review • The fuzzy logic analysis and control method: First Step: • Receive inputs, measurements or other assessment of conditions existing in the system we wish to analyze or control. • Second step: • Processing all inputsaccording to "If-Then" rules. • Third step: • Averaging and weighting the resulting outputs into one output decision or signal which decides what to do or tells a controlled system what to do. (Modified from www.fuzzy-logic.com)
Literature Review (Modified from www.fuzzy-logic.com)
Why Fuzzy Logic? • Robust – It does not require precise, noise free inputs • Can be tweaked easily to improve or drastically alter system performance. • Not limited to a few inputs and one or two control outputs • FL can control nonlinear systems
How is FL used? • Define the control objectives and criteria • Determine the input and output • Using the rule-based structure of FL, break the control problem down into series of IF X AND Y THEN Z rules. • Create FL membership functions that define the meaning (value) of Input / Output terms use in the rules. • Create the necessary pre- and post- processing • Test the system, evaluate the result.
Fuzzy logic is not logic that is fuzzy, but logic that is used to describe fuzziness. Fuzzy logic is the theory of fuzzy sets, sets that calibrate vagueness. • Fuzzy logic is based on the idea that all things admit of degrees. Temperature, height, speed, distance, beauty – all come on a sliding scale. • The motor is running really hot. • Tom is a very tall guy.
Mathematics Part in Fuzzy Logic • Will use logic function (e.g. AND OR function and truth values) • Set • Matrices • Mathematical graphical representation • Mathematical Inferencing Methods (e.g. MAX-MIN, MAX-DOT, MAX-PRODUCT, AVERAGING, ROOT-SUM-SQUARE)
Example Step1 :Define the control objectives and criteria • Following questions will help you to make to achieve the goal of this steps. • What am I trying to control? • What do I have to do to control the system? • What kind of response do I need? • What are the possible (probable) system failure modes?
Example Step1: Define the control objectives and criteria A temperature controller with an electric heating element and a variable-speed cooling fan
Example Step1 :Define the control objectives and criteria • What am I trying to control? Temperature • What do I have to do to control the system? To determine the command (target) temperature and room temperature. Find the error and error dot for FL engine. • What kind of response do I need? To Heat / To cool / No change to the system • What are the possible (probable) system failure modes?
Example Step2: Determine the input and output • For this example, we are going to use error and error dot as our input for the FL engine to do decision. • Input1: Error = the value of cmd – temp (e.g 10°C - 15°C = -5°C) • Input2: Error dot = rate-of-change-of-error • Error: • + = too cold • - = too hot • Error dot: • + = getting hotter • - = getting cooler
Example Step2: Determine the input and output For this example, we can use: • "N" = "negative" error or error-dot input level • "Z" = "zero" error or error-dot input level • "P" = "positive" error or error-dot input level And output: • "H" = "Heat" output response • “NC" = "No Change" to current output • "C" = "Cool" output response
Example Step2: Determine the input and output DEFINITIONS: • INPUT#1: ("Error", positive (P), zero (Z), negative (N)) • INPUT#2: ("Error-dot", positive (P), zero (Z), negative (N)) • CONCLUSION: ("Output", Heat (H), No Change (NC), Cool (C)) • INPUT#1 System Status • Error = Command temp-Feedback temp • P=Too cold (+), Z=Just right(0), N=Too hot(-) • INPUT#2 System Status • Error-dot = d(Error)/dt • P=Getting hotter(+)Z=Not changing(0) N=Getting colder(-) • OUTPUT Conclusion & System Response • Output H = Call for heatingNC = Don't change anythingC = Call for cooling
Example Step3: Using the rule-based structure of FL, break the control problem down into series of IF X AND Y THEN Z rules. • 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)"
Example Make it to 3X3 Matrices Form
Example For step 4-6…. • Create FL membership functions that define the meaning (value) of Input / Output terms use in the rules. • Create the necessary pre- and post- processing • Test the system, evaluate the result.
Exercise • Building a fuzzy logic speed control system: • Parts needed: • (1) 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. • (2) Controller. • (3) Signal conditioner (transistor amplifier to adjust levels as needed). • (4) Transistor - 2N3053. • (5) DC motor, 1.5 V to 3.0 V, 100 ma., 1100 Rpm to 3300 Rpm, and compatible generator. (Adopted from www.fuzzy-logic.com)
Exercise • Step 1: 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.
Exercise • Step 2: 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.
Exercise • Step 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.
Exercise • Step 4: Choose word descriptions for the status of input and output. • For a steam engine project, example input: • Positive BigPositive MediumPositive SmallAlmost No ErrorNegative SmallNegative MediumNegative Big
Exercise • In our cases, the input can be: Descriptions • Too slowAbout rightToo fast • And, for output: • Speed upNot much change neededSlow down
Exercise • The rules will be: • 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.
Exercise • Step 5: Associate the above inputs and outputs as causes and effect with a Rules Chart • Step 6: Derive results in the following regarding voltage to the speed controller • Step 7: Determine the output, that is the voltage that will be sent from the controller/signal conditioner/transistor to the speed controlled motor. • Step 8: The next step is to draw "effect" (output determining) triangles with their height "h" determined by the values obtained in Step 7
Exercise • Derived results (Step 6): • If speed is about right then not much change needed in voltage to the speed controller. • If speed is too slow then increase voltage to the speed controller to speed up. • If speed is too fast then decrease voltage to the speed controller to slow down.