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

    PWM to constant DC voltage for fan control

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    5
    22
    1.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.
    • bananapuppyundefined
      bananapuppy
      last edited by bananapuppy

      Hiya,

      I'd like to connect 12V fans to my Duet 3 Mini 5+ that don’t allow/like PWM control, and feed them a constant voltage (0-12V) based on the PWM duty cycle.

      I plan to make a little PCB which sits between the board and fans. Unfortunately I’m not taught in electronics, at all, designing circuits is unknown territory to me. I’ve found this (https://forum.duet3d.com/topic/6227/rc-low-pass-filter-for-blower-fan/9) topic by @wilriker, from which I understand he is trying/tried the same using a Duet 2(?).

      His topic includes a schematic, and it seems all I might need is an inductor and capacitor to get this to work? I’m not so sure if the components & values in the schematic are any good for 12V / the Duet 3 Mini 5+ / with my fans 🤔

      Hope someone can help me out! 😄

      PS: my fans have the following specs:

      • 4.5~13.8V - 196mA (max)
      • 4.5~13.8V - 100mA / max 115mA
      DIY-O-Sphereundefined jay_s_ukundefined dc42undefined 3 Replies Last reply Reply Quote 0
      • DIY-O-Sphereundefined
        DIY-O-Sphere @bananapuppy
        last edited by

        @bananapuppy
        https://forum.duet3d.com/topic/21680/designing-a-pwm-to-analog-mini-board-for-fans/99

        (UTC+1)

        1 Reply Last reply Reply Quote 1
        • jay_s_ukundefined
          jay_s_uk @bananapuppy
          last edited by jay_s_uk

          @bananapuppy why not buy some boards from @Egon.net?
          https://forum.duet3d.com/topic/21680/designing-a-pwm-to-analog-mini-board-for-fans

          Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

          1 Reply Last reply Reply Quote 0
          • bananapuppyundefined
            bananapuppy
            last edited by

            Interesting, I didn't ran into @Egon-Net his post yet. Thanks for sharing it!

            From what I gather in the thread, his board seems more complicated/expensive then necessary for my application, maybe; as indicated by this post: https://forum.duet3d.com/topic/21680/designing-a-pwm-to-analog-mini-board-for-fans/50?_=1620147998783

            I'll send @Egon-Net a message regardless for sure 😄

            1 Reply Last reply Reply Quote 0
            • dc42undefined
              dc42 administrators @bananapuppy
              last edited by dc42

              @bananapuppy said in PWM to constant DC voltage for fan control:

              I'd like to connect 12V fans to my Duet 3 Mini 5+ that don’t allow/like PWM control, and feed them a constant voltage (0-12V) based on the PWM duty cycle.

              The simplest approach for that application is to connect a 1mH inductor (with a rated current high enough for the fan) between the Duet FAN- output and the fan negative wire, and a capacitor in parallel with the fan, and then increase the Duet PWM frequency to 65535Hz. I suggested an inductor part number that would be suitable for most fans in another thread.

              [Edit: I just found that post: https://forum.duet3d.com/post/216923.]

              The board made by @Egon-Net is designed to work also with the fan ports on the DueX5, which have fixed PWM frequencies.

              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

              bananapuppyundefined 1 Reply Last reply Reply Quote 0
              • bananapuppyundefined
                bananapuppy @dc42
                last edited by bananapuppy

                I've contacted @Egon-Net to score at least one of his boards when he makes the next batch 😄

                @dc42 thanks for confirming that again! I'd also like to try that 'simple way' with just the inductor and capacitor for myself. Although I can't find the specific inductor all that conveniently; are the following inductor and capacitor fit for the job? They are 1mH and 1µF, matching the given numbers, but I can't quite judge their other properties.

                • RLB0914-102KL BOURNS
                • UPS2D010MED NICHICON

                Also:

                • What if the PWM frequency isn't increased (which might for instance temporarily occur after a reset), does that create any serious issue or potential damage to the Duet?
                • Is it normal for capacitors to have a rated lifetime of 2000h? Seems short? 🤔
                Egon.Netundefined 2 Replies Last reply Reply Quote 0
                • Egon.Netundefined
                  Egon.Net @bananapuppy
                  last edited by

                  @bananapuppy I'm sorry I ran out of time yesterday night...

                  Here you have some analysis:

                  This should be the simple LC filter schematic:
                  schematic.png

                  The part on the left is the Duet itself. The part on the right is the fan (modeled as a pure resistor load sinking about 170mA at 12V), with the capacitor in parallel and the inductor in series with Fan-

                  This is the simulation at 50% PWM, 65KHz:
                  65535HZ-50PWM.png

                  There's some overshoot, but the voltage stabilizes fast, and only a small hint of the PWM frequency remains.

                  Let's try at 100% PWM, 65KHz:
                  65535HZ-100PWM.png

                  Now the transient gets to 18V, but it also stabilizes fast. I don't think it would be a problem for a fan, but for other kind of loads, it may be.

                  Now, lets try with a lower frequency, like the one Duex 5 forces on PWM fans (250Hz, IIRC), 50% PWM again:
                  250HZ-50PWM.png
                  Ouch! Not only the LC filter is too small for that frequency, but it also transients over 18V on each cycle. I wouldn't do that to any of my fans.

                  The resonant transient depends on the L-C values, and in a lesser way on the real impendance of the exact fan you are driving. But for 250Hz L-C should be huge as hell for it to work.

                  What I do with my board is applying a 3rd order active low-pass RC filter with quite high R's so small capacitors can be used (and no inductors), and a transistor as a current buffer, so there is not transient at all and the frequency can be as low as the Duex 5 is without problems.

                  dc42undefined 1 Reply Last reply Reply Quote 0
                  • Egon.Netundefined
                    Egon.Net @bananapuppy
                    last edited by

                    @bananapuppy said in PWM to constant DC voltage for fan control:

                    but I can't quite judge their other properties.

                    • RLB0914-102KL BOURNS
                    • UPS2D010MED NICHICON

                    The most important other parameter is maximum current. I'd pick one with at lest double the fan's current.

                    Also:

                    • What if the PWM frequency isn't increased (which might for instance temporarily occur after a reset), does that create any serious issue or potential damage to the Duet?

                    I don't think so. You'll get a transient for every "first" pulse, Duet board would not notice at that level.

                    • Is it normal for capacitors to have a rated lifetime of 2000h? Seems short? 🤔

                    Electrolytic capacitor's fate. That's life. IIRC, for each 10ºC less than specified, the capacitor doubles its life.

                    1 Reply Last reply Reply Quote 0
                    • dc42undefined
                      dc42 administrators @Egon.Net
                      last edited by

                      @egon-net did you include the resistance of the inductor in your simulation? It's 2.1 ohms for the inductor that @bananapuppy is thinking of using. If the capacitor is electrolytic then you should include its ESR in the simulation too.

                      What happens if you simulate using a lower value capacitor, or no capacitor at all?

                      @bananapuppy, that inductor looks OK. It's normal for electrolytic capacitors to have 2000 hour rated life, but that will be at either 85C or 105C. In practice they last much longer at lower temperatures. You can also get 1uF ceramic capacitors.

                      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

                      Egon.Netundefined 1 Reply Last reply Reply Quote 0
                      • Egon.Netundefined
                        Egon.Net @dc42
                        last edited by

                        @dc42 said in PWM to constant DC voltage for fan control:

                        @egon-net did you include the resistance of the inductor in your simulation? It's 2.1 ohms for the inductor that @bananapuppy is thinking of using. If the capacitor is electrolytic then you should include its ESR in the simulation too.

                        What happens if you simulate using a lower value capacitor, or no capacitor at all?

                        I added a 2 Ohm series resistor to the inductor, but didn't add anything to the capacitor (I'm used to use low ESR electrolytics). I'll perform a test and show the results.
                        Regarding the capacitor, the lower the capacitor the smaller the transient, but the worse the ripple too.

                        Egon.Netundefined 1 Reply Last reply Reply Quote 0
                        • Egon.Netundefined
                          Egon.Net @Egon.Net
                          last edited by

                          @dc42 here are the results:

                          2.1 Ohm ESR for Inductor, 7 Ohm ESR for capacitor, 100%PWM:
                          65535HZ-100PWM-ESR.png

                          It still overshoots, but less than before.

                          Now, witha 100nF capacitor, 50% PWM:
                          65535HZ-100PWM-ESR-100nF.png
                          The overshoot is almost gone, but ripple increases.

                          And finally without capacitor at all (same 50% PWM):
                          65535HZ-100PWM-ESR-noCAP.png
                          No transient, but lots of ripple.

                          dc42undefined bananapuppyundefined 2 Replies Last reply Reply Quote 0
                          • dc42undefined
                            dc42 administrators @Egon.Net
                            last edited by

                            @egon-net thanks, looks like 100nF might be a good value to use then.

                            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
                            • bananapuppyundefined
                              bananapuppy @Egon.Net
                              last edited by

                              @egon-net thanks for making these graphs, very useful to me! Does the voltage still overshoot to about 16V with 100% PWM, when using a 100nF capacitor?

                              How about a capacitor somewhere between 100nF and 1µF? I.e. 0.47µF for instance, I figure that might be a nice middle ground for ripple with not too much of an overshoot 😄?

                              Egon.Netundefined 1 Reply Last reply Reply Quote 0
                              • Egon.Netundefined
                                Egon.Net @bananapuppy
                                last edited by

                                @bananapuppy you are welcome 🙂
                                With a 100nF capacitor the overshoot should be about 1.5V (13.5V max for 12V), and ripple about 1Vpp

                                The bigger the cap, the bigger the overshoot.

                                dc42undefined bananapuppyundefined 2 Replies Last reply Reply Quote 0
                                • dc42undefined
                                  dc42 administrators @Egon.Net
                                  last edited by

                                  A ripple of 1V p-p is unlikely to matter.

                                  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

                                  Egon.Netundefined 1 Reply Last reply Reply Quote 0
                                  • Egon.Netundefined
                                    Egon.Net @dc42
                                    last edited by

                                    @dc42 said in PWM to constant DC voltage for fan control:

                                    A ripple of 1V p-p is unlikely to matter.

                                    I agree.

                                    Is there any drawback for the Duet with the highest PWM frequencies (CPU/resource usage wise) besides a tiny bit more power consumed by the mosfet?

                                    dc42undefined 1 Reply Last reply Reply Quote 0
                                    • bananapuppyundefined
                                      bananapuppy @Egon.Net
                                      last edited by bananapuppy

                                      @egon-net @dc42 thanks! I recon the following should do for a capacitor then? A ceramic one, as electrolytic doesn't even seem available at 100nF, does that matter? There was mention of ESR with use of an electrolytic capacitor / being used in the simulation?

                                      SA105E104MARTB AVX

                                      Egon.Netundefined 1 Reply Last reply Reply Quote 0
                                      • Egon.Netundefined
                                        Egon.Net @bananapuppy
                                        last edited by

                                        @bananapuppy said in PWM to constant DC voltage for fan control:

                                        SA105E104MARTB AVX

                                        Ceramic is ok, but I'd try to get one with X5R or X7R dielectric. The one you picked has Z5U dielectric which is not that good.

                                        bananapuppyundefined 1 Reply Last reply Reply Quote 1
                                        • bananapuppyundefined
                                          bananapuppy @Egon.Net
                                          last edited by

                                          @egon-net no idea what that difference means (if someone can recommend me a good electronics course, please do 🤣), but the following should be good then!? 😄

                                          CM-100N-X7R SR PASSIVES

                                          dc42undefined 1 Reply Last reply Reply Quote 0
                                          • dc42undefined
                                            dc42 administrators @bananapuppy
                                            last edited by

                                            @bananapuppy said in PWM to constant DC voltage for fan control:

                                            CM-100N-X7R

                                            Yes, that's 100nF 100V X7R.

                                            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 1
                                            • First post
                                              Last post
                                            Unless otherwise noted, all forum content is licensed under CC-BY-SA