baden...
I am not trying to discourage your learning of Fuzzy Logic. As I said before, I am a great proponent for Fuzzy Logic. Learn it! It's great stuff!
For many, your idea is an exercise in futility. Many wonder what it has to do with PLC's. Others think there are more practical ways to attain PID tuning.
I see this as a GREAT exercise in Engineering! Engineering is NOT ONLY about finding the way to employ some idea cheaply and effectively. It is ALSO about DEVELOPMENT!
In the world of Magic and Wonder...
"What if..." is not as
powerful as
"Open, Sesame!"
However, I feel...
"What if..." is definitely more
magical than
"Open, Sesame!"
A very interesting aspect of this exercise is that while you are trying to figure out how to get your code to "learn", YOU are trying to figure out how to "teach" it to learn!
That, of course, is the problem that all the guys at MIT are experiencing! Some of the fundamental questions are...
- What is "Learning"?
- What does it mean "to Learn"?
- What makes anything "Capable of Learning"?
- How does anything "Learn"?
- What is "Effective Learning"?
- What is "Teaching"?
- What does it mean "to Teach"?
- What makes anything "Capable of Teaching"?
- How does anything "Teach"?
- What is "Effective Teaching"?
Sure, we can come up with some "answers" to these questions. But, do those answers contribute to the solution of the problem? I think, not.
The answers to those questions are intuitive to us. Yet, we CAN NOT VERBALIZE those answers in a manner that contributes to the solution! We can only demonstrate!
Q.E.D. - Quod Erat Demonstrandum! (Something like, "That which is proven to be so by demonstration".)
So... Fuzzy Logic...
An interesting thing about Fuzzy is that, of all of the logic-tools out there (Flowcharts, K-Maps, State-Diagrams, etc, etc), Fuzzy is the most Human-like.
While Flowcharts, K-Maps, State-Diagrams, etc, examine conditions in a Black-White manner, Fuzzy can see EVERY** shade of gray in between (**subject to resolution limitations).
Fuzzy
can deal with problems in a manner very similar to how Humans deal with problems.
The basis of Fuzzy Logic is the Rule Structure. As long as there is an adequate set of rules for a particular situation, then the subject can make a "Fuzzy-evaluation" followed by a "Fuzzy-decision".
Here's another interesting point...
The "Fuzzy-decision" can result in what we recognize as a Black/White Response (as in "$hit, or get off the pot!") or it can result in a response that is as gray as any of the examined conditions (I'm only 20-feet away from that brick wall, and my speed is 50-Mph... so I should probably step on the brakes quite a bit harder!).
Notice that a Black/White Response ("YES") is implied in the second example.
Fuzzy Logic produces a "Vectored Response". That is, Direction and Magnitude.
|<--------------|-------------|------------|---------------->|
100%-NO 50%-NO 0% 50%-YES 100%-YES
.
We would recognize the 100%-NO and the 100%-YES as being Black and White. This also allows a response of... "Yeah, sorta." This might be 50%-YES. It's a "YES", but not a very strong YES. Much like the responses that we come up with, everyday, in our dealings with day-to-day activities.
This scale is used to represent the "weight" of the Input conditions as well as the "weight" of the resulting Output condition. The easiest way to visualize this is with an Analog Input and Analog Output.
OK, so that provides a very general description of the Input & Output conditions. Notice, I did not say RELATIONSHIP. The Relationships are determined by the RULES.
In a
typical Fuzzy-System, the Rules are hard-coded. The programmer needs to know all of the situations being controlled and the operational extents of those situations. Knowing that information, the programmer can then design the Rules to produce reasoned results.
Since the Rules are hard-coded, the response will always be the same for a given set of Input conditions (this might, or might not, include feed-back... that depends on how the code was designed.) In this scheme, the Rules don't "Learn". They simply respond as they were designed.
In terms of solving the problem, employing Fuzzy Logic (or any logic),
at this point, is like taking the test
before studying for it.
There are some questions that need to be answered...
Q: Do you want the subject to "learn" how to handle a specific task, in all its KNOWN variations?
A: That can be accomplished using plain Fuzzy.
Q: Do you want the subject to be able to "learn" how to handle ABNORMAL variations that come along? That is, Do you want the subject to be able to find ways around peculiar, unexpected problems as they occur?
A: This is the Holy Grail!
I've seen some attempts at making a C3PO-type droid. These are more impressive for their visible (hardware) attributes than their "intellectual" prowess. In this case, they have a hunk of hardware with many capabilities, but the hardware has no (or very little) impetus to use those capabilities... at least, not yet.
As you mentioned, there is this problem of VOLUME.
How much Historical data is necessary?
How do you "filter" that data?
How do you develop "common sense" out of that data?
I've also seen where engineers are trying to "teach" a mechanical mouse to negotiate a maze. Once the mouse figures out how one maze is layed out they put the mouse in another maze. Of course the mouse immediately tries to use the path it learned in the previous maze. And, of course, that doesn't work.
The maze patterns are NOT random, at least, not yet. The first several mazes all have the same pattern at the begining. It repeatedly starts with what it learned. This continues until the maze is changed. The maze changes only as the mouse gets closer to the target. The continued success at the beginning of the maze instills a "sense of confidence" in the mouse.
Meanwhile, the mouse is "building a map". At some point, the Left/Right decision is determined by the mouses' interpretation of the map. That is, in some situations, when the mouse gets to an unexplored area of the maze, the mouse "knows" that turning this-way or that-way will lead to a dead-end... simply by referring to the recorded "geography" - the map.
This brings up the following point...
The mouse "learns" the extents, that is, the limits, of the maze through exploration. It can only "learn" the FULL extent of the maze if it explores, damned near, the entire maze. That does not necessarily require that the mouse explore all of the inner-recesses.
Likewise...
Your Fuzzy-System has to be able to "explore". BUT, and this is a Big But, you sure don't want the Fuzzy-System exceeding the Physical Limitations of the controlled system. So... how do you accomplish that?
I gotta stop before I exceed the Character-Count Limit.