Chapter 2 PID AlgorithmsLabWindows/CVI PID Control Toolkit User Manual 2-2 ni.comImplementing the PID Algorithm with the PID FunctionsThis 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 ControlToolkit.Error CalculationThe following formula represents the current error used in calculating proportional, integral,and derivative action, where PVf is the filtered process variable.Proportional ActionProportional action is the controller gain times the error, as shown in the following formula:Trapezoidal IntegrationTrapezoidal integration is used to avoid sharp changes in integral action when there is asudden change in the PV or SP. Use nonlinear adjustment of the integral action to counteractovershoot. The following formula represents the trapezoidal integration action.Partial Derivative ActionBecause of abrupt changes in the SP, apply derivative action to only the PV, not to the error(e), to avoid derivative kick. The following formula represents the partial derivative action.Controller OutputController output is the summation of the proportional, integral, and derivative action,as shown in the following formula:e(k) = (SP PV f)–u P k( )= K c* e k( )( )u I k( )=K cT i------ e i( ) e i 1–( )+2---------------------------------- tΔi 1=k∑u D k( ) = K cT dΔt----- PVf k( ) PVf k 1–( )–( )–u k( ) u P k( ) u I k( ) u+ D k( )+=