Chapter 2 PID Algorithms
LabWindows/CVI PID Control Toolkit User Manual 2-2 ni.com
Implementing the PID Algorithm with the PID Functions
This section describes how the PID Control Toolkit functions implement the fast (positional)
PID algorithm. The fast PID algorithm is the default algorithm used in the PID Control
Toolkit.
Error Calculation
The following formula represents the current error used in calculating proportional, integral,
and derivative action, where PVf is the filtered process variable.
Proportional Action
Proportional action is the controller gain times the error, as shown in the following formula:
Trapezoidal Integration
Trapezoidal integration is used to avoid sharp changes in integral action when there is a
sudden change in the PV or SP. Use nonlinear adjustment of the integral action to counteract
overshoot. The following formula represents the trapezoidal integration action.
Partial Derivative Action
Because of abrupt changes in the SP, apply derivative action to only the PV, not to the error
(e), to avoid derivativekick. The following formula represents the partial derivative action.
Controller Output
Controller output is the summation of the proportional, integral, and derivative action,
asshown in the following formula:
e(k) = (SP PVf)–
uPk()=Kc*ek()()
uIk()=Kc
Ti
------ ei() ei 1–()+
2
----------------------------------tΔ
i1=
k
∑uDk() = Kc Td
Δt
----- PV
fk()PV
fk1–()–()–
uk() uPk() uIk() u+Dk()+=