More on Hans' model; do we have a problem here?

[From Bill Powers (950601.1120 MDT)]

Hans Blom (950601) --

I think we can agree that the Kalman filter approach works impressively
well for a control system that relies on an internal world-model. That
kind of control system is of interest because it can bridge brief
moments when the perceptual input is cut off, or becomes very uncertain
for any reason. The inability to handle "unmodelled dynamics" is a
drawback, but there are situations in which that is not the primary
consideration (i.e., walking through a familiar room in the dark, when
nobody has moved the furniture).

I still disagree with you about some of your generalizations, but before
getting into that, I want to ask about another possible application of
the Kalman filter method.

Consider a simple negative feedback control system with a Kalman filter
system added:

                  ref signal
                       > error signal
           ------>[comparator]->-----------------------
          > > >
          > > [Kalman filter]
          > > >
          > > >
  [input function] [output function] <---------
          > >
     controlled output
     variable variable
          > > system
- - - -| - - - - - - - - |- - - - - - - -
          > > environment
           <--[feedback function]--
          >
          >
     disturbing
      variable

Now, instead of acting to reduce the difference between an internal
model's output and the value of a controlled variable, the Kalman
process would be used to reduce the error signal of the control system
(by altering parameters in the output function).

The basic output function would be similar in origin to the model used
in your program: however, it would be of a form that generally resembles
the complex complement or inverse of the environmental feedback
function, rather than that function itself. The adjustable parameters
would be changed in exactly the same way as for your model.

This kind of adaptive model would not have the ability to work without
continuous feedback, but there are many human control systems that will
not work properly without feedback, either. These systems still need to
be able to adapt their parameters to the properties of the feedback
function that lies between output and input.

This approach has the great advantage that it is not necessary to know
what disturbances are going to occur. What is learned is not the
temporal pattern of a specific disturbing variable, but the form of a
function that is the inverse of the form of the feedback function. Those
forms are independent of the signals they happen to experience at their
inputs or produce at their outputs. If the system is exposed to the
maximum range of disturbance frequencies that is likely to occur, the
system, after adaptation, will then be able to handle disturbances of
any temporal form, without prior knowledge of what they will be.

I am sure this application of Kalman filtering must have occurred to
someone already. Any comments?

···

------------------------------------------
You say

     a "controller" is a (good) controller only in particular
     environments. Or, equivalently, whether a system is a (good) con-
     troller depends on the environment in which it finds itself.

This is true, but some controllers are able to work without change in a
wider range of environments than others.

Consider the most elementary "controller" of all, the open-loop system:

                                         (environment)
    ref signal ----[transfer function] ------------------> result

If the properties of the environment are well-enough known, including
effects of disturbances and forms of functions that lie in the
environment between the transfer function and the result, and if those
properties are taken into account in the transfer function, this system
can in principle control the result perfectly. However, the slightest
change in any aspect of the environment or in the transfer function will
directly affect the result, making it different from the desired result;
control will disappear.

Now consider an operational amplifier as an element of an analog
computer:

                               ---[feedback element] ---
                              > >
                              > >\ |
   input ---[series element] --->|- \___________________v____ output
                             --->|+ /
                            > >/
                           ref

The operational amplifier is the triangle; it amplifies the difference
in voltage between its positive and negative input terminals by a factor
of 20,000 to 100,000 (or more). Its frequency response is ideally a
simple 3 db per octave rolloff. The op amp combines a perceptual input
(negative terminal), a reference input (positive terminal), a comparator
(the differential amplifier at its input) and an output function (the
main amplifier where most of the gain occurs). The feedback element is
analogous to the feedback function in the first diagram; the series
input element lies between the disturbance (here called the input) and
the controlled variable that is also affected by the feedback
connection.

The basic principle is that the op amp maintains the voltage at its
negative input terminal equal to the voltage at its positive input
terminal (the reference voltage), by means of feedback from the output
through the feedback element to the negative input terminal. The voltage
at the negative input terminal is also disturbed by effects from the
input passed through the series element.

Without any change in the operational amplifier itself, this arrangement
can compute an enormous range of input-output functions. What is
computed depends only on the nature of the passive series and feedback
elements. If those elements are resistors, R1 and R2 respectively, the
output voltage is simply (R2/R1)*(input voltage). If the series element
is a resistor with a value of R ohms and the feedback element is a
capacitor with a value of C farads, the output is integral(input)/(R*C).
If there is a resistor in parallel with the output element, a leaky
integrator results. If a resistor is put in series with the capacitor,
the output becomes the integral of the input plus an added term
proportional to the input. The series and feedback elements can be of
many forms, including diodes and multipliers and inductors as well as
resistor-capacitor networks.

The computing abilities of the analog computing circuit are beside the
point here. The real point is that this "control system" manages to keep
its controlled variable, the voltage at its negative input, precisely
matching the voltage at the reference input in all these cases, with no
adaptation or other adjustment to compensate for the radical changes in
the series and feedback elements. And it does this with absolutely no
advance information about what voltage waveform will be applied to the
input. In fact, that is the point of this analog computing component: it
will compute a particular function of ANY input waveform, the value of
the function being continuously represented as its output voltage.

So we have two points in the spectrum of control. The open-loop
"controller" depends on the environment and any disturbances remaining
exactly the same forever. The operational amplifier can work essentially
perfectly despite a huge range of changes both in the passive properties
of its environment and in the waveforms of disturbances applied to it.
Even if the amplification factor of the op amp itself changes, the
performance will remain essentially the same over a large range of
amplifications, even 10:1. Performance is dictated almost entirely by
the properties of the passive series and feedback elements.

The adaptive controller should take us even further toward tolerance of
changes in the environment. In an operational amplifier, there are
certain combinations of passive elements that can result in instability,
due to phase changes with frequency. By adding a detector that can see
when instability is occurring, and a suitable computational system that
can change the parameters of the op amp, we could adjust the op amp to
maintain stability over a much wider range of passive element
properties. This would give us the greatest independence of the
enviroment of all these types of control systems.
-------------------------------
Obviously, a non-adaptive high-gain negative feedback control system
already has a large degree of independence from environmental properties
and disturbances. This is why, when I look at your design for an
adaptive control system, there are some aspects of the design that look
like a step backward. In particular, the need to have an explicit model
of the disturbance seems like a drastic loss of generality.

I said

If d is a function of time, d(t), then we must build d(t) into the
controller and time it so it is synchronized with the external d(t)
acting on qi.

and you said
     You got it. That is part of what in the demo is called
     "prediction". But prediction is possible only in so far as we can
     build a model of d. The unpredictable part of d cannot be modelled
     and cannot be controlled.

What you say is true of a control system designed exactly as you
designed yours, using exactly your strategy for computing u. But it is
not true of negative feedback control systems in general. Your system
suffers one of the primary defects of the open-loop "controller." If the
form of the disturbance changes, control is immediately lost. The system
(if it is equipped to do so) must redetermine the new form of the
disturbance and get its internal model of the disturbance re-
synchronized with the real disturbance. And if, while it was doing so,
the form of the disturbance changed again, it would still not be able to
control. This is why I call that aspect of your model a step backward:
we have lost independence from the form of the disturbing waveform.

Your claim that "the unpredictable part of d cannot be modelled and
cannot be controlled" is true only for a control system designed the way
yours was designed. The same statement, made of a negative feedback
control system, is simply false. A negative feedback control system does
not need ANY information about the waveforms of future disturbances. It
contains no model of the disturbance that is synchronized with the real
disturbance. It does not need one.
---------------------------------------

So we might easily come to the conclusion that a control system
can't resist disturbances that are not represented in the equation
of the control system. This seems to be your claim, Hans, and what
your professor from long ago taught you.

     Yes. It correlates with the everyday observation that one cannot
     use tools that one is not familiar with -- that one doesn't even
     recognize as tools.

This is a false analogy. In fact, Hans, these statements make me wonder
just how much you DO understand about control systems.

That is a pretty drastic problem, and I don't want to make too much of
it without checking what you actually mean. Are you really talking about
control systems IN GENERAL, or simply about the specific design that you
presented in your program? I agree that your design DOES require an
internal model of d(t) in order to oppose disturbances, so when you say
that "the unpredictable part of d cannot be modelled and cannot be
controlled" ABOUT YOUR MODEL, I can accept that. That feature is a major
drawback of your model. But if you believe that there is NO kind of
control system that can resist disturbances without such an explicit
model of them, I wouldn't be able to help wondering if you have ever
actually understood negative feedback control.

Help me out here.
-----------------------------------------------------------------------
Best,

Bill P.

<[Bill Leach 950602.00:00 U.S. Eastern Time Zone]

[From Bill Powers (950601.1120 MDT)]

This will probably consist mostly of irrelevent comments except that I
hope to head off a few challanges to some of what Bill stated.

Your Kalman filter question almost startled me. I was thinking along the
line you suggested as well as possible use in perceptual input paths
(probably at rather high levels).

Kalman filtering in a classic controller.

I doubt it but only because of the computing horsepower required to drive
the filter (or the nightmare of designing an analog version). In "real
world" engineered control systems design this sort of controller is used
where "absurd" degrees of accuracy are required. This is pretty much
"state of the art", "push the limits" type stuff.

Today's typical Op amp gains are a couple of orders of magnitude greater
(there are some 500Mhz+ GBW that are still "off the shelf" units).

The real point is that this "control system" manages to keep its
controlled variable, the voltage at its negative input, precisely
matching the voltage at the reference input in all these cases, with no
adaptation or other adjustment to compensate for the radical changes in
the series and feedback elements.

To the "tune" of the full gain bandwidth product of the op amp and of
course for applications where load changes occur at the output
(disturbances) then the "computing" unit is usually followed by a "Unity
Gain" Op Amp circuit which will typically handle a 1E4 load change or
better.

The operational amplifier can work essentially perfectly despite a huge
range of changes both in the passive properties of its environment and
in the waveforms of disturbances applied to it.

Feel free to add that with proper design it will resist changes or drift
in its own parameters from affecting the transfer function. In most real
world mechanical control applications an Op Amp can loose an order of
magnitude or more of its' gain and still function without observable
change (though admittedly partial loss of gain is unusual).

In a carefully designed circuit using several amps to derive a log
function for example the performance can be held to instrumentation
accuracy over 10 DECADES of gain (General Atomic designed such a unit).
Though admittedly the response speed is nothing to "write home about" for
an electronic circuit (with less than 10 decade dynamic range) it is
still considerably faster than any human control system.

... due to phase changes with frequency. By adding a detector that can
see when instability is occurring, and a suitable computational system
that can change the parameters of the op amp, we could adjust the op amp
to maintain stability over a much wider range of passive element
properties. This would give us the greatest independence of the ...

Actually this effect is pretty much accomplished with various types of
active feedback circuits. Circuits that compensate the feedback path for
temperature changes and provide signals to modify input offset loading
(resistive and reactive).

We probably are quite fortunate that digital circuits are so bloody noisey
else there likely would be no advances in analog circuit design!

What you say is true of a control system designed exactly as you
designed yours, using exactly your strategy for computing u. But it is
not true of negative feedback control systems in general. Your system
suffers one of the primary defects of the open-loop "controller." ...

I believe that the adaptation to disturbance can be considerably better
than is demonstrated by Hans model. Particularly when viewed from a
standpoint of "noise not an issue".

-bill