PC Fan Controller design verification

Thread Starter

DeletedUser1212

Joined Oct 26, 2015
16
Hello

Im designing a PC fan controller that will let me set speed of up to 5 fans in my PC case, it will be powered with 12V from PSU.
I decided that each fan will have its own voltage regulator and with potentioneter ill be setting voltage going to fan from max to min at which they will stop running.

This is the initial schematic


From left to right. First there is MOLEX connector with 12V on it, then main fuse (its 4A because ill have 5x fan each max 500mA + some space for other stuff) and next main switch. There i have RC circuit to create a softstart (12kΩ and 47μF should give about 4 seconds before full 12V is reached) in case all 5 fans are set to max speed when the power is triggered.

Next the 12V is going to fan speed control section. On schematic there is only one but it will be cloned 5 times, for each fan controlled. The voltage regulator is LM1117 (same as LM317T but its LDO). A fixed resistor of 110Ω and potentiometer of 1kΩ should give me full range of regulation from min 1.25V to the max of about 11V (12V - Dropout voltage).

I dont have yet fans im gonna use, but initial tests on other 12V case fan have shown that minimal voltage at which they start moving on their own is 4V and current draw is at 40mA and at max 12V its 110mA. In this case power dissipated on voltage regulator is from 0.15W to 0.35W.
I think that the TO220 case + radiator should be fine? Also i added capacitors on in and out of regulator as per datasheed, tho im wondering if i shouldn't move the C2 capacitor "outside" (right now i have 5x C2 capacitor, each of separate fan and im thinking if i shouldnt make just one capacitor for all of them). And lastly there is separate fan fuse and a flyback diode across the fan.

And here comes the troubling part.

I want to have a LED light signalising if the fan is turned off or its currently running. Separate LED for each fan.
The 4V is approximately the minimal voltage at which fan starts running. Because of that I was thinking to make a voltage divider.
In first circuit the 2N7000 mosfet is triggering LED. Its Vgs Treshold voltage is from 0.8V to 3V, so with a voltage divider R7 and R8 i should have that 0.8V when the input voltage is 4V and while it will be not enough to trigger mosfet the light will be off. Increasing input voltage will light it up as the fan starts spinning.

After while of looking at schematic i figured, should i use the 2M7000 at all? I made this schematic:


The voltage divider made of R4 and X5 potentiometer (precise for finetuning) will be triggering LED. With R4 with fixed 460Ω and adjustable potentioneter X2 2kΩ i cane make it that when around 4V is going into voltage divider the output voltage is at around 2V which is not enough to trigger LED and when voltage increases to say 4.5V it will light up. The R5 limits current on LED to about 5mA so the power dissipated trough R4 resistor is at around 5mW.

Please check my schematic. Especially if i didnt make any mistakes, forgot about some parts. Or maybe if i complicated something too much and there is simpler way to make it (less parts, safer). Especially a way to make the light go off at voltage lover than X and light up when it goes up to some level.

Thank you in advance for advices.
 

wayneh

Joined Sep 9, 2010
17,496
I'm concerned about one of your basic design choices - to control fan speed with voltage. This is problematic and is usually not done. The usual solution is to use PWM (pulse-width modulation) instead. This maintains torque at low rpm and is more reliable for getting smooth speed control. Many, many fans are designed to be controlled this way, and these may even be damaged by low voltage. I highly recommend you read about computer fan speed control.
 

atferrari

Joined Jan 6, 2004
4,764
Hola Conrado

Maybe this could help you if the PC fan has a controller embeded on the hub. Learnt that "all" have them nowadays.

From a very recent test I did on what seemed a "standard" 4-pins connector PC fan, having the black wire on your left, I got:

black - GND
yellow - +12V
green - tacho signal - 2 pulses per revolution (output)
light blue - PWM ctrl (input - see below)

The 3-pin fans may be used here knowing that you do not have the PWM control available.

As per the governing standard (reccomendations?) the PWM control should be a nominal 25KHz signal (0 to 5V). Look for that standard to know about the "iddle" speed.

Worth to note:

Those PC fans get their voltage unaltered; control is via PWM.

At the tacho output I used a 10K pull-up resistor to 12V.

With no signal in pin 4, the fans goes faster.

0V on pin 4 gets the fan running to a supposed "minimum" of 30%. (Read the standard).

Steady 5V on pin 4 means NO change in speed.

PWM ctrl (between 20 and 80% that my function generator allows) seemed to have a very linear response.
------------------------------------------

Not read you schematic in detail Do you actually need a regulator for each fan? Really?.

Buena suerte.
 
Last edited:

AnalogKid

Joined Aug 1, 2013
10,986
100% of the total fan current is coming through a 12 K resistor. This won't work. Let your power device do the power work. Adding a large capacitor to the LM1117 control pin will cause a slow voltage ramp up without having a fixed series resistor in the power path. This can be decoupled with a diode to remove itself after start up.

DC voltage control of small fans is not very efficient, but it is low effort and generates much less noise than PWM. I strongly recommend limiting the minimum output voltage to 6 V, as many fans will not start up reliably below this.

Your description mentions fans being off, but there is no mechanism for this in the schematic.

Because fans last much longer when operated a little below their rated voltage, consider sensing fan power with a shunt resistor to GND and a bipolar transistor. Or, since you are turning fans off presumably by eliminating their power, use a voltage comparator on each fan's output voltage.

ak
 

Thread Starter

DeletedUser1212

Joined Oct 26, 2015
16
Thank you for replies and link to pcbheaven.

Using PWM seems like great idea, i didnt think of 555 ICs (im more of digital person MCU etc. but i know sometimes its much easier and faster to 'go analog' ;). Using 5x 555IC (for 5 separate control channels to fans) look like it should make design more efficent? Reduce total power dissipation (especially after removing loosy linear voltage regulators).

Ill clarify few things first:
1. The circuit will be designed to control only 3-wire fans (12V, Gnd, Tacho) and i wont need the tacho signal at all.
2. I mention fans being off (and led indicating spinning fan off too) but the way i want to achieve it is to lower the effective voltage powering fan to the level where fan starts to stall. With new schematic with PWM by lowering it to minimum.

This is the new schematic:




I removed the bad softstart with RC. I no longer have LM1117. Is there another way to make softstart in case PWM on NE555 is at 100% and all fans will start up at max speed at once?

I redesigned circuit according to PCBheaven. Changed transistor to one i have (its low rdson 160mΩ so voltage drop and power dissipation will be small, fast switching for PWM and has low gate charge of 11nC).

The thing still left from previous circuit is the part that shuts down LED indication if the fan is working when voltage drops below 4V. @AnalogKid mentioned sensing fan power with a shunt resistor to GND and bipolar transistor. Im not familiar with this.
A more simply solution seems to be the other one he mentioned. Using voltage comparator. Could it look like this:

I would take some opamp voltage comparator like LM393P. On its Input+ i would link the PWM signal from NE555. On its Input- i would put a reference voltage (either from voltage divider to get 4V from 12V or link it from ATX 5V). Then on V+ of comparator i would add 12V and i would link GND and V- to GND. The OUTPUT signal from comparator would be connected to RESET pin of NE555.

Will this work? When PWM goes to 30% (and effective voltage on FAN is lower than 4V) which would be lower than reference voltage on comparator, then the comparatour OUTPUT would go to low state (gnd/0v) which would set NE555 to reset state and setting its output to 0v thus it will shut down the fan and i could also use it to shut down the LED (now without the voltage divider, tied directly to same voltage powering fan?
 

Thread Starter

DeletedUser1212

Joined Oct 26, 2015
16
I couldn't edit previous post. This is how i understood what @AnalogKid meant with using comparator to shut down fans below X[V] to prevent stalling:

When PWM % lower than 33 effective voltage on fan around 4V which is smaller than reference 4.3V so comparator out is low (0v/gnd) and linked to NE555 reset sets its output to 0 (0% PWM, all low, fans stop).
 

AnalogKid

Joined Aug 1, 2013
10,986
Close. The 393 is an analog comparator, and won't know what to do with a square wave input. Also, the input common mode range of a 393 does not include its positive rail, so both the reference and the compared input must be divided down. The compared input must come from the fan output voltage where its been filtered some. If there still is too much sawtooth at the input, either extra filtering at the comparator input or some hysteresis (or both) should stabilize the output.

ak
 

RichardO

Joined May 4, 2013
2,270
Also, the input common mode range of a 393 does not include its positive rail, so both the reference and the compared input must be divided down.
AnalogKid:
One quirk of the LM393 is that only one of the differential inputs must be within the common mode voltage range. For example if one input is at 1/2 of the power supply voltage then the other pin can go all the way to 36 volts without any problems! The input current does not increase and the output polarity is correct.

Those National Semiconductor designers sure had their act together 40 years ago. :D
 

AnalogKid

Joined Aug 1, 2013
10,986
True, but it's a comparator. An extra-wide out-of comparison tolerance or outside-the-rails operation tolerance is great for field reliability, but that doesn't affect the requirements for the comparator transition voltage.

ak
 

Thread Starter

DeletedUser1212

Joined Oct 26, 2015
16
@RichardO @AnalogKid

1. Regarding the the common mode range, looking into datasheet of 293 and 393 comparators and reading around i figured there is parameter VICR = Vcc-2 and reading around it seems that its not allowed when both inputs Input- and Input + are above VCC-2 (so in my case around 10V) and as long as one input is below that (so Vref on Input- at 4 or 5V would fill this condition) the IC will work as intended? Need more clarification.

2. And for the filtering NE555 PWM output. Will an RC filter be sufficient? Ive seen things like this being used to turn pulse outputs of MCUs like arduino etc. to create a 'real' DC output DAC


Im simulating this circuit with a PWM source 21kHz 12V 33% and it seems to be working as intended:


But the circuit im using is having PWM output frequency set at 2.4Hz, at when i change source frequency to that the filter fails to work:


I understand the tuning of Capacitor and Resistor values i needed? Im having problems doing it. From what i figured out, i want RC filters cutoff frequency to be lower than PWM frequency? The first page results on PWM RC filtering omit this case entirely, the filters they present are working on some standard PWM frequencies but they dont explain how i should match the filter for low frequency filter.
 

Thread Starter

DeletedUser1212

Joined Oct 26, 2015
16
I found this site:
http://www.allegromicro.com/en/Desi...Output-When-Using-Hall-Effect-Sensor-ICs.aspx

It explains how to pick RC filter for a PWM output but im having hard time adjusting it.

I used the formulas and example, for fPWM = 2.4Hz, VPWM of 12V, and i wasnt picky about ripple voltage so i left it at 0.2V

I calculated Adb = -41.584dB; f3db = 0.02 Hz for first order filter and f3dB = 0.22 Hz for second order filter. From formula (5) and (6) i calculated Rf = 795kOhm with Cf = 10 uf and the result was terribly slow.

I lowered the capacitor value to 1uF and resistor to 159kOhms. The response time was still terribly slow and ripple was enormous 6V.

Lowering capacitor value to 0.1uF would still give long time and big ripple while lowering the capacitor value to like 0.01uF (with 15mega Ohm resistor) would make filter fail to work (result like on screenshot in previous post).
 

Thread Starter

DeletedUser1212

Joined Oct 26, 2015
16
I lack the knowledge to read from schematic what's the real frequency.
I asked creator if he really meant 2.4Hz but im waiting for reply.
Maybe someone here can tell if the circuit really is generating 2.4Hz.
 
Last edited:

Thread Starter

DeletedUser1212

Joined Oct 26, 2015
16
Why such a low frequency? That's unrealistic for fan speed control.
Honestly, I have no idea. Im using circuit from pcbheaven posted at top of topic.

The creator wrote there he uses 2.4 Hz pwm. he might have mistyped and for real he meant 2.4kHz and that's the real frequency in his circuit that I use.
 

Thread Starter

DeletedUser1212

Joined Oct 26, 2015
16
I lack the knowledge to read from schematic what's the real frequency.
I asked creator if he really meant 2.4Hz but im waiting for reply.
Maybe someone here can tell if the circuit really is generating 2.4Hz.
I strongly dislike that i can edit my last post only for hour after posting it. But back to topic.

I just simulated circuit in Multisim, exactly this one (i switched the potentiometer with two resistors to simulate it) http://pcbheaven.com/circuitpages/PWM_Fan_controller_using_a_555/



I linked the PWM output of NE555 to oscilloscope and took the time points to calculate frequency, red channel is 555 output with 50% duty cycle:
(0.020327s - 0.019550s) = 0.000777s period -> 0.000777^-1 ~= 1.287kHz frequency

To make sure what i see is what it is i added separate signal generator to channel b (green color). Its parameters were amplitude 12Vp, frequency 1302Hz, duty cycle 50% and rise/fall time 1ns:
(0.020353s - 0.019584s) = 0.000769s period -> 0.000769s^-1 ~= 1.3kHz frequency

So it seems there is typo on the PCBheaven, probably the meant frequency was supposed to be 2.4kHz, the other thing is that simulated circuit outputs only 1.3kHz.

After finding out the frequency is not whats written on that site, i repeated all my calculations for RC filter and now everything is as intended. 1st order filter R = 7.3kOhm, C=1uF, fPwm=1.3kHz, Vripple = 200mV and in simulation looks like its working as intended........... but is it real? or is it only theory?




So the question remains if filtering NE555 output with RC filter will be enough to make it comparator input valid?
 

Thread Starter

DeletedUser1212

Joined Oct 26, 2015
16
I just cleaned up the main schematic and put it together with all changes.
Things changed/added:
- LED2 is now properly powered from PWM/dimming according to PWM fill
- Added attempt to cut off power to fan when voltage drops below set lvl (reference from voltage divider R5 R6) to prevent fan stalling). Voltages compared in U2, the PWM signal filtered with RC filter R3 C.
- Added pullup resistor on LM393 output

But there is a problem. I think that if ill wire comparator output to NE555 reset pin then the IC will never start up and PWM signal will always be flat 0V line.
Situation: Potentometer is set to minimum duty cycle, close to 0. Circuit is being started up. NE555 reads potentiometer to be set to 0 so sends out 0V PWM. 0V PWM gets to comparator, its lower than 4V so LM393 output is LOW. The LOW output goest to reset and keeps NE555 in low state. Now i set potentiometer to 100%.

And problem here, the NE555 might newer send a 100% PWM because before it does so, it still getting a LOW input on reset pin because the new 100% PWM signal will never reach comparator.

Even with the potentiometer set to max PWM the initial states on circuit inputs/outputs will be low when the main switch S1 is disconnected. And then when i turn it on, even if NE555 is told to go MAX PWM from potentiometer the LOW signal from previous state of LM393 (from before power was turned on) will keep NE555 reset pin down and thus the PWM will never start.

Is my way of thinking legit? If yes i need another way that will let me cut off power to fan (and LED2) when average voltage from NE555 PWM output will drop below set reference voltage.

This is how schematic looks now:


Close. The 393 is an analog comparator, and won't know what to do with a square wave input. Also, the input common mode range of a 393 does not include its positive rail, so both the reference and the compared input must be divided down. The compared input must come from the fan output voltage where its been filtered some. If there still is too much sawtooth at the input, either extra filtering at the comparator input or some hysteresis (or both) should stabilize the output.

ak
 
Last edited:

wayneh

Joined Sep 9, 2010
17,496
Why not just use external resistors on X3, to limit the low end of the PWM signal? You could set it so that "zero" on the knob gives a minimum percentage duty cycle.
 

Thread Starter

DeletedUser1212

Joined Oct 26, 2015
16
Why not just use external resistors on X3, to limit the low end of the PWM signal? You could set it so that "zero" on the knob gives a minimum percentage duty cycle.
Thats a good idea but not exactly what im aiming for. I want not only 'limit' the PWM signal but be able to actually 'turn off' separate fans when i dont need them.

Just limiting PWM with external resistor will mean that all the fans will always have to be running, even if at minimal speed.
 

wayneh

Joined Sep 9, 2010
17,496
Sorry, I meant to add that you could use a pot with a switch built into it. If you turn it low enough, it'll simply switch off the fan entirely, going from, say, a 40% duty cycle (determined by the external resistor added in series with the pot) to completely off.
 
Top