> Fuzzy Control has its place, but it is > not the great solution or replacement for PID control. Pease Porridge of > Electronic Design ran a contest for a Fuzzy Control system that he could not > duplicate or exceed the performance of. He won every challenge using op-amps > and classic control theory. Fuzzy Control and Fuzzy Logic has had lots of > boasting and very little real substance. Fuzzy logic is a bunch of terminology wrapped around some useful concepts. While PID loops have their uses, they are often not ideal--even with fully linear systems. Consider the problem: you are supposed to pilot a hover-tram from point A to point B as quickly as posslble, with zero velocity at point B. You will not be deemed to have arived until you are at point B with zero velocity; if you overshoot you will have to come back. The hover-tram is equipped with a linear isometric control: applying 1N of forward pressure on the lever will impart 1000N of forward force on the tram; applying 2N of reverse pressure will impart 2000N of reverse force on the tram, etc. Using a PID loop, the hovercraft would be able to go moderately quickly from A to B regardless of the distance between them. If the loop is properly tuned to the mass of the tram, the ride will be smooth and the tram will stop precisely on target. If the loop is not tuned properly, it will either over- shoot the target and then oscillate around it (if the tram is heavier than expected) or will slow down too soon and crawl extremely slowly toward the target, Zeno's-paradox-style. By contrast, a faster method is to give the tram maximum safe forward thrust until some point (about halfway, though friction will shift the proper spot) and then maximum safe reverse thrust. If one does the switch from forward to reverse at just the right moment, the tram will stop precisely at the desired spot. Obviously this faster method would be a little dangerous in practice; if the driver doesn't reverse direction soon enough, the tram may significantly over- shoot the target while travelling dangerously fast. On the other hand, it is faster than the PID method (which can also overshoot, though not as badly). The goal then is to find a method which is faster than PID but safer than the alternative above. One approach is to consider how a person would solve this problem (or, in real life, how one would stop a car at a stop sign in potentially icy weather). If the car is going, e.g., 1mph, then it can be stopped easily within 3" of any desired point just by pressing the brakes 3" before that point. If the car is going 3mph, then it can be gotten to 1mph within 5 feet by pressing the brakes until it reaches 1mph. Etc. So the algorithm becomes (the numbers vary with weather, etc., but the idea should be clear): [1] If speed > 55mph press brakes (maximum permissible speed) [2] If speed > 40mph and distance < 700ft press brakes [3] If speed > 30mph and distance < 400ft press brakes [4] If speed > 20mph and distance < 150ft press brakes [5] If speed > 15mph and distance < 75ft press brakes [6] If speed > 10mph and distance < 25ft press brakes [7] If speed > 5mph and distance < 15ft press brakes [8] If speed > 3mph and distance < 10ft press brakes [9] If speed > 1mph and distance < 5ft press brakes [10] If speed > 0 and distance < 3" press brakes [11] If none of the above, release brakes This algoritm will stop the car at the proper spot every time, regardless of weather (unless it's really bad). It won't always be the fastest way to get there, but the results are much less dependent upon variations in loading, friction, etc. than with the PID method. The only major problem with this method is that it will produce very jerky results: the brakes are always "on" or "off"; there's no moderation. This is where fuzzy logic comes in. If the above system were entered into a fuzzy logic system and the car was cruising down the road at 54mph while nearing the destination, the fuzzy logic interpreter would start applying the brakes as the distance approached 700ft. As the car slowed down, it would start releasing the brakes as the speed dropped doward 40mph (assuming the distance was still well over 400ft). Rather than applying and releasing the break suddenly, the system would do so gradually. While this "smoothing" would affect the overall system behavior somewhat, the effects would be fairly predictable and generally not severe (though rule 10 might need to be adjusted if the fuzzy system stops short or long, the car would be moving slowly at that point so the stop should be "safe" even if it's not perfect. Fuzzy logic is by no means a panacea in motion-control or other applications; nonetheless, it allows decent and robust solutions to be produced fairly quickly.