# fuzzy control etc.

[From Bill Powers (951111.0630 MST)]

Shannon Williams (951110) --

How does a system of loops work except as a network of fuzzy-logic?
Each loop maintains its own reference level- or subset of reality.
When its reference level is disturbed, the loop responds. This
sounds very fuzzy-logic-ish to me.

...

Or maybe we need a third choice? We need something as controlled
as digital logic, but as instantaneous/volatile(?) as analog
control.

The problem with fuzzy logic is that (as I understand it) it tries to
approximate continuous relationships through using probability
distributions. There has to be a random variable in order to sample the
distribution on any given iteration. The result of this is to substitute
for a smooth continuous function a noise envelope that follows the same
basic relationship but with a large amount of superimposed random
variation. This superimposed noise is one of the factors that limits the
possible accuracy and stability of fuzzy-logic control systems.

The other factor is that each relationship involved in the control
system has to be represented by different rules over various regions of
the range of variation of a variable, both as to its magnitude and its
rate of change. Thus in a (simulated) fuzzy-logic controller I saw for
balancing an inverted pendulum, you had conditions like small-amount-
left-of-center, large-amount-left-of-center, left-of-center-and-moving
left, left-of-center-and-moving-right, and so on and so on -- I believe
there were more than 20 rules altogether, all with probability
distributions. All this to accomplish a control task that could be done
with half a dozen lines of code representing continuous relationships,
and done a hell of a lot better. The performance of this model was very
poor: slow, wobbly, and greatly upset by disturbances.

An analog control system designed to do the same thing, which beginning
control system engineers are often given as an exercise, will bring the
inverted pendulum to its vertical position in one snappy move and hold
it there. A more advanced exercise is to simulate (or build) a small
cart with wheels run by electric motors, which can balance the pendulum
by moving its lower end the same way a person balances a broomstick.
What's more, this system can bring the position of the pendulum to any
designated reference position above the track by automatically moving
the cart to cause the pendulum to lean, then just before the required
position, moving the cart ahead to decelerate the pendulum to a stop.
This requires a little more code, but not 1% of the amount that would be
needed for all the fuzzy-logic rules to do the same thing but much
worse.

Fuzzy-logic controllers are an attempt to combine control of logical
variables with control of analog variables. The result is that neither
is done very well. A far better approach is to use a two-level control
system: analog control for analog variables, and logical control for
logical variables. An example would be a cart balancing an inverted
pendulum at any position along a scale, with a logical control system
selecting _which_ position to use as a reference position. A logical
perception might be "(pendulum at third mark AND red light on) XOR
(pendulum at 12th mark AND green light on) OR pendulum at zero mark."
The reference condition for this perception is TRUE. The error would be
corrected by selecting a reference position for the pendulum, and the
analog systems would then bring the actual pendulum position swiftly and
accurately to the reference position without any logical calculations.
If the red light is on, the pendulum is given a reference signal of 3;
if the green light is on, a reference signal of 12; if neither light is
on, a reference signal of 0. If both are on, the designer has to go back
to the drawing board because there is an undefined condition. If you set
the reference condition to FALSE, the pendulum will be brought to some
indefinite position (I haven't really worked all this out, but you get
the idea).

I have a hunch that you're not used to working with systems in which the
variables are continuous (real-number domain) and the functions that
relate them are also continuous (continuous physical relationships). Is
that so?

You are going to build the hundreds of little control loops
required for the analog control of your Little Man? These control
loops are what occur in nature, but it does not mean that we need
to recreate them.

Bill Leach gave the answer to this. For the arm control system, we
assume that the control systems for one muscle can be lumped into groups
that perform the same function in parallel, redundantly, and represent
them as a single equivalent control system controlling equivalent
composite variables. For a whole-body model, that would still leave us
with about 600 to 800 first-level control systems. That's no big
problem; each control system is so simple that we could probably do the
calculations for all 800, on a single iteration, in less than ten
milliseconds on a 486-33 -- in floating point.

Here is the code for a typical control system in the Little Man Version
2 program:

o = o + (g*(r - p) - o)/s, where

o = output signal
r = reference signal
p = perceptual signal
g = gain
s = slowing factor

You can see how we can compute a lot of these in a short time and still
maintain an iteration time of 1/60 second.

The control loops need to be able to act on and react to each other
in real time. The only reason you would need analogue control is
so that actions and reactions can be immediate. Why can't a
dedicated digital controller react quickly enough to simulate a
number of small loops? You have to admit, it is much easier to
make a digital loop than an analogue one.

No, the reason we need analog control (or a digital approximation of it,
which is what we use) is that analog control systems work differently
from truly digital ones. Digital control systems work with variables
that have only two values. Variables in analog systems are continuously
variable.

When you find a way to cause control loops to spawn more control
loops, you will have a process for learning. Once you have a
process for learning, you will have AI. (I think).

If you had a way to spawn a _different_ process from the original, and
if you could find a background method that would make sure the new
process was different in just the way needed to improve control, maybe
so. But I think perhaps this proposition needs to be thought about a
little more.

···

-----------------------------
I work at a PC. And most of my work experience is digital hardware
design. I have only been programming for the last couple of years.

Ah, that makes you less threatening. Can you work in Turbo Pascal? Can
you get, or do you have, version 7.0? Actually, we haven't been using
objects and any version from 3.0 up should work with the programs we've
been writing.

Can you browse the Web? If so, you can download a lot of programs that
again) and I'll send a couple of disks to you.

Honeymoon's over.

??? I must have blinked. I missed it.

Jeez, luvvie, how much foreplay do you expect from an old geezer?
-----------------------------------------------------------------------
Best to all,

Bill P.

[Martin Taylor 951115 11:00]

Shannon Williams (951110)

Each loop maintains its own reference level- or subset of reality.
When its reference level is disturbed, the loop responds. This
sounds very fuzzy-logic-ish to me.

Bill Powers (951111.0630 MST)
The problem with fuzzy logic is that (as I understand it) it tries to
approximate continuous relationships through using probability
distributions.

This is a common misunderstanding about fuzzy logic. Normally I wouldn't
bother to comment, but it seems a recurrent issue, so here goes.

Fuzziness has only a passing connection with probability.

If someone is 6' 2" (about 187cm, if my translation is right) we might
describe him as "tall" (or her as "very tall"). We might describe him
as "a bit above average height," or even in some contexts as "very tall."
These are fuzzy categories, in which this person has some "membership."
His membership value is high for the category "tall", moderate for the
category "a bit above average", low for "very tall" and near zero for "short"
(unless the context is basketball players or Watusi). There is no
probability associated with the question of whether this person is "tall."
The idea of "membership" could be paraphrased as "how appropriate would
this be as a description of the observation," and it would not be very
appropriate in most contexts to describe a 6'2" person as short.

Thus in a (simulated) fuzzy-logic controller I saw for
balancing an inverted pendulum, you had conditions like small-amount-
left-of-center, large-amount-left-of-center, left-of-center-and-moving
left, left-of-center-and-moving-right, and so on and so on -- I believe
there were more than 20 rules altogether, all with probability
distributions.

I think that this passage would be correct if, and only if, you substitute
"membership values" for "probability distributions." Not having seen the
actual controller, I can't say for sure, but it sounds like the usual kind of
fuzzy controller. If the rule for "small-amount-left-of-centre" is, say,
"move left at 5 cm/sec", the rule for "large-amount-left-of-centre"
is "move left at 15 cm/sec", and the rule for "on-centre" is "do nothing,"
then the actual move that is used will be proportionate to the membership
of the observation in the various classes. Let's say that it the
observation is moderately left of centre, which translates into a membership
of 0.8 in "small-amount-left-of-centre", 0.5 in "large-amount-left-of-centre"
and 0.1 in "on-centre" , then the action would be to move at
0.8*5 + 0.5*15 +0.1*0 cm/sec (or something like that--I don't know the
algorithms used). It has nothing to do with the probability that the
observation is large, small or zero left-of-centre. The observation is
reasonably precise, but the rules are fuzzy.

I'm not sure how Shannon related the multiple control loops of a hierarchy
to fuzzy logic, but she may have been thinking of each of these rules as
corresponding to a single ECUs, with all of the individual ECUs
acting in parallel. We have discussed this before, talking about coarse
coding of observations. Coarse-coding is related to fuzzy coding, in a way.
There are overlapping categories, and the coding is both refined and robust
against loss of some category observation. PCT normally doesn't worry
and properly reorganized system, but it might have implications for the
process of reorganization (for example, it might greatly reduce the transients
involved in flipping the sign of a connection). Generally speaking, things
happen more smoothly in a fuzzy or coarse-coded system than they do in
an orthogonally organized system (which includes a system of discrete
categories).

Anyway, that's getting a bit off topic. My intent was simply to point out
that fuzziness and probability are unrelated concepts, and that arguments
related to probability are seldom applicable to fuzzy systems, except by
pure coincidence.

Martin

PS. I'm still 100 messages behind in my mail reading, from what came in over
the long weekend. I'm away for Thursday-Sunday, so expect my responses to
anything to be quite a bit delayed.