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

PID (FPGA) (PID Control Toolkit)

LabVIEW 8.5 FPGA Module Help
August 2007

NI Part Number:
371599C-01

»View Product Info

On an FPGA target, implements an integer PID algorithm for PID applications with high-speed control and/or high channel count that require an efficient algorithm. You can use this Express VI with single-channel or multi-channel configurations. The PID algorithm features control action range and uses the 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 Control Toolkit and LabVIEW FPGA Module.

Details  

Dialog Box Options
Block Diagram Inputs
Block Diagram Outputs

Dialog Box Options

ParameterDescription
PID ParametersContains the following options:
  • Number of channels—Specifies the number of I/O channels to which the Express VI applies the PID control.
  • Initial setpoint—Specifies the initial setpoint that you want the process variable to attain. The 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. Sampling time Ts (s) also converts the Initial Gains parameters from double representation into Initial Quantized Gains parameters, which the Express VI represents as 16-bit integers.
Initial GainsContains the following options: The values you enter in the Initial Gains section determine the values the Express VI returns in the Initial Quantized Gains section.
  • Proportional gain (Kc)—Specifies the proportional gain. The Express VI applies this value to all of the PID channels.
  • Integral time (Ti, min)—Specifies the integral time in minutes. The Express VI applies this value to all of the PID channels.
  • Derivative time (Td, min)—Specifies the derivative time in minutes. The Express VI applies this value to all of the PID channels.
Initial Output RangeContains the following options:
  • High limit—Specifies the maximum value of the PID controller output. The Express VI applies this value to all of the PID channels.
  • Low limit—Specifies the minimum value of the PID controller output. The Express VI applies this value to all of the PID channels.
Initial Quantized GainsContains the following options:
  • Proportional gain (scaled)—Specifies the scaled proportional gain in 16-bit representation that the Express VI applies for all of the PID channels on the FPGA. Refer to the Details section for the conversion formula.
  • Integral gain (scaled)—Specifies the scaled integral gain in 16-bit representation that the Express VI applies for all of the PID channels on the FPGA. Refer to the Details section for the conversion formula.
  • Derivative gain (scaled)—Specifies the scaled derivative gain in 16-bit representation that the Express VI applies for all of the PID channels on the FPGA. Refer to the Details section for the conversion formula.

Block Diagram Inputs

ParameterDescription
reset?If TRUE, sets the derivative (D) action to zero and resets the integrated error to zero. The Express VI initializes automatically when it first runs.
setpointSpecifies the value that you want the process variable to attain. The value you wire to this input overrides the value of Initial setpoint in the configuration dialog box.
process variableSpecifies the value of the variable that you are controlling.
PID gains (x 2^8)Includes a cluster of three integers representing the scaled PID gain parameters. The upper 8 bits of each integer represent the integer portion of the gain, and the lower 8 bits of each integer represent the fractional portion of the gain.
  • proportional gain (Kc)—Represents the proportional (P) gain of the controller.
  • integral gain (Kc*Ts/Ti)—Represents the integral (I) gain of the controller. Ts represents the sampling interval, in minutes. Ti represents the integral time, in minutes.
  • derivative gain (Kc*Td/Ts)—Represents the derivative (D) gain of the controller. Td represents the derivative time, in minutes. Ts represents the sampling interval, in minutes.
output rangeSpecifies the allowable range of the integer output. 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.
  • output low—Specifies is the minimum value of output.
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 (x2^8) 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
channel being processedReturns which PID channel the Express VI currently is processing. The channel being processed output appears only if you enter a number greater than 1 in the Number of channels parameter in the configuration dialog box.
outputReturns the control action returned by the PID algorithm. The signal corresponds to the process variable channel.

where

PV(n) = value of process variable on the nth call after initialization

ΔPV(n) = PV(n) – PV(n – 1)

e(n) = setpoint(n) – PV(n)

Ts = sampling interval

P = Kc

I = Ki * Ts

D = Kd / Ts

Ki = Kc / Ti

Kd = Kc * Td

Ti and Td are the integral and derivative times, respectively, in minutes, and Kc is the proportional gain constant.

PID (FPGA) Details

The Express VI represents the PID proportional, integral, and derivative gains as 16-bit integers, where the upper 8 bits represent the integer part and the lower 8 bits represent the fractional part. Given the Proportional gain (Kc), Integral time (Ti, min), and Derivative time (Td, min), respectively, the Express VI scales these gains according to the following formulas:



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


Resources


 

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