**1. Introduction**

The reason for using fuzzy logic in control applications stems from the idea of modeling uncertainties in the knowledge of a system's behavior through fuzzy sets and rules that are vaguely or ambiguously specified. By defining a system's variables as linguistic variables such that the values they can take are also linguistic terms (modeled as fuzzy sets), and by establishing the rules based on said variables, a general method can be devised to control these systems: Fuzzy Control (Babuška, 1998; Chen, 2009). Fuzzy control is a class of control methodology that utilizes fuzzy set theory (Pedrycz, 1993). The advantages of fuzzy control are twofold. First, fuzzy control offers a novel mechanism for implementing control laws that are often based on knowledge or on linguistic descriptions. Second, fuzzy control provides an alternative methodology for facilitating the design of non-linear controllers for plants that rely on generally uncertain control that is very difficult to relate to the conventional theory of non-linear control (Li & Tong, 2003; A. Sala et al., 2005).

Every day we mindlessly perform complex tasks: parking, driving, recognizing faces, packing the groceries at the supermarket, moving delicate objects, etc. To solve these tasks (overcome an obstacle), we gather all the information necessary for the situation (topology of the terrain, characteristics of the obstacle such as speed, size, …). With this information and by relying on our experience, we can carry out a series of control actions that, thanks to the feedback present between the system under control and our bodies, can achieve the desired goal.

The controller receives the performance indices (reference) and the system output. To replace the human in a control process, a controller must be added. The controller is a mathematical element, and as such all of the tasks that it is able to perform must be perfectly defined. This control link is studied in Control Theory and is based on two principles:


When a system's complexity increases, mathematics cannot be used to define the aforementioned points. The model cannot be defined due to non-linearities, to its nonstationary nature, to the lack of information regarding the model, and so on.

Control Application Using Fuzzy Logic: Design of a Fuzzy Temperature Controller 381

control scheme (Horváth & Rudas, 2004). We will use it in this text, however, to illustrate the

An introduction to fuzzy control is presented first, followed by a description of the general outline. In subsequent sections we describe each of the steps in the design of the fuzzy controller: choice of inputs and outputs, rule base, fuzzy quantification, and fuzzification, inference and defuzzification mechanisms. We conclude with a simulation of the proposed

The use of the Fuzzy Logic methodology in real systems is immediately applicable to those systems whose behavior is known based on imprecisely defined rules. This imprecision arises from the complexity of the system itself. The way to approach such a problem is to reduce the complexity by increasing the uncertainty of the variables (J. Sala et al., 2000; Yager & Filev, 1994). Thus, in problems that present non-linearities, and to which classical control techniques are hardest to apply, these techniques are very useful and easy to use

In the vast majority of systems, be they highly complex or not, the systems' behavior can be given by a set of rules that are often imprecise, or that rely on linguistic terms laden with uncertainty. This results in rules of the type "If the volume is large, the pressure is small", which define the behavior of a system. If we focus on the rules that are defined to control the system, we can formulate different rules of the type "If the cost is small and the quality is

This last rule type is the most frequently seen in daily life. For example, to regulate water flow from a faucet, we need only apply rules of the type "If the flow is excessive, close the tap a lot", or "If the flow is low, open the tap a little" in order to carry out the desired action. Using precise magnitudes such as "flow rate of 1.2 gallons/minute" or "turn 45º clockwise"

Therefore, a general knowledge base for the system is available; that is, a set of rules that aim to model the actions to be carried out on the system so as to achieve the desired action. Said rules are provided by an expert, one whose experience with handling the system

The Mandani fuzzy inference mechanism is very useful when applying Fuzzy Logic to the control of systems (Passino, 1998). If we consider a classic feedback scheme, the controller has enough information about the system to determine the command that must be applied to said system so as to achieve a desired setpoint. The idea, put forth by Zadeh, for using Fuzzy Control algorithms relies on introducing the knowledge base into the controller such that its output is determined by the control rules proposed by the expert. Said rules contain fuzzy sets (linguistic terms) in the antecedents and in the consequents, and hence they are

If we wish to apply this control scheme to a real system, the fuzzy controller must be adjusted to existing sensor and actuator technology, which relies on precise magnitudes (Jantzen, 2007). The exact values provided by a sensor must therefore be converted into the

**2. Fuzzy logic applied to control: Fuzzy control of temperature** 

(Takana & Sugeno, 1992; Tanaka & Wang, 2001; Wang, 1994).

provides him with knowledge of how the system behaves.

referred to as a whole as a fuzzy control rule base.

design and operation of a fuzzy controller.

temperature controller.

good, make a large investment".

is unnecessary.

We are, however, living in rapidly evolving times where the main goal is to break the limitations that exist in our use of machines in an effort to increase productivity. The use of and advances in intelligent machines will fundamentally change the way we work and live.

To this end, we are building autonomous control systems that are designed to work properly for long periods of time under given uncertainties in the system and the environment. These systems must be capable of compensating for faults in the system without any outside intervention. Intelligent autonomous control systems use techniques from the field of Artificial Intelligence (AI) to achieve autonomy. These control systems consist of conventional control systems that have been augmented using intelligent components, meaning their development requires interdisciplinary research (Jang et al., 1997).

The emergence and development of Artificial Intelligence is of great importance. AI can be defined as that part of computer science that is charged with the design of intelligent computers, meaning systems that exhibit those characteristics that we associate with intelligent human behavior, such as understanding, learning, reasoning, problem solving, etc. Fuzzy Control is one of the new techniques in Intelligent Control, one that aims to imitate the procedure we humans use when dealing with systems (Cai, 1997). For example, when operating a water tap, if we want to obtain the desired flow rate, we reason using terms such as:

"If the flow is low, turn the handle all the way left"

"If the flow is high, turn the handle right a little bit", etc.

Precise quantities such as "2 liters/second" of "65 degrees counterclockwise" do not appear in these rules, and yet we manage to achieve the desired flow rate.

We also apply this form of reasoning to more complex situations, from regulating not only the flow rate but the water temperature, and even when driving a car. In none of these cases do we know precise values; rather, vague magnitudes suffice, such as "very hot", "near", "fast", etc.

Another important consideration is that the control can be expressed as a set of rules of the type: "For certain conditions with some variables, do these actions in others". In this structure, the conditions are called antecedents and the actions consequents.

We may conclude that human reasoning in these situations involves applying logic to uncertain magnitudes. If we want to implement this control artificially, the most convenient course of action is to use a tool that models uncertain magnitudes, this being Fuzzy Set Theory, and apply a logic to these magnitudes, this being Fuzzy Logic (Klir & Yuan, 1995). Both elements belong to a new field in the symbolic branch of Artificial Intelligence that has found in Fuzzy Control one of its main applications, even above other, more formal applications such as expert systems. The fact that it mirrors the process of human reasoning justifies the success of this new method, due to its ease of use and understanding. In a few years AI has blossomed and experienced great commercial success, eclipsing even that of expert systems.

In this chapter we will consider the fuzzy control of a liquid's temperature. This is a very simple academic problem that can be solved using various techniques, such as a classic PI

We are, however, living in rapidly evolving times where the main goal is to break the limitations that exist in our use of machines in an effort to increase productivity. The use of and advances in intelligent machines will fundamentally change the way we work and live. To this end, we are building autonomous control systems that are designed to work properly for long periods of time under given uncertainties in the system and the environment. These systems must be capable of compensating for faults in the system without any outside intervention. Intelligent autonomous control systems use techniques from the field of Artificial Intelligence (AI) to achieve autonomy. These control systems consist of conventional control systems that have been augmented using intelligent components, meaning their development

The emergence and development of Artificial Intelligence is of great importance. AI can be defined as that part of computer science that is charged with the design of intelligent computers, meaning systems that exhibit those characteristics that we associate with intelligent human behavior, such as understanding, learning, reasoning, problem solving, etc. Fuzzy Control is one of the new techniques in Intelligent Control, one that aims to imitate the procedure we humans use when dealing with systems (Cai, 1997). For example, when operating a water tap, if we want to obtain the desired flow rate, we reason using

Precise quantities such as "2 liters/second" of "65 degrees counterclockwise" do not appear

We also apply this form of reasoning to more complex situations, from regulating not only the flow rate but the water temperature, and even when driving a car. In none of these cases do we know precise values; rather, vague magnitudes suffice, such as "very hot", "near",

Another important consideration is that the control can be expressed as a set of rules of the type: "For certain conditions with some variables, do these actions in others". In this

We may conclude that human reasoning in these situations involves applying logic to uncertain magnitudes. If we want to implement this control artificially, the most convenient course of action is to use a tool that models uncertain magnitudes, this being Fuzzy Set Theory, and apply a logic to these magnitudes, this being Fuzzy Logic (Klir & Yuan, 1995). Both elements belong to a new field in the symbolic branch of Artificial Intelligence that has found in Fuzzy Control one of its main applications, even above other, more formal applications such as expert systems. The fact that it mirrors the process of human reasoning justifies the success of this new method, due to its ease of use and understanding. In a few years AI has blossomed and experienced great commercial success, eclipsing even that of

In this chapter we will consider the fuzzy control of a liquid's temperature. This is a very simple academic problem that can be solved using various techniques, such as a classic PI

structure, the conditions are called antecedents and the actions consequents.

requires interdisciplinary research (Jang et al., 1997).

"If the flow is low, turn the handle all the way left"

"If the flow is high, turn the handle right a little bit", etc.

in these rules, and yet we manage to achieve the desired flow rate.

terms such as:

"fast", etc.

expert systems.

control scheme (Horváth & Rudas, 2004). We will use it in this text, however, to illustrate the design and operation of a fuzzy controller.

An introduction to fuzzy control is presented first, followed by a description of the general outline. In subsequent sections we describe each of the steps in the design of the fuzzy controller: choice of inputs and outputs, rule base, fuzzy quantification, and fuzzification, inference and defuzzification mechanisms. We conclude with a simulation of the proposed temperature controller.
