FUZZY LOGIC FOR "JUST PLAIN FOLKS "
Chapter 2. An Exciting Moment in the History of Science
The World's First Fuzzy Logic Controller
In England in 1973 at the University of London, a professor and student were trying to stabilize the speed of a small steam engine the student had built. They had a lot going for them, sophisticated equipment like a PDP-8 minicomputer and conventional digital control equipment. But, they could not control the engine as well as they wanted. Engine speed would either overshoot the target speed and arrive at the target speed after a series of oscillations, or the speed control would be too sluggish, taking too long for the speed to arrive at the desired setting, as in Figure 1, below.
The professor, E. Mamdani, had read of a control method proposed by Dr. Lotfi Zadeh, head of the electrical engineering department at the University of California at Berkeley, in the United States. Dr. Zadeh is the originator of the designation "fuzzy", which everyone suspects was selected to throw a little "pie in the face" of his more orthodox engineering colleagues, some of whom strongly opposed the fuzzy logic concept under any name.
Professor Mamdani and the student, S. Assilian, decided to give fuzzy logic a try. They spent a weekend setting their steam engine up with the world's first ever fuzzy logic control system ....... and went directly into the history books by harnessing the power of a force in use by humans for 3 million years, but never before defined and used for the control of machines.
The controller worked right away, and worked better than anything they had done with any other method. The steam engine speed control graph using the fuzzy logic controller appeared as in Figure 2, below.
As you can see, the speed approached the desired value very quickly, did not overshoot and remained stable. It was an exciting and important moment in the history of scientific development.
The Mamdani project made use of four inputs: boiler pressure error (how many temperature degrees away from the set point), rate of change of boiler pressure error, engine speed error and rate of change of engine speed error. There were two outputs: control of heat to the boiler and control of the throttle. They operated independently.
Note: A fuzzy logic system does not have to include a continuous feedback control loop as in the above described Mamdani system in order to be a fuzzy-logic system, an impression you might receive from reading much of the fuzzy logic literature. There could be continuous feedback loop control, a combination of feedback loop control and on-off control or on-off control alone.
A fuzzy logic control system could be as simple as: "If the motor temperature feels like it is too hot, turn the motor off and leave it off." Or, "If the company's president and all the directors just sold every share of stock they own, then WE sell!"
A fuzzy logic system does not have to be directed toward electro-mechanical systems. The fuzzy logic system could be, for example, to provide buy-sell decisions to trade 30 million US dollars against the Japanese yen.
Fuzzy logic controllers can control solenoids, stepper motors, linear positioners, etc., as well as, or concurrently with, continuous feedback control loops. Where there is continuous feedback control of a control loop, the response for varying degrees of error can be non-linear, tailoring the response to meet unique or experience determined system requirements, even anomalies.
Controllers typically have several inputs and outputs. The handling of various tasks, such as monitoring and commanding a control loop and monitoring various inputs, with commands issued as appropriate, would all be sequenced in the computer program. The program would step from one task to the other, the program receiving inputs from and sending commands to the converter/controller.
Inputs for a fuzzy logic controlled mechanical/physical system could be derived from any of thousands of real world, physical sensors/transducers. The Thomas Register has over 110 pages of these devices. Inputs for financial trading could come from personal assessments or from an ASCII data communication feed provided by a financial markets quote service.
Progress in Fuzzy Logic
From a slow beginning, fuzzy logic grew in applications and importance, until now it is a significant concept worldwide. Intelligent beings on the other side of our galaxy and throughout the universe have probably noted and defined the concept.
Personal computer based fuzzy logic control is pretty amazing. It lets novices build control systems that work in places where even the best mathematicians and engineers, using conventional approaches to control, cannot define and solve the problem.
A control system is an electronic or mechanical system that causes the output of the controlled system to automatically remain at some desired output (the "set point") set by the operator. The thermostat on your air conditioner is a control system. Your car's cruise control is a control system. Control may be an on-off signal or a continuous feedback loop.
In Japan, a professor built a fuzzy logic control system that will fly a helicopter with one of the rotor blades off! Human helicopter pilots cannot do that. And, the Japanese went further and built a fuzzy logic controlled subway that is as smooth as walking in your living room. You do not have to hang on to a strap to keep your balance. If you did not look out the window at things flashing by, you would hardly know you had started and were in motion.
In the United States, fuzzy logic control is gaining popularity, but is not as widely used as in Japan, where it is a multi-million dollar industry. Japan sells fuzzy logic controlled cameras, washing machines and more. One Internet search engine returns over 16,000 pages when you search on "fuzzy+logic.
Personal computer based fuzzy logic control follows the pattern of human "fuzzy" activity. However, humans usually receive, process and act on more inputs than the typical computer based fuzzy logic controller. (This is not necessarily so; a computer based fuzzy logic control system in Japan trades in the financial markets and utilizes 800 inputs.)
Fuzzy Logic Control Input - Human and Computer
Computer based fuzzy logic machine control is like human fuzzy logic control, but there is a difference when the nature of the computer's input is considered.
Humans evaluate input from their surroundings in a fuzzy manner, whereas machines/computers obtain precise appearing values, such as 112 degrees F, obtained with a transducer and an analog to digital converter. The computer input would be the computer measuring, let's say, 112 degrees F. The human input would be a fuzzy feeling of being too warm.
The human says, "The shower water is too hot." The computer as a result of analog input measurement says, "The shower water is 112 degrees F and 'If-Then' statements in my program tell me the water is too warm." A human says, "I see two tall people and one short one." The computer says, "I measure two people, 6' 6" and 6' 9", respectively, and one person 5' 1" tall, and 'If-Then' statements in my program tell me there are two tall people and one short person."
Even though transducer derived, measured inputs for computers appear to be more precise, from the point of input forward we still use them in a fuzzy logic method approach that follows our fuzzy, human approach to control.
For a human, if the shower water gets too warm, the valve handle is turned to make the temperature go down a little. For a computer, an "If-Then" statement in the program would initiate the lowering of temperature based on a human provided "If-Then" rule, with a command output operating a valve.
More About How Fuzzy Logic Works
To create a personal computer based fuzzy logic control system, we:
1. Determine the inputs.
2. Describe the cause and effect action of the system with "fuzzy rules" stated in plain English words.
3. Write a computer program to act on the inputs and determine the output, considering each input separately. The rules become "If-Then" statements in the program. (As will be seen below, where feedback loop control is involved, use of graphical triangles can help visualize and compute this input-output action.)
4. In the program, use a weighted average to merge the various actions called for by the individual inputs into one crisp output acting on the controlled system. (In the event there is only one output, then merging is not necessary, only scaling the output as needed.)
The fuzzy logic approach makes it easier to conceptualize and implement control systems. The process is reduced to a set of visualizable steps. This is a very important point. Actually implementing a control system, even a simple control system, is more difficult than it appears. Unexpected aberrations and physical anomalies inevitably occur. Getting the process working correctly ends up being a "cut and try" effort.
Experienced, professional digital control engineers using conventional control might know how to proceed to fine tune a system. But, it can be difficult for us just plain folks. Fuzzy logic control makes it easier to visualize and set up a system and proceed through the cut and try process. It is only necessary to change a few plain English rules resulting in changing a few numbers in the program.
In reading about fuzzy logic control applications in industry, one of the significant points that stands out is: fuzzy logic is used because it shortens the time for engineering development. Fuzzy logic enables engineers to configure systems quickly without extensive experimentation and to make use of information from expert human operators who have been performing the task manually.
Perhaps your control need is something a lot more down to earth than flying helicopters or running subways. Maybe all you want to do is keep your small business sawmill running smoothly, with the wood changing and the blade sharpness changing. Or, perhaps you operate a natural gas compressor for some stripper wells that are always coming on and going off, and you need to have the compressor automatically adjust in order to stay on line and keep the suction pressure low to get optimum production. Perhaps you dream of a race car that would automatically adjust to changing conditions, the setup remaining optimum as effectively as the above mentioned helicopter adjusts to being without a rotor blade.
There are a million stories, and we cannot guess what yours is, but chances are, if there is something you want to control, and you are not an experienced, full time, professional control engineer financed by a multi-million dollar corporation, then fuzzy logic may be for you. If you are all those things, it still may be for you.
A conventional programmable logic controller monitors the process variable (the pressure, temperature, speed, etc., that we want to control). If it is too high, a decrease signal is sent out. If it is too low, an increase signal is sent out. This is effective up to a point. But, consider how much more effective a control system would be if we use a computer to calculate the rate of change of the process variable in addition to how far away it is from the set point. If the control system acts on both these inputs, we have a better control system. And, that could be just the beginning; we can have a large number of inputs all being analyzed according to common sense and experience rules for their contribution to the averaged crisp output controlling the system.
Further, whereas conventional control systems are usually smooth and linear in performance, we sometimes encounter aberrations or discontinuous conditions, something that does not make good scientific sense and cannot be predicted by a formula, but it's there. If this happens, the fuzzy logic method helps us visualize a solution, put the solution in words and translate to "If - Then" statements, thereby obtaining the desired result. That is a very difficult thing to do with conventional programmable logic controllers (known as PLC's). PLC's are programmable, but are far more limited than the program control available from a very simple BASIC program in a personal computer.
Fuzzy logic control is not based on mathematical formulas. This is a good thing, because, as easy as it might seem, it is difficult to impossible to write formulas that do what nature does. This is why novices using fuzzy logic can beat Ph.D. mathematicians using formulas. Fuzzy logic control makes use of human common sense. This common sense is either applied from what seems reasonable, for a new system, or from experience, for a system that has previously had a human operator.
Some of the greatest minds in the technical world try to explain to others why fuzzy logic works, and other great technical minds contend that fuzzy logic is a "cop out." The experts really "go at" each other. But, for us just plain folks, the fact is fuzzy logic does work, seems to work better than many expensive and complicated systems and is understandable and affordable.
End of Chapter 2.