Discrete Integrator Function

Simulation VI and Function

Discrete Integrator Function

Owning Palette: Discrete Linear Systems Functions

Installed With: Control Design and Simulation Module

Integrates the input using forward rectangular (Euler) integration, backward rectangular (Euler) integration, or trapezoidal integration.

Details  Example

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

Dialog Box Options

ParameterDescription
Polymorphic instanceSpecifies whether this function is Scalar or Vector. The default value is Scalar.
FeedthroughConfigures the function to be either a Direct or Indirect feedthrough function. Enable this control by selecting a parameter 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.

Refer to the Details section for a description of the parameters that determine the feedthrough behavior of this function.
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.
sample period (s)Specifies the length of the discrete time step, in seconds, of this function. If you enter a value of –1, this function inherits the discrete time step you specify for the simulation diagram. Otherwise, the value of sample period (s) must be a multiple of the discrete time step you specify for the simulation diagram. The default value of sample period (s) is 1.
sample skew (s)Specifies the length of time by which you want to delay the execution of this function. The default value is 0. The value of this parameter must satisfy the following relationship:

0 ≤ sample skew (s)sample period (s)
discrete integratorSpecifies the discrete integration method this function uses. You can choose from the following options:
  • backward—Backward rectangular (Euler) integration method.
  • forward—(Default) Forward rectangular (Euler) integration method.
  • trapezoidal—Trapezoidal integration method.
Refer to the Details section for information about how these options affect the feedthrough behavior of this function.
initial conditionSpecifies the initial output of the integrator on the first time step. The default value is 0.
limit typeSpecifies the limit behavior of the integral. You can choose from the following options:
  • upper—The integrator output saturates at the upper limit. The output can drop below the lower limit.
  • lower—The integrator output saturates at the lower limit. The output can exceed the upper limit.
  • both—The integrator output saturates at the lower limit and the upper limit.
  • none—(Default) The function does not limit the integrator output.
lower limitSpecifies the lower limit of the output. The LabVIEW Control Design and Simulation Module uses this parameter only if you set limit type to lower or both. The default value of lower limit is 0.
upper limitSpecifies the upper limit of the output. The Control Design and Simulation Module uses this parameter only if you set limit type to upper or both. The default value of upper limit is 0.
reset?Sets the discrete states to the reset condition, when TRUE.
reset conditionSpecifies the values to which to reset the discrete states when reset? is TRUE.

Block Diagram Inputs

ParameterDescription
sample period (s)Specifies the length of the discrete time step, in seconds, of this function. If you enter a value of –1, this function inherits the discrete time step you specify for the simulation diagram. Otherwise, the value of sample period (s) must be a multiple of the discrete time step you specify for the simulation diagram. The default value of sample period (s) is 1.
sample skew (s)Specifies the length of time by which you want to delay the execution of this function. The default value is 0. The value of this parameter must satisfy the following relationship:

0 ≤ sample skew (s)sample period (s)
discrete integratorSpecifies the discrete integration method this function uses. You can choose from the following options:
  • backward—Backward rectangular (Euler) integration method.
  • forward—(Default) Forward rectangular (Euler) integration method.
  • trapezoidal—Trapezoidal integration method.
Refer to the Details section for information about how these options affect the feedthrough behavior of this function.
initial conditionSpecifies the initial output of the integrator on the first time step. The default value is 0.
limit typeSpecifies the limit behavior of the integral. You can choose from the following options:
  • upper—The integrator output saturates at the upper limit. The output can drop below the lower limit.
  • lower—The integrator output saturates at the lower limit. The output can exceed the upper limit.
  • both—The integrator output saturates at the lower limit and the upper limit.
  • none—(Default) The function does not limit the integrator output.
lower limitSpecifies the lower limit of the output. The LabVIEW Control Design and Simulation Module uses this parameter only if you set limit type to lower or both. The default value of lower limit is 0.
upper limitSpecifies the upper limit of the output. The Control Design and Simulation Module uses this parameter only if you set limit type to upper or both. The default value of upper limit is 0.
reset?Sets the discrete states to the reset condition, when TRUE.
reset conditionSpecifies the values to which to reset the discrete states when reset? is TRUE.
inputSpecifies the input to the system.

Block Diagram Outputs

ParameterDescription
outputReturns the integral of the input signal over time. This integral also is the state value.
limited?Returns TRUE if the output of this function saturates at the upper limit or lower limit. limited? returns FALSE if you specified a value of none for the limit type parameter or if the value of the output is between the upper limit and the lower limit.

Discrete Integrator Details

This function uses the following equations to calculate the output:

Forward Rectangular (Euler) Integration:

y(tk) = u(tk – 1) * T + y(tk – 1)

Backward Rectangular (Euler) Integration:

y(tk) = u(tk) * T + y(tk – 1)

Trapezoidal Integration:

whereu is the input
tk = initial time + sample skew (s) + k * sample period (s), for k = 0, 1, 2, …
t is the current simulation time
y is the output
T is the sample period (s) of this function

When you select the Vector instance of this function, the input and output parameters must be the same size as the initial condition parameter.

All other Discrete Integrator function parameters must be either the same size as the initial condition parameter or of size one. If the parameter array is of size one, the function assumes that array[i] equals array[0] for all values of i.

Feedthrough Behavior

The value you specify for the discrete integrator parameter determines the feedthrough behavior of this function.

  • If you select backward or trapezoidal, the all input/output pairs have direct feedthrough behavior.
  • If you select forward, the input input has indirect feedthrough to the output output. All other input/output pairs have direct feedthrough behavior.

When you use the configuration dialog box to specify a value for the discrete integrator parameter, LabVIEW verifies that the feedthrough behavior is correct. For example, if you set the Feedthrough parameter to Indirect, and you set the value of the discrete integrator parameter to trapezoidal, LabVIEW changes the Feedthrough parameter to Direct.

If you specify a value for the discrete integrator parameter programmatically by wiring values to the parameter terminals, LabVIEW does not adjust the feedthrough behavior for you. You must ensure that you specify the proper feedthrough behavior for the value of the discrete integrator parameter that you specify.

Example

Refer to the SimEx discrete integrator VI in the labview\examples\Control and Simulation\Simulation\Discrete Linear directory for an example of using the Discrete Integrator VI.

 Open example  Browse related examples