What is Fuzzy Logic?

Fuzzy logic is a form of many-valued logic in which a statement is not only true (1) or false (0) but can take any degree of truth between 0 and 1, so that vague concepts such as “warm” or “almost full” become mathematically usable. In automation, fuzzy logic is mainly applied in a fuzzy controller: a controller that captures the knowledge of an experienced operator in rules such as “IF the temperature is high AND rising fast, THEN open the cooling wide”. This is useful for processes that are non-linear or for which no good mathematical model exists. For PLCs, the programming of fuzzy control is standardised in IEC 61131-7.


🧠 Where does fuzzy logic come from?

The Iranian-American mathematician Lotfi Zadeh of the University of California, Berkeley published the paper Fuzzy Sets in 1965. In it he introduced sets of which an element can be a “partial” member. In 1973 he added the concept of the linguistic variable: a variable such as temperature that takes values like “cold”, “lukewarm” and “hot”.

The step into control engineering followed quickly:

Year Milestone
1965 Zadeh publishes Fuzzy Sets
1974-1975 Ebrahim Mamdani and Sedrak Assilian (Queen Mary College, London) control a steam engine and boiler with fuzzy rules
1976 First industrial application (commonly cited year): fuzzy control of a cement kiln in Denmark
1980 F.L. Smidth brings a fuzzy kiln control system for the cement industry to market
1985 Takagi and Sugeno publish their model with mathematical functions as rule outputs
1987 The Namboku Line of the Sendai subway (Japan) runs with a fuzzy train operation and braking system from Hitachi
2000 IEC publishes IEC 61131-7 Fuzzy control programming

Japan embraced the technique on a large scale in the late 1980s, from autofocus cameras to washing machines and air conditioners.


🎯 How does fuzzy logic differ from classical logic?

In classical (Boolean) logic, 49.9 °C is “not warm” and 50.0 °C is “warm”. Fuzzy logic replaces that hard boundary with a gradual transition: 48 °C can be 0.4 “warm” and at the same time 0.6 “lukewarm”.

Aspect Boolean logic Fuzzy logic
Truth value 0 or 1 Any value from 0 to 1 inclusive
Set An element is a member or not An element has a degree of membership
Boundary Sharp threshold (Temp > 50 = WARM) Gradual transition between terms
AND Both true Minimum of both degrees
OR Either true Maximum of both degrees
NOT Invert 1 minus the degree

A common mistake is to treat a degree of membership as a probability. It is not: 0.7 “warm” says how well 63 °C fits the concept warm, not how likely it is that it is warm.


🔧 How is a fuzzy controller built?

A fuzzy controller receives ordinary numeric measurements from a sensor and produces a numeric control signal, just like a PID controller. The vague concepts exist only inside the controller. There are four steps:

  1. Fuzzification - the measured value is converted into degrees of membership. A temperature of 63 °C might be “warm” = 0.7 and “hot” = 0.3. Triangular or trapezoidal membership functions are most common, with three to seven terms per input.
  2. Rule evaluation - each rule receives an activation degree. For “IF temperature is warm AND rate of rise is fast THEN fan is high”, that is the minimum of the two input degrees.
  3. Aggregation - the results of all active rules are combined, usually with the maximum.
  4. Defuzzification - the combined fuzzy result (for example “high” = 0.8, “medium” = 0.2) is converted into one concrete value, for example 78% opening of a control valve. The most widely used method is the centre of gravity (COG).

There are two main types:

Type Output of a rule Characteristics
Mamdani A fuzzy set (“valve is half open”) Easy to read, rules resemble operator language, needs defuzzification
Takagi-Sugeno A constant or linear function of the inputs Computes faster, easier to combine with mathematical models and optimisation

🏭 Where is fuzzy logic used in practice?

Application Fuzzy behaviour
Cement kilns Adjust fuel and air supply using operator rules, because the kiln process is highly non-linear
HVAC and building automation Match ventilation and heating to perceived comfort rather than hard thresholds
Metro and trains Smooth acceleration and precise stopping, as in Sendai
Level control in a silo or buffer Drive a pump based on the level and the trend of the level
Robot control Adjust gripping force to the softness of the product
Process control Fuzzy supervision that adjusts the parameters of a PID loop under changing conditions
Household appliances Washing machines and dishwashers that match cycle time and water to the load

In process automation, fuzzy logic often sits in a supervisory layer: the fuzzy controller passes a setpoint to an underlying PID loop, similar to cascade control.


🔄 When do you choose fuzzy logic and when PID?

Aspect Fuzzy logic PID
Input Numeric (error, change of error, extra measurements) Numeric (error between PV and SP)
Knowledge source Operator expertise, captured in rules Process model or step response, tuned with P, I and D
Non-linearity Can describe strongly non-linear behaviour directly Works best around one operating point
Multiple inputs Several variables easily in one rule base One input per loop, coupling through extra loops
Tuning Many design choices (terms, rules, method) Three parameters, well-known tuning methods
Stability proof Hard to demonstrate formally Well-established theory

A standard fuzzy controller is not adaptive by itself: it is a fixed non-linear mapping from inputs to outputs. Self-learning behaviour requires additional mechanisms, such as neuro-fuzzy systems that train the membership functions with machine learning. For multivariable processes with a good model, MPC within APC is often a stronger alternative.


🛠️ How do you program fuzzy logic in a PLC?

IEC 61131-7 (edition 1.0, August 2000) is the part of the IEC 61131 series that defines the Fuzzy Control Language (FCL). In FCL, a fuzzy controller becomes a function block with fixed sections:

  • FUNCTION_BLOCK with VAR_INPUT and VAR_OUTPUT - the numeric inputs and outputs
  • FUZZIFY - for each input, the terms (TERM) with their membership functions
  • DEFUZZIFY - the output terms, the method (METHOD, for example COG) and a DEFAULT value for when no rule is active
  • RULEBLOCK - the operators for AND, activation and accumulation, plus the rules themselves

A practical approach for a first application:

  1. Interview the operators and write down how they adjust the process by hand.
  2. Choose two inputs, usually the control error and the change in error, with three to five terms per input.
  3. Draw up the rule base as a matrix; with 5 x 5 terms that gives at most 25 rules.
  4. Test in simulation or with a digital twin before the controller drives the real process.
  5. Define a DEFAULT and output limits, and keep a PID or manual mode as a fallback.

Some vendors offer their own software packages, such as the older FuzzyControl++ from Siemens for STEP 7 with the S7-300 and S7-400. Because its behaviour is hard to prove formally, fuzzy logic is generally not used as a safety function: that stays in an SIS according to IEC 61511 or IEC 61508.


❓ Frequently asked questions

Is fuzzy logic a form of artificial intelligence?

Fuzzy logic is often counted as classical AI, because it captures human expert knowledge in rules. Unlike machine learning, however, fuzzy logic does not learn from data by itself. Combinations such as neuro-fuzzy systems do add that learning capability.

What is the difference between fuzzy logic and probability?

Fuzzy logic describes to what degree a value fits a vague concept, while probability describes how likely an event is. A membership degree of 0.7 for “warm” therefore does not mean there is a 70% chance that it is warm. The membership degrees of different terms also do not have to add up to 1.

Which standard covers fuzzy logic in PLCs?

IEC 61131-7 covers the programming of fuzzy control in programmable controllers with the Fuzzy Control Language (FCL). The standard was published in August 2000 as edition 1.0 and has not been replaced since. FCL has no hedges such as “very”, so you define a separate term for those.

Is fuzzy logic better than a PID controller?

Fuzzy logic is not better than PID in general, but it is better suited to strongly non-linear processes without a good model where experienced operators can still steer the process. For most single control loops, PID is simpler to tune and to justify. In practice the two are often combined, with fuzzy logic as a supervisory layer.

How many rules does a fuzzy controller need?

A fuzzy controller with two inputs and five terms per input needs at most 25 rules. With three inputs of five terms each, that can already be 125, because the number of combinations grows exponentially. That is why designers keep the number of inputs per rule base small or split the controller into smaller blocks.

Can fuzzy logic be used in a safety function?

Fuzzy logic is hardly ever used for safety functions in practice, because its behaviour is hard to verify formally. Safety functions belong in an SIS or safety PLC designed according to IEC 61508 or IEC 61511. Fuzzy logic therefore stays limited to process control.


📌 In summary

Fuzzy logic makes vague concepts computable with degrees of truth between 0 and 1. A fuzzy controller goes through fuzzification, rule evaluation, aggregation and defuzzification, and so turns operator knowledge into a numeric control signal. The technique proved itself in cement kilns, subways and building management, and for PLCs it is standardised in IEC 61131-7.

Fuzzy logic is the right choice for non-linear processes without a good model where human experience is available, as a complement to PID and never as a replacement for a safety function.