CD Discrete Observer Function
Owning Palette: Implementation VIs and Functions
Installed With: Control Design and Simulation Module
Implements a discrete-time observer for a linear state-space system model.
Dialog Box Options |
Block Diagram Inputs |
Block Diagram Outputs |
Place on the block diagram | Find on the Functions palette |
Dialog Box Options
Parameter | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|
Polymorphic instance | Specifies whether this function implements a current observer and corrects state estimates made at a previous time step, or whether this function implements a predictive observer and calculates the estimated states for the next time step k + 1. This option also specifies whether the observer checks the model parameters. The default is Current, w/ check. Refer to Chapter 15, Estimating Model States, of the LabVIEW Control Design User Manual for information about using current and predictive observers. | ||||||||
Feedthrough | Configures the function to be either a Direct or Indirect feedthrough function. Enable this control by selecting State-Space Model from the Parameters list and then selecting Terminal from the Parameter source pull-down menu. If you select Configuration Dialog Box from the Parameter source pull-down menu, LabVIEW disables this control and calculates the feedthrough behavior automatically. You can use the Corrected State Estimate xhat(k|k) to design the Input u(k) only if you specify Indirect feedthrough. Refer to the Details section for a description of the parameters that determine the feedthrough behavior of this function. | ||||||||
Parameters | Lists 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. | ||||||||
Preview | Displays a graphical preview, if available, of the function output or configuration. | ||||||||
Parameter Information | Contains 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 source | Specifies 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. | ||||||||
Initial State Estimate xhat(0|-1) | Specifies the initial states from which this function begins estimating the model states. If you do not specify a value for this parameter and you select one of the w/ check instances of this function, Initial State Estimate xhat(0|–1) is a vector of zeros. | ||||||||
Observer Gain | Specifies the estimator gain matrix this VI applies to the difference between the observed output and the estimated output, which is Output y(k) – Estimated Output yhat(k). You can use the CD Pole Placement VI or the CD Ackermann VI to calculate the Observer Gain. The Observer Gain for a current observer relates to the Observer Gain for a predictive observer through the following relationship: Observer Gain (Current) = A–1 · Observer Gain (Predictive), where A is the state matrix of the State-Space Model. | ||||||||
State-Space Model | Specifies the mathematical representation of and information about the system for which this function implements the observer.
|
Block Diagram Inputs
Parameter | Description |
---|---|
Initial State Estimate xhat(0|-1) | Specifies the initial states from which this function begins estimating the model states. If you do not specify a value for this parameter and you select one of the w/ check instances of this function, Initial State Estimate xhat(0|–1) is a vector of zeros. |
Observer Gain | Specifies the estimator gain matrix this VI applies to the difference between the observed output and the estimated output, which is Output y(k) – Estimated Output yhat(k). You can use the CD Pole Placement VI or the CD Ackermann VI to calculate the Observer Gain. The Observer Gain for a current observer relates to the Observer Gain for a predictive observer through the following relationship: Observer Gain (Current) = A–1 · Observer Gain (Predictive), where A is the state matrix of the State-Space Model. |
Output y(k) | Specifies the measurements a sensor makes on the State-Space Model. You also can use the Discrete State-Space function to simulate the behavior of a state-space model. |
Initialize | Specifies whether to restart the calculation from any initial values you provide. The default is FALSE. |
Input u(k) | Specifies the control action this VI applies to the model. |
State-Space Model | Specifies the mathematical representation of and information about the system for which this function calculates the estimated states. |
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. |
Block Diagram Outputs
Parameter | Description |
---|---|
Estimated Output yhat(k) | Returns the estimated output of the State-Space Model. |
Predicted State Estimate xhat(k+1|k) | Returns the predicted state estimates of the State-Space Model for the next time step k + 1. The length of this vector is equal to the number of model states. |
Corrected State Estimate xhat(k|k) | Returns the corrected state estimates at time k. The length of this vector is equal to the number of model states. This output appears only if you select Current, w/ check or Current, w/o check from the Polymorphic instance pull-down menu. |
Predicted State Estimate xhat(k|k-1) | Returns the estimated states of the State-Space Model estimated at the previous time step. This output appears only if you select Predictive, w/ check or Predictive, w/o check from the Polymorphic instance pull-down menu. |
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. |
CD Discrete Observer Details
Current Observer
At each time step k, this function calculates the Corrected State Estimate xhat(k|k) using the Estimated Output yhat(k), any control action Input u(k), and the Predicted State Estimate xhat(k|k-1) calculated at the previous time step. This function also calculates the estimated states for the next time step k + 1, Predicted State Estimate xhat(k+1|k).
This VI uses the following equations to calculate the outputs.
yhat(k) = C(k) · xhat(k|k–1) + D(k) · u(k)
where C and D are the output and direct feedthrough matrices, respectively, of the State-Space Model.
xhat(k|k) = xhat(k|k–1) + Lc [y(k) – yhat(k)]
where Lc is the Observer Gain.
xhat(k+1|k) = A(k) · xhat(k|k) + B(k) · u(k)
where A and B are the state and input matrices, respectively, of the State-Space Model.
Predictive Observer
At each time step k, this function calculates the Predicted State Estimate xhat(k+1|k) using the Estimated Output yhat(k) and the Predicted State Estimate xhat(k|k–1).
The following equations define the outputs of this function:
yhat(k) = C(k) · xhat(k|k–1) + D(k) · u(k)
xhat(k+1|k) = A(k) · xhat(k|k–1) + B(k) · u(k) + Lp[y(k) – yhat(k)]
where Lp is the Observer Gain.
Feedthrough Behavior
The value you specify for the D matrix of the Stochastic State-Space Model parameter determines the feedthrough behavior of this function.
- If the D matrix is nonzero, all input/output pairs have direct feedthrough behavior.
- If the D matrix is zero, the following input/output pairs have indirect feedthrough behavior.
- Input u(k) — Corrected State Estimate xhat(k|k)
- Input u(k) — Predicted State Estimate xhat(k|k–1)
When you use the configuration dialog box to configure the D matrix, LabVIEW verifies that the feedthrough behavior is correct. For example, if you set the Feedthrough parameter to Indirect, and you set the D matrix to nonzero, LabVIEW changes the Feedthrough parameter to Direct.
If you specify the value of the D matrix programmatically by wiring a value to the parameter terminal, LabVIEW does not adjust the feedthrough behavior for you. You must ensure that you specify the proper feedthrough behavior for the value of the D matrix that you specify.