Smoothing output from PWM fan controller

Teancum

Limp Gawd
Joined
Dec 12, 2003
Messages
275
So call me nuts when I say I'm building my own pwn fan controller. I've got all the parts and tools, and I'm just waiting for fall semester to start so I can get into the analog circuits lab down on campus to test my circuit as I'm building it.

My one question is this: I want a smoother output from my Pulse Width Modulation circuit. Normally, you get a modified square wave out of a PWM circuit, and I want to smooth that out so that the voltage the fans see is smoother. I thought about putting a resistor and capacitor in series connected to the output, with the fan(s) connected across the capacitor, but then at full power, the resistor will soak up some of the voltage.

But what about an inductor? Putting an inductor between the fan and the output of the PWM circuit would help to smooth out the waveform without ruining the full-power performance. It would look like this:

Do you see any problem with this circuit?
Code:
from PWM
     |
     |
    --- <-transistor (so it can handle larger loads)
12V_/ \___(inductor)____(fan)___GND
 
Solutions like that can be made to work for 1 particular fan power, but fall down if you put a different fan in system. The better way is to use an opamp integrator circuit to convert the pwm signal to an equivalent DC level. Dig out Micrel's Application Note 34 for their MIC502 fan controller chip, they show the method.
 
The inductor would work, I think, because it would (try to) maintain the same current through whatever load would be present, no matter the voltage, but your solution seems a bit more elegant. I should have thought of that! And I call myself an EE...
 
You're gonna kill that transistor by sticking an inductor there without an appropriate catch diode placed across it to snub voltage transients when the transistor turns off. Put the diode with one terminal at the junction of the transistor and inductor, and the other to ground. WHich way you ask? The way that doesn't cause the supply to short to ground when the transistor turns on....=)

But the bigger question is, why do you want to do this? Please recognize that by filtering the PWM output, you're harming your ability to run the fan at low speeds without damage to the motor-- The larger the inductor ( i.e. the more filtering you do) the more the final output looks like a DC voltage, and the more damaging it is to run the fan at low speed. However, if you're getting nasty RF interference, or the noise from the fan windings being driven by a PWM circuit is bothering you, filtering might be appropriate.... Always remember--don't fix things that aren't broke;)

good luck, have fun, and if you let the smoke out, learn why...
 
Normally i stay away from inductors and use capacitors instead.
it depends on how complex you want the circuit though. square waves are a little different also. i'd probably put some isolation on the PWM output so you could put the inductor or capacitor in front of the transistor. however, thats just me.
 
Aristarchus said:
...But the bigger question is, why do you want to do this?
One common reason is so the speed signal still works. Motherboard fan speed control converts the PWM output to a more linear form for that reason.

Also, some (most?) fans are noisier on PWM at lowish duty cycle than on an equivalent linear voltage.
 
Those would certainly be valid reasons for filtering the output. I only ask, because there are a lot of well-intentioned folks out there who jump into a project with less than a good idea of why, and end up disappointed with the results. (I certainly have)

And I'd be interested to know what PWM frequencies people are using to drive their fans that would cause them to be louder at low speed than with an equivalent DC input. I've never bothered to mess with my case fans, but it would be an interesting thing to investigate-- With a PWM freq >~20 kHz, what would be causing the additional audible vibrations? inquiring minds want to know! =)
 
I want to smooth out the output for the very reason cpemma mentioned--speed control. I did the diagram wrong--I'll have the transistor on the low-voltage side of the fan (is that right, btw?), so the signal can go from 12v down.

I thought about a capacitor. The problem is this, however. The capacitor will charge basically instantly to a high voltage, then fall off exponentially with the output of the PWM low. In other words, I'd end up with close to 12V all the time, witht he voltage simply falling down a certain amount between the peaks of the square wave. I thought about a lot of different permutations with capacitors and resistors to smooth the output, but none of them seem to work--until I heard the idea of using an amplifier. That's probably what I'll use--an integrating circuit with a bleed-off resistor to smooth out the wave. This circuit's getting bigger than I originally intended...
 
How about an inductor and capacitor? That's how it's done in switching power supplies.

switch.GIF


I'm not sure how you'd go about selecting the inductor and capacitor though, as I've never designed a switching supply myself.
 
Aristarchus said:
With a PWM freq >~20 kHz, what would be causing the additional audible vibrations? inquiring minds want to know! =)

I'd like to know as well. It seems to me that if you pushed the PWM frequency past audible range, you wouldn't be able to tell the difference. I could see if you were using a 1khz PWM frequency though...
 
mattg2k4 said:
How about an inductor and capacitor? That's how it's done in switching power supplies.

I'm not sure how you'd go about selecting the inductor and capacitor though, as I've never designed a switching supply myself.

Basically, higher the frequency, smaller inductor size you need and vice versa.
 
what IC are you using to generate the PWM signal?

I'll throw together a quick circuit. I design switchers as part of my day job :D
 
Aristarchus said:
With a PWM freq >~20 kHz, what would be causing the additional audible vibrations? inquiring minds want to know! =)
The 20KHz is probably causing some sort of mechanical resonance in the fan...
 
Aristarchus said:
And I'd be interested to know what PWM frequencies people are using to drive their fans that would cause them to be louder at low speed than with an equivalent DC input...With a PWM freq >~20 kHz, what would be causing the additional audible vibrations? inquiring minds want to know! =)
Most commercial PWM controllers for case fans seem to run at low frequencies - the purpose-built ICs made by Micrel (MIC502) and Microchip (TC646) as low as 30Hz. One's I've built have run around 120Hz max.
 
I don't realy see this as working to keep the rpm monitor working and still getting the true pwm opperation.

Would the audible noise from high freq PWMs be some sort of harmonic between the high frequency and the slow rotation of the fan?
 
Pherret said:
Would the audible noise from high freq PWMs be some sort of harmonic between the high frequency and the slow rotation of the fan?
In a fit of monkey curiosity, I modified one of my PWM controllers to run at around 1.5kHz - the fan noise can best be described as "someone next door but one using a circular saw on chipboard" and was loud up to almost full speed. Lots of harmonics, very noisy compared to low frequency. Next time I'm ordering components I'll try going above the audio range, but I'm not optimistic.
 
That's to be expected. You're basically using your fan as a speaker :). I bet you wouldn't find a 1.5khz sound to be that pleasant to listen to either :).
 
Yes, I'm planning on using a frequency >20 khz, so the audio won't be a problem. I just hope the timer circuit can go that fast. The problem with that is that I'll be sinking a not-insignificant amount of power. The way to avoid excessive power is to slow down the frequency or reduce the size of the capacitors I'm using for the timer circuit.

Thinking about it, I could smooth the output either with an integrating circuit (with an opamp), or use a series resistor/capacitor, which would require quite a few fewer components.
 
Ok, I'm resurrecting this thread rather than starting a new one as it's along the lines of the problem that I'm having.

I have just built a new machine with Yate Loon medium speed fans and a Lian Li TR-30 PWM controller. I've already modified the backlighting to change it from blue to green, and now I discover that the YL fans make a knocking noise when used at lower speeds with a PWM controller. I like both the fans and the controller, and can't return either as they've been modified.

So it looks like I need to smooth the output from the controller somewhat to get rid of the knocking noise.

Can anyone tell me (a n00b when it comes to circuits) what the best way to go about it would be? I had initially thought a cap might work, but reading this thread I'm thinking that it won't.

There are 3 fans running off the controller, so each would need it's own circuit presumably.

I've had a quick look at the Mircel notes mentioned but they make no sense to someone of my knowledge.

All help appreciated!



 
There's really no perfect way to do it. The advantage of a PWM speed controller is that it's very efficient--the controller itself dissipates very little energy, compared with a similar-functioning linear regulator. A resistor/capacitor on the output of the PWM will work for a single power rating of fan, but falls apart when you swap it out for a higher- or lower-powered fan. And the resistor will be dissipating the extra voltage, so you end up no better than a linear regulator anyway.

The best solution is to simply use a PWM circuit with a frequency that is higher than the normal range of human hearing. Depending on the circuit used, it may or may not be possible to modify it to do that. If the circuit uses a monolithic PWM chip, you're pretty much out of luck, because those chips aren't designed to go very high in frequency. If it uses 555 or 556 timers, then it's a simple capacitor swap. If you have a fan controller/speed monitor that uses a microcontroller to do everything, fuggedaboutit.

It's actually not that hard to build a PWM fan controller circuit--the hardest part is the design, which folks around here seem to be very helpful about.
 
Thanks, I'll have a look at it over the weekend and see if I can work out what it's using.
I don't want to build my own for a couple of reasons - this one looks good, and anything I make won't. Plus I'm already stuck with this one :)
 
I anyone is still wanting to know how to do this, it's actually simpler than I thought--just an inductor and a capacitor tuned to the PWM frequency. There's a nice PDF from Ericsson on the topic, with explanations, equations, and diagrams provided.
 
That PDF is helpful if the PWM frequency is >10KHz. Some fan PWM controllers operate in the hundreds of Hz, and doing passive filtering of that won't be practical.

I recommend LM317-style fanbusses. They dissipate heat, but you won't ever encounter weirdness with fan noise.
 
Instead of trying to smooth the output of the power transistor or MOSFET, use the smarter approach of smoothing the input for smoother turn on and off. Using a RC circuit on the base leg of the transistor will smooth the turn on and off of the transistor and reduce the "ringing" in the circuit, with a softer turn on and off.

A typical PWM circuit will have a low value resistor between the PWM output and the base of the power transistor. Instead, use a resistor with a value of between 1 and 10K (this will vary depending on what you're using to drive the transistor and what your frequency is). Add a capacitor (about 0.5 - 47uF) with one leg on the base of the transistor and the other grounded. This will form a RC circuit that will keep the transistor from switching on and off instantly and instead ramp the current up and down more smoothly, basically smoothing the edges of your pulse. The values will have to be determined experimentally - the frequency of your PWM and the characteristics of your fan (impulse torque, feedback inductance, current draw, etc) will make each situation unique.
 
Putting in an RC circuit upstream of the transistor defeats the efficiency of the PWM circuit. The nice part about PWM is that either it drops very little voltage (while on) or passes zero current (when off). Since the power dissipated is voltage times current, the PWM dissipates almost zero energy. Anywhere in between, you have voltage dropped and current passed across that transistor, so it will dissipate some power. The RC filter will put the transistor in just such a state.

gee is right that using an LC filter for low-frequency PWM isn't practical. That's another reason to go for high-frequency PWM. Combine the high frequency (above hearing range) with an appropriately-sized LC filter, and you get all the benefits of PWM, while the motor sees a close-to-constant DC voltage between 0 and 12V.
 
Unless you're running lots of fans off a fanbus, or large/fast fans, the heat dissipated by a linear fanbus should be more than manageable. Unless you *really* try, I doubt you'll get a 4-fan fanbus to dissipate more than 10 watts.

But yes, an "ideal" fanbus would use high frequency PWM buck converters, which effectively integrate a LC filter.

I thought about designing one, but I don't really have a use for one myself, and I can't really make anything that's price-competitive with chinese-made commodity fanbusses. Not many people want to pay 50 bucks for something that won't even come with a 5-1/4" bay bracket or knobs...
 
You're gonna kill that transistor by sticking an inductor there without an appropriate catch diode placed across it to snub voltage transients when the transistor turns off. Put the diode with one terminal at the junction of the transistor and inductor, and the other to ground. WHich way you ask? The way that doesn't cause the supply to short to ground when the transistor turns on....=)

But the bigger question is, why do you want to do this? Please recognize that by filtering the PWM output, you're harming your ability to run the fan at low speeds without damage to the motor-- The larger the inductor ( i.e. the more filtering you do) the more the final output looks like a DC voltage, and the more damaging it is to run the fan at low speed. However, if you're getting nasty RF interference, or the noise from the fan windings being driven by a PWM circuit is bothering you, filtering might be appropriate.... Always remember--don't fix things that aren't broke;)

good luck, have fun, and if you let the smoke out, learn why...

Yep. You don't really need to smooth the output at all. It's a fan. Now, if you where building a TEC thermal control module you would need to do all of the above. Ask me how I know.
Incidentally you can pick up some MIC502 from Newark. I would use a MIC502BN. They are in high demand. If you intend to use thermal control, use a 10k@25c NTC Thermistor. I do know that the fan control schematic in the data sheet works just fine(No Knocking).
 
Well, I've found that some fans exhibit a "growl" using PWM circuits. The fans themselves don't have a constant current draw, but instead have thier own current pulses. The interference of these two frequencies (PWM and fan current pulse), combined with impulse torque and feedback inductance and transistor turn on/off noise can cause problems. A softer on/off will benefit this while having minimal impact on heating - the turn on/off time probably shouldn't be more than about 2-5% of duty cycle. While that would probably be more heat generation than a standard PWM, it should be nowhere near a linear regulator, plus still have the benefit of a PWM that provides full voltage making initial starting easier.
 
That's an interesting though--the back-EMF interacting with the PWM frequency. If you used the LC smoothing circuit, though, the motor would see something approximating a constant voltage, while you'd still get the benefits of the PWM circuit.
 
That's an interesting though--the back-EMF interacting with the PWM frequency. If you used the LC smoothing circuit, though, the motor would see something approximating a constant voltage, while you'd still get the benefits of the PWM circuit.

Nah, it's an RC circuit BEFORE the transistor, so the output is smoothed, but it doesn't have the complication of mass stored energy with a smoothing capacitor. The smoothing is really done on the very leading and trailing edges of the on/off pulse - the RC time constant should probably be only about 1-5% of the PWM frequency. It's like using an active audio filter before the amp rather than a passive one after.
 
Ach, talking past each other.... what I meant to say was that if you used the LC smoothing circuit after the transistor instead of the RC circuit, you'd get the benefits of PWM without the drawbacks.

The RC circuit before the transistor would eliminate the highest frequency components in the square wave, of course. But do we know which frequency components of the PWM output are interacting with the back-EMF? I guess you'd have to know more about the back EMF to be able to tell.
 
Unfortunately, every PWM / fan combo would be different. You would probably need to try lots of different components/frequencies or, optimally, O-scope the output.
 
I guess I'll have to drag out my old PWM circuit and test it out with a bunch of fans....
 
Back
Top