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

PID (FPGA) Express VI

LabVIEW 2011 FPGA Module Help

Edition Date: June 2011

Part Number: 371599G-01

»View Product Info

Owning Palette: Control VIs

Requires: FPGA Module and PID and Fuzzy Logic Toolkit

Implements a fixed-point PID algorithm for PID applications with high-speed control and/or high channel count on an FPGA target. You can use this Express VI with single-channel or multi-channel configurations. The PID algorithm features control action range and uses an integrator anti-windup calculation to limit the effect of the integral action during transients. The PID algorithm also features bumpless controller output for PID gain changes.

Note  This Express VI is available only if you install both the LabVIEW PID and Fuzzy Logic Toolkit and the LabVIEW FPGA Module.

Details  

Dialog Box Options
Block Diagram Inputs
Block Diagram Outputs

Dialog Box Options

ParameterDescription
Number of channelsSpecifies the number of I/O channels for which this Express VI implements the PID control algorithm.
Initial setpointSpecifies the initial setpoint that you want the process variable output to attain. This Express VI applies the initial setpoint to all of the PID channels.
Sampling time Ts (s)Specifies the loop time, in seconds, at which the PID loop on the FPGA target runs.
Initial Output RangeSpecifies the range of values for the PID controller output. This Express VI applies these values to all of the PID channels.

Contains the following options:
  • High limit—Specifies the maximum value of the PID controller output.
  • Low limit—Specifies the minimum value of the PID controller output.
Initial GainsSpecifies the values this Express VI converts into the Initial Quantized Gains parameters. This Express VI computes the Initial Quantized Gains such that the values fit in signed fixed-point numbers with word length 16 and integer word length 8, then updates the Initial Gains to represent the exact values that produce the Initial Quantized Gains. This Express VI applies the Initial Quantized Gains to all PID channels.

Contains the following options:
  • Proportional gain (Kc)—Specifies the proportional gain.
  • Integral time (Ti, min)—Specifies the integral time in minutes.
  • Derivative time (Td, min)—Specifies the derivative time in minutes.
Initial Quantized GainsDisplays the values this Express VI converts from the Initial Gains parameters. This Express VI computes the Initial Quantized Gains such that the values fit in signed fixed-point numbers with word length 16 and integer word length 8. This Express VI applies the Initial Quantized Gains to all PID channels.

Contains the following options:
  • Proportional gain—Displays the proportional gain, Kp, as a signed fixed-point number with word length 16 and integer word length 8.
  • Integral gain (normalized)—Displays the normalized integral gain, Ki, as a signed fixed-point number with word length 16 and integer word length 8.
  • Derivative gain (normalized)—Displays the normalized derivative gain, Kd, as a signed fixed-point number with word length 16 and integer word length 8.

Block Diagram Inputs

ParameterDescription
reset?If TRUE, sets the derivative action to zero and resets the integrated error to zero. This Express VI initializes automatically when it first runs.
process variableSpecifies the value of the variable that you want to control. This value is represented by a fixed-point number with a maximum word length of 16.
setpointSpecifies the value that you want the process variable to attain. This value is represented by a fixed-point number with a maximum word length of 16. This input is available only for single-channel configurations, that is, when Number of channels is 1.

The value you wire to this input overrides the value of Initial setpoint in the configuration dialog box.
PID gainsSpecifies the normalized PID gain parameters. This input is available only for single-channel configurations, that is, when Number of channels is 1. The values you wire to this input override the values of the Initial Quantized Gains calculated from the Initial Gains you set in the configuration dialog box.

If you specify a parameter with a word length greater than 16, LabVIEW rounds the parameter to use only the most significant 16 bits. You cannot specify any of these parameters with a integer word length greater than 8.
Note  The PID gains you specify for this Express VI are different from the PID gains you specify for the PID VI. In this Express VI, you specify the proportional gain, integral gain, and derivative gain. In the PID VI, you specify the proportional gain, integral time, and derivative time from which the VI then calculates the integral gain and derivative gain.
  • proportional gain (Kc)—Specifies the proportional gain, Kp, of the controller. Kp is the fixed-point value corresponding to the Proportional gain (Kc) you set in the configuration dialog box. This value is represented by a fixed-point number with word length 16 and integer word length 8.
  • integral gain (Kc*Ts/Ti)—Specifies the normalized integral gain, Ki, of the controller. This value is represented by a fixed-point number with word length 16 and integer word length 8. Ts represents the sampling interval. Ti represents the integral time.
  • derivative gain (Kc*Td/Ts)—Specifies the normalized derivative gain, Kd, of the controller. This value is represented by a fixed-point number with word length 16 and integer word length 8. Td represents the derivative time. Ts represents the sampling interval.
output rangeSpecifies the allowable range of the output. This input is available only for single-channel configurations, that is, when Number of channels is 1.

The values you wire to this input override the values in the Initial Output Range section of the configuration dialog box.
  • output high—Specifies the maximum value of output. This value is represented by a fixed-point number with the same fixed-point type as process variable.
  • output low—Specifies the minimum value of output. This value is represented by a fixed-point number with the same fixed-point type as process variable.
configurationAppears only for multi-channel configurations, which you specify if you enter a number greater than 1 in the Number of channels parameter in the configuration dialog box. Includes a cluster of two clusters and two numeric controls. The clusters are PID gains and output range, which are also available for single-channel configurations. The numeric controls are setpoint and channel index. setpoint is the value that you want the process variable to attain. channel index specifies to which PID channel you want to apply the PID gains, output range, and setpoint.

Block Diagram Outputs

ParameterDescription
outputReturns the control action that the PID algorithm calculates. This value is represented by a fixed-point number with the same fixed-point type as process variable.
Note  This Express VI rounds the relevant inputs to use only the most significant 16 bits and calculates the output based on these values.
channel indexReturns the index of the PID channel this Express VI currently is processing. The channel index begins at 0. For example, if you have two channels, channel index returns either 0 or 1, depending on the channel being processed.

This output is available only for multi-channel configurations, that is, when Number of channels is greater than 1.

PID (FPGA) Details

This Express VI represents the PID proportional, integral, and derivative gains as signed fixed-point numbers with word length 16 and integer word length 8. Given the Proportional gain (Kc), Integral time (Ti, min), and Derivative time (Td, min), respectively, this Express VI normalizes these gains according to the following formulas:

where Ts is the Sampling time Ts (s) at which the PID loop runs.

This Express VI calculates the output, u(k), according to the following equation:

where

e(k) = setpoint(k) – PV(k)

PV(k) = value of process variable on the kth call after initialization

Refer to the PID and Fuzzy Logic Toolkit Help for more information about using PID on FPGA targets, including information about implementing single-channel and multi-channel PID.


 

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