• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

RC Low-Pass Filter for Blower Fan

Scheduled Pinned Locked Moved
Duet Hardware and wiring
9
57
9.3k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    wilriker
    last edited by 1 Aug 2018, 18:47

    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. ๐Ÿ˜‰

    Manuel
    Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
    with probably always latest firmware/DWC (incl. betas or self-compiled)
    My Tool Collection

    1 Reply Last reply Reply Quote 0
    • undefined
      Phaedrux Moderator
      last edited by 1 Aug 2018, 19:14

      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?

      Z-Bot CoreXY Build | Thingiverse Profile

      undefined 1 Reply Last reply 2 Aug 2018, 08:11 Reply Quote 0
      • undefined
        Knaudler @dc42
        last edited by 1 Aug 2018, 19:49

        @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

        undefined 1 Reply Last reply 1 Aug 2018, 21:49 Reply Quote 0
        • undefined
          dc42 administrators @Knaudler
          last edited by 1 Aug 2018, 21:49

          @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.

          Duet WiFi hardware designer and firmware engineer
          Please do not ask me for Duet support via PM or email, use the forum
          http://www.escher3d.com, https://miscsolutions.wordpress.com

          undefined 1 Reply Last reply 2 Aug 2018, 08:03 Reply Quote 1
          • undefined
            wilriker @dc42
            last edited by 2 Aug 2018, 08:03

            @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.

            Manuel
            Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
            with probably always latest firmware/DWC (incl. betas or self-compiled)
            My Tool Collection

            undefined 1 Reply Last reply 2 Aug 2018, 08:36 Reply Quote 0
            • undefined
              wilriker @Phaedrux
              last edited by 2 Aug 2018, 08:11

              @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. ๐Ÿ™‚

              Manuel
              Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
              with probably always latest firmware/DWC (incl. betas or self-compiled)
              My Tool Collection

              1 Reply Last reply Reply Quote 0
              • undefined
                dc42 administrators @wilriker
                last edited by 2 Aug 2018, 08:36

                @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.

                Duet WiFi hardware designer and firmware engineer
                Please do not ask me for Duet support via PM or email, use the forum
                http://www.escher3d.com, https://miscsolutions.wordpress.com

                undefined 1 Reply Last reply 2 Aug 2018, 08:41 Reply Quote 0
                • undefined
                  wilriker @dc42
                  last edited by 2 Aug 2018, 08:41

                  @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?

                  Manuel
                  Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                  with probably always latest firmware/DWC (incl. betas or self-compiled)
                  My Tool Collection

                  undefined 1 Reply Last reply 2 Aug 2018, 08:49 Reply Quote 0
                  • undefined
                    dc42 administrators @wilriker
                    last edited by dc42 8 Feb 2018, 08:50 2 Aug 2018, 08:49

                    Yes, replace the resistor by an inductor (and use a smaller capacitor). This solution is better because it gives you a variable smooth DC output that is proportional to the PWM, and the mosfet doesn't have to handle high peak currents.

                    With the resistor and capacitor, the output will also depend on the load on the fan, because it's essentially a balance between the rate at which the capacitor charges through the series resistor and the rate at which it discharges through the fan. But you may find that it works well enough.

                    Duet WiFi hardware designer and firmware engineer
                    Please do not ask me for Duet support via PM or email, use the forum
                    http://www.escher3d.com, https://miscsolutions.wordpress.com

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      wilriker @dc42
                      last edited by wilriker 8 Mar 2018, 12:07 3 Aug 2018, 12:03

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

                      1. 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.

                      I would still want to give this a try even if it may output bogus values - only then I know for sure.
                      So where would I connect the tacho line to and what would I have to do in config?

                      EDIT: I just found https://duet3d.dozuki.com/Wiki/Connecting_and_configuring_fans#Section_Connecting_4_wire_fans where it says how and where to connect the tacho line to. What is not clear to me is how/if I have to configure something or if this is bound to M106 I1.

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

                      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.

                      Yesterday I changed my 1kOhm resistor to a (regular) 6.8 Ohm resistor and set frequency to 100 Hz. First of all the fan spun up with this put in series on the fan wires - in contrast to before where the fan would just not run at all.
                      Now the problem is that at 100Hz it runs virtually only full speed all the time, no matter of what I set speed to. If I reduce frequency to 10-15Hz I can hear a difference in speeds but still I think it runs significantly faster then it it should. I did not yet measure output voltage, though.

                      I want to try to figure out how I can measure the fans speed before I further tinker on the RC-filter or switch to a LC-filter. Just wanted to let you know what came out of it so far.

                      Manuel
                      Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                      with probably always latest firmware/DWC (incl. betas or self-compiled)
                      My Tool Collection

                      undefined undefined 2 Replies Last reply 3 Aug 2018, 12:20 Reply Quote 0
                      • undefined
                        dc42 administrators @wilriker
                        last edited by 3 Aug 2018, 12:20

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

                        I would still want to give this a try even if it may output bogus values - only then I know for sure.
                        So where would I connect the tacho line to and what would I have to do in config?

                        EDIT: I just found https://duet3d.dozuki.com/Wiki/Connecting_and_configuring_fans#Section_Connecting_4_wire_fans where it says how and where to connect the tacho line to. What is not clear to me is how/if I have to configure something or if this is bound to M106 I1.

                        If you want to try connecting the tacho output of a 3-wire fan to the Duet, you must connect a diode between the fan tacho output (cathode) and the Duet RPM input (anode), to prevent 12V being fed into the Duet RPM pin.

                        Yesterday I changed my 1kOhm resistor to a (regular) 6.8 Ohm resistor and set frequency to 100 Hz. First of all the fan spun up with this put in series on the fan wires - in contrast to before where the fan would just not run at all.
                        Now the problem is that at 100Hz it runs virtually only full speed all the time, no matter of what I set speed to. If I reduce frequency to 10-15Hz I can hear a difference in speeds but still I think it runs significantly faster then it it should. I did not yet measure output voltage, though.

                        That's all to be expected using an R-C filter. A higher value resistor will give you more speed control, but will limit the maximum speed.

                        Duet WiFi hardware designer and firmware engineer
                        Please do not ask me for Duet support via PM or email, use the forum
                        http://www.escher3d.com, https://miscsolutions.wordpress.com

                        undefined 1 Reply Last reply 3 Aug 2018, 12:25 Reply Quote 0
                        • undefined
                          wilriker @dc42
                          last edited by 3 Aug 2018, 12:25

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

                          If you want to try connecting the tacho output of a 3-wire fan to the Duet, you must connect a diode between the fan tacho output (cathode) and the Duet RPM input (anode), to prevent 12V being fed into the Duet RPM pin.

                          From you calling it the "Duet RPM pin" I assume there is just the one (PB6) and whenever there is a signal fed into it it will be providing this information automatically with no further config, right?

                          Yesterday I changed my 1kOhm resistor to a (regular) 6.8 Ohm resistor and set frequency to 100 Hz. First of all the fan spun up with this put in series on the fan wires - in contrast to before where the fan would just not run at all.
                          Now the problem is that at 100Hz it runs virtually only full speed all the time, no matter of what I set speed to. If I reduce frequency to 10-15Hz I can hear a difference in speeds but still I think it runs significantly faster then it it should. I did not yet measure output voltage, though.

                          That's all to be expected using an R-C filter. A higher value resistor will give you more speed control, but will limit the maximum speed.

                          And another day I learned something new here. ๐Ÿ™‚ ๐Ÿ‘
                          From how I understood you regarding the LC-filter this would give me both, a smooth DC output as well as a good control on speed, right?

                          Manuel
                          Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                          with probably always latest firmware/DWC (incl. betas or self-compiled)
                          My Tool Collection

                          undefined 1 Reply Last reply 3 Aug 2018, 14:41 Reply Quote 0
                          • undefined
                            dc42 administrators @wilriker
                            last edited by 3 Aug 2018, 14:41

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

                            From you calling it the "Duet RPM pin" I assume there is just the one (PB6) and whenever there is a signal fed into it it will be providing this information automatically with no further config, right?

                            Yes.

                            From how I understood you regarding the LC-filter this would give me both, a smooth DC output as well as a good control on speed, right?

                            Yes. make sure that your Duet is recent enough to include flyback diodes on the fan outputs.

                            Duet WiFi hardware designer and firmware engineer
                            Please do not ask me for Duet support via PM or email, use the forum
                            http://www.escher3d.com, https://miscsolutions.wordpress.com

                            undefined 1 Reply Last reply 3 Aug 2018, 14:44 Reply Quote 0
                            • undefined
                              wilriker @dc42
                              last edited by 3 Aug 2018, 14:44

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

                              Yes. make sure that your Duet is recent enough to include flyback diodes on the fan outputs.

                              Yes, I got a 1.03 which already has them.

                              One last question: I saw that inductors are also rated for an amperage besides their inductance. What would I have so get for this case? Or what do I have to consider? The fans amperage (140mA)? Or something else?

                              Manuel
                              Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                              with probably always latest firmware/DWC (incl. betas or self-compiled)
                              My Tool Collection

                              undefined 1 Reply Last reply 3 Aug 2018, 14:48 Reply Quote 0
                              • undefined
                                dc42 administrators @wilriker
                                last edited by 3 Aug 2018, 14:48

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

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

                                Yes. make sure that your Duet is recent enough to include flyback diodes on the fan outputs.

                                Yes, I got a 1.03 which already has them.

                                One last question: I saw that inductors are also rated for an amperage besides their inductance. What would I have so get for this case? Or what do I have to consider? The fans amperage (140mA)? Or something else?

                                I would choose somewhat higher than the fan current, e.g. 250mA or more.

                                Duet WiFi hardware designer and firmware engineer
                                Please do not ask me for Duet support via PM or email, use the forum
                                http://www.escher3d.com, https://miscsolutions.wordpress.com

                                undefined 1 Reply Last reply 3 Aug 2018, 19:20 Reply Quote 0
                                • undefined
                                  wilriker @dc42
                                  last edited by wilriker 8 Mar 2018, 19:20 3 Aug 2018, 19:20

                                  @dc42 Thanks again.

                                  Earlier tonight I was playing some more with my fan and the RC-filter. I used my multimeter to measure the voltage and found something that at least to me seems strange - but maybe this is normal and I just don't know.

                                  When I set the fan speed to 30% output voltage (after RC) never actually was 30% of Vin. It always was above it. In my case it should have been about 4V but with the RC-filter it was depending on frequency (higher frequency=higher voltage) but even at a ridiculous F2 it still was about 8V. I can imagine that this could be expected using the small resistor and large capacitor.
                                  But I also tried without the RC-filter and this was also a little bit frequency dependent (higher frequency=lower voltage) but it never came down to 4V either. At least it got closer and was "only" 5.6V.

                                  Now what am I missing? Is a multimeter just not the right tool for this task?

                                  Manuel
                                  Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                                  with probably always latest firmware/DWC (incl. betas or self-compiled)
                                  My Tool Collection

                                  1 Reply Last reply Reply Quote 0
                                  • undefined
                                    Iamturbo1978 @wilriker
                                    last edited by 3 Aug 2018, 19:37

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

                                    Yesterday I changed my 1kOhm resistor to a (regular) 6.8 Ohm resistor and set frequency to 100 Hz. First of all the fan spun up with this put in series on the fan wires - in contrast to before where the fan would just not run at all.
                                    Now the problem is that at 100Hz it runs virtually only full speed all the time, no matter of what I set speed to. If I reduce frequency to 10-15Hz I can hear a difference in speeds but still I think it runs significantly faster then it it should. I did not yet measure output voltage, though.

                                    That makes sense. With the 6.8 ohm resistor, the cutoff frequency is 106.4Hz. If you did the (3) 22 ohm resistors it would have gave you 7.3 ohms, and that would give you a cutoff frequency of 99.1Hz. It is not the best option, but I was trying to get you working with what you had on hand.

                                    The best advice I could give is to you is, use a small capacitor. Large ones are good for load surges, but not real good at light load filter circuits. I personally would use a 22uF or less cap. Then use a breadboard to figure out what would be the best option for resistor and/or inductor to use. Then after I found the perfect combo, I would solder everything together.

                                    undefined 1 Reply Last reply 6 Aug 2018, 08:39 Reply Quote 0
                                    • undefined
                                      wilriker @Iamturbo1978
                                      last edited by 6 Aug 2018, 08:39

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

                                      That makes sense. With the 6.8 ohm resistor, the cutoff frequency is 106.4Hz. If you did the (3) 22 ohm resistors it would have gave you 7.3 ohms, and that would give you a cutoff frequency of 99.1Hz.

                                      What difference would that have made? I mean I could easily increase frequency to 107Hz but I doubt that this would really change the fact that at any frequency above about 15Hz the fan spins virtually full speed independent of speed setting.

                                      The best advice I could give is to you is, use a small capacitor. Large ones are good for load surges, but not real good at light load filter circuits. I personally would use a 22uF or less cap. Then use a breadboard to figure out what would be the best option for resistor and/or inductor to use. Then after I found the perfect combo, I would solder everything together.

                                      Breadboard-prototyping is a really good hint. I even do have a breadboard but I always forget about it. ๐Ÿคฆ


                                      Today I bought a 1N4148 diode to first get the tacho output fed correctly into the Duet. Then I see how I proceed in this topic.

                                      Manuel
                                      Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                                      with probably always latest firmware/DWC (incl. betas or self-compiled)
                                      My Tool Collection

                                      undefined 1 Reply Last reply 7 Aug 2018, 04:18 Reply Quote 0
                                      • undefined
                                        Iamturbo1978 @wilriker
                                        last edited by 7 Aug 2018, 04:18

                                        @wilriker I'll try to make this as simple as I can, hopefully this will help.

                                        A PWM signal only has 2 states, "HIGH" and "LOW". for this example the voltage does not matter. It could be 12V, 5V, 3.3V etc... We don't care about the voltage right now, only the PWM signal.

                                        The PWM frequency is the number of PWM cycles in one second. If the frequency is 100Hz, then there are 100 PWM cycles in one second. Meaning, that each PWM cycle is only 0.01 seconds (10ms) long.

                                        The duty cycle is the ratio of how long the signal is high to how long it is low.

                                        If we have a duty cycle of 50%, the signal would be high for 0.005 seconds (5ms), then low for the remaining 0.005 seconds (5ms). If we set the duty for 30%, that would be 3ms high and 7ms low. and if we set it to 90%, that would be high for 9ms, and low for 1ms.

                                        The common way for a PWM cycle is to start high, wait the amount of time set by the duty cycle, then go low for the remaining amount of time. Not everything follows this way, but for this example, we are not going to worry about the other ways.

                                        Now, lets say our filter is tuned to only look at a single 10ms (100Hz) PWM cycle. It would only see the signal being high for sometime, then go low for sometime.

                                        But now lets change the filter to look at a 9ms (106Hz) PWM cycle. It would see the high like the last filter, but the low would be shorter than the other filter.

                                        Lets set the duet duty cycle to 50%, and the frequency to 100Hz (10ms cycle). The duet would make the signal high for 5ms, then low for 5ms. Now we add the 106Hz filter. The filter is only going to see 9ms of the PWM cycle. So that would be 5ms high, then 4ms low. That would mean the signal is high 80% of the time ((4ms/5ms)*100). That means, even though you set the duet to 50%, your fan would see 80%.

                                        Capacitors are like water towers. They store a charge, and depending on there size, they can store a little or a lot of charge. That stored charge takes time to discharge. Larger caps take more time to discharge, just like water towers. Everytime the PWM signal goes high, the cap gets charged. And every time the signal goes low, the cap gets discharged. How much discharged depends on the load, your fan for example. If the cap cant discharge most of the energy before the next PWM cycle, the cap gets recharged before it can discharge. If you keep putting in a 80% PWM duty cycle into a cap, but only using 40% of the energy, the cap would be fully charged in only 2 PWM cycles or 20ms. That is why your fan stays on no matter what duty cycle you set. And that is why the lower frequency helped, there was more time for the cap to discharge.

                                        The advice I gave you before was me trying to get what you had on hand to at least help you. Without some kind of feedback from the fan, and a circuit to monitor and adjust the PWM on the fly automatically, you are not going to be able to get a direct correlation between the speed you set, and the actual speed of the fan.

                                        What I did is with my old ramps board is is found a R-C combination that removed the PWM noise from the my fan using the smallest cap I could use. I used a 100uF cap, and a 10ฮฉ resister on a fan that has a 0.25A rating. If my fan used less power, I would have used a smaller cap.

                                        Hope that helped.

                                        undefined 1 Reply Last reply 7 Aug 2018, 08:10 Reply Quote 1
                                        • undefined
                                          wilriker @Iamturbo1978
                                          last edited by 7 Aug 2018, 08:10

                                          @iamturbo1978 First of all a big thanks for this very detailed explanation. ๐Ÿ‘
                                          I knew parts of it but there was some very interesting news in it.

                                          Especially that the PWM high-low-cycles are always within a cycle that is defined by the frequency. Up until now I always thought that it would combine the latter type of cycles to continues high and low phases. But the way you describe it makes a lot more sense because otherwise you would loose a lot of fine-control at very low frequencies.

                                          Also finally I understand cut-off frequency of the RC-filter.
                                          With one open question though: you say if we have 10ms cycles and a 106Hz filter will only see 9ms of these cycles - what happens with the remaining 1ms? A friend of mine just proposed that it will "stretch" what it sees to match the "outer" cycle, i.e. it will create a 10ms cycle out of what it sees but using the proportions it sees in 9ms.

                                          I guess I finally have to buy a book on electronics. ๐Ÿ˜‚

                                          Manuel
                                          Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                                          with probably always latest firmware/DWC (incl. betas or self-compiled)
                                          My Tool Collection

                                          undefined 1 Reply Last reply 7 Aug 2018, 12:25 Reply Quote 0
                                          22 out of 57
                                          • First post
                                            22/57
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA