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

    Thermostatic controlled fan coming on at 50%

    Scheduled Pinned Locked Moved
    General Discussion
    7
    37
    2.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.
    • richardmckennaundefined
      richardmckenna
      last edited by richardmckenna

      Hi all,

      I'm sure I have missed something in the config and/or just being stupid so if someone could have a look it would be much appreciated.

      I have my hot end fan set to come on at 45ºC but when it gets to temperature it only comes on at 50%

      M106 P1
      Fan 1 (Hemera), speed: 0%, min: 10%, max: 100%, blip: 0.10, temperature: 45.0:45.0C, sensors: 1, current speed: 50%:
      

      setting the speed to 1 manually then sets it to 100% and I can physically feel the fan moving more air.

      M106 P1 S1
      M106 P1
      Fan 1 (Hemera), speed: 100%, min: 10%, max: 100%, blip: 0.10, temperature: 45.0:45.0C, sensors: 1, current speed: 100%:
      

      My fan and tool config are as follows

      ; Fans
      M950 F0 C"out7" Q500                                  ; create fan 0 on pin out7 and set its frequency
      M106 P0 S0 H-1 C"Part Cooling"                        ; set fan 0 value. Thermostatic control is turned off
      M950 F1 C"!out4" Q500                                 ; create fan 1 on pin out4 and set its frequency
      M106 P1 S1 H1 T45 C"Hemera"                           ; set fan 1 value. Thermostatic control is turned on
      M950 F2 C"out5" Q500                                  ; create fan 2 on pin out5 and set its frequency
      M106 P2 S1 H-1 C"Case 1"                              ; set fan 2 value. Thermostatic control is turned off
      M950 F3 C"out6" Q500                                  ; create fan 3 on pin out6 and set its frequency
      M106 P3 S1 H-1 C"Case 2"                              ; set fan 3 value. Thermostatic control is turned off
      
      ; Tools
      M563 P0 S"Hemera" D0 H1 F1                            ; define tool 0
      

      I'm using a Noctua NF-A4x20 PWM.

      1 Reply Last reply Reply Quote 0
      • Danalundefined
        Danal
        last edited by

        @richardmckenna said in Thermostatic controlled fan coming on at 50%:

        M106 P1 S1 H1 T45 C"Hemera"

        Maybe add L100. This is minimum speed when on.

        Delta / Kossel printer fanatic

        richardmckennaundefined 2 Replies Last reply Reply Quote 0
        • richardmckennaundefined
          richardmckenna @Danal
          last edited by

          @Danal thanks Danal, I'll try that after this print has finished.

          1 Reply Last reply Reply Quote 0
          • gtj0undefined
            gtj0
            last edited by

            The PWM frequency is pretty low for a 4-wire PWM fan. Try Q25000

            richardmckennaundefined 1 Reply Last reply Reply Quote 1
            • richardmckennaundefined
              richardmckenna @gtj0
              last edited by

              @gtj0 yeah I read about higher frequencies, I did have it set to 5000 but there didn't seem to be any difference with 500.

              I did not go as high as 25000 though, so will give it a go 🙂

              1 Reply Last reply Reply Quote 0
              • richardmckennaundefined
                richardmckenna @Danal
                last edited by

                @Danal said in Thermostatic controlled fan coming on at 50%:

                L100

                Adding L1 seems to have done the trick L100 sets it to 39% 🙂

                And I've changed Q to 25000 for good measure.

                Thanks!

                1 Reply Last reply Reply Quote 0
                • gtj0undefined
                  gtj0
                  last edited by gtj0

                  Yeah for most PWM settings, a number between 0 and 1 inclusive is treated as a percentage and anything above that is treated as the 8-bit absolute PWM so 100 out of 255 would be... wait for it ... 39.2% 🙂 I always forget about that.

                  richardmckennaundefined 1 Reply Last reply Reply Quote 0
                  • richardmckennaundefined
                    richardmckenna @gtj0
                    last edited by

                    @gtj0 aye I checked the gcode documentation when I saw it was 39% and saw it was similar to other percentage settings.

                    Now I’ve fixed the issue? Any idea why it was starting at 50% without the minimum speed option?

                    1 Reply Last reply Reply Quote 0
                    • deckingmanundefined
                      deckingman
                      last edited by deckingman

                      Actually, this is all a bit strange. The OP had an "S" values of 1 which is (should be) the same as 255 so the fan should switch to fully on when the heater temperature exceeds the set point of (in this case) 45 deg C.
                      PWM should only come into play if he had set a temperature range - e.g. 40:80 and in that case, the speed would be proportional to the temperature between 40 and 80. At 41 deg C the fan would just start to turn unless the OP used the L parameter. If he had used say L125, with that 40:80 range, then the fan would run at 50% speed for all temperatures between 40 and 60, then ramp up from 50% speed to full speed between 60 and 80.
                      So it looks like there may be a problem using S1 and setting the L parameter to 1 or 255 is merely masking that problem. I use a very similar M106 setting to the OP which works fine, the difference being that I use S255 instead of S1. My machine is in bits so I can't test this but it might be worth checking on a working machine if there is a difference between using S1 and S255.

                      EDIT @richardmckenna Try setting S255 instead of S1 and take out the "L" parameter.

                      Ian
                      https://somei3deas.wordpress.com/
                      https://www.youtube.com/@deckingman

                      richardmckennaundefined 1 Reply Last reply Reply Quote 1
                      • richardmckennaundefined
                        richardmckenna @deckingman
                        last edited by

                        @deckingman just started another print but will try it before starting the next one

                        deckingmanundefined 1 Reply Last reply Reply Quote 0
                        • deckingmanundefined
                          deckingman @richardmckenna
                          last edited by deckingman

                          @richardmckenna The other thing that doesn't make sense to me is why changing the PWM frequency would make any difference. My understanding is that the PWM value determines the on-off (or mark-space) ratio and that either setting it to 1 (in the range 0 to 1) or 255 (in the range 0 to 255) means that the on period is 100% of the time and the off period is 0 % of the time. So why would it matter what the frequency (which is the time period) is? Or to put it another way, if the PWM value is 100% so it it never switches off, why does it matter how quickly or slowly it never switches off?

                          Ian
                          https://somei3deas.wordpress.com/
                          https://www.youtube.com/@deckingman

                          richardmckennaundefined 1 Reply Last reply Reply Quote 0
                          • richardmckennaundefined
                            richardmckenna @deckingman
                            last edited by

                            @deckingman changing the frequency (Q value) didn’t make any difference in my case. Only adding the L1 made the fan come on at 100%.

                            deckingmanundefined 1 Reply Last reply Reply Quote 0
                            • deckingmanundefined
                              deckingman @richardmckenna
                              last edited by

                              @richardmckenna I was just being curious as to why people were recommending that you change the Q value (PWM frequency), in case my understanding of how PWM works is incorrect.

                              Ian
                              https://somei3deas.wordpress.com/
                              https://www.youtube.com/@deckingman

                              gtj0undefined 1 Reply Last reply Reply Quote 0
                              • gtj0undefined
                                gtj0 @deckingman
                                last edited by gtj0

                                @deckingman Intel's specification for 4-wire PWM fans specified a nominal pwm frequency of 25kHz with an acceptable operational range 21 kHz to 28 kHz. Many fans simply won't behave correctly with a PWM frequency outside that range. It's the duty cycle of that pulse train that controls the speed of the fan.

                                Oh... For 3 or 2 wire fans, it's the actual motor driving current that's modulated to control speed. The frequency can also play a part there as well.

                                deckingmanundefined 1 Reply Last reply Reply Quote -1
                                • richardmckennaundefined
                                  richardmckenna
                                  last edited by

                                  On that note I’ve just found this https://noctua.at/media/wysiwyg/Noctua_PWM_specifications_white_paper.pdf page 6

                                  1 Reply Last reply Reply Quote 0
                                  • deckingmanundefined
                                    deckingman @gtj0
                                    last edited by

                                    @gtj0 Yes, I appreciate that but the bit that I can't get my head around is that, in this case, the OP doesn't want to vary the speed. He wants the fan to run at full speed. Which means that PWM will always be high and never switch to low doesn't it? In which case, why does it matter what frequency that never switching to low occurs at?

                                    Ian
                                    https://somei3deas.wordpress.com/
                                    https://www.youtube.com/@deckingman

                                    richardmckennaundefined 1 Reply Last reply Reply Quote 0
                                    • richardmckennaundefined
                                      richardmckenna @deckingman
                                      last edited by richardmckenna

                                      @deckingman it doesn’t I think @gtj0 was just letting me know that my original Q value was quite low for a PWM fan.

                                      1 Reply Last reply Reply Quote 0
                                      • richardmckennaundefined
                                        richardmckenna
                                        last edited by

                                        Ok now I am confused!

                                        So I set Q back to 500 just to rule out any other changes. I set S255

                                        M106 P1 S255 H1 T45 C"Hemera"

                                        Under 45ºC i get

                                        Fan 1 (Hemera), speed: 100%, min: 10%, max: 100%, blip: 0.10, temperature: 45.0:45.0C, sensors: 1, current speed: 0%:
                                        

                                        Over 45ºC i get

                                        Fan 1 (Hemera), speed: 100%, min: 10%, max: 100%, blip: 0.10, temperature: 45.0:45.0C, sensors: 1, current speed: 100%:
                                        

                                        So all good 🙂 In order to verify this I set it back to S1, let the printer cool below 45ºC and restarted the printer
                                        M106 P1 S1 H1 T45 C"Hemera"

                                        Under 45ºC I now get

                                        Fan 1 (Hemera), speed: 100%, min: 10%, max: 100%, blip: 0.10, temperature: 45.0:45.0C, sensors: 1, current speed: 0%:
                                        

                                        instead of what I was originally getting

                                        Fan 1 (Hemera), speed: 0%, min: 10%, max: 100%, blip: 0.10, temperature: 45.0:45.0C, sensors: 1, current speed: 50%:
                                        

                                        And over I get

                                        Fan 1 (Hemera), speed: 100%, min: 10%, max: 100%, blip: 0.10, temperature: 45.0:45.0C, sensors: 1, current speed: 100%:
                                        

                                        Why am I now seeing different results when changing S back to 1 as in my original settings?

                                        Board: Duet 3 MB6HC
                                        Firmware: RepRapFirmware for Duet 3 MB6HC v0.6 or 1.0 3.01-RC2 (2020-02-18b1)
                                        Running in standalone mode.

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

                                          @richardmckenna said in Thermostatic controlled fan coming on at 50%:

                                          Why am I now seeing different results when changing S back to 1 as in my original settings?

                                          My guess is that there was an error in your original line so that instead of S1 you had Sl (lowercase L instead of 1) or S<space>1 or S<invisible character>1. In each case it would have been treated as S0; however the firmware enforces a minimum 50% PWM for thermostatic fans.

                                          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

                                          richardmckennaundefined 1 Reply Last reply Reply Quote 0
                                          • richardmckennaundefined
                                            richardmckenna @dc42
                                            last edited by

                                            @dc42 hmmm that may be it just strange as that line was from the original output from the configuration tool I just added the name parameter to the end.

                                            Anyway, at least it is behaving now 🙂

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Unless otherwise noted, all forum content is licensed under CC-BY-SA