This is documentation for an obsolete product.
Current products and services

 Documentation /  Control Systems Professional /  Optimal Control Systems Design /

Discrete Estimator by Emulation of Continuous DesignOptimal Controller

10.7 Kalman Estimator

Once the gain matrix for the Kalman estimator has been found, the estimator can be constructed as a state-space object using KalmanEstimator. The block diagram of the device is shown in Figures 10.4 and 10.5 for continuous and discrete cases, respectively. Notice that the estimator outputs the estimates for both output and state variables of the system, and therefore can be used either as an estimator per se (for example, to form a controller, as described in the following section) or as a filter (see the example later in this section).

Figure 10.4. Continuous Kalman estimator.

Figure 10.5. Discrete Kalman estimator.

Kalman estimator design.

Consider a two-input, two-output system.



Let the estimator gain matrix be symbolic.

In[60]:=ll = {{l}};

This finds the state-space representation for the Kalman estimator assuming that the first output of the system is the sensor output and only the first of the inputs is deterministic. The result agrees with the block diagram in Figure 10.4.



Now we create another system that has the same state-space matrices as the pervious one, but is in the discrete-time domain.



KalmanEstimator recognizes the discrete-time data object and, consequently, computes the discrete-time estimator. The result satisfies the block diagram in Figure 10.5.



Because KalmanEstimator provides estimates for output signals, too, it can be used as a Kalman filter (Figure 10.6). In the rest of this section, we design and try out the Kalman filter, which extracts the useful signal from additive Gaussian noise that masks the angular measurements for the antenna servomechanism (see Section 10.5).

Figure 10.6. Kalman filter connected to a system.

This is again our antenna system.



Recall that the variance of the process noise is q, and the variance of the measurement noise is r. We now make the measurement noise far more intense and will try to filter it out with the Kalman filter.


This is the estimator gain matrix.



Notice that because the process noise was made relatively small and the measurement noise was relatively large compared with the noise in the example in Section 10.5, the relatively smaller gains in the Kalman estimator were achieved. Consequently, the Kalman filter will rely more on re-creating the output signal from the deterministic input using the known system dynamics than on actually processing the noisy sensor output, which is the optimal strategy for noisy measurements.

This is a new object, antenna1, that incorporates another stochastic input through which the measurement noise adds directly to the output. This is done by using the parallel connection with no input connected. The expanded system has three inputs and one output.



This finds the Kalman estimator. Note that only the first output of the estimator gives the filtered output of the system (the rest of the outputs give estimates for the state vector; see Figure 10.4).



This picks the subsystem we are currently interested in. It contains all the inputs and the first output of the estimator.



Then, we connect the expanded system antenna1 and the Kalman filter according to the diagram in Figure 10.7. First we connect the inputs. In the figure, the inputs and outputs are numbered as they appear after this stage.



Figure 10.7. Kalman filter connection example.

Finally, we close the feedback loop by connecting the first output of the preceding system with its fourth input (which actually is the first input of the filter). In the composite, the first output corresponds to the output of the system and the second one to the filtered output.



To create the normally distributed noise, we will load this standard package.


Let the length of our simulation sequences be n.


This creates the process noise vector that has the Gaussian distribution with zero mean and standard deviation as required.


This is the measurement noise vector.


This is the sinusoidal input signal.


We intend to supply no external signal to the summing input . This prepares a dummy zero signal for this input.


This is where the simulation is performed. The result is a list of output vectors.


We wish to see how the filter suppresses the measurement noise added to the system output signal y1. The "original" signal (before the addition of noise v) is denoted as y10.


This plots the signals. We can see that the Kalman filter has quite successfully restored the original signal from the noise.


Discrete Estimator by Emulation of Continuous DesignOptimal Controller