Question about M106



  • Hi,

    The online documentation for M106 says that the speed can be set using 0 to 255 or 0.0 to 1.0.

    This does not appear to be true for the firmware I am currently using when controlling a fan connected to a Duex5 v0.7 board.

    Only 0.00 to 1.00 seems to work.

    Is this correct?

    0_1542900366545_Firmware Info.jpg


  • administrators

    0 to 255 should work as well. Values of 1.0 or lower are assumed to be in the range 0 to 1, values above 1 are assumed to be in the range 0 to 255.



  • @dc42 said in Question about M106:

    0 to 255 should work as well. Values of 1.0 or lower are assumed to be in the range 0 to 1, values above 1 are assumed to be in the range 0 to 255.

    I just tested it again with LEDs as it is a bit easier to view the result

    0 by itself does turn the LEDs off BUT 1 to 255 all seem to be the same - full on.

    0.00 to 1.00 does yield varying light levels.

    The slider in DWC confirms this.

    Is the number in the 2nd decimal place (x.x#) intended to change the speed/level by 1%?

    I cannot be sure that I am seeing such a small change in the light level.

    Thanks.

    Frederick


  • administrators

    The resolution depends on the PWM frequency you have set. It's usually well below 1%.

    What commands are you sending to adjust the PWM?



  • @dc42 said in Question about M106:

    The resolution depends on the PWM frequency you have set. It's usually well below 1%.

    What commands are you sending to adjust the PWM?

    According to the docs the FAN outputs on the Duex5 v0.7 do not have adjustable frequency.

    To test M106 I have tried:

    M106 P6 S0.0 - LEDs are off - DWC slider = 0%
    M106 P6 S0.5 - LEDS are medium - DWC slider is 50%
    M106 P6 S1.0 - LEDS are max - DWC slider is 100%

    M106 P6 0 - LEDs are off - DWC slider is 0%
    M106 P6 2 - LEDS are max - DWC slider is 100%
    M106 P6 255 - LEDS are max - DWC slider is 100%

    Frederick


  • administrators

    OK, you are using fans on the DueX board. I'll re-test those, because I only tested direct-connect fans in my recent tests.


  • administrators

    I found there is a problem using values in the range 2-255 if you have other parameters in the M106 command. For example, M101 P6 S128 sets the fan to half PWM; but M106 P6 S128 F100 sets it to full PWM. I will fix this in the next 2.02RC.



  • @dc42 said in Question about M106:

    I found there is a problem using values in the range 2-255 if you have other parameters in the M106 command. For example, M101 P6 S128 sets the fan to half PWM; but M106 P6 S128 F100 sets it to full PWM. I will fix this in the next 2.02RC.

    Thanks for the feedback.

    But what you found does not match what I found, at least with it comes to a Duex5 v0.7.

    No extra parameters had to be present for the S1 through S254 values to cause the setting (according to the DWC slider) to be 100%.

    Frederick


  • administrators

    @fcwilt said in Question about M106:

    No extra parameters had to be present for the S1 through S254 values to cause the setting (according to the DWC slider) to be 100%.

    I was unable to reproduce that, it worked perfectly for me provided that the only parameters to the M106 command were P and S.



  • @dc42 said in Question about M106:

    @fcwilt said in Question about M106:

    No extra parameters had to be present for the S1 through S254 values to cause the setting (according to the DWC slider) to be 100%.

    I was unable to reproduce that, it worked perfectly for me provided that the only parameters to the M106 command were P and S.

    I will check it again.

    Frederick



  • @dc42 said in Question about M106:

    @fcwilt said in Question about M106:

    No extra parameters had to be present for the S1 through S254 values to cause the setting (according to the DWC slider) to be 100%.

    I was unable to reproduce that, it worked perfectly for me provided that the only parameters to the M106 command were P and S.

    Well I went back and tested it and it now works - values from 1 to 255 have the expected effect.

    Under any conditions does the firmware "remember" that extra parameters were used at one point and apply them for subsequent commands that have only P and S?

    Frederick


  • administrators

    No, it doesn't.



  • @dc42 said in Question about M106:

    No, it doesn't.

    Then I will just have to keep an eye on the problem and see if it reappears and under what circumstances.

    Thanks.

    Frederick


 

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