LabVIEW Control Design and Simulation Module

CD Kalman Gain VI

  • Updated2023-03-14
  • 10 minute(s) read

CD Kalman Gain VI

Owning Palette: State Feedback Design VIs

Requires: Control Design and Simulation Module

Calculates the optimal steady-state Kalman gain L that minimizes the covariance of the estimation error for a continuous or discrete model affected by noise. You can use this VI to calculate the Kalman gain for a stochastic or deterministic model. You also can use this VI to discretize automatically a continuous stochastic or continuous deterministic model before calculating L. You must manually select the polymorphic instance you want to use.

Details  

CD Kalman Gain (Stochastic)

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 the Stochastic State-Space Model.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
Closed-Loop Eigenvalues returns the poles of the Kalman filter when using the Steady-State Kalman Gain (L).
Steady-State Kalman Gain (L) returns the optimal gain matrix L that minimizes the Steady-State Estimation Error Covariance (P) for the given model and noise.
Steady-State Estimation Error Covariance (P) returns the covariance of the estimation error.
Steady-State Innovation Gain (M) returns the optimal gain matrix M that minimizes the Steady-State Error Covariance of Updated Estimate (Z) in the discrete estimation process.
Steady-State Error Covariance of Updated Estimate (Z) returns the covariance of the error between the actual states and the updated state estimates in the discrete estimation process.
error out contains error information. This output provides standard error out functionality.

CD Kalman Gain (Deterministic)

G specifies the matrix that relates the process noise vector to the model states.
State-Space Model contains a mathematical representation of and information about the system of which this VI calculates optimal estimator gain.
Q specifies the auto-covariance matrix of w.
R specifies the auto-covariance matrix of v.
N specifies the cross-covariance matrix between the process noise vector w and the measurement noise vector v. If w and v are uncorrelated, N is a matrix of zeros.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
H specifies the matrix that relates the process noise vector to the model outputs.
Closed-Loop Eigenvalues returns the poles of the Kalman filter when using the Steady-State Kalman Gain (L).
Steady-State Kalman Gain (L) returns the optimal gain matrix L that minimizes the Steady-State Estimation Error Covariance (P) for the given model and noise.
Steady-State Estimation Error Covariance (P) returns the covariance of the estimation error.
Steady-State Innovation Gain (M) returns the optimal gain matrix M that minimizes the Steady-State Error Covariance of Updated Estimate (Z) in the discrete estimation process.
Steady-State Error Covariance of Updated Estimate (Z) returns the covariance of the error between the actual states and the updated state estimates in the discrete estimation process.
error out contains error information. This output provides standard error out functionality.

CD Discretized Kalman Gain (Stochastic)

Continuous Stochastic State-Space Model specifies a mathematical representation of a continuous stochastic system.
Continuous Second-Order Statistics Noise Model specifies a mathematical representation of the continuous noise model of the Continuous Stochastic State-Space Model.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
Sampling Time (s) specifies the sampling time this VI uses to discretize the continuous model(s) before calculating the estimator gain.
Closed-Loop Eigenvalues returns the poles of the Kalman filter when using the Steady-State Kalman Gain (L).
Steady-State Kalman Gain (L) returns the optimal gain matrix L that minimizes the Steady-State Estimation Error Covariance (P) for the given model and noise.
Steady-State Estimation Error Covariance (P) returns the covariance of the estimation error.
Steady-State Innovation Gain (M) returns the optimal gain matrix M that minimizes the Steady-State Error Covariance of Updated Estimate (Z) in the discrete estimation process.
Steady-State Error Covariance of Updated Estimate (Z) returns the covariance of the error between the actual states and the updated state estimates in the discrete estimation process.
error out contains error information. This output provides standard error out functionality.

CD Discretized Kalman Gain (Deterministic)

G specifies the matrix that relates the process noise vector to the model states.
Continuous State-Space Model contains a mathematical representation of and information about the system of which this VI calculates optimal estimator gain.
Q specifies the auto-covariance matrix of w.
R specifies the auto-covariance matrix of v.
N specifies the cross-covariance matrix between the process noise vector w and the measurement noise vector v. If w and v are uncorrelated, N is a matrix of zeros.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
H specifies the matrix that relates the process noise vector to the model outputs.
Sampling Time (s) specifies the sampling time this VI uses to discretize the continuous model(s) before calculating the estimator gain.
Closed-Loop Eigenvalues returns the poles of the Kalman filter when using the Steady-State Kalman Gain (L).
Steady-State Kalman Gain (L) returns the optimal gain matrix L that minimizes the Steady-State Estimation Error Covariance (P) for the given model and noise.
Steady-State Estimation Error Covariance (P) returns the covariance of the estimation error.
Steady-State Innovation Gain (M) returns the optimal gain matrix M that minimizes the Steady-State Error Covariance of Updated Estimate (Z) in the discrete estimation process.
Steady-State Error Covariance of Updated Estimate (Z) returns the covariance of the error between the actual states and the updated state estimates in the discrete estimation process.
error out contains error information. This output provides standard error out functionality.

CD Kalman Gain Details

Continuous Stochastic and Deterministic Models

For continuous models, the estimation error is defined as . The Steady-State Estimation Error Covariance (P) is calculated as

The Kalman filter minimizes this quantity. This VI computes the Steady-State Kalman Gain (L) to apply to the Kalman filter by solving the continuous algebraic Riccati equation expressed in terms of P. This expression is defined as

The Steady-State Kalman Gain (L) is calculated as

The following equations define the noise covariance matrices Q, R, and N.

Discrete Stochastic and Deterministic Models

For discrete models, the prediction estimation error is defined as . The Steady-State Estimation Error Covariance (P) is calculated as

The Kalman filter minimizes this quantity. This VI computes the Steady-State Kalman Gain (L) to apply to the Kalman filter by solving the discrete algebraic Riccati equation expressed in terms of P. This expression is defined as

This VI calculates the Steady-State Kalman Gain (L) as

The following equations define the noise covariance matrices Q, R, and N.

This VI calculates the Steady-State Innovation Gain (M) as

The updated estimation error is defined as . The Steady-State Error Covariance of Updated Estimate (Z) is defined as Z = PMCP.

Matrix Restrictions

For both continuous and discrete models, which either are stochastic or deterministic, Q, R, and N must satisfy the following conditions:

  • Q is a symmetric, positive semi-definite matrix
  • R is a symmetric, positive definite matrix
  • N satisfies the following relationship:

The following conditions also must be satisfied.

The matrix must satisfy the following relationship:

The pair is detectable, and the pair is stabilizable.

where the following definitions apply:

The matrix is the full-rank factorization of the matrix , such that and .

The matrix is the full-rank factorization of the matrix , such that and .

Discretized Kalman Gain

These instances convert the A, B, C, and D matrices using the numerical integration method as proposed by Van Loan. Refer to the reference material by the following authors for more information about this method:

  • Franklin, G.F., J.D. Powell, and M. Workman.
  • Loan, C.F.V.

Delay Support

This VI does not support delays unless the delays are part of the mathematical model that represents the dynamic system. To account for the delays in the synthesis of the controller, you must incorporate the delays into the mathematical model of the dynamic system using the CD Convert Delay with Pade Approximation VI (continuous models) or the CD Convert Delay to Poles at Origin VI (discrete models). Refer to the LabVIEW Control Design User Manual for more information about delays and the limitations of Pade Approximation.

Log in to get a better experience