PID controller
Thus, a "velocity algorithm" for implementation of the discretized PID controller in a MCU is obtained by differentiating formula_6, using the numerical definitions of the first and second derivative and solving for formula_94 and finally obtaining: