Numerical integration and differentation in the PID algorithm