Technical Article

# What is Fuzzy Logic?

September 12, 2021 by Sara McCaslin

## Learn how to utilize fuzzy logic as a powerful tool in modern control applications.

Fuzzy logic may not sound like the most reliable means of implementing a complex control system. However, the ability of fuzzy logic systems to work with imprecise data and implement the experience of experts makes it a powerful tool in modern control applications.

### An Overview of Fuzzy Logic

Fuzzy logic, a  subdivision of AI (artificial intelligence) developed by Lofti Zada in 1965, enables a computer system to mimic how humans interpret and interact with data. While Boolean logic is limited to two outcomes (True or False, 0 or 1), fuzzy logic deals with degrees of truth.

Consider, as an example, a machine vision system enabling an autonomous robotic system to navigate a busy warehouse floor. We would see a door to our right swing open quickly and know that an obstacle is probably about to appear. But Boolean logic does not deal in “probably” -- it deals in “an obstacle is about to appear” and “an obstacle is not about to appear.”

With fuzzy logic, input such as the speed with which the door opened (i.e., very slow, slow, average, fast, very fast), where the door is located, and the time of day can be transformed into the probability that an obstacle is about to appear (e.g., 0.8).

### The Basics of Fuzzy Logic

In a fuzzy logic system, there are three different types of values:

• Input values, which are in the form of crisp numerical values (e.g., T = 120°C)
• Fuzzy values, which represent the probability that a crisp value falls into a set of linguistically represented categories (e.g., Low = 0.2, Normal = 0.8, High = 0.0)
• Output values, which are defuzzified and crisp (Priority = 0.7)

There are four parts to a fuzzy logic system:

1. Fuzzification module
2. Knowledge base
3. Inference engine
4. Defuzzification module

The fuzzification module receives system inputs in the form of crisp (as opposed to fuzzy) numerical values. The crisp value input signal is divided into a set of categories usually represented by linguistic values (e.g., cold, warm, hot).

##### Figure 1. A plot of three membership functions representing poor, good, and excellent. Image used courtesy of Mathworks

The fuzzy value for each category is the probability that the crisp value falls into it. Fuzzy values can also be thought of as a “degree of truth”: a car traveling at 95 mph could be “traveling fast with a degree of truth of 0.75.” The actual fuzzification process is accomplished by a set of membership functions, with the most common being triangular, trapezoid, Guassian, or Sigmoid.

The knowledge base contains a set of if-then rules based on human reasoning and informed by an expert in the subject area. Here is an example of what this can look like:

• IF Temp is High AND Speed is Low THEN Alert_Level = Moderate
• IF Temp is High AND Speed is Very_High THEN Alert_Level = Low
• IF Speed is Low AND Temp is High OR Accel is HIGH Then Alert_Level = High

The inference engine uses the rules of the knowledge base to the fuzzy values in a manner similar to how a human subject matter expert would. The result is another fuzzy value and in this case.

Finally, the defuzzification module converts the output of the inference engine into a crisp value, much like a reverse of the fuzzification module. In this example, the alert level might come out to 0.8, which helps technicians prioritize preventive maintenance tasks.

### How Fuzzy Logic is Used

Fuzzy logic is widely used, and many people benefit from its capabilities without realizing it. Natural language processing, where voice commands are used to interact with objects, is one area where fuzzy logic is applied. In natural language processing, there is a level of uncertainty as to what an individual is saying. Still, fuzzy logic can deal with such noisy or imprecise data to interpret what is said to a high degree of accuracy.

##### Figure 2. Fuzzy logic and neural networks can identify various regions in satellite imagery including offshore oil facilities.

Engineers use fuzzy logic as part of their decision-making support system, and it can be found integrated into marketing and advertising. In addition, fuzzy logic systems can be combined with neural networks as part of machine vision systems for identifying possibly differentiating between farmland, urban areas, forests, and water in satellite imagery.

One area where fuzzy logic has found extensive applications, however, is control systems.

### Fuzzy Logic and Control Systems

In automobiles, there may be a fuzzy logic system that controls the braking system. Autonomous vehicles depend heavily on fuzzy logic control (FLC) for systems such as speed, steering, and adaptive cruise control. And even non-autonomous automobiles will likely utilize FLC for the braking system. Air conditioning systems, as well, often depend on fuzzy logic as part of smart thermostats to keep room temperatures and fan speed at comfortable levels while optimizing energy consumption.

However, those are only two examples of its use. FLC can be found in very diverse industries, including industrial automation, biomedical manufacturing, petrochemical processing, automotive manufacturing, and nuclear power.

Pumps, motors, fans, and drivetrains can be controlled using fuzzy logic, receiving data from an array of sensors as input. Extremely precise motion control can be achieved utilizing FLCs, hence its use in computer numeric control (CNC) machining systems. Its ability to effectively control temperatures is evidenced by its use in kilns and heat treatment ovens that depend on highly precise temperature cycles. FLC can also supervise extremely complex system interactions, such as those seen in swarm robotics.

##### Figure 3. The technology behind developing swarm robotics systems, such as this one developed by MIT’s Research Laboratory of Electronics, leveraging the power of fuzzy control systems. Image used courtesy of MIT

FLC is also invaluable in systems that depend on machine vision and has made many advances in industrial automation, IIoT, and Industry 4.0 possible and effective.

Traditional control systems depend on very precise data and rules that may not be able to take into account the experience of operators and experts. On the other hand, Fuzzy logic is ideal for applications where the data is noisy, imprecise, or partially missing. Its knowledge base can leverage the insight and experience of actual people to simulate their decision-making process.

• pnachtwey September 12, 2021

Fuzzy logic is a joke, a fad that died years ago.  It is an attempt to control something without understanding it.  There are many better algorithms that will produce much better results.  I have downloaded many papers on fuzzy logic where they claim they can control something better than a simple PID.  The fuzzy logic papers make fuzzy logic look better than a PID by making the PID control look bad.  This only shows the authors have lost all credibility because they don’t understand the control basics.  Some of the papers were presentations at engineering seminars.  This also shows that those that reviewed the paper know little.  So here is my rebuttal.
I will take on all challengers.  Be prepared.
If you want to optimize the control for something more than a simple SISO system then there is LQC or MPC.

Seriously,  do you really expect people to adjust input curves using hit or miss when everything can be calculated?
System identification can determine a model and then the controller gains can be optimized to put the closed loop poles in the desired location.
I have an answer for those that mention non-linear systems too.

My YouTube channel gets deep fast.  Most don’t understand the mathematics and bail after 3 minutes.  However look at the comments of those that stick around and understand what I am saying.
If you don’t like my YouTube channel then look at the apmonitor channel on YouTube.

Like.