How Fuzzy Logic works can be understood in a simple example of driving in a lane within speed limits. While the driver may take precise inputs (not fuzzy) from the speedometer, he also keeps an eye on the drivers behind him, ahead of him and an overall trend of the speed of the traffic, density pouring in from side lanes etc. to have a rough estimate of conditions. The whole information is processed and summarized into a crisp output of the speed decision he maintains, whether to speed or not. This is a simple example of fuzzy logic.
Like any other mathematical modeling process, FL too uses a few steps to achieve the final goal. The various steps are outlined as:
1. System Requirements: Define control objectives, specifications, criteria, type of response needed, possible failure modes etc.
2. Input/Output relationship: Choosing the minimum number of fuzzy variables for inputs and their relation to the output. These can be linguistic variables, for example for error measurements, large positive error, zero error, small negative error etc.
3. Create FL Membership Functions: These define the values of Input/output terms used in the rules. These represent graphically, the magnitude of participation of an input and associate a weight to each input which determines their influence on the final output. These functions seldom have simple shapes, and may range from triangular to bell shaped, trapezoidal or exponential. The degree of membership is determined by having the input on the x-axis and projecting it to the upper boundary of membership function.
4. Rule Based Engine Structure: FL systems are based more on intuitive reasoning with If-Then clauses for all the possible cases. There is no Else clause, which means that all the conditions are checked. A rule matrix is initially formed to tabulate all the possible number of rules. Though all might not be needed, it helps mapping out the possible inputs while keeping the system under control.
5. Create Routines: In case of software, pre and post-processing routines, and in hardware programs, putting rules into the FL Engine.
6. Defuzzification: The firing strength of each rule is determined and logical products of each rule are inferred through techniques like max-min’d, root-sum-squared, max-dot’d etc. before passing them to the defuzzification phase. Defuzzification involves the conversion of the fuzzy data into a crisp output using the Fuzzy Centroid Algorithm.
7. Testing and Evaluation: The objective is to try and try again until the goal is achieved. The rules are changed and new rules may be added to tune the system to achieve the desired performance.
Fuzzy logic has always been a controversial subject. Researchers often argue that it is just another way of expressing probability. This however, is not true. While probability is the mathematical modeling of degree of ignorance and deals with the stochastic uncertainty of an event happening or not, Fuzzy logic is the modeling of degree of semblance which expresses the uncertainty of the clear definition of the event itself. While many argue over the similarity of the two subjects, its pioneer Lotfi, argues that both are different and none is the replacement of the other.
There are a few requirements for a Software Development Kit (SDK) to qualify as a good fuzzy logic SDK. Firstly, it should support all the design phases ranging from design to the implementation phase. Secondly, it should support all the targeted platforms and the various industry standard interfaces like DLL/DDE/OLE. The hard way to do it is to use a programming language and do it all manually which is not only exhaustive and tiring, but every minute change in the design would require rewriting the entire code. Since the time of 8 bit MCUs, dedicated hardware for fuzzy systems has been favored because of the advantages involved like reduced processing time.
Filed Under: Articles