Table of Contents >Quanser Rapid Control Prototyping Toolkit >Getting Started >Creating a New VI >
Using VI Templates
To facilitate creating new control systems, the RCP Toolkit supplies convenient templates. To use a template, simply
select New...
from the File menu
. Then select one of the templates under the
Template/Quanser/Rapid Control Prototyping Toolkit/Hardware category.
Basic Control Loop Template
For example, select the Basic Control Loop
template, as illustrated below:
Finally, click
to open a new VI based on the template. A VI such as the one illustrated below will open:
Now simply modify the VI to suit your application. In the case of the Basic Control Loop
template, this might involve:
board type
by double-clicking on the HIL Initialize VI.
Control
, with a PID controller or other algorithm.
Basic Hardware Loop Template
Alternatively you can open the Basic Hardware Loop
template under
From Template/Quanser/Rapid Control Prototyping Toolkit/Hardware
for a basic loop
structure where the user is responsible for filling in the content.
Finally, click
to open a new VI based on the template. A VI such as the one illustrated below will open:
Since a new VI is created from the template, the new VI may be saved without worrying about overwriting the original template. |
Changing the Sample Time
To change how often the control algorithm executes, change the Step Size (s) parameter in the Configure Simulation Parameters dialog. The default is 0.002 seconds or 2 ms. Open the Configure Simulation Parameters dialog by double-clicking on the input to the CD&Sim loop or right-clicking on its border and selecting from the context menu as shown:
The Step Size (s) parameter is depicted in the following figure. Its units are in seconds. Notice that the Auto Discrete Time option is checked so that the discrete step size is made equal to the continuous time step. Also observe that the Auto Period option is also selected on the Timing Parameter page to ensure the period is calculated to match the step size. Finally, the Synchronize Loop to Timing Source option is checked to make the loop run in real time. The default numerical solver is the Runge-Kutta 1 (Euler) solver.
Copyright © Quanser Inc. This page was generated 2021-09-24. Submit feedback to Quanser about this page.
Link to this page.