Pwm on a DC motor

Add a flyback diode.