implemented PWM control on motor