CONTROL & AUTOMATION

Fuzzy Logic: Fundamentals, Membership Functions, and Control Rules

A complete introduction to fuzzy variables, sets, domains, membership functions, set operators, rule bases, Mamdani Max–Min evaluation, and the path from a numerical input to a control decision.

PUBLISHED 2 MAY 2020UPDATED 7 AUGUST 2026FULL TECHNICAL NOTE

Fuzzy logic is useful when an engineering decision is easier to describe with gradual linguistic ideas—such as low, medium, high, slightly hot, or very humid—than with one exact mathematical boundary.

Lotfi A. Zadeh introduced fuzzy-set theory in 1965. The central idea is not that logic becomes vague or arbitrary. Instead, the degree to which a numerical value belongs to a linguistic set can vary continuously between 0 and 1. That gives a controller a structured way to represent qualitative engineering knowledge.

INPUTNumerical measurements
KNOWLEDGEMemberships + IF–THEN rules
OUTPUTNumerical control action

Why fuzzy logic is used in control

Classical control methods often begin with a mathematical model. If a system can be represented well by differential equations or a transfer function, that approach can be powerful. But some systems are nonlinear, poorly identified, strongly coupled, or influenced by experience that is difficult to express as one compact equation.

Fuzzy control offers another route. An experienced operator may already know rules such as “if temperature is slightly high and humidity is low, increase fan speed moderately.” Fuzzy logic provides a formal mechanism to turn those statements into a repeatable algorithm.

This does not mean fuzzy logic is automatically better than PID, state-space control, or model predictive control. Its value is strongest when linguistic knowledge is meaningful, boundaries are gradual, and a precise plant model is difficult or unnecessary for the intended control performance.

The basic vocabulary

Fuzzy variable

The quantity discussed in the fuzzy system, such as temperature, humidity, speed, error, or controller output.

Fuzzy set

A linguistic condition associated with the variable, for example LOW, NORMAL, HIGH, SLOW, or FAST.

Universe of discourse

The complete numerical range allowed for a variable. A humidity input might, for example, be defined over 0–100% RH.

Domain

The numerical interval over which a particular fuzzy set has meaning or nonzero membership.

Unlike a classical set, a fuzzy set does not require one hard boundary. A temperature of 29°C might belong to WARM with membership 0.7 and HOT with membership 0.3 at the same time. Overlap is intentional; it creates gradual transitions between rules.

Membership functions map numbers to degrees

A membership function converts a crisp numerical input into a degree of membership between 0 and 1. Linear ramps, triangular functions, trapezoids, Gaussian curves, and other shapes are commonly used.

LOWMEDIUMHIGH10
Illustrative overlapping membership functions. At one input value, more than one linguistic set can be active.

Suppose the variable is controller error. A small positive error might have memberships of 0.7 in POSITIVE SMALL and 0.3 in ZERO. Both rule paths can then contribute to the output. This is one reason a fuzzy controller can transition smoothly rather than jumping from one hard rule to another.

AND, OR, and NOT for fuzzy sets

Minimum, maximum, and complement operators are simple and widely used in Mamdani-style systems:

AND: μ(A ∩ B) = min[μA(x), μB(y)]OR: μ(A ∪ B) = max[μA(x), μB(y)]NOT: μ(A′) = 1 − μA(x)

If a rule says IF error is LARGE AND rate-of-change is POSITIVE, the activation level of that rule can be taken as the smaller of the two membership degrees. Other fuzzy systems may use product or other t-norm/t-conorm operators, but the min/max approach is a useful starting point.

Building a fuzzy rule base

A rule base expresses relationships between linguistic inputs and outputs. The general form is:

Ri: IF x1 is Fi1 AND … AND xn is Fin THEN y is Gi

For a simple fan controller with humidity error as the input and fan command as the output, a rule set might look like this:

ConditionOutput ruleMeaning
Error is NEGATIVE LARGEFan LOWMeasured humidity is already well above the reference, so reduce transport.
Error is NEAR ZEROFan MEDIUMMaintain a moderate command around the desired operating region.
Error is POSITIVE LARGEFan HIGHMeasured humidity is well below the reference, so increase moist-air transport.

Real controllers often use two inputs, such as error and change of error. That allows the rule base to distinguish “far from setpoint but moving quickly toward it” from “far from setpoint and not improving.”

Mamdani Max–Min inference step by step

A typical Mamdani controller follows four stages.

  1. Fuzzification. Convert each numerical input into membership degrees for the relevant fuzzy sets.
  2. Rule evaluation. Calculate each rule firing strength, commonly using the minimum membership for AND conditions.
  3. Implication and aggregation. Clip or scale the output membership function for each rule, then combine the outputs of all active rules, commonly using the maximum.
  4. Defuzzification. Convert the final aggregated fuzzy output into one crisp control value.

For centroid defuzzification, the controller chooses the center of area of the aggregated output membership function:

z* = ∫ z μC(z) dz / ∫ μC(z) dz

The result might be a fan duty cycle of 63%, a valve opening of 42%, or another continuous actuator request depending on the defined output universe.

What actually requires engineering judgement

Fuzzy logic can look intuitive because its rules are readable, but the controller still contains many design choices. The engineer must decide the input variables, numerical ranges, number of fuzzy sets, membership shapes and overlap, operators, rule table, output sets, and defuzzification method.

Bad choices can create dead zones, excessive sensitivity, contradictory rules, or poor behavior outside the region used during tuning. A fuzzy controller therefore needs the same disciplined validation as any other control method.

Useful design habit

Plot the controller surface: sweep the input variables through their full ranges and visualize the resulting output. This immediately reveals abrupt regions, flat spots, saturation, and unintended rule interactions before the controller is connected to hardware.

Fuzzy control versus PI/PID

AspectPI/PIDFuzzy controller
Primary representationNumerical error terms and gainsLinguistic sets and rules
Plant model requiredNot always, but tuning relates strongly to dynamicsNot necessarily; can use qualitative process knowledge
NonlinearityOne fixed gain set can struggle over a wide operating rangeRules can deliberately change behavior across regions
InterpretabilityGain meaning is compact but not always intuitive to operatorsRules are often readable in engineering language
Validation needResponse, stability, robustnessRule coverage, surface behavior, response, robustness