To cool the enclosure of my project I've installed two identical 40mm fans.
I've connected them to an IRF520 which is controlled by a PWM pin like shown here:
But the weird thing is when I try to use PWM it only works on 1 fan, the other refuses to spin unless it's full on.
How can this be? They are identical and I've tested them both with the same IRF520 and the same pin on the arduino...
The problem with the brushless DC motor is that it is, internally, driven with a kind of pwm. By interrupting the supply voltage using your own PWM you are breaking the PWM inside the motor. You would need a traditional brushed motor based fan to use PWM.
Alternatively, you can vary the voltage to the fan - that usually works.
You might be able to construct a low-pass filter on the PWM signal to give a varying DC voltage. It might work - worth a try.