added EMA-averaging of pwm values (used to estimate direction and velocity).