Download LabVIEW Control Design User Manual

Transcript
Chapter 17
Deploying a Controller to a Real-Time Target
5.
Enter numerator and denominator coefficients in the Numerator and
Denominator text boxes. Notice the Preview window updates to
display the model equation. For MIMO models, use the Input-Output
Model control to select different input/output pairs. You can enter
unique Numerator and Denominator coefficients for each
input/output pair.
6.
Click the OK button to save the model definition and return to the
block diagram. If you defined a SISO model, the function icon updates
to show the model equation. You also can resize the function icon.
Defining a Controller Model Programmatically
Launch the Discrete Transfer Function Configuration dialog box, select
Transfer Function from the Parameters listbox, and select Terminal
from the Parameter source pull-down menu. After you click the OK
button, the Transfer Function input appears on the function icon. You
then can use the CD Construct Transfer Function VI, or a block diagram
constant, to define a transfer function model. Wire this model definition to
the Transfer Function input of the Discrete Transfer Function function.
Writing Controller Code
The examples in this section use a Timed Loop to implement the feedback
configuration Figure 17-1 shows. This structure also ensures the controller
code you write executes in real time. Refer to the LabVIEW Help for
information about configuring and executing a Timed Loop.
If you designed a continuous controller model, you must convert that model to a
discrete one before deploying that model to an RT target. The sampling time you use in this
conversion must equal the Period of the Timed Loop. Refer to Chapter 3, Converting
Models, for more information about converting models.
Note
The following sections show example transfer function, state-space, and
zero-pole-gain controller code. These examples also define and convert
models in different ways. The following sections also describe how to
implement observers and Kalman filters on an RT target.
Control Design User Manual
17-4
ni.com