Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

CD Discrete Recursive Kalman Corrector (Control Design Toolkit)

LabVIEW Control Design Toolkit 3.0 Help
August 2007

NI Part Number:
370853D-01

»View Product Info

Corrects Kalman state estimates made at the previous time step for a discrete stochastic state-space model.

Refer to Chapter 17, Using Stochastic System Models, of the LabVIEW Control Design Toolkit User Manual for information about using this VI.

Note  This VI uses the CD Verify Noise Model VI to verify that the noise model matrix dimensions are consistent with the stochastic state-space model matrix dimensions.

Details  

Output y(k) specifies measurements made on the Stochastic State-Space Model. You can use the Discrete Stochastic State-Space (Internal) function to simulate the model and obtain this parameter. You also can wire in measurements made from a hardware sensor.
Initialize is TRUE if you want to restart the calculation from any initial values you provide. Initialize is FALSE if you do not want to restart this VI. The default value is FALSE.
Input u(k) specifies the control action this VI applies to the model. If the D matrix of the state-space model is 0, do not wire a value to the Input u(k) parameter. If the D matrix of the State-Space Model is not 0, you must wire a value to the Input u(k) parameter. In this situation, you cannot design a controller u(k) based on the Corrected State Estimate xhat(k|k).
Stochastic State-Space Model specifies a mathematical representation of a stochastic system.
Second-Order Statistics Noise Model specifies a mathematical representation of the noise model of a stochastic state-space model.
State Estimate xhat(0|-1) specifies the initial states from which this VI begins estimating the model states. If you do not specify a value for this parameter, State Estimate xhat(0|-1) is a vector of zeros.
error in describes error conditions that occur before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.
status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.
code is the error or warning code. The default is 0. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source specifies the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.
Estimation Error Covariance P(0|-1) specifies the initial covariance matrix of the estimation error. If you do not specify a value for this parameter, Initial Estimation Error Covariance P(0|-1) is the identity matrix. Initial Estimation Error Covariance P(0|-1) must be symmetric and positive semi-definite such that P (0|-1) = PT (0|–1) ≥ 0
State Estimate xhat(k|k-1) specifies the state estimate this VI calculated at the previous time step k – 1.
Estimation Error Covariance P(k|k-1) specifies the covariance of the estimation error associated with the State Estimate xhat(k|k-1).
Corrected State Estimate xhat(k|k) returns the corrected Kalman state estimate at time k, given all measurements up to and including time k. The length of this vector is equal to the number of model states.
Estimated Output yhat(k) returns the estimated model output at time k.
Kalman Filter Gain M(k) returns the Kalman filtered gain matrix this VI uses to calculate the Corrected State Estimate xhat(k|k).
Filter Error Covariance P(k|k) returns the covariance matrix of the estimation error associated with the Corrected State Estimate xhat(k|k).
error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out front panel indicator and select Explain Error from the shortcut menu for more information about the error.
status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.
code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning.

CD Discrete Recursive Kalman Corrector Details

This VI uses the following equations to calculate the outputs.

Corrected State Estimate xhat(k|k) = State Estimate xhat(k|k-1) + Kalman Filter Gain M(k) · [Output y(k)Estimated Output yhat(k)]

Estimated Output yhat(k) = C · State Estimate xhat(k|k-1) + D · Input u(k)

Kalman Filter Gain M(k) = Estimation Error Covariance P(k|k-1) · CT(k) · [C(k) · Estimation Error Covariance P(k|k-1) · CT(k) + H(k)Q(k)HT(k) + H(k)N(k) + NT(k)HT(k) + R(k)]–1

Filter Error Covariance P(k|k) = Estimation Error Covariance P(k|k-1)Kalman Filter Gain M(k) · C(k) · Estimation Error Covariance P(k|k-1)

This VI adapts to changes in the Stochastic State-Space Model and the Second-Order Statistics Noise Model as long as the model dimensions do not change. Therefore, you can use this VI with linear time-invariant (LTV) models.

This VI uses the Second-Order Statistics Noise Model to obtain the values of E{w(k)}, E{v(k)}, Q(k), R(k), and N(k). The following equations define these terms:

whereδkl is the Kronecker delta function. The following equations defines this function: δkl = 1 when k = l; δkl = 0 when kl.
w(k) is the process noise vector.
v(k) is the measurement noise vector.
Q(k) is the covariance matrix of w(k).
R(k) is the covariance matrix of v(k).
N(k) is the cross-covariance matrix between w(k) and v(k). If these noise vectors are uncorrelated, N(k) is a matrix of zeros.
E{} denotes the expected value or the mean of the enclosed term(s).

The noise covariance matrices must satisfy the following conditions:

Q(k) = QT(k) ≥ 0

R(k) = RT(k) ≥ 0

This VI assumes these noise vectors are temporally uncorrelated between time steps. This VI also assumes the State Estimate xhat(0|–1) is uncorrelated with the noise vectors. If the noise vectors are Gaussian-distributed, this VI is an optimal minimum mean square error (MMSE) estimator. However, if these vectors are not Gaussian-distributed, this VI is an optimal affine MMSE estimator.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit