Controlling fan speed via PWM

In the electronics section of these forums Perry Bebbington has a very good writeup about flyback diodes and why you need them. You want to give that a read. Hopefully it will answer some of your questions.

Ron