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

Version 2009 Features (Control Design and Simulation Module)

LabVIEW 2009 Control Design and Simulation Module Help

Edition Date: June 2009

Part Number: 371894D-01

»View Product Info

Refer to the LabVIEW 2009 Features and Changes topic for information about new features in LabVIEW 2009.

Refer to the readme_ControlandSim.html file, located in the labview\readme directory, for a complete list of new features and changes, information about upgrade and compatibility issues specific to different versions of the Control Design and Simulation Module, and information about known issues with the LabVIEW 2009 Control Design and Simulation Module.

Using the External Model Interface

Previous versions of the LabVIEW Control Design and Simulation Module provided an External Model Interface (EMI) as an example in the labview\examples\Control and Simulation\Simulation\External Model Interface\External Model Interface Node directory. The LabVIEW 2009 Control Design and Simulation Module provides a new, more robust version of EMI.

Third parties can use EMI to create an external, or third-party, model in C/C++. LabVIEW users can use EMI to simulate the external model in the Control Design and Simulation Module.

If you are a third-party user of EMI, you first must create a C/C++ project that uses the External Model Interface functions to define the dynamic equations for a model. Export the External Model Interface functions as appropriate for the structure of the model. Then build the C/C++ project into a shared library and distribute the shared library to end users.

If you are a LabVIEW user of EMI, use the External Model function in LabVIEW to reference the shared library you receive from a third-party. Use the External Model function to represent and simulate the model that corresponds to the shared library. When you run the simulation, the Control Design and Simulation Module uses an ordinary differential equation (ODE) solver to compute the behavior of the dynamic system model that the External Model function represents. The Control Design and Simulation Module calls the External Model Interface functions that the corresponding shared library exports.

Note  Shared libraries created in the previous version of EMI no longer work in the current version. However, the previous version of EMI still is available in the labview\examples\Control and Simulation\Simulation\External Model Interface\External Model Interface Node directory.

Simulation Model Converter Enhancements

The Simulation Model Converter converts a model (.mdl) file, developed in The MathWorks, Inc. Simulink® simulation environment, into a LabVIEW VI that contains a simulation diagram. The Simulation Model Converter now converts additional Simulink blocks and provides improved support for previously supported blocks. Select Tools»Control Design and Simulation»Simulation Model Converter to launch the Simulation Model Converter.

The Simulation Model Converter now converts the following blocks used in the Simulink software environment.

  • Bias
  • Bit Clear
  • Bit Set
  • Compare To Constant
  • Compare To Zero
  • Counter Free-Running
  • Counter Limited
  • Dead Zone Dynamic
  • Detect Change
  • Detect Decrease
  • Detect Fall Negative
  • Detect Fall Nonpositive
  • Detect Increase
  • Detect Rise Nonnegative
  • Detect Rise Positive
  • Difference
  • Interpolation (n-D) using PreLook-Up
  • Lookup Table Dynamic
  • MinMax Running Resettable
  • PID Controller
  • Prelookup
  • Random Number
  • Rate Limiter Dynamic
  • Repeating Sequence
  • Repeating Sequence Interpolated
  • Repeating Sequence Stair
  • Saturation Dynamic
  • Tapped Delay
  • Unary Minus
  • Weighted Sample Time Math
  • Wrap To Zero

Using the Simulation Model Converter,you can also now convert the following blocks used in the Simulink application software under limited conditions.

  • Discrete FIR Filter—The Simulation Model Converter can convert Discrete FIR Filter blocks only if they use scalar quantities.
  • Integer Delay—The Simulation Model Converter cannot convert Integer Delay blocks that use initial conditions.
  • Transfer Fcn First Order—The Simulation Model Converter cannot convert Transfer Fcn First Order blocks that use initial conditions, rounding, or saturation.
  • Transfer Fcn Lead or Lag—The Simulation Model Converter cannot convert Transfer Fcn Lead or Lag blocks that use initial conditions, rounding, or saturation.
  • Transfer Fcn Real Zero—The Simulation Model Converter cannot convert Transfer Fcn Real Zero blocks that use initial conditions, rounding, or saturation.

The Simulation Model Converter provides improved support for the following previously supported blocks used in the Simulink software environment.

  • Assignment—In previous versions of the LabVIEW Control Design and Simulation Module, the converted subsystem in LabVIEW corresponding to this block might not have the same functionality as this block. The Simulation Model Converter now can convert this block with full functionality.
  • Digital Clock—In previous versions of the Control Design and Simulation Module, the Simulation Model Converter can convert the Digital Clock block only if it uses a sample time of 1. The Simulation Model Converter now can convert this block for any sample time.
  • Direct Lookup Table (n-D)—The Simulation Model Converter now can convert this block with tables of up to 10 dimensions.
  • Matrix Concatenate—In previous versions of the Control Design and Simulation Module, the Simulation Model Converter cannot convert this block if the block concatenates matrices along arbitrary dimensions. The Simulation Model Converter now can convert this block when the block concatenates 2D matrices along rows, columns, or a third dimension.
  • MinMax—In previous versions of the Control Design and Simulation Module, the VIs and functions in the converted subsystem created by the Simulation Model Converter and that correspond to this block might not have the same functionality as this block. The Simulation Model Converter now can convert this block with full functionality.
  • Reshape—In previous versions of the Control Design and Simulation Module, the Reshape block might transpose 2D results. The Simulation Model Converter now converts the Reshape block to a simulation subsystem that correctly handles 2D results.
  • Rounding Function—In previous versions of the Control Design and Simulation Module, the VIs and functions in the converted subsystem created by the Simulation Model Converter and that correspond to this block might not have the same functionality as this block. The Simulation Model Converter now can convert this block with full functionality.
  • Scope—The Simulation Model Converter now can convert a Scope block that has multiple inputs.
  • Selector—In previous versions of the Control Design and Simulation Module, the VIs and functions in the converted subsystem created by the Simulation Model Converter and that correspond to this block might not have the same functionality as this block. The Simulation Model Converter now can convert this block with full functionality.
  • Sine Wave—In previous versions of the Control Design and Simulation Module, the Simulation Model Converter only can convert blocks that use frequency units of hertz. The Simulation Model Converter now can convert this block when the block uses other units of frequency, including radians per second, hertz, and degrees per second.
  • State Space—The Simulation Model Converter now can convert this block for single-input multiple-output systems.
  • Vector Concatenate—The Simulation Model Converter now can convert this block from all versions of the Simulink application software in which the Vector Concatenate block is included.

Using the External Solver Interface

Use the External Solver Interface (ESI) to create and use external ordinary differential equation (ODE) solvers in the LabVIEW Control Design and Simulation Module.

First use the External Solver Interface functions to create the ODE solver in C/C++. The solver must export all of the Callback API functions. Build the C/C++ project into a (Windows) .dll, (Mac OS) .framework, or (Linux) .so shared library file.

To use the external solver, copy the shared library for the solver into the labview\vi.lib\Simulation\ContinuousLinear\Implementation\Shared\Solvers\Plugins directory. In LabVIEW, double-click the Input Node of the Control & Simulation Loop to display the Configure Simulation Parameters dialog box. Then select the external solver from the ODE Solver pull-down menu. The item in the ODE Solver pull-down menu corresponds to the name you specify for the solver using the Information function.

Estimating States of Nonlinear Stochastic State-Space Models with Extended Kalman Filters

In previous versions of the LabVIEW Control Design and Simulation Module, you can use the Discrete Kalman Filter function and the Continuous Kalman Filter function to estimate the states of a linear discrete or linear continuous stochastic state-space model, respectively. In the LabVIEW 2009 Control Design and Simulation Module, you can use the Continuous Extended Kalman Filter function and the Discrete Extended Kalman Filter function to estimate the states of a nonlinear continuous or a nonlinear discrete stochastic state-space model, respectively.

The Continuous Extended Kalman Filter function and the Discrete Extended Kalman Filter function estimate model states of a partially observable plant based on noisy measurements. First, use the SIM Discrete Nonlinear Plant Model template VI or the SIM Continuous Nonlinear Plant Model template VI located in the labview\templates\Control and Simulation directory to define the system model. Then use the Discrete Nonlinear Noisy Plant function or the Continuous Nonlinear Noisy Plant function to simulate the discrete or continuous nonlinear model, respectively, with the addition of noise. Finally, use the Continuous Extended Kalman Filter function or the Discrete Extended Kalman Filter function to estimate the states of the model.

The Continuous Extended Kalman Filter function and the Discrete Extended Kalman Filter function linearize the nonlinear system either by calculating a Jacobian matrix internally or by using an external Jacobian matrix that you define. Use the SIM Continuous Jacobians template VI or the SIM Discrete Jacobians template VI, located in the labview\templates\Control and Simulation directory, to define an external Jacobian matrix.

Refer to the LabVIEW Control Design User Manual for more information about estimating the states of nonlinear stochastic state-space models with extended Kalman filters.

Using the Estimation Functions

The Estimation palette contains functions that estimate the states of a state-space system. The state-space system can be deterministic or stochastic, continuous or discrete, linear or nonlinear, and completely or partially observable.


 

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