Thermostatic controlled fan coming on at 50%



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



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



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



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



  • @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 🙂



  • @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!



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



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



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



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



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



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



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



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





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



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



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


  • administrators

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



  • @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 🙂



  • @dc42 ok nope. turned the printer on this evening this is the fan config I have at the moment, copy and pasted from the DWC editor, so there definitely isn't a lower case L

    M950 F1 C"!out4" Q500
    M106 P1 S1 H1 T45 C"Hemera"
    

    and the fan came on at 50%

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

  • Moderator

    Can you test S255 instead of S1?


  • administrators

    @richardmckenna, I think you have a M106 P1 S0 command somewhere, or possibly you have a F1 parameter in one of your M563 commands and a M107 command in the file you are printing.



  • @Phaedrux same with S255

    @dc42 ok I have an interesting development.

    I don't have any M106 P1 S0 commands anywhere I do have M106 P0 S0 in my slicer start and end gcode. I'm using Simplify3D

    I do have M563 P0 S"Hemera" D0 H1 F1 for my tool definition but no M107 commands anywhere.

    So I have it set with this at the moment

    M950 F1 C"!out4" Q500
    M106 P1 S255 H1 T45 C"Hemera"
    

    If I increase the temperature it comes on at 100%

    If I let it cool then start a print, when it gets to temperature it starts at 50%. If I then cancel the print the fan then goes to 100% without me doing anything.


  • administrators

    I think there is something in your print file that is causing it. Please post the first 50 lines or so, not counting the comments at the start.


Log in to reply