A Fuzzy Logic Controller Using Fuzzy Feedback
This is based on an old web page. I thought I would store it on this blog just for backup. It was an attempt to construct a predictive interface. Since a users actions could not be completely predicted, it seemed to demand an approximation system. BTW, there is a new field called Soft Computing that this type of investigation is related to.
Updates
 June 21, 2015: One of the concepts I was modeling in my project was the notion of contrary Fuzzy evidence. Apparently, this is now an unrelated research topic under the Vague Set fuzzy sets extension. This is also the subject of Intuitionistic Fuzzy Sets. See for example, Vague sets or intuitionistic fuzzy sets for handling vague data: Which one is better
“Type2 fuzzy sets and systems” and the generalized typen, appear to capture the fuzziness of a membership function itself.
For background on Fuzzy Logic:
 Harpreet Singh, Madan M. Gupta, Thomas Meitzler, et al., “RealLife Applications of Fuzzy Logic,” Advances in Fuzzy Systems, vol. 2013, Article ID 581879, 3 pages, 2013. doi:10.1155/2013/581879
 Generalizations of Fuzzy Sets
 “Fuzzy Logic — A Mordern Perspective (1998)“, is very informative though dated.
 The paper that started it all: Fuzzy Sets by L. A. Zadeh
 An interview with Zadeh
 Is there a need for fuzzy logic? A more up to date writing on Fuzzy Logic by Lotfi A. Zadeh.
Table of Contents

Introduction
In February 1992, while watching my daughter learn how to use our home computer, I came up with a new product idea. Hopefully I will post more about that wouldbe product on this site. The following presents the approach I used for its controller.
I could not get over some technical hurdles with the product, so I put it aside until I could get back to it. One thing that I was proud of was learning a little bit of Fuzzy Logic and using it as the controller. I even wrote a graphical simulator in the C++ language; threading was fun stuff. Watching the fuzzy sets behave like analog surfaces or neural EEG waves gave me the idea for the biomimicry aspects.
Yesterday while at a UNISYS class at Burlington, Mass., all of a sudden a thought came to me full blown, I should save each resultant Fuzzy set for each object and add to it instead of resetting it at each sample of the user focusing.
It works! I added fuzzy memory to the prototype and it works beautifully! No jitter except for the GetZone() function which doesn’t use fuzzy memory.
I think this development will allow me to do away with the focal space creation entirely.I also started writing a research paper called Controller Using Fuzzy Memory. I should call it shortterm memory
since the fuzzy rules serves as the long term memories. Thus, there are three “organic” memories, LongTerm, ShortTerm, and Reflective, which correspond to Instinct, Learning, and Reflex.
A Year later in 1996, I dusted off my notes and looked at the Fuzzy Logic Controller (FLC) again, and thought maybe someone else can make use of it, or lead to some other ideas. So, I quickly wrote it up and sent it to a journal for review. The paper aludes to biomimicry, I tried to duplicate how animal systems have both a voluntary and reflex arc (but I never showed how the reflex would override the “voluntary” control output. Perhaps by using weights?).
It was a ginormous rejection! And, reading it now (2006), I would have rejected it too! A little knowledge is dreadful. A snippet of what the reviewer wrote: “It’s hardly clear what’s …. The paper continues without much of an organization & jumps from posterior possibilities (hardly the case) to ANN.”
The reviewer suggested the book: An Introduction to Fuzzy Control by Driankov, Hellendoorn, and Reinfrank. I purchased it recently. Very good book. Whats funny is after reading a little bit of this book, my paper’s main innovation is still valid, as far as I can see.
I make no apologies; I was a computer programmer at the time and not trained as a researcher. I learned enough to get the job done. I read a bunch of stuff and just put it all together.
So, once again I dusted off the notes and exported the paper to HTML. I have not attempted to check if the idea is original or still bad. The contents are unmodified. The diagrams were redone since I lost the digital version. Don’t ask me what the diagrams mean, I vaguely remember.
If I had time I would have liked to see if it could compete with a Kalman filter controller. But, that would have meant learning a lot more, like what “Gaussian white noise with covariance matrix” means. Yeah right.
What is this about?
This section is under construction and was meant as a nontechnical introduction to Fuzzy Logic Control.
A Fuzzy Controller, the ones I was aware of then, and even most simple controllers, sample control variables, and based on the error calculations, produces control outputs. The sampling is performed on a set time period (or triggered by input events). So the controller samples some values, does some calculations, then outputs a control value.
In a car cruise control system, for example, every few milliseconds the speed is checked and the calculation determines how far the speed is from the desired cruise control speed. The output is increasing or lowering the throttle to change the engine speed. The amount of engine speed increase or decrease level is based on the size of the error.
Of course, actual controllers are more complex then this. The important point in terms of this paper is that each “cycle” forgets the previous cycle’s sampling (in simplest cases). Josef Betancourt, last modified 8/15/2007 – 10:03:51 PM
Abstract:
Inefficiencies in the conventional fuzzy logic controller are discussed, and a model to overcome them is presented. Conventional Fuzzy Controllers produce a Fuzzy Set output for each output control variable and defuzzifies these to produce a crisp control variable. Instead of using the fuzzy set output for defuzzification, the presented model uses ShortTerm Memory. This memory is an aggregation of the sets produced at each control cycle. This allows intercycle evidence formation which improves the control processing. Defuzzification of this short term memory more fully uses information generated by the inference engine.
Keywords:
Fuzzy Logic, controller, adaptive control, feedback.
Introduction
Since it seemed to meet all of the requirements, a Fuzzy Logic Controller (FLC) was chosen for use in a new product development. However, the FLC did not perform well. Many attempts to improve the controller did not succeed: alpha cut thresholds were added, the term sets tinkered with, knowledge pools created, and different fuzzy logic operators tested. No doubt there is a combination of FLC parameters and pre and post process filtering that would work; however, such a search seemed daunting.
Finally, by an intuitive leap, a simple modification to the FLC model was found that could make it work. And this solution seemed to be unique and usable in other applications.
Fuzzy Logic Controllers
During a control cycle, a FLC, see figure 1, fuzzifies the output of the controlled process and applies this to a fuzzy logic engine which uses a knowledge base, term sets, and Zadehan logic. An output fuzzy set is then generated and finally defuzzified to produce crisp outputs to supply to the controlled process. During the next control cycle the reinitialized output fuzzy spaces, where the interim fuzzy sets are aggregated, are again reused. The operation of such a controller is well documented in the literature.
Inefficiencies
There is a basic inefficiency in this FLC model; the information generated by the FLC operation is not fully used. First, defuzzification, though necessary, is a contraction of dimensionality, thus information loss [1]. Second, by reinitialization of the output fuzzy space in preparation for the next control cycle, the generated information is not used to effect subsequent cycles. Even in Adaptive FLCs, the exogenous ad hoc processes, such as an adaptation engine or a neural network, that monitors the FLC operating characteristics and modify the parameters or knowledge base, only affect a change after several processor cycles. This information loss is also partially true in feedback FLCs, since after information is fed back, they also operate in a conventional feedforward manner. Third, the evidence formation is intracycle, that is, the contrary effects of rule firings occur only within a control cycle. Contrary evidence from cycle to cycle is not used. For example, if a particular cycle generated the fuzzy output set HIGH THROTTLE with a maximum height of .9, and in the next cycle HIGH THROTTLE now has a maximum height of .2, then that is intercycle contrary evidence in that output space.
Remembering
This information loss and adaptation delay is easily reduced by the use of ShortTerm Memory (STM). As shown in figure 2, a memory space is added to the FLC to store fuzzy sets. In a multiple output system each variable would have such a memory space.
Now, since some information is stored to influence the following cycles, every cycle improves the controller. Furthermore, since Defuzzification is performed on the updated memory and not on the greatly changing reflex fuzzy set, a smoother control surface that rapidly converges to the optimum output control value without overshoot is expected. This smoothing “naturally” resists transient or noisy input.
Forgetting
The method of updating fuzzy memory must be a suitable Aggregation operation that provides the optimum response for the particular control application. Ideally, to allow adaptation this operation should be parameterized, such as a Generalized Mean [2].
In the new product that inspired this FLC model, the aggregation operation used is a simple arithmetic average
Where r_{i} is the i th membership value at the t cycle of the reflexterm fuzzy set and s_{i} , of the shortterm fuzzy set,. Another operation also tested is an exponential smoothing of the membership values
Where a is the smoothing parameter .
Note that when the stored membership value is zero, the current value is fully used. The rationale here is that if there is no contrary evidence, what remains should be fully used.
These aggregation operators properly accumulate evidence, but most importantly, contrary evidence, rules firing with low value, reduce the fuzzy set surfaces. Interpreting the fuzzy sets as Possibility Distributions, this feedback creates, analogously to Bayesian posterior probabilities, posterior possibilities.
Other aggregation operations are possible. For example, since the output of a FLC is usually defuzzified, and normalization is not required, a simple unbounded sum, which acts as strong positive feedback, may be adequate in certain situations. This type of aggregation accumulates all information and is useful in applications that undergo mode changes, choose among options, or are human interacting.
One important concern with any aggregation method is overflow or saturation of the fuzzy memory space. This may be addressed in many ways. For example, a threshold or normalization can be applied to the fuzzy set memory. Another option is to reset the fuzzy memory when the controlled process undergoes distinct mode changes or operations. Lacking such reset criteria, the FLC system can accomplish this through autoadaptive methods.
Adaptation
This FLC model adds to the many FLC adaptation options available. Such as opportunities for the use of new metrics. For example, the reflex fuzzy set output can be defuzzified to produce an internal control value O_{c} _{.} Comparing this to the STM control output, O_{m} , provides metrics that can be used to qualify or change the FLC system: the aggregation operation can be changed to either increase or decrease the smoothing effect, or this can be used in runlength memory reset control.
Similarly, comparing the reflex fuzzy set surface with the STM fuzzy set provides other metrics that can adapt the generation of the reflex fuzzy sets by modifying the input sensitivity, term sets, rule weights, etc. Figure two illustrates a possible schematic for such an adaptive FLC model.
Fuzzy memory can also be viewed as a form of Artificial Neural Network field or layer. Thus, the techniques used in ANN can be applied. Furthermore, since Neural networks sum throughputs while Fuzzy systems sum outputs [3], the aggregation of Reflex output in ShortTerm Memory brings a FLC closer to the operation of a neural network.
Conclusion
The presented FLC model has the ability to accumulate evidence in each cycle for discrete changes of state in a specific new product under development. This is accomplished by the use of a tripartite memory scheme: Reflex, Short, and LongTerm. The Reflex corresponds to the conventional FLC output fuzzy sets, the ShortTerm to the aggregated fuzzy memory space disclosed above, and the LongTerm to the Fuzzy Logic Rule base used in the controller.
The term ‘ReflexTerm Memory’ is an indicator for future use in complex Soft Computing controllers having separate ‘reflex’ control paths that bypass the highlevel knowledge base and inference engine ‘intelligence’. There can even be competing parallel control paths, each using different technologies.
Perhaps the presented model may offer the same advantages in other applications areas. For example, since the updating of the STM is a transcycle evidence accumulation, it may be useful in a multistage decision system. Each goal or solution variable is allocated a fuzzy memory. The decision system updates these in each step or cycle to ultimately produce a crisp score for each.
Another example is an automotive cruise control with automatic intercar safety gap system where evidence for a mode change is accumulated until a certain compatibility level is reached, then the fuzzy memory is reset and the process repeats. Cruising along at 195 mph in the future super highway, the controller should use all the evidence, all the time!
Further research is needed to determine the actual differences, performance, applicability, and advantages of this model compared to both conventional and fuzzy controllers.
References
1. Cox, E., Fuzzy Logic For Business and Industry, Charles River Media, Inc., Rockland, MA., 1995, pg 107.
2. Kosko, B., Neural Networks and Fuzzy Systems, Prentice Hall, Englewood Cliffs, N.J., 1992, pg 29.
3. Klir, G.J., Yuan, B., Fuzzy Sets and Fuzzy Logic: theory and applications, Prentice Hall, Englewood Cliffs, N.J., 1995, pp 8990.
End of original paper: “An Adaptive Controller Using Fuzzy Memory”, Originally written: 19960330T03:13:00Z words: 1406 characters: 8019
Links
1. Cox, E., Fuzzy Logic For Business and Industry, Charles River Media, Inc., Rockland, MA., 1995, pg 107.
2. Kosko, B., Neural Networks and Fuzzy Systems, Prentice Hall, Englewood Cliffs, N.J., 1992, pg 29.
3. Klir, G.J., Yuan, B., Fuzzy Sets and Fuzzy Logic: theory and applications, Prentice Hall, Englewood Cliffs, N.J., 1995, pp 8990.
4. Design Of Fuzzy Controllers, Jan Jantzen, http://www.iau.dtu.dk/~jj/pubs/design.pdf, accessed 20070321
5. Prevention of Load Sway by a Fuzzy Controller http://people.clarkson.edu/~esazonov/neural_fuzzy/loadsway/LoadSway.htm
6. An Introduction to Fuzzy Control by Dimiter. Driankov, Hans. Hellendoom, Michael Reinfrank
7. search: feedback fuzzy control system
11. Introduction to Fuzzy Control by Hans P. Geering, September 1998. Accessed August 16, 2007.
An Adaptive Controller Using Fuzzy Memory
All rights reserved. No part of this document may be reproduced or transmitted in any form by any means, electronic or mechanical, including photocopy, recording, or any information storage and retrieval system, without permission in writing from Josef Betancourt.
Author Josef Betancourt
Originally written: 19960330T03:13:00Z words: 1406 characters: 8019
This work is licensed under a Creative Commons AttributionNoncommercialNo Derivative Works 3.0 License.
Similar Posts:
 Google Now and predictive interfaces
 The arguments for two spaces after a period
 Fuzzy Cognitive Maps in C++
 Declarative Object Graphs: programs as queries
 A Quest For A Personal Dashboard?
2 thoughts on “Predictive Interface using Fuzzy Logic”