Electronic Design

What's All This Fuzzy Logic Stuff, Anyhow (Part II)?

<p>If you can think of an unlikely person to study Fuzzy Logic, it's RAP. While it's a dirty, nasty job, somebody must do it, and I've had lots of encouragement from all you readers since I put out my first column on the subject.<sup>1</sup> Note, some people have characterized me as being a detractor of Fuzzy Logic (F.L.), but I think I have done more good for the field of F.L. than lots of other guys all put together. I think it's to nobody's benefit to have people bragging about advantages that are unreal.</p> <p> I believe people who are making responsible, intelligent claims for F.L. will be glad to have me on their side, to cut down on irresponsible, unfair, preposterous claims. I consider myself, rather, a skeptic—and here is a laundry list of ideas I have figured out or discovered so far:</p> <p> 1. Nobody has yet submitted to me any realistic task or control loop that they did with Fuzzy Logic which I could duplicate.<sup>2</sup> Isn't it strange that some Fuzzy Logic promoters want to quiet down Pease, but none of them has brought me a nice simple example to show how F.L. really is better than conventional systems (and, after we turn on the lights, we hear them scuttling under the cabinets). I didn't expect to get many, but zero is indeed a very interesting number. However, as one person pointed out, the F.L. experts who really are good are too busy to fool around with demonstrations, since they have lots of work to do—that's a fair explanation.</p> <p> 2. Almost everybody agrees that the examples I gave of outrageous F.L. claims were indeed pretty incredible, and that some F.L. promoters do exaggerate a lot. Several people sent in additional examples of Fuzzy Logic hype, such as pumps that allegedly come up to speed 2 times faster than with a "conventional" controller, and fuzzy motor controllers with miraculous "advantages"....</p> <p> 3. I have seen several readers give the same opinion that F.L. will be a lot more useful and valuable than its detractors predict, but a lot less useful and valuable than its promoters have said. Some of the claims, for example, that 50% of all microprocessors will be used for F.L. by 1996 seem a bit far-out.</p> <p> 4. Some promoters of F.L. are quite young, and when they promote F.L. as superior to other kinds of controllers, they show fantastic advantages—not out of malice, but just because they're not really familiar with the capabilities of other techniques. So they set up a straw man, which they then proceed to knock over easily. They do this because they don't know any better. Those of us who know better have an obligation to explain this to them.</p> <p> 5. Some F.L. guys aren't very good at explaining. Certain people think this may arise from their experiences in applying for research grants: If they clarify everything, and make it look too clear and easy, how can they apply for another grant to explain yet more? Even allowing for this, they still aren't very good at explaining things. They love to use lots of jargon. They speak in terms that are suitable for "preaching to the converted," but don't make clear explanations to the rest of us. Then they bleat that the rest of the world is closed-minded and prejudiced against them. I wonder why that is....</p> <p> 6. For example, some of them like to talk about the ability of their math to handle "probability." When you check it out, you find that they're talking about <i>proportionality</i>—the analog parameters. But because many of their old mathematical tools are borrowed from the probability experts, they persist in using that phrase. It bugs the hell out of me!!</p> <p> 7. Many F.L. guys love to make rash, outrageous philosophical claims: "With Fuzzy Logic controllers, you don't need any models." "With F.L., you never have to worry about the Nyquist sample rate." "You do not need to know the characteristics of a plant to design a controller for it." "The major advantage in the use of a fuzzy loop is that it reacts much faster to a process disturbance (or to overshoot and undershoot) than does a standard PID loop."<sup>3</sup> After much debate and criticism from conventional control experts, they may concede their claims aren't entirely true, but only after they have succeeded in getting everybody mad at them.</p> <p> 8. F.L. is claimed to make a good servo for some kinds of systems where conventional controllers don't work well. WELL, let's assume that in some cases it's true. Then how do you prove that such an F.L. system has good dynamic stability in all cases? For conventional controllers, there are methods to prove that a controller has a good safety margin of dynamic stability. How can you demonstrate and prove adequate safety margins/safety factors for F.L. systems? Remember—F.L. claims advantages because it can accommodate system nonlinearity by incorporating appropriate nonlinearity in the controller. How do you prove that this is safe? How much proof is necessary? That sounds like a real problem to me. If your new F.L. washing machine blows up, how can the manufacturer prove to the jury that he used the best available tests to ensure customer safety? As with any nonlinear controller system, extensive testing is needed to prove that no regions of instability will jeopardize proper system operation.</p> <p> 9. Some people pointed out that a Fuzzy Logic system is a kind of Expert System—a form of Artificial Intelligence. Now, the F.L. people may not like to talk about this because of the disappointments with Expert Systems in the past. But, are these not some of the same people who worked with Expert Systems and Artificial Intelligence in the past?? You tell me. Still, despite old disappointments, this seems to be a place where the Expert System, under the name of Fuzzy Logic, finally begins to fulfill its promise. MEANWHILE, some Artificial Intelligence experts are the most adamant detractors of F.L., because they have their math, and do not like to see F.L. people using "linguistic variables." Personally, if I hear "If the input is <i>small</i>, the output is <i>little</i>," one more time, I will <i>vomit</i>.</p> <p> 10. Let's assume that F.L. really can help make vacuum cleaners and washing machines work better. If that's the case, they do so because of the SENSORS. Which is more important, better sensors or the F.L.?? Maybe those smart, aggressive, and problem-solving F.L. guys will use the sensors very thoughtfully. Which is the chicken, which the egg? I can't say.</p> <p> 11. Fuzzy Logic doesn't really generate a control law. It maps an existing control law from one set of rules into a logic set.<sup>4</sup> If the rules permit this to be done efficiently, it may be able to accomplish the computing function just by remapping. That's a well-known way to get your computation done quickly. But the programmer or rule-maker has to provide the mapping functions—the rules. However, writing those rules isn't a trivial exercise. Even if you want to let Neural Networks write the rules for you, as with NeuFuz4,<sup>5</sup> that can be quite a piece of work.</p> <p> 12. F.L. guys universally ignore the role of their input sensors, their analog-to-digital converters, and the format of the (digital) interface to their Fuzzy Processors. I've heard people say that in some cases, F.L. works just fine with a single input bit stream. In other cases, the controller obviously requires an 8-bit, 10-bit, 12-bit, or higher-resolution parallel data bus. But (just about) every Fuzzy Experimenter makes ZERO mention of the input data. One person admitted about F.L. designers: "<i>Of course</i> they need good input data, and they just <i>assume</i> that the data will be made available to them in a suitable format."</p> <p> ...Well now, what format is that? It certainly isn't the same for every case, and, therefore, it should certainly be discussed. Every time I've looked at an "example" of a real Fuzzy Logic system or controller, the data inputs were left completely unmentioned. This frustrates the hell out of me because I know that in the real world, in a real system, this is quite important. Caution—don't be fooled into thinking, as one of my friends did, that a F.L. system only needs a 3-bit ADC at its input, because there are only 3 or 4 "rules." These few rules will take in and process the 8 or more bits of data (1 part in 256 resolution), which they then map into an output with full 8-bit (or more) resolution.</p><p> Also, don't think that the F.L. process is fuzzy or imprecise, or isn't "deterministic". I have been informed to point out that when the input moves a small amount, the output will move an appropriate amount, with no real uncertainty or doubt. A F.L. controller is, normally, just as "deterministic" as a conventional controller, whether analog or digital. It just uses different internal processes.</p> <p> The "fuzziness" in F.L. just refers to the way that an object is in a set. In classical set theory, an object is either in a set or it is not. There's no "in-between," no grading. In the real world, of course, objects can be in a set "partially." F.L. extends classical set theory by assigning degrees of membership (typically, fractional amounts) to objects in such a way as to not conflict with classical set theory.<sup>6</sup> </p> <p> Thus, F.L. can serve as a generalization and as an extension of existing set theory to help solve real-world problems in cases where traditional methods fail, or where nonlinearities cause poor results in price or performance. Of course, many of us engineers use analog signals to represent that proportionality.</p> <p> 13. Note that in most real systems, whether F.L. or conventional, it's important for the system to be given good information, with good resolution and good accuracy. If adequate information isn't made available, it's unclear how either one will do a good job. Specifically, when F.L. guys say that "You never have to worry about the Nyquist sample rate," that is true only if you have a big safety margin. If your F.L. system's sample rate is too low, and your system works badly, then <i>of course</i> you have to worry about it, just as everybody else does.<sup>7</sup> </p> <p> 14. In a conventional digital or analog controller, it is customary to provide a parameter, such as distance or rotation, to the controller. The controller then computes a derivative or difference signal, dx/dt, or, Δx/Δt. But in a F.L. system, you have to <i>provide</i> the x data and then a derivative, dx/dt. Apparently F.L. falls short when it comes to timing or counting, so the F.L. controller can't compute the derivative function<i>—you</i> have to provide it that. Therefore it's <i>not</i> quite true that an F.L. system needs the same information as a conventional controller—sometimes it needs <i>more</i> information.</p> <p> 15. LIKEWISE, Fuzzy guys uniformly ignore the output format of their systems. Is it serial or parallel? They're always too shy to mention this. I did hear that for the Inverted Pendulum experiment, the F.L. approach is so greatly superior to conventional controllers that it puts out just a serial pulse train (the signal is the duty cycle) which controls the loop without any trouble. Yet in other cases, it's obvious that the output must comprise parallel bits to a conventional DAC. But they never make any reference to this, either. How many bits, 8, 12, or 16? Nobody talks about this; it's "academic" and is left as an exercise to the reader.</p> <p> 16. Not only do the F.L. guys never talk about their input interface or their outputs, they also avoid talking about the actual computer or microprocessor they use. They rarely mention the number of bits, or the clock rate, or the software. They always try to keep things "academic"—and they don't tell you what they really did.</p> <p> NOW, let's talk about cases where F.L. may have advantages:</p> <p> 17. Fuzzy Logic is generally admitted—even by RAP—to have real advantages where the system is nonlinear. One simple example, again, is the Inverted Pendulum, where the base of a stick on a pivot is moved along a track by a little motor. The angular acceleration of the pendulum is NOT a linear function of its angle away from vertical, but a sort of third-power law. If you try to approximate this with a linear function, it's hard to get the gain right. It's either too low at the ends or too high in the middle. Or else you have to compute the function precisely, which takes a LOT of computation. But with F.L., you can get the gain approximately right with just a few segments of F.L. coding—perhaps just 5 rules. These rules now are so simple, that the F.L. computing processors can compute this with good speed, and a cheap computer, faster and cheaper than a conventional computer can do when it computes EXACTLY the equations of motion for that Inverted Pendulum. Consequently, if the computer can go faster, it may be able to do a superior job of controlling, because although its math is crude, it's plenty accurate enough, and it's <i>fast.</i> NOW, when you compound the problem by stacking <i>two</i> inverted pendulums on top of each other, F.L. can still do it easily. For the <i>triple</i> inverted pendulum, F.L. can still do it, whereas conventional controllers apparently can't do all of the complicated math fast enough. <i>Maybe</i> if you made some simplifying assumptions, some approximations, the conventional controller could then go fast enough, but this is generally ignored. F.L. can make certain assumptions, approximations, and simplifications, but other controllers aren't supposed to be able to do this.</p> <p> 18. F.L. is supposed to have real advantages where an approximate system solution is adequate. For example, I read a statement by a F.L. promoter<sup>8</sup> that said if you want a computer to park your car for you, you should exploit imprecision. If you don't need the car at exactly 6.00±0.02 inches from the curb, but something like 6±2 inches, then F.L. may be able to do a superior job, especially since you can use a cheap computer. When I read this, I was struck by its wisdom. But who would dare to admit that F.L. is not only not always better, but sometimes, <i>inferior</i> in accuracy, yet it's still plenty good enough? I looked, and it was Lotfi Zadeh himself, the creator of Fuzzy Logic. He was wise enough to say that, and I'm delighted to say I agree that when a solution is good enough, don't worry about perfection. I'm absolutely in favor of pragmatism, and of good-enough engineering. Perfectionism is the bane of cost-effective engineering. Anybody who knows when to do a good-enough job and <i>stop</i> is a friend of mine.</p> <p> 19. Let me insert an esaeP's fable here: One time I was bicycling down Massachusetts Avenue in Cambridge, Mass. on a quiet Sunday morning, and a dog started chasing me. Because I was on a downgrade I accelerated well, and the dog fell a few yards behind me. He could not gain on me, and I was going fast enough, so I did not bother to pull further away from him. At a split in the road, I continued on down Mass Ave. The dog veered off onto Mt. Auburn Street, barking all the way, as if to say that he was not really chasing me at all, so he did not care if he had not caught me.</p> <p> WELL, when I make a few convincing arguments to rebut the F.L. claim that "F.L. is always better", the F.L. experts often veer away, saying, "Even if it is not always more precise, it is less expensive...." NOW, F.L. is <i>alleged</i> to be a less expensive way to run a controller. In some cases, it may be able to use a cheap computer. It may use fewer lines of code or a smaller ROM. The F.L. guys love to claim this. But I don't automatically trust them when they say "it's cheaper." After all, what would you expect them to say?? I am still skeptical about these guys. Other experienced engineers find that for some cases <i>conventional</i> controllers can be more compact, cheaper, and easier to program than F.L. So, if in a given system the F.L. experts claim that F.L. is cheaper, you had better check their data. Make your own cost comparisons. Don't let them just set up straw comparisons.</p> <p> Stay tuned for more Fuzzy Logic stuff in the next issue...</p> <p> All for now./Comments invited! <br> RAP/Robert A. Pease/Engineer</p> <p> Address:<br> Mail Stop D2597A (note change!),<br> National Semiconductor,<br> P.O. Box 58090,<br> Santa Clara, CA 95052-8090</p> <p> References:</p> <ol> <li> "What's All This Fuzzy Logic Stuff, Anyhow?," R. A. Pease, <i>Electronic Design</i>, May 13, 1993, pp. 77-79.</li> <li>One reader sent a report on a design involving a focusing system for a laser's lenses, but I couldn't very well duplicate that. Another person promised to send me more info about a motor speed controller, but never sent anything. One writer said that "all of the arguments of the above writer are not right," but gave no specific example of anything in my writing he thought was wrong....</li> <li>"Fuzzy Logic: A Clear Choice For Temperature Control", Haubold vom Berg, <i>Instruments and Control Systems</i>, June 1993, pp. 39-41.</li> <li>Private correspondence with Daniel Abramovitch, Hewlett-Packard Labs, Palo Alto, Calif. June 30, 1993.</li> <li>NeuFuz4 from NSC, combining Neural Networks and Fuzzy Logic. The Neural Network part can learn from recorded data, then generate fuzzy rules and membership functions. Thus, it can learn the best way to control the system. Call (800) 272-9959 for details.</li> <li>"Fuzzy Models - What Are They, And Why?" J. Bezdek, IEEE Transactions on Fuzzy Systems. Feb. 1993, pp. 1-6. A good introduction to Fuzzy Sets and concepts.</li> <li>Private correspondence with Daniel Abramovitch, Hewlett-Packard Labs, Palo Alto, CA. June 30, 1993.</li> <li>"On The Fuzzy Edge Of Technology", Tom Williams (quote of Lotfi Zadeh), <i>Computer Design</i>, April 1993, p. 14.</li> </ol>

TAGS: Components
Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.