Chapter 2 PID Algorithms
LabWindows/CVI PID Control Toolkit User Manual 2-4 ni.com
The Precise PID AlgorithmThis section describes how the PID Control Toolkit functions implement the precise PID
algorithm.
Error Calculation
The current error used in calculating integral action for the precise PID algorithm is shown in
the following formula:
where SPrange is the range of the SP and L is the linearity factor that produces anonlinear gain
term in which the controller gain increases with the magnitude of the error. If L is1, the
controller is linear. A value of 0.1 makes the minimum gain of the controller 10% Kc. Use of
a nonlinear gain term is referred to as a precise PID algorithm.
The error for calculating proportional action for the precise PID algorithm is shown in the
following formula:
where β is the setpoint factor for the Two Degree of Freedom PID algorithm described in the
Proportional Action section. The formula used to calculate derivative action for the precise
PID algorithm is the same formula used to calculate derivative action for the fast PID
algorithm.
Proportional Action
In applications, SP changes are usually larger and faster than load disturbances, while load
disturbances appear as a slow departure of the controlled variable from the SP. PIDtuning for
good load-disturbance responses often results in SP responses with unacceptable oscillation.
However, tuning for good SP responses often yields sluggish load-disturbance responses.
β, when set to less than one, reduces the SP response overshoot without affecting the
load-disturbance response, indicating the use of a TwoDegree of Freedom PID algorithm.
βis an index of the SP response importance, from zero to one. For example, if you consider
load response the most important loop performance, set β to 0.0. Conversely, if you want the
PV to quickly follow the SP change, set β to 1.0.
e(k) = (SP PVf)(L+1 L–()*SP PV
f
–
SPrange
-------------------------) –
eb k() (β*SP PVf)(L+1 L–()*βSP PV
f
–
SPrange
----------------------------) –=
uPk()=Kc*ebk()()