Motor and pump driver with PWM control