Trouble with PWM Control of DC Fan

Thread Starter

dmarciano84

Joined Oct 1, 2023
36
I am currently experiment with PWM for a project I am working on where I need to control a fan from PIC MCU. To ensure I understood everything, and before I start designing/coding with the PIC, I designed to hook a fan up to a breadboard. For this I got a Noctua NF-A4x10 5V fan as Noctua had good documentation. However I am running into an issue where the speed does not seem to change.

I have the fan hooked up to a 5V regulator (running off a 12V power supply). If I don't connect the PWM signal, then I see the fan drawing 70mA and the scope is showing that it is running at approximately ~4,500 RPM (i.e., 152Hz) and the maximum speed of the fan is 5,000 RPM so I was fine with this:
1700158734160.png

When I hook up the PWM signal, and turn the channel off, the fan does not rotate, which is what I expected. However, if I turn on the PWM signal, regardless of what duty cycle I set it to (i.e., 1% - 99.9%), I get a frequency of ~84Hz which works out to ~2,500 RPM (half of the maximum). I can also see on my power supply that it is drawing half the current (i.e., 30mA).

1700158866739.png

Based on the Noctua documentation (linked above) I am running my PWM signal at 25KHz @ 5V:
1700158977842.png

I did use a multimeter to confirm at the fan terminals that it was indeed receiving at 25KHz signal. For reference, this was the circuit:
1700161439168.png

When that didn't work at all, I tried using their recommended drive circuit which has MOSFET's:
1700161694021.png

However, when using this circuit, all of a sudden I see over 800mA being drawn by the LM7805 and it got quite hot. I've never needed to use MOSFETs before so I am assuming I am doing something wrong, even though I check the connections multiple times and even took them out and re-did it. Do I need a resistor on the PMOS Drain and/or on the output to the fan? If so, what would be the best way going about choosing the value?

Any guidance on a way to get this PWM signal working as expected and what I may be doing wrong with the MOSFETs would be greatly appreciated. TIA.
 

Attachments

ci139

Joined Jul 11, 2016
1,898
is the Q1 pinout (protective diode polarity) as indicated at last schematic diagram

also 800mA · 7V≈ 5.6W heat to LDO

IF the MOSFET-s module is built-in to motor THEN you must see you have sufficient driving signal for not to leave both shoulders open
 

Thread Starter

dmarciano84

Joined Oct 1, 2023
36
is the Q1 pinout (protective diode polarity) as indicated at last schematic diagram
The Q1 schematic symbol (with the diode polarity) matches the datasheet.

also 800mA · 7V≈ 5.6W heat to LDO
Just to clarify, it is running at 5V, not 7V (so 4W). Either way, yes, it is drawing way to much current but I am not clear on why; it should only be drawing 7mA max. The fan does draw that without a PWM signal. It is definitely something to do with the MOSFETs because if I use the second circuit and simply turn off the PWM signal, the fan runs at full speed and there is only a 7mA draw. But as soon as I turn on the PWM signal, the current goes way up. That is why I am think I need a resistor somewhere.

I did try putting a 1k potentiator on the drain of Q1 to see if it helped. At 1k the current draw was ~3mA and as I slowly decreased it the current draw went up, but the fan speed remained the same (at about half speed) the entire time regardless of the duty cycle. I decreased the resistance until I got up to about 8mA and then stopped since it made no difference and I am trying to not burn anything out.

Unfortunately I have never used MOSFETs, and rarely transistors, as I have really never had a need so I am kind of lost. I am assuming it is something simple I am just ignorant to.

IF the MOSFET-s module is built-in to motor THEN you must see you have sufficient driving signal for not to leave both shoulders open
The MOSETs are not built-into the motor. The Noctua documentation shows two different way to drive the PWM line. They show one using a single transistor, which they say is not recommended, and the above MOSFET circuit which they do recommend.
 
Last edited:

Thread Starter

dmarciano84

Joined Oct 1, 2023
36
I also just tried moving the potentiator between the source pin of Q2 and Ground. This time though, instead of drawing 3mA and then increase as I decreased the resistance, it drew the normal 7mA, regardless if there was a signal or not, and once I decreased it to a certain point (with the PWM signal on) then the current draw jumped to +100mA at which point I quickly turned it off. Could it be I need 2-3 resistors (i.e., between VCC and Drain of Q1, between Source and Ground of Q2, and/or on the fan input)? I am really lost on this now.
 

Alec_t

Joined Sep 17, 2013
14,189
Q1 in your second schematic is upside-down. Its source should be connected to the positive rail. The way you have it there will be shoot-through, accounting for the high current you experienced.
 

Thread Starter

dmarciano84

Joined Oct 1, 2023
36
Q1 in your second schematic is upside-down. Its source should be connected to the positive rail. The way you have it there will be shoot-through, accounting for the high current you experienced.
I thought this matched exactly what was shown in the Noctua documentation. It shows this:
1700167336269.png

And in the PMOS datasheet it shows this:
1700167428078.png

So based on these two (which are vertically mirrored) I would think that the VCC is connected to the Drain on Q1 (i.e., the pin/line not connected to the center).

I will try your suggestion but can you explain what I am missing/misinterperting?
 

Thread Starter

dmarciano84

Joined Oct 1, 2023
36
I tried your suggestion but had the same issue that as soon as I turn on the PWM signal the current skyrockets. Here is a picture of how I have everything wired up (prior to the suggestion of flip the PMOS). Hopefully this help somewhat:
1700168317033.png

When I tried your suggestion of flipping the PMOS I swapped the positions of the Brown & Beige wires of the PMOS with the Red wire of the PMOS.
 

ElectricSpidey

Joined Dec 2, 2017
2,756
You shouldn't need any transistors as long as your signal gen. produces a proper output signal.

I would be very leery of shoot thru with that MOSFET configuration.

Are you sure you have your grounds connected properly.
 
Last edited:

Thread Starter

dmarciano84

Joined Oct 1, 2023
36
Yes, all grounds are hooked up to the same rail.

I did find why the original circuit wasn't working without any transistors. Turns out on my signal generator I needed to put it into Pulse mode. It doesn't have a PWM-specific mode so I thought Square made sense since it had the duty cycle and everything but it turns out it doesn't do anything (even though you can set the duty cycle) and I thought Pulse mode was for single-shot. Turns out Pulse Mode = PWM Mode on the tool. Only found this out after hooking my scope directly to my signal generator.

I would be very leery of shoot thru with that MOSFET configuration without a proper dead zone.

You shouldn't need any transistors as long as your signal gen. produces a proper output signal.
The only reason I was trying this configuration is because that is what the manufacture put in their documentation.

I am going to be generating this signal from a PIC16F18877 using its built-in PWM controls. Everything I have read has said not to drive it directly from the MCU but to use some kind of transistor driver.
 

ElectricSpidey

Joined Dec 2, 2017
2,756
Well, if you feel the need to buffer your PIC output, I would NOT use the MOSFET configuration that is in the Noctua Whitepaper.

I just had it in a sim (LTSpice) and I was seeing 200 amp draws while the input was high.

That configuration seems to be ignoring the body diodes.
 
Top