Low Pass Filter For Derivative Control

For the derivative portion of the PID controller a low pass filter with infinite impulse response (IIR) was used to reduce the noise in the derivative error and therefor smooth out the control signal. An exponential moving average was used.


et = Positional Error at time t
det/dt = Derivative of Positional Error (approximated by current and previous positional error)
Et = Derivative of Positional Error after low pass filter
r = Smoothing Factor (smaller for greater smoothing)