tag:blogger.com,1999:blog-55016030245236527002014-10-04T23:38:23.752-07:00Fuzzy LogicFuzzy logic is a form of multi-valued logic derived from fuzzy set theory to deal with reasoning that is approximate rather than precise.phr4zalhttp://www.blogger.com/profile/11085077650582276658noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-5501603024523652700.post-38644207055127650152010-09-19T13:07:00.000-07:002010-09-19T13:07:08.252-07:00Why Use Fuzzy Logic<u>Introduction</u><br /><br />This is the second in a series of six articles intended to share information and experience in the realm of fuzzy logic (FL) and its application. This article will continue the introduction with a more detailed look at how one might use FL. A simple implementation will be explained in detail beginning in the next article. Accompanying outside references are included for interested readers.<br /><br />In the last article, FL was introduced and the thrust of this article series presented. The origin of FL was shared and an introduction to some of the basic concepts of FL was presented. We will now look a little deeper.<br /><br /><u>Why use fuzzy logic?</u><br /><br />FL offers several unique features that make it a particularly good choice for many control problems.<br /><br />1) It is inherently robust since it does not require precise, noise-free inputs and can be programmed to fail safely if a feedback sensor quits or is destroyed. The output control is a smooth control function despite a wide range of input variations.<br /><br />2) Since the FL controller processes user-defined rules governing the target control system, it can be modified and tweaked easily to improve or drastically alter system performance. New sensors can easily be incorporated into the system simply by generating appropriate governing rules.<br /><br />3) FL is not limited to a few feedback inputs and one or two control outputs, nor is it necessary to measure or compute rate-of-change parameters in order for it to be implemented. Any sensor data that provides some indication of a system's actions and reactions is sufficient. This allows the sensors to be inexpensive and imprecise thus keeping the overall system cost and complexity low.<br /><br />4) Because of the rule-based operation, any reasonable number of inputs can be processed (1-8 or more) and numerous outputs (1-4 or more) generated, although defining the rulebase quickly becomes complex if too many inputs and outputs are chosen for a single implementation since rules defining their interrelations must also be defined. It would be better to break the control system into smaller chunks and use several smaller FL controllers distributed on the system, each with more limited responsibilities.<br /><br />5) FL can control nonlinear systems that would be difficult or impossible to model mathematically. This opens doors for control systems that would normally be deemed unfeasible for automation.<br /><br /><u>How is fuzzy logic used?</u><br /><br />1) Define the control objectives and criteria: 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?<br /><br />2) Determine the input and output relationships and choose a minimum number of variables for input to the FL engine (typically error and rate-of-change-of-error).<br /><br />3) Using the rule-based structure of FL, break the control problem down into a series of IF X AND Y THEN Z rules that define the desired system output response for given system input conditions. The number and complexity of rules depends on the number of input parameters that are to be processed and the number fuzzy variables associated with each parameter. If possible, use at least one variable and its time derivative. Although it is possible to use a single, instantaneous error parameter without knowing its rate of change, this cripples the system's ability to minimize overshoot for a step inputs.<br /><br />4) Create FL membership functions that define the meaning (values) of Input/Output terms used in the rules.<br /><br />5) Create the necessary pre- and post-processing FL routines if implementing in S/W, otherwise program the rules into the FL H/W engine.<br /><br />6) Test the system, evaluate the results, tune the rules and membership functions, and retest until satisfactory results are obtained.<br /><br /><u>Linguistic Variables</u><br /><br />In 1973, Professor Lotfi Zadeh proposed the concept of linguistic or "fuzzy" variables. Think of them as linguistic objects or words, rather than numbers. The sensor input is a noun, e.g. "temperature", "displacement", "velocity", "flow", "pressure", etc. Since error is just the difference, it can be thought of the same way. The fuzzy variables themselves are adjectives that modify the variable (e.g. "large positive" error, "small positive" error ,"zero" error, "small negative" error, and "large negative" error). As a minimum, one could simply have "positive", "zero", and "negative" variables for each of the parameters. Additional ranges such as "very large" and "very small" could also be added to extend the responsiveness to exceptional or very nonlinear conditions, but aren't necessary in a basic system.<br /><br /><u>Summary</u><br /><br />FL does not require precise inputs, is inherently robust, and can process any reasonable number of inputs but system complexity increases rapidly with more inputs and outputs. Distributed processors would probably be easier to implement. Simple, plain-language IF X AND Y THEN Z rules are used to describe the desired system response in terms of linguistic variables rather than mathematical formulas. The number of these is dependent on the number of inputs, outputs, and the designer's control response goals.<img src="http://feeds.feedburner.com/~r/blogspot/GotbV/~4/n9XEemE7X9U" height="1" width="1" alt=""/>phr4zalhttp://www.blogger.com/profile/11085077650582276658noreply@blogger.com0http://fuzzysettheory.blogspot.com/2010/09/why-use-fuzzy-logic.htmltag:blogger.com,1999:blog-5501603024523652700.post-76326576636631101052010-09-17T00:59:00.000-07:002010-09-17T00:59:22.004-07:00Introduction to fuzzy logic<u>Introduction</u><br /><br />This is the first in a series of six articles intended to share information and experience in the realm of fuzzy logic (FL) and its application. This article will introduce FL. Through the course of this article series, a simple implementation will be explained in detail. Each article will include additional outside resource references for interested readers.<br /><br /><u>Where did Fuzzy Logic come from?</u><br /><br />The concept of Fuzzy Logic (FL) was conceived by Lotfi Zadeh, a professor at the University of California at Berkley, and presented not as a control methodology, but as a way of processing data by allowing partial set membership rather than crisp set membership or non-membership. This approach to set theory was not applied to control systems until the 70's due to insufficient small-computer capability prior to that time. Professor Zadeh reasoned that people do not require precise, numerical information input, and yet they are capable of highly adaptive control. If feedback controllers could be programmed to accept noisy, imprecise input, they would be much more effective and perhaps easier to implement. Unfortunately, U.S. manufacturers have not been so quick to embrace this technology while the Europeans and Japanese have been aggressively building real products around it.<br /><br /><u>What is Fuzzy Logic?</u><br /><br />In this context, FL 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. It can be implemented in hardware, software, or a combination of both. FL provides a simple way to arrive at a definite conclusion based upon vague, ambiguous, imprecise, noisy, or missing input information. FL's approach to control problems mimics how a person would make decisions, only much faster.<br /><br /><u>How is FL different from conventional control methods?</u><br /><br />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.<br /><br /><u>How does Fuzzy Logic work?</u><br /><br />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.<br /><br /><u>Summary</u><br /><br />FL was conceived as a better method for sorting and handling data but has proven to be a excellent choice for many control system applications since it mimics human control logic. It can be built into anything from small, hand-held products to large computerized process control systems. It uses an imprecise but very descriptive language to deal with input data more like a human operator. It is very robust and forgiving of operator and data input and often works when first implemented with little or no tuning.<br /><br /><span style="font-size: small;"><u>References</u></span><br /><br />[1] "Europe Gets into Fuzzy Logic" (Electronics Engineering Times, Nov. 11, 1991).<br /><br />[2] "Fuzzy Sets and Applications: Selected Papers by L.A. Zadeh", ed. R.R. Yager et al. (John Wiley, New York, 1987).<br /><br />[3] "U.S. Loses Focus on Fuzzy Logic" (Machine Design, June 21, 1990).<br /><br />[4] "Why the Japanese are Going in for this 'Fuzzy Logic'" by Emily T. Smith (Business Week, Feb. 20, 1993, pp. 39).<img src="http://feeds.feedburner.com/~r/blogspot/GotbV/~4/u54q8FKwbF8" height="1" width="1" alt=""/>phr4zalhttp://www.blogger.com/profile/11085077650582276658noreply@blogger.com4http://fuzzysettheory.blogspot.com/2010/09/introduction-to-fuzzy-logic.html