Why Use Fuzzy Logic? 

Fuzzy Logic is a paradigm for an alternative design methodology which can be applied in developing both linear and non-linear systems for embedded control. By using fuzzy logic, designers can realize lower development costs, superior features, and better end product performance. Furthermore, products can be brought to market faster and more cost-effectively.

An Alternative Design Methodology Which Is Simpler, And Faster

In order to appreciate why a fuzzy based design methodology is very attractive in embedded control applications let us examine a typical design flow. Figure 4 illustrates a sequence of design steps required to develop a controller using a conventional and a Fuzzy approach.

Using the conventional approach our first step is to understand the physical system and its control requirements. Based on this understanding, our second step is to develop a model which includes the plant, sensors and actuators. The third step is to use linear control theory in order to determine a simplified version of the controller, such as the parameters of a PID controller. The fourth step is to develop an algorithm for the simplified controller. The last step is to simulate the design including the effects of non-linearity, noise, and parameter variations. If the performance is not satisfactory we need to modify our system modeling, re-design the controller, re-write the algorithm and re-try.

With Fuzzy Logic the first step is to understand and characterize the system behavior by using our knowledge and experience. The second step is to directly design the control algorithm using fuzzy rules, which describe the principles of the controller's regulation in terms of the relationship between its inputs and outputs. The last step is to simulate and debug the design. If the performance is not satisfactory we only need to modify some fuzzy rules and re-try.

Although the two design methodologies are similar, the fuzzy-based methodology substantially simplifies the design loop. This results in some significant benefits, such as reduced development time, simpler design and faster time to market:

Fuzzy Logic reduces the design development cycle

With a fuzzy logic design methodology some time consuming steps are eliminated. Moreover, during the debugging and tuning cycle you can change your system by simply modifying rules, instead of redesigning the controller. In addition, since fuzzy is rule based, you do not need to be an expert in a high or low level language which helps you focus more on your application instead of programming. As a result, Fuzzy Logic substantially reduces the overall development cycle.

Fuzzy Logic simplifies design complexity

Fuzzy logic lets you describe complex systems using your knowledge and experience in simple English-like rules. It does not require any system modeling or complex math equations governing the relationship between inputs and outputs. Fuzzy rules are very easy to learn and use, even by non-experts. It typically takes only a few rules to describe systems that may require several of lines of conventional software. As a result, Fuzzy Logic significantly simplifies design complexity.

Fuzzy Logic improves time to market

Commercial applications in embedded control require a significant development effort a majority of which is spent on the software portion of the project. Development time is a function of design complexity, and the number of iterations required in a debugging and tuning cycle. As we explained above, a fuzzy based design methodology addresses both issues very effectively. Moreover, due to its simplicity the description of a fuzzy controller not only is transportable across design teams, but also provides a superior media to preserve, maintain, and upgrade intellectual property. As a result, Fuzzy Logic can dramatically improve time to market.

A Better Alternative Solution To Non-Linear Control

Most real life physical systems are actually non-linear systems. Conventional design approaches use different approximation methods to handle non-linearity. Some typical choices are, linear, piecewise linear, and lookup table approximations to trade off factors of complexity, cost, and system performance.

A linear approximation technique is relatively simple, however it tends to limit control performance and may be costly to implement in certain applications. A piecewise linear technique works better, although it is tedious to implement because it often requires the design of several linear controllers. A lookup table technique may help improve control performance, but it is difficult to debug and tune. Furthermore in complex systems where multiple inputs exist, a lookup table may be impractical or very costly to implement due to its large memory requirements.

Fuzzy logic provides an alternative solution to non-linear control because it is closer to the real world. Non-linearity is handled by rules, membership functions, and the inference process which results in improved performance, simpler implementation, and reduced design costs:

Fuzzy Logic improves control performance

In many applications Fuzzy Logic can result in better control performance than linear, piecewise linear, or lookup table techniques. For instance, a typical problem associated with traditional techniques is trading-off the controller's response time versus overshoot. For the simple one-input temperature controller example this is illustrated in Figure 5:

The first linear approximation for the desired curve generates a slow output response with no overshoot, which implies that the room would be too cold for a while. The second linear approximation results in faster response with an overshoot and subsequent fluctuations, which implies that the temperature will be uncomfortable for a period of time.

With fuzzy logic we can use rules and membership functions to approximate any continuous function to any degree of precision. Figure 6 illustrates how we can approximate the desired control curve for our temperature controller using four points (or four rules). We can also add more rules to increase the accuracy of the approximation (similar to a Fourier transform), which yields an improved control performance. Rules are much simpler to implement and much easier to debug and tune than piecewise linear or lookup table techniques.

IF temperature IS cold THEN force IS high

IF temperature IS cool THEN force IS medium

IF temperayure IS warm THEN force IS low

IF temperature IS hot THEN force IS zero

Rules are not like a lookup table because the fuzzy arithmetic interpolates the shape of the non-linear function. The combined memory required for the labels and fuzzy inference is substantially less than a lookup table, especially for multiple input systems. As a result, processing speed can be improved as well.

Another example of robust control that can be achieved with Fuzzy Logic is the classical problem of the inverted pendulum. A conventional controller for the pendulum depends on system parameters such as length, weight, and mass. If the parameters change, then we need to re-design our controller. With fuzzy control this is not necessary because a fuzzy system is robust. Aptronix has demonstrated an actual device where we can vary the weight or length of the pendulum and the system is still stable using the original set of rules.

By using a more natural rule-based approach which is closer to the real world, Fuzzy control can offer a superior performance and a better trade-off between system robustness and sensitivity, which results into handling non-linear control better than traditional methods.

Fuzzy Logic simplifies implementation

The one input temperature controller presented so far has helped us illustrate some fundamental concepts, however real life control is much more complex in nature. Most control applications have multiple inputs and require modeling and tuning of a large number of parameters which makes implementation very tedious and time consuming. Fuzzy rules can help you simplify implementation by combining multiple inputs into single if-then statements while still handling non-linearity.

Consider a modified version of the temperature controller example, with two inputs, temperature and humidity and the same output, fan_speed (Figure 7). This example can be described with a small set of rules as follows:


A linear approximation requires handling each input separately which multiplies design effort. Similarly, a piecewise linear approach requires the design of several controllers and is costly to implement. A lookup table seems more appropriate for this problem but it takes time to develop, debug and tune. For example, if we assume that each input requires eight bits, a lookup table would require 64K entries which makes it very time consuming to implement (Figure 8).

Using Fuzzy Logic we can describe the output as a function of two or more inputs linked with operators such as AND. This relationship can also be represented in a table form illustrated in Figure 8. The fuzzy approach requires significantly less entries than a lookup table depending upon the number of labels for each input variable. Rules are much easier to develop, and simpler to debug and tune compared to a lookup table.

Another example of simplicity is the classical control problem of the double stage inverted pendulum. Using conventional programming, this problem is extremely difficult, or impossible to implement. Aptronix has demonstrated a physical model of the 2-stage inverted pendulum which was accomplished using only 30 rules. The software portion of the project took only two days to develop.

Fuzzy Logic reduces hardware costs

Using a lookup table the two-input temperature controller requires 64Kb of memory, while the fuzzy approach is accomplished with less than 0.5Kb of memory for labels and object code combined. This difference in memory savings implies a cheaper hardware implementation. In addition, conventional techniques in most real life applications require complex mathematical analysis and modeling, floating point algorithms, and complex branching. This typically yields a substantial size of object code which requires a high end DSP chip to run. Fuzzy Logic enables you to use a simple rule based approach which offers significant cost savings, both in memory and processor class.

As an example, consider again the 2-stage inverted pendulum, whose model is equivalent to a second order differential equation. With a traditional approach, the model requires a high end workstation to develop, and the controller is extremely difficult or very costly to implement. For example, a non-linear equation would require a costly high end processor to cope with calculation intensity, while a lookup table would require a huge amount of memory. Aptronix's 2-stage pendulum was developed on a PC, runs on a low cost 8-bit microcontroller and requires under 1Kb of memory. This achievement demonstrates that we can use existing low end hardware to tackle an order of magnitude more complex applications.

Back to FIDE


© 1996-2000, Aptronix Inc.