Previously, I answer for this PID controller that I want to understand completly.
This is used for control the opening $U_n$ of a valve let gas pass and reach a certain pressure (SetPoint).
There is current error, and Tsample and 2 Tsample before. Aditionally, there is a variable that store the current change in the error respect the last , and the same Tsample before. Finally a variable that store the variation of the change of the error.
$$e_{n-2}=e_{n-1}$$ $$e_{n-1}=e_n$$ $$e_n=SetPoint-ProcessValue$$
$$P_n=e_n-e_{n-1}$$ $$P_{n-1}=e_{n-1}-e_{n-2}$$
$$Q_{n}=P_n-P_{n-1}=(e_n-e_{n-1})-(e_{n-1}-e_{n-2})$$
And the calculation of control signal, where $dP_n$ is the proportional part, $dI_n$ is the integral part, $dD_n$ is derivative part, $K_p$ is global gain, $R_p$ is proportional gain, $T_i$ integral time, $T_d$ derivative time, and $dU_n$ is the PID output:
$$dP_n=R_p*P_n$$ $$dI_n=T_i*e_n$$ $$dD_{n-1}=dD_{n}$$ $$dD_n=(Q_{n}*T_d+dD_{n-1})/2$$ $$dU_n=K_p*(dP_n+dI_n+dD_n)$$
After that, it calculate the direction of the correction, where PC (positive correction) is a variable with TRUE value if $dU_n>0$ and FALSE value if $dU_n<0$ and NC (negative correction) is TRUE if $dU_n<0$ and FALSE if $dU_n>0$.
If PC=TRUE then $U_n$=$U_{n-1}$+$dU_n$
If NC=TRUE then $U_n$=$U_{n-1}$-$dU_n$
In the post whose link I attached at the beginning of the query, Tim Wescott answered me that the step where $$U_n=U_{n−1}±dU_n$$ is a numerical integration.
He said that this is an ordinary PID controller, with a numerical derivative of every step.
What is the point of using this derived PID controller?