RC Low-Pass Filter for Blower Fan



  • I have a blower fan for part cooling that does not like PWM too much. I went ahead and lowered PWM frequency from default 500Hz to 100Hz and it kind of works this way. But I have a feeling that neither runs smoothly this way nor actually at 30% speed if I set M106 P0 S0.3. I also tried a PWM frequency of 10Hz which at least let's it run audibly smoother.

    When I bought this fan I already knew from reviews that it does not like to work with PWM but some reviewer said "Just wire a 220uF capacitor in parallel and everything is fine". So I stuck this capacitor in parallel and the fan ran a lot smoother. But as soon as I increased PWM frequency above about 15Hz it would run full speed all the time no matter of what PWM setting I chose.

    I also heard a while back of RC low-pass filters that are designed to convert a digital PWM signal into an analoge one. So I used this calculator to find a resistor and PWM frequency that would give me a very smooth output for my 220uF capacitor I already bought (without knowing any more details - I do this most of the time 😂). I came up with 500Hz and 1kOhm. This would give me a very small voltage ripple compared to a relatively slow response time but that is OK for me.

    Yesterday I soldered all parts together and inserted them into the wire to the fan and... nothing. It won't move anymore at all. I pulled out my multimeter measured at the input and got 30% of my Vin for M106 P0 S0.3 (which would only be visible as PWM with an oscilloscope that I don't have). At the output side I only had slightly more than 1V which is clearly to low for a 12V fan.
    If I disconnect the fan and measure again at the output side I get basically the same as on the input side (only this time it is supposed to be smoother but again not visible with a simple multimeter).

    I read somewhere that if there is a load attached to this one would have to use smaller resistors. Is that right? How small? Or do I need to change something else?

    For the sake of completeness my wiring diagram:

    V_Fan --- R (1kOhm) --|------|
                     C (220uF)   Fan
    GND ------------------|------|
    

    P.S.: What I currently have at hand is

    • Resistors: 22 Ohm, 1kOhm, 10kOhm
    • Capacitors: 220uF, 220nF

    Of course these parts are not expensive and I could get more or less any other value if someone says "the perfect combination here would be x F and y Ohm at z Hz"

    P.P.S.: My fan has a rated current of 140mA



  • Hi

    I'm using 30Hz with 2 Blowers
    M106 P0 S0 I0 F30 H-1 ; Bauteilkühlung mit 2 Blowers parallel, daher 30Hz PWM
    works good

    I already had your idea, you just have to know if it doesn't hurt the board ?



  • Try this,

    1. change the PWM frequency to 100Hz
    2. Take (3) of the 22 ohm resistors and wire them in parallel.
    3. Change the 1k ohm resistor with the resistor pack from step 2.

    That should help you out, with what you have on hand.



  • @iamturbo1978 Just so that I understand this right: wiring (3) 22 Ohm resistors in parallel would effectively give me something like a 7.xx Ohm resistor, right? That would let about 1.7A through this circuit which would be more then enough for my fan.

    But if I enter these values in the linked calculator it will give me an enormous peak-to-peak voltage ripple of nearly the whole Vin amplitude which is what I already have without the low-pass filter. According to the calculator I would have to raise the frequency to something like 10kHz to get a decently small ripple.

    Or do I miss anything here?



  • @wilriker

    You are correct about the resistance. You are not worried about peak-to-peak ripple, you are only worried about averaging out the PWM pulse, so you can get an average voltage from the LP filter.



  • @iamturbo1978 I am not sure if I understand as to why I should not care for peak-to-peak ripple. I am fairly new in this part of electronics (i.e. LP filter) and I am a learn-as-I-go-type. So could you maybe explain why that does not matter?

    Meanwhile I am going to try your advice nevertheless, so already thanks for this! 👍



  • @wilriker Please understand, I am in no way an electronics pro, but from the questions I have asked in my life, and the experiences I have had, I think I can answer you correctly.

    Peak-to-peak ripple really matters for sensitive systems. Like video/display, audio, high frequency microprocessors. But stuff like LED's, motors, fans, hotends, etc... dont care about the ripple. Ripple only really applies for power supplies. Within a power supply (non-linear kind), there is a coil called an inductor. The power supply will charge and discharge that inductor to either boost or buck the input voltage (depending on the setup). The charging and discharging of the inductor will create little spikes. Those spikes are ripple. Understanding ripple can be complicated. The duet's PWM output doen't have an inductor to charge. So the ripple should be very low, to almost no ripple at all.

    Hope that helped



  • @iamturbo1978 I am still trying to understand all of this but your answer is helping me on this way. I also (finally) read the article on RC-filters on Wikipedia and now I understand what this filter really does. I though it would convert the PWM'd voltage that only results in an average over time into a true constant voltage (that is equal to the aforementioned average).
    Now I know that this will "only" reduce the steepness of the voltage changes from infinite to something that is smoother. Now I am no longer sure if that is really what I want/need. Will try it anyway, though...


    Additional Question

    Can anyone tell me what I will get on the signal line of a fan? I mean, when I put a multimeter to it and ground the other side, what will I measure? Is there a specification that these signal lines follow?

    I want to know what speed my fan really is at when I command it to run at 30% (I know the spec'd full speed).


  • administrators

    @wilriker said in RC Low-Pass Filter for Blower Fan:

    Can anyone tell me what I will get on the signal line of a fan? I mean, when I put a multimeter to it and ground the other side, what will I measure? Is there a specification that these signal lines follow?
    I want to know what speed my fan really is at when I command it to run at 30% (I know the spec'd full speed).

    There are two problems with this:

    1. If you ground the negative wire, the fan will run at full speed, because the PWM on the Duet switches the negative feed to the fan (like all other controllers that I know of);
    2. The tacho line may not produce a sensible output when you PWM the fan, because these fans were never designed to be fed a PWM'd supply.

    The solution is to use a 4-wire fan that has a separate PWM input. RepRapFirmware supports a single fan tacho input, and DWC can display the RPM for a 4-wire fan whose tacho output is connected to that input.



  • @wilriker I'm glad I could I was able to offer you some help.

    For your additional question;
    The signal line of the fan is a pules output. Most fans will provide 4 pulses for every revolutions. The pulse wire is pulled to ground, so some kind of pull-up resistor is needed. Just using a multi-meter will not give you any usable information. You would need an oscilloscope to see the pulses. The issue with reading the speed and controlling the speed at the same time is, most fan controllers use the ground for the PWM signal. There are ways around the problem....

    1. change the PWM control circuit from controlling the ground, to control the Vin. (doable, but not the best way)
    2. when a speed check is needed, change fan drive circuit from PWM mode to full on mode, so the fan's negative will be connected to ground. Then after 1 revolution (or more) of the fan, read the speed, then turn the fan drive circuit back to PWM mode. The easy way to control and read fan speed at the same time, is to get a 4-wire fan.

    This article should give you some more information about fan speed control, and fan speed reading.
    Fan Speed Control Is Cool!


  • administrators

    @iamturbo1978 said in RC Low-Pass Filter for Blower Fan:

    Most fans will provide 4 pulses for every revolutions

    The fans I have produce 2 pulses per rev.



  • @dc42 Thanks for bringing that up. I wanted to say there are 2 pulse fans. My Delta (company) fans are all 4 pulse per revolution.



  • Thanks @dc42 and @Iamturbo1978

    I already was afraid of getting the answer that I would need an oscilloscope to get speed readings. 😞

    @dc42 Just for clarification: I did not mean to ground the negative side of the fan but the second probe of the multimeter as I hoped I would get some kind of voltage through the signal wire that would then need to be A/D converted back into RPM.
    Very interesting though that you mention that probably most PWM circuits are switched on ground. In my absence of expertise in this field I assumed this would be something special about the Duet. 😉



  • Not to dissuade you from the academic pursuit of fan PWM, but wouldn't it be easier to simply acquire a better suited blower fan?

    https://www.digikey.ca/short/jrmcdf for example?



  • @dc42
    Hi, can the pwm output be damaged by a capacitor ?
    for my blower fans I also had to try around a little with the PWM frequencies
    with 30Hz it works good for me


  • administrators

    @knaudler said in RC Low-Pass Filter for Blower Fan:

    @dc42
    Hi, can the pwm output be damaged by a capacitor ?

    Yes. Connecting a large capacitor directly across a PWM output (without a series resistor) is likely to damage the mosfet, due to the current surge it causes every time the mosfet turns on.



  • @dc42 said in RC Low-Pass Filter for Blower Fan:

    Yes. Connecting a large capacitor directly across a PWM output (without a series resistor) is likely to damage the mosfet, due to the current surge it causes every time the mosfet turns on.

    What qualifies as a large capacitor? I had my 220µF capacitor wired in without a series resistor - but only for testing. I did not use this longer than a couple of minutes and so far everything still seems to work.



  • @phaedrux said in RC Low-Pass Filter for Blower Fan:

    Not to dissuade you from the academic pursuit of fan PWM, but wouldn't it be easier to simply acquire a better suited blower fan?

    That's probably true - but who says I want it to be easy? 😂 But seriously, I chose my blower fan (exact model: TFD-B5015M12B) because it gives my enough airflow while still being at an acceptable noise level. The one you proposed is already about 7dB louder - which is more than 4 times louder.

    Also that's part of the fun (and in some cases frustation) I chose by pursuing the path of building a better print from a crappy one.

    Today I stopped at my local electronics dealer and asked her for a 6.8Ohm resistor rated for 2W. She only had 5W in stock, so I took this chunky beast instead.
    This is based on me having basically no clue of what I am doing but I figured if I have a fan with about 1.7W power I would get a problem with my standard 1/4W resistors. If that assumption was false, please correct me. 🙂


  • administrators

    @wilriker said in RC Low-Pass Filter for Blower Fan:

    What qualifies as a large capacitor? I had my 220µF capacitor wired in without a series resistor - but only for testing. I did not use this longer than a couple of minutes and so far everything still seems to work.

    If you continue using 220uF then I expect the mosfet will fail. To work out what value would be safe without a resistor, I would need to look at the switching time of the mosfet on an oscilloscope. But the easy fix is to use a series resistor so that the charging current cannot exceed the 3.5A rating of the mosfet, e.g. at least 3.5 ohms @ 12V or 7 ohms @ 24V. Using a series resistor will also give you better speed control.

    Even better is to use a series inductor before the capacitor and a high PWM frequency, for example 1mH, 1uF and 50kHz. With older Duets you would also need to add a flyback diode.



  • @dc42 As I said this was only for testing purposes and sadly I seem to not have damaged my MOSFET yet. But good to know that I could.

    I bought a 6.8Ohm resistor today that will be wired in series as a replacement for my 1kOhm resistor I already have in the circuit I built meanwhile (but that won't let enough current through to even let the fan spin up).

    In your "Even better" recommendation, do I get it right that in this case I replace the resistor by the inductor? And what makes this solution better?


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.