Fuzzy logic, neural networks--Basic principles--part 1



Home | Forum | DAQ Fundamentals | DAQ Hardware | DAQ Software

Input Devices
| Data Loggers + Recorders | Books | Links + Resources


AMAZON multi-meters discounts AMAZON oscilloscope discounts


Goals

This section reviews the basic principles and descriptions of neural networks and fuzzy logic.

• Describe the basic principles of fuzzy logic

• Describe the acronyms and basic terminology as used in neural networking and fuzzy logic applications.

Introduction to fuzzy logic

In the real world there is a lot of vague and imprecise conditions that defy a simple 'True' or 'False' statement as a description of their state. The computer and its binary logic are incapable of adequately representing these vague, yet understandable, states and conditions.

Fuzzy logic is a branch of machine intelligence that helps computers understand the variations that occur in an uncertain and very vague world in which we exist. Fuzzy logic 'manipulates' such vague concepts as 'warm' or 'going fast', in such a manner that it helps us to design things like air conditioners and speed control systems to move or switch from one set of control criteria to another, even when the reason to do so is because


AMAZON multi-meters discounts AMAZON oscilloscope discounts


'It’s too warm, or not warm enough to go faster or slow down a bit': all of these 'instructions' make sense to us, but are far removed from the digital world of just binary 1s and 0s. The true and false statements that are absolute in there meaning come from a defined starting location and are designed to terminate at a known destination. No known mathematical model can describe the action of, say a ship coming from some undefined point at sea into a dock area and finally coming to rest at a precise position on a wharf.


AMAZON multi-meters discounts AMAZON oscilloscope discounts


Humans and fuzzy logic can perform this action very accurately, if the wind blows a bit harder, or another ship hampers a particular docking maneuver this is sensed and an unrelated but effective action is taken. The action taken though is different each and every time as the disturbance is also different every time. (Similar but different events occur every time a ship tries to perform this procedure.) When mathematicians lack specific algorithms that dictates how a system should respond to inputs, fuzzy logic can be used to either control or describe the system by using commonsense rules that refer to indefinite quantities.

Applications for fuzzy logic extend far beyond control systems; in principle they can extend to any continuous system, be it in, say physics or biology. It may well be that fuzzy models are more useful and accurate than standard mathematical ones.

What is fuzzy logic?

In standard set theory an object either does or does not belong to a set. There is 'no middle ground'. This theory is an ancient Greek law propounded by Aristotle - the law of the excluded middle.

The number five belongs fully to the odd number set and not at all to the set of even numbers. In such bivalent sets an object cannot belong to both a set and its complement set or indeed to neither of the sets. This principle preserves the structure of logic and prevents an object being 'is' and 'is not' at the same time.

Sets that are 'fuzzy' or multivalent break this 'no middle ground' law to some extent.

Items belong only partially to a fuzzy set, they may also belong to more than one set. The boundaries of standard sets are exact, those of fuzzy sets curve or taper off, and it’s this fact that creates partial contradictions. The temperature of ambient air can be 20% cool and 80% not cool at the same time.

What does fuzzy logic do?

Fuzzy degrees are not the same as probability percentages. Probability measures whether something will occur or not. Fuzziness measures the degree to which something occurs or some condition exists.

The rules of fuzzy logic

The only real constraint in the use of fuzzy logic is that, for the object in question, its membership in complementary groups must sum to unity. If something is 30% cool, it must also be 70% not cool. This enables fuzzy logic to avoid the bivalent contradiction that something is 100% cool and 100% not cool, that would destroy formal logic.

===

Air temperature (°F): Air temperature --Air temperature --Fuzzy set and its complement-- Non-fuzzy set --Fuzzy set-- Not cool; Cool Membership (%)

+=+=+=+ Fuzzy logic-complementary rules set

===

Fuzzy logic! a conundrum (by Bertrand Russell):

This section probably serves to illustrate the fuzzy logic world. Read this with your full attention though it shows the difference between half empty and half full!! It’s a Greek paradox at the center of modern set theory and logic.

• A Cretan asserts that all Cretans lie.

• So, is he lying?

• If he lies, then he tells the truth and does not lie.

• If he does not lie then he tells the truth and so he lies.

Both cases lead to a contradiction because the statement is both true and false. The same paradox exists in set theory. The set of all sets is a set, so it’s a member of itself. Yet the set of all apples is not a member of itself because its members are apples and not sets.

The underlying contradiction is then: Is the set of all sets that are not members of themselves a member of itself? If it is, it isn't; if it isn't, then it is.

Classic logic surrenders here, but fuzzy logic says that answer is half true and half false; a 50-50 divide 50% of the Cretans statements are true and 50% are false; he lies half the time and tells the truth for the other half. When membership is less than total a bivalent might simplify this by rounding it down to 0 or up to 100%. But 50% neither rounds up or down.

An example to illustrate fuzzy rules?

Fuzzy logic is based on the rules of the form 'If . . . Then' that converts inputs into outputs - one fuzzy set into another.

E.g., the controller of a car's air conditioner might include rules such as:

• If the temperature is cool, then set the motor on slow.

• If the temperature is just right set the speed to medium.

The temperatures (cool and just right) and the motor speeds (slow and medium) name fuzzy sets rather than specific values.

Plotting and creating a fuzzy patch:

If we now plot the inputs (temperature) along one axis of a graph, and the outputs (motor speed) along a second axis. The product of these fuzzy sets forms a fuzzy patch, an area that represents the set of all associations that the rule forms between those inputs and outputs.

The size of this patch shows the magnitude of the rule's vagueness or uncertainty. However, if 'cool' is precisely 21.5 °C the fuzzy set collapses to a 'spike'. If both the 'slow' and 'cool' sets are spikers, the rule patch is a point. This would be caused by 21.5 °C requiring a speed of 650 rpm for the motor - a logical result to this problem.

The use of fuzzy patches:

A fuzzy system must have a set of overlapping patches that relate to the full range of inputs to outputs. It can be seen that enough small fuzzy patches can cover a graph of any function or input/output relationship. It’s also possible to pick in advance the maximum error of the approximation and be sure there is a finite number of fuzzy rules that achieve it.

A fuzzy system 'reasons, or infers', based on its rule patches.

Two or more rules convert any incoming number into some result because the patches overlap. When data activates the rules, overlapping patches react in parallel - but only to some degree.

Fuzzy logic example using five rules and patches

As an example of fuzzy logic we will look at an example of an air conditioner that relies on five rules and therefore five patches to relate temperature to motor speed.

===

Blast Fast Medium Slow Stop --If warm, then fast; If just right, then medium; If cool, then slow Function XY Cold Cool Just right Warm Hot Input(X ): Air temperature: 50 60 68 70 80 Cool Just right Air temperature (°F) Motor speed (revolutions/minute)

Summed sets; Slow; Centroid Medium Output (Y): motor speed

+=+=+=+Application of fuzzy logic to the control of an air conditioner shows how manipulating vague sets can yield precise instructions

===

Defining the rules:

The temperature sets are, cold, cool, just right, warm and hot; these cover all the possible fuzzy inputs.

The motor speed sets are very slow, slow, medium, fast and maximum describe all the fuzzy outputs.

A temperature of say 68 °F, might be represented by these fuzzy sets and rules:

• 20% cool and therefore 80% not cool; and...

• 70% just right and 30% not just right

• At the same time the air is 0% cold, warm and hot.

The 'if cool' and 'if just right' rules would fire and invoke both the slow and medium motor speeds.

Acting on the rules:

The two rules contribute proportionally to the final motor speed. Because the temperature was 20% cool, the curve describing the slow motor must shrink to 20% of its height. The medium curve must shrink to 70% for the same reason. Summing these two curves results in the final curve for the fuzzy set.

However, in its fuzzy form it cannot be understood by a binary system so the final step in the process is defuzzification.

De-fuzzification:

This is where the resultant fuzzy output curve is converted to a single numeric value. The normal way of achieving this is by computing the center of mass, or centroid, of the area under the curve. In our example, this corresponds to a speed of 47 rpm. Thus, beginning with a quantitative temperature input, the electronic controller can reason from fuzzy temperature and motor speed sets and arrives at an appropriate and precise speed output.

The Achilles heel of fuzzy logic

The weakness of fuzzy logic is its rules. These are, in the majority of fuzzy applications, set by engineers who are expert in the related application. This leads to a lengthy process of 'tuning' these rules and the fuzzy sets. To automate this process many companies are resorting to building and using adaptive fuzzy systems that use neural networks or other statistical tools to refine or even form those initial rules.


NEXT: Fuzzy logic, neural networks--Basic principles part 2
PREV: Long process deadtime in closed-loop control--Smith Predictor

All related articles   Top of Page   Home



Updated: Friday, March 29, 2013 5:19 PST