# Feedback in State Models

Developing Models for Kalman Filters

Some systems, though linear and stable, are difficult to keep within a safe and normal operating range. Other systems are inherently unstable, and without continuous action to keep them under control, the state tends to explode to infinity.  Feedback control is often used to tame poorly behaved systems like these, to keep the state stable and bounded. But when this happens, the system responses are a combination of the system AND its applied controls.

There are two things that you can do when you have feedback present.

1. Explicitly and separately represent the feedback terms.
2. Fold the effects of the feedback into the model.

## Extended model

Suppose you start with a known model in the usual discrete state form, as we discussed in the preceding installment.

$\begin{array}{c}{x}^{k+1}=\phantom{\rule{1em}{0ex}}A·{x}^{k}+B·{u}^{k}\\ {y}^{k}=\phantom{\rule{1em}{0ex}}C·{x}^{k}\end{array}$

You can use one or more of the observed output values for producing feedback. Since we are considering linear systems, we will propose a feedback that is some linear combination of the output variables, representable using matrix notation.

${f}^{k}=\phantom{\rule{1em}{0ex}}F·{y}^{k}$

This can now be used as the input `uk.` Actually, since linear systems are additive, we can use the feedback in addition to the existing input. The new feedback input will couple into the state equations by increasing or decreasing the previous values of the input variables, so we can show the effects as being coupled into the system through the `B` matrix, just like any other inputs. We show a minus sign, since a stabilizing feedback is typically negative.

${x}^{k+1}=\phantom{\rule{1em}{0ex}}A·{x}^{k}+B·{u}^{k}-B·{f}^{k}$

## Model with feedback folded in

If you need to make frequent adjustments to feedback gains, the explicit form above is probably what you want. But sometimes a fixed stabilizing feedback is always present, and it is advantageous to make the model as simple as possible using some mathematical substitutions to consolidate.

${x}^{k+1}=\phantom{\rule{1em}{0ex}}A·{x}^{k}+B·{u}^{k}-B·F·C·{x}^{k}$ ${x}^{k+1}=\phantom{\rule{1em}{0ex}}\left(A-B·F·C\right)·{x}^{k}+B·{u}^{k}$

Now define the matrix `G`.

$\left(A-B·F·C\right)\phantom{\rule{1em}{0ex}}⇔\phantom{\rule{1em}{0ex}}G$

When this notation is substituted into the state equation system, it is clear that the result is a modified state equation system, the same as the original form but with a modified state transition matrix.

$\begin{array}{c}{x}^{k+1}=\phantom{\rule{1em}{0ex}}G·{x}^{k}+B·{u}^{k}\\ {y}^{k}=\phantom{\rule{1em}{0ex}}C·{x}^{k}\end{array}$

What can be done linearly can be undone linearly. If you know what the feedback is, and you develop a model that incorporates the feedback, you can "unfold" the feedback effects to recover the original `A` matrix.

## Coming next

This installment found that feedback transformed the behavior of the state transition equations but did not change the structure of the dynamic state transition equations. In future installments, we will consider other useful transformations, but we have enough information now to begin thinking about the practical side of evaluating a working model.

Footnotes:

 Actual explosions typically require a nonlinear model. Even if pieces don't fly, assumptions of linearity often fail when the system state ranges too far, encountering bounds that the linear model does not cover.

Contents of the "Developing Models for Kalman Filters" section of the ridgerat-tech.us website, including this page, are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License unless otherwise specifically noted. For complete information about the terms of this license, see http://creativecommons.org/licenses/by-sa/4.0/. The license allows usage and derivative works for individual or commercial purposes under certain restrictions. For permissions beyond the scope of this license, see the contact information page for this site.