Setting Model Timing

Adjust the step size to have the model run at a different rate.

Before you begin, learn about the VeriStand system.
A model is set to run at a rate as defined in the build options when the model is compiled. Depending on configuration settings for the system definition, the rate at which the VeriStand Engine executes models can differ from the compiled rate.

The following equation describes how the VeriStand Engine executes models:

actual model rate = Primary Control Loop (PCL) rate / model decimation

Modify the system definition to alter this equation.

  1. Launch your project in the VeriStand Editor.
  2. In the Project Files pane, left-click a system definition file (.nivssdf) and select Configure in System Explorer.
  3. Set the PCL rate.
    1. Click Targets » Controller in the configuration tree.
    2. Under Timing Source Settings, set a Target Rate.
  4. Set the model decimation.
    1. Click Targets » Controller » Simulation Models » Models in the configuration tree.
    2. Click a model.
    3. Under Model Settings, enter a Decimation.
  5. Save the system definition file.

If both the controller and plant are simulated, such as during a model-in-the-loop test, you can run your model at a different rate than specified when it was compiled. For example, you can set the Primary Control Loop of a model compiled to run at 100 Hz to 1 kHz, or 10 times faster than real time (assuming model decimation is 1).

This results in more simulations and more data in a shorter amount of time. However, a model that does not run in real time is potentially unstable. When testing with hardware, such as hardware-in-the-loop testing, run your model at the rate it was compiled to accurately simulate the system.