July 2006 
Innovations in Comfort, Efficiency, and Safety Solutions. 

Anwer Bashi 
Introduction
The next sentence is true. But the previous sentence is false.
Epimenides Paradox 
Epimenides of Knossos (Crete) was a semimythical philosopherpoet from the 6th century. One day, in a fit of poetic inspiration, it is said that he proclaimed, “All Cretans are liars!” Being a Cretan himself, he is remembered until this day for the Cretan paradox.
In Aristotelian logic, where something cannot be both true and false at the same time, these selfnegating statements cannot be reconciled. If they are true, then they are false, but if they are false, then they are true.
Enter fuzzy logic, a calculus that allows variables to have partial membership in a set. True and false are no longer absolutes  things can be somewhat true or somewhat false. Using this reasoning, one could mathematically prove that the Epimenides Paradox is exactly 50% true, and 50% false.
As such, fuzzy logic is fundamentally incompatible with Aristotelian logic, particularly the law of tertium non datur (Latin for: a third is not given), also called the law of excluded middle^{1} . Basically, it states that either something is true or it is not true. These postulates seem so basic that they are often considered unquestionable.
To give a less colorful example of places that fuzzy logic is useful, consider the concept of coldness. Most people will be able to answer the question, “Are you cold?” In general (unless you are talking to a postgraduate physics student), people will understand that the question is not asking if you are cold in an absolute sense. While 0^{o}Kelvin is definitely cold, 65^{o}F might not be cold to some.
Machines, on the other hand, have no such distinction. If cold is defined to be less than 65^{o}F, then 64.99^{o}F is cold, and 65^{o}F is not.

Fuzzy Set Theory
While fuzzy logic has traditionally been the domain of graduate students, the basic concepts are surprisingly simple.
Consider Illustration 1. Here, we have created a graph to assist in the interpretation of the idea of temperature as a human perceives it. At 60^{o}F, the temperature is cold, at 80^{o}F, it is hot. At 65^{o}F, it is somewhat cold, and somewhat comfortable. We will call this group of descriptions the human temperature membership function.
We could just as easily create more sets to describe human temperature. For example, we could add very cold and very hot sets. Similarly, we could describe different membership functions to describe other concepts, such as open or closed, or related concepts such as chiller temperature, or coolingtower temperature.
It has been shown that a fuzzy system is a universal approximator, meaning that it can be used to approximate a very large class of linear or nonlinear systems. Not only does this allow for a nonlinear controls strategy with less value action and overshoot, but it allows the application of expert human knowledge to computer reasoning.
Fuzzy Misconceptions 
Fuzzy Operators
In order to define an algebra for handling fuzzy math, we need to define the operators. Boolean logic normally deals with a small set of operators from which all other operations proceed: NOT, AND, OR.
There are many possible definitions of these basic operations, a few of which are shown in Table 1. Incidentally, all these definitions apply equally well to boolean logic (just plug in 0 and 1 to test them).
Table 1: Three common fuzzy operators definitions
In boolean logic, FALSE takes on the value of 0, while TRUE is represented with a 1. Similarly, in fuzzy logic, truth ranges from 0 to 1, so if it is Cold to a degree of 0.1, then it is NOT(Cold) to a degree of 0.9.
Before we continue, you might want to return to the Epimenides Paradox and try solving it (mathematically, A = NOT(A), where A is how true the statement is). For extra credit, you could try to figure out the sound of one hand clapping...

Defuzzification
Very few valves know how to open up “just a little”. In general, a piece of equipment prefers crisp numbers (such a 010V signal), which are produced by a process called “defuzzification.” Defuzzification can convert the semantic knowledge contained in a fuzzy system into a realizable control strategy^{2}.
There are many different techniques to do this, but we can consider just one to illustrate the process.
Height defuzzification outputs the weighted sum of fuzzy set peaks. It has several disadvantages, including a weakness at dealing with lopsided membership functions, but it has the advantage of being one of the simplest to understand.
Lotfi Zadeh, the Father of
Fuzzy 
For example, we assume that a set of rules that control a valve results in the following conclusion:
Closed: 0.1
Somewhat Closed: 0.2
Somewhat Open: 0.7
Open: 0.3
Using height defuzzification gives us:
Value = (0*0.1 + 0.2*25 + 0.7*75 + 0.3*100) / (0.1 + 0.2 + 0.7 + 0.3)
= (0 + 5 + 52.5 + 30) / (1.3)
= 87.5 / 1.3
= 67.3 % Open
Fuzzy Logic Applications
When fuzzy logic first came out, you would find articles in the scientific journals about a possible application of the theory. As the field advanced, lists started popping up of places where fuzzy logic was used in realworld applications. As it stands now, the list would be far too long to publish, but looking at a few examples illustrates how widely applicable fuzzy logic is to controls and expert knowledge mapping^{3}:
Cruise control and efficiency/stability enhancements to car engines (Nissan, Subaru)
Handwriting recognition for PDA's (Sony)
Safety improvement for nuclear reactors (Hitachi, Bernard, Nuclear Fuel Div.)
Robot control (Toshiba, Fuji Electric, Omron)
Industrial controls applications (Aptronix, Omron, Meiden, Sha, Micom, NisshinDenki, Mitsubishi, OkuElectronics, and others)
To illustrate the applicability of fuzzy logic to building automation, we list below a few rules that might improve efficiency in a building or help with fault detection. A typographic emphasis (like this) is placed on terms that are fuzzy quantities.
Control:
if most of my VAV dampers are
closed and at least some VAV reheat valves are open
then:
make supply setpoint higher
if most zone dampers are closed
or almost closed for a long time then:
make cold deck setpoint higher
if most zone dampers are open
or almost open for a long time then:
make cold deck setpoint lower
Fault Detection and Diagnosis:
unit failure = most units' error is very low and my error is very high
system failure = units have been running a long time and most units' error is high
sticktion = pid has been running a long time
and pid error variance is high
if sticktion is high:
suggest sticktion_test
if sticktion_test passes:
badly tuned pid = pid
error variance is high or pid mean error is high
if cooling:
leaky duct = units have been running a long time
and return air is cold
and average space
temperature is hot
if heating:
leaky duct = units have been running a long time
and return air is hot
and average space
temperature is cold
Fuzzy Logic in Building Automation
While fuzzy logic may indeed be the next frontier in building automation, it is important to remember that in order to use fuzzy logic in a meaningful fashion, the BAS (building automation system) software needs to be built from the ground up with this functionality in mind. Not only must the language used to define the rules be well integrated into the operation of the software, but the distinction between conventional control agents or resources (such as PIDs, schedules, alarms, and so on) and fuzzy control must be clearly delineated. Incomplete integration or illdefined conventionaltofuzzy relationships may give rise to some very hard to find bugs.
Also, the vast majority of information that a fuzzy system needs to operate efficiently should be automatically supplied during the initial commissioning of the software. Leaving this up to the building engineer programming the system would be negligent on the part of the BAS developers, and would effectively result in it not being used in the majority of installations. For example, membership functions (see Illustrations 1 and 2) for quantities commonly used in building automation should be provided. And if a space temperature or a VAV controller is added, the software should be able to automatically assign appropriate membership functions to the points.
As energy prices continue to rise and it becomes
clear that advanced failure detection is possible, building engineers and
managers should keep their eyes open for innovative solutions. Fuzzy logic is a
buzzword that, if done right, may just live up to its expectations.
Do you have any fuzzy rules you think are clever enough to appear in print? Computrols, Inc. invites you to email them to fuzzy@computrols.com. The best submissions will be published on our website (http://computrols.com/fuzzy) and in our newsletter, which is sent monthly to over 500 HVAC engineers, managers, and distributors. 
[1] Two other laws of Aristotelian logic are also violated by fuzzy logic; the law of identity, which states that if something is true then it is true, and the law of contradiction, which states that something cannot be true and false simultaneously.
[2] For an example of a fuzzy logic algorithm that generally outperforms PID controls, take a look at the Mamdani controller (http://www.esru.strath.ac.uk/Reference/concepts/fuzzy/fuzzy.htm).
[3] A longer list can be found at: http://www.esru.strath.ac.uk/Reference/concepts/fuzzy/fuzzy_appl.10.htm
[Home Page] [The Automator] [About] [Subscribe ] [Contact Us]