Chapter 3 Using the PID Control Toolkit
© National Instruments Corporation 3-5 LabWindows/CVI PID Control Toolkit User Manual
The fast PID algorithm is faster and simpler than the precise PID algorithm. Use the fast
algorithm in fast control loops. The precise PID algorithm uses the Two Degree of Freedom
algorithm to control the PV, which gives better results than the fast PID algorithm. The precise
PID algorithm also uses extra parameters such as Beta, Linearity, and Setpoint Range, which
you can specify using PidSetAttribute. The precise PID algorithm implements a
bumpless manual-to-automatic transfer, which ensures a smooth controller output during the
transition from manual to automatic control mode.
Control Input FilterYou can use the filtered PV to filter high-frequency noise from the measured values in a
control application. For example, you can use a filtered PV if you are measuring process
variable values using a DAQ device. To use a filtered PV, set pidAttrUseFilteredPV to 1.
By default, this attribute is set to 0. You can use PidSetProcessVariableFilter and
PidGetProcessVariableFilter to set or get custom filters.
As discussed in the Setting Timing section, the sampling rate of the control system should be
at least 10 times faster than the fastest time constant of the physical system. Therefore, if
correctly sampled, any frequency components of the measured signal that are greater than
one-tenth of the sampling frequency are a result of noise in the measured signal. Gains in the
PID controller can amplify this noise and produce unnecessary wear on actuators and other
system components. The filtered PV uses a low-pass fifth-order Finite Impulse Response
(FIR) filter to filter out unwanted noise from input signals. The cutoff frequency of the
low-pass filter is one-tenth of the sampling frequency, regardless of the actual sampling
frequency value.
Output Rate LimitingSudden changes in control output are undesirable or even dangerous for many control
applications. For example, a sudden large change in the SP can cause a very large change in
controller output. Although, in theory, this large change in controller output results in fast
system response, it may also cause unnecessary wear on actuators or sudden large power
demands. In addition, the PID controller can amplify noise in the system, which results in a
constantly changing controller output.
You can use output rate limiting to avoid the problem of sudden changes in controller
output. To enable output rate limiting, set pidAttrLimitOutputRate to 1, set
pidAttrOutputRate and pidAttrInitialOutput to limit the rate of change of the
controller output, and specify the controller output value on the first iteration of the control
loop, respectively. Call PidSetAttribute and PidGetAttribute to set and get these
attributes.