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

    M106 handling of X (max fan speed) parameter

    Scheduled Pinned Locked Moved Solved
    Documentation
    2
    3
    231
    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.
    • gloomyandyundefined
      gloomyandy
      last edited by

      Hi, I think there is a small error/confusion in the M106 documentation. The latest doc for M106 describes how the X parameter (max fan speed is handled as):

      The L parameter defines the minimum PWM value that is usable with this fan. If a lower value is commanded that is not zero, it will be rounded up to this value.
      
      The X parameter defines the same for a maximum PWM value. If a higher value is commanded, it will be rounded down to this value.
      

      But looking at the code:
      https://github.com/Duet3D/RepRapFirmware/blob/3.4-dev/src/Fans/LocalFan.cpp#L76

      		reqVal = (val <= 0.0) ? 0.0 : max<float>(val * maxVal, minVal);		// scale the requested PWM by the maximum, enforce the minimum
      

      It looks like the requested value (from the S parameter) is scaled to be between 0..<max value> and that value is then rounded up to the minimum. Which seems to make more sense than the rounding down described in the docs.

      droftartsundefined 1 Reply Last reply Reply Quote 0
      • droftartsundefined
        droftarts administrators @gloomyandy
        last edited by

        @gloomyandy Thanks Andy, I'll check with @dc42 (though I'm sure you are correct!) and amend.

        Ian

        Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

        1 Reply Last reply Reply Quote 0
        • droftartsundefined
          droftarts administrators
          last edited by

          M106 entry updated.

          Ian

          Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

          1 Reply Last reply Reply Quote 0
          • droftartsundefined droftarts marked this topic as a question
          • droftartsundefined droftarts has marked this topic as solved
          • First post
            Last post
          Unless otherwise noted, all forum content is licensed under CC-BY-SA