CD Continuous Recursive Kalman Filter Function

Simulation VI and Function

CD Continuous Recursive Kalman Filter Function

Owning Palette: Continuous Linear Systems Functions

Installed With: Control Design and Simulation Module

Implements a Kalman filter for a continuous linear time-invariant (LTI) or linear time-variant (LTV) stochastic state-space model. This function calculates the Kalman filtered state estimates and outputs at time t.

Details  

Dialog Box Options
Block Diagram Inputs
Block Diagram Outputs
 Place on the block diagram  Find on the Functions palette

Dialog Box Options

ParameterDescription
ParametersLists all the parameters associated with this function. Select a parameter from this list to configure the parameter. When you select a parameter, the parameter and its associated Parameter source control appear in the Parameter Information section of the configuration dialog box.
PreviewDisplays a graphical preview, if available, of the function output or configuration.
Parameter InformationContains the parameters you can configure for this function. You must select a parameter from the Parameters list to make that parameter and its associated Parameter source control visible in the Parameter Information section of the configuration dialog box.
Parameter sourceSpecifies whether you configure this parameter using the Configuration Dialog Box or a Terminal on the simulation diagram. The default value is Configuration Dialog Box. If you select Terminal, LabVIEW displays an input for that parameter on the simulation diagram, and you can wire values to that input to configure this function programmatically. If you select Configuration Dialog Box, LabVIEW removes that input from the simulation diagram. You then must set the value for this parameter inside the configuration dialog box.
Stochastic State-Space ModelSpecifies a mathematical representation of a stochastic system. You can construct a stochastic state-space model using the CD Construct Stochastic Model VI.
  • A—Specifies the system matrix that describes the dynamics of the states of the system.
  • B—Specifies the input matrix that relates the inputs to the states.
  • G—Specifies the matrix that relates the process noise vector to the model states.
  • C—Specifies the output matrix that relates the outputs to the states.
  • D—Specifies the transmission matrix that relates the inputs to the outputs.
  • H—Specifies the matrix that relates the process noise vector to the model outputs.
  • Sampling Time (s)—Specifies the sampling time of the system model and determines whether the model represents a continuous-time or discrete-time system. If the model represents a continuous-time system, Sampling Time (s) must equal zero. If the model represents a discrete-time system, Sampling Time (s) must be greater than zero and equal to the sampling rate, in seconds, of the discrete system. The default is 0.
    Note  If you use the inputs to create a continuous-time system, setting the Sampling Time (s) to a value greater than zero does not yield the discrete-time equivalent of the system. You must use the CD Convert Continuous Stochastic to Discrete VI to convert the continuous-time system to the discrete-time equivalent of the system.
Second-Order Statistics Noise ModelSpecifies a mathematical representation of the noise model of a stochastic state-space model. You can create a noise model using the CD Construct Noise Model VI.
  • E{w}—Specifies the expected value or mean of the process noise vector. The default is 0.
  • Q—Specifies the covariance matrix of the process noise vector. The default is 0.01.
  • E{v}—Specifies the expected value or mean of the measurement noise vector. The default is 0.
  • R—Specifies the covariance matrix of the measurement noise vector. The default is 0.1.
  • N—Specifies the cross-covariance matrix between the process noise vector and the measurement noise vector. If these noise vectors are uncorrelated, N is a matrix of zeros. The default is 0.
Initial State Estimate xhat(t0)Specifies the initial states from which this function begins estimating the model states. If you do not specify a value for this parameter, Initial State Estimate xhat(t0) is a vector of zeros.
Input u(t)Specifies the control action this function applies to the model. If you specify a vector of zeros for Input u(t), this function does not apply any control action.
Output y(t)Specifies the measurement made on the stochastic state-space model.
Initial Estimation Error Covariance P(t0)Specifies the initial covariance matrix of the estimation error. If you do not specify a value for this parameter, Initial Estimation Error Covariance P(t0) is a matrix of zeros.

Block Diagram Inputs

ParameterDescription
Stochastic State-Space ModelSpecifies a mathematical representation of a stochastic system. You can construct a stochastic state-space model using the CD Construct Stochastic Model VI.
  • A—Specifies the system matrix that describes the dynamics of the states of the system.
  • B—Specifies the input matrix that relates the inputs to the states.
  • G—Specifies the matrix that relates the process noise vector to the model states.
  • C—Specifies the output matrix that relates the outputs to the states.
  • D—Specifies the transmission matrix that relates the inputs to the outputs.
  • H—Specifies the matrix that relates the process noise vector to the model outputs.
  • Sampling Time (s)—Specifies the sampling time of the system model and determines whether the model represents a continuous-time or discrete-time system. If the model represents a continuous-time system, Sampling Time (s) must equal zero. If the model represents a discrete-time system, Sampling Time (s) must be greater than zero and equal to the sampling rate, in seconds, of the discrete system. The default is 0.
    Note  If you use the inputs to create a continuous-time system, setting the Sampling Time (s) to a value greater than zero does not yield the discrete-time equivalent of the system. You must use the CD Convert Continuous Stochastic to Discrete VI to convert the continuous-time system to the discrete-time equivalent of the system.
Second-Order Statistics Noise ModelSpecifies a mathematical representation of the noise model of a stochastic state-space model. You can create a noise model using the CD Construct Noise Model VI.
  • E{w}—Specifies the expected value or mean of the process noise vector. The default is 0.
  • Q—Specifies the covariance matrix of the process noise vector. The default is 0.01.
  • E{v}—Specifies the expected value or mean of the measurement noise vector. The default is 0.
  • R—Specifies the covariance matrix of the measurement noise vector. The default is 0.1.
  • N—Specifies the cross-covariance matrix between the process noise vector and the measurement noise vector. If these noise vectors are uncorrelated, N is a matrix of zeros. The default is 0.
Initial State Estimate xhat(t0)Specifies the initial states from which this function begins estimating the model states. If you do not specify a value for this parameter, Initial State Estimate xhat(t0) is a vector of zeros.
Input u(t)Specifies the control action this function applies to the model. If you specify a vector of zeros for Input u(t), this function does not apply any control action.
Output y(t)Specifies the measurement made on the stochastic state-space model.
Initial Estimation Error Covariance P(t0)Specifies the initial covariance matrix of the estimation error. If you do not specify a value for this parameter, Initial Estimation Error Covariance P(t0) is a matrix of zeros.

Block Diagram Outputs

ParameterDescription
Estimated Output yhat(t)Returns the estimated values of the model outputs at time t.
Estimated State xhat(t)Returns the estimated model states at time t.
Estimation Error Covariance P(t)Returns the covariance matrix of the estimation error associated with the estimated model states xhat(t).
Kalman Filter Gain L(t)Returns the estimator gain matrix this function uses to estimate the model states xhat(t) at time t.

CD Continuous Recursive Kalman Filter Details

The following equations define the outputs this function calculates:

Estimated Output yhat(t) = C(t)xhat(t) + D(t)u(t)

Kalman Filter Gain L(t) = [P(t)CT(t) + G(t)Q(t)HT(t) + G(t)N(t)] . [H(t)Q(t)HT(t) + H(t)N(t) + NT(t)H(t)T+R(t)]–1

Estimation Error Covariance P(t) = A(t)P(t) + P(t)AT(t) + G(t)Q(t)GT(t) – P(t)C(t)T[H(t)Q(t)H(t)T + H(t)N(t) + NT(t)HT(t) + R]–1C(t)P(t) – [G(t)Q(t)HT(t) + G(t)N(t)][H(t)Q(t)HT(t) + H(t)N(t) + NT(t)HT(t) + R]–1 . [G(t)Q(t)HT(t) + G(t)N(t)]T

Estimated State xhat(t) = A(t)xhat(t) + B(t)u(t) + L(t)[y(t) – yhat(t)]