Go Down

Topic: Fan Control Theory (Read 8320 times) previous topic - next topic

Dylfish

Hey Guys,

Im looking to control 3 fans (12v PC Case, Arctic f12 PWM) and i was wondering if my logic is correct.

Since the fans are connected to +12v could I use a transistor as a switch connected to pin 3 set up so when the PWM duty cycle goes high it connect the grounds of the fans and allows me to throttle them that way? The 12v will eventually be from an external Molex connector.

Would there be any downsides if done correctly like fan wear or any dangers im unaware of?

Cheers

dc42

That should be fine, I've controlled a PWM fan like that, I think it was an Arctic F12 pwm too. Bear in mind that the Intel PWM spec only guarantees that fans will run from 30% pwm to maximum. Also, if you drive the fan PWM input from an NPN transistor or N-channel mosfet (the easiest way), then the PWM works in inverse mode, i.e. the more the Arduino output pin is high, the slower the fan speed.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Dylfish

cool thanks,

How does the inverse part work? Would a npn work different to a pnp in regards to how it switches? I'll have to look into mosfets as i never have used them.

krupski


That should be fine, I've controlled a PWM fan like that, I think it was an Arctic F12 pwm too. Bear in mind that the Intel PWM spec only guarantees that fans will run from 30% pwm to maximum. Also, if you drive the fan PWM input from an NPN transistor or N-channel mosfet (the easiest way), then the PWM works in inverse mode, i.e. the more the Arduino output pin is high, the slower the fan speed.


I've done that (PWM control a PC muffin fan). You need to be sure that the PWM frequency is high enough not to alias with the switching speed of the fan at any RPM, otherwise the fan will tend to "jump" in speed at the alias point, then the loop will try to correct it and the fan will hunt "zoom..... slow....zoom...slow....".

Or, use a parallel capacitor to smooth out the PWM into a reasonably clean DC level so that the fan can't alias with the PWM frequency.
Gentlemen may prefer Blondes, but Real Men prefer Redheads!

Dylfish

Sorry what do you mean by alias with the fan?

dc42


I've done that (PWM control a PC muffin fan). You need to be sure that the PWM frequency is high enough not to alias with the switching speed of the fan at any RPM, otherwise the fan will tend to "jump" in speed at the alias point, then the loop will try to correct it and the fan will hunt "zoom..... slow....zoom...slow....".

Or, use a parallel capacitor to smooth out the PWM into a reasonably clean DC level so that the fan can't alias with the PWM frequency.


We're talking about PC fans with a separate PWM input, so the above doesn't apply. However, the Intel PWM fan specification calls for the PWM to be at 25kHz, +- 2kHz AFAIR.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

dc42


How does the inverse part work? Would a npn work different to a pnp in regards to how it switches? I'll have to look into mosfets as i never have used them.


There isn't a good way to use a PNP transistor to interface the fan because it's designed to be driven from an active low open-collector/open-drain output.

You can program the counter-timer to get inverse PWM, it's one of the options in the control register.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Dylfish

I have been looking at this and im thinking it might be the way to go.

http://bildr.org/2012/03/rfp30n06le-arduino/

Hopefully i can run the 3 fans this way PWM controlled fan or not. I dont have much experience with mosfets but this might the time to start.

dc42

Personally, I would stick with fans that are designed for PWM use, and use a 2N7000 small signal mosfet to drive the PWM pin.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Dylfish

Yeah, When ive tried with direct PWM i cant get it to scale down to nearly nothing. Im thinking ill use the PWM signal to open and close a switching MOSFET as if I were disconnecting the fans hand by hand. Would this damage the fan?

dc42

I still don't understand why you are talking about PWMing the power to the fans, when the fans you are talking about have a pwm control input. Either way, you won't get the fan speed to go down to nearly nothing. The Intel spec for PC fans with PWM input requires them to go down to 30% or less.

btw if you PWM the power to the fans, then the tacho output from the fan won't work. If you use the pwm input, then it will work as normal.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Dylfish

im only saying that because the PWM control pin with analogwrite(3, 0) would only decrease the speed by 5% (barely noticeable).

Then again i don't know if its anything I'm doing incorrectly. I have the gnd from the arduino to my breadboard and then 12v into the breadboard terminal strip, so the grounds are common. The fan is connected to the 12v and gnd on the breadboard and the blue PWM wire is connected directly to pin 3.

If i wont need to PWM the power what is the use of the mosfet? Sorry for the stupid question and thank you for all your help.

dc42

PC fan PWM inputs are supposed to be driven from an open-collector or open-drain output, at a frequency of 25kHz. I posted suitable code in my response to your question in the Microcontrollers section. That code has been tested on a PWM fan - an Arctic F12 PWM afair.

The best way to drive the fan PWM input is one of the following:

1. Use a small signal npn transistor such as BC337 or 2N3904. Connect collector to fan PWM input, emitter to ground, and base to Arduino PWM output pin through a 10K resistor.

2. Use a small signal mosfet such as 2N7000. Connect drain to fan PWM input, source to ground, and gate to Arduino PWM output pin (no resistor needed when driving a small signal mosfet from an Arduino pin).
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

dc42

PS - just noticed you are trying to use pin 3. You can't get accurate 25KHz PWM from pin 3 because that pin is controlled from an 8-bit timer. If you use analogWrite then the PWM frequency you get is about 490Hz. The code I posted in the other thread generates 25KHz PWM on pin 10 (on a Uno).
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

krupski



I've done that (PWM control a PC muffin fan). You need to be sure that the PWM frequency is high enough not to alias with the switching speed of the fan at any RPM, otherwise the fan will tend to "jump" in speed at the alias point, then the loop will try to correct it and the fan will hunt "zoom..... slow....zoom...slow....".

Or, use a parallel capacitor to smooth out the PWM into a reasonably clean DC level so that the fan can't alias with the PWM frequency.


We're talking about PC fans with a separate PWM input, so the above doesn't apply. However, the Intel PWM fan specification calls for the PWM to be at 25kHz, +- 2kHz AFAIR.


Actually, I was talking about a plain old 3 wire fan (power, ground and tach output).

When the fan is spinning, the hall sensor switches the two phases back and forth (acting like the commutator on a DC brush motor). Obviously, this occurs at a rate (frequency) proportional to the fan RPM. If the PWM frequency of the driver is near the switching rate of the fan motor, strange things will happen. I know this because I've had the problem and figured out what it was.

I was NOT talking about a 4 wire "Intel style" PWM speed controlled fan, I was talking about using Arduino PWM + switching transistor to control an ORDINARY fan.
Gentlemen may prefer Blondes, but Real Men prefer Redheads!

Go Up