National Instruments 371685C-01 用户手册

下载
页码 39
© National Instruments Corporation
3-1
3
Using the PID Control Toolkit
This chapter contains the basic information you need to design a control strategy using the 
PID Control Toolkit functions.
Designing a Control Strategy
When you design a control strategy, sketch a flowchart that includes the physical process and 
control elements such as valves and measurements. Add feedback from the process and any 
required computations. Then use the PID Control Toolkit functions to translate the flowchart 
into an application.
You can handle the inputs and outputs using DAQ devices, FieldPoint I/O modules, GPIB 
boards, or serial I/O ports. You can adjust polling rates in real time. Potential polling rates are 
limited only by your hardware.
Setting Timing
According to control theory, a control system must sample a physical process at a rate that is 
approximately 10 times faster than the fastest time constant in the physical process. For 
example, a time constant of 60 s is typical for a temperature control loop in a small system. 
In this case, a cycle time of 6 s is sufficient. Faster cycling offers no improvement in 
performance (Corripio 1990).
The PID control feature, lead-lag feature, and setpoint profile feature in the PID Control 
Toolkit are time-dependent. A component can acquire the timing information either from a 
value you supply to the 
pidAttrDeltaT
 attribute or from the built-in internal timer. By 
default, the 
pidAttrUseInternalTimer
 attribute is set to 1, so the component uses the 
internal timer. Call 
PidSetAttribute
 and 
PidGetAttribute
 to set and get PID controller 
attributes.
The internal timer calculates new timing information each time 
PidNextOutput
 is called. 
When the function is called, the timer determines the time since the last call to 
PidNextOutput
 and uses that time difference in its calculations. 
You can set the component to use the value you have supplied to the 
pidAttrDeltaT
 
attribute by setting 
pidAttrUseInternalTimer
 to 0. Use the 
pidAttrDeltaT
 attribute 
for fast loops, including instances in which you use acquisition hardware to time the 
controller input.