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

    Set min and max PWM of fan

    Scheduled Pinned Locked Moved
    Using Duet Controllers
    3
    3
    199
    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.
    • e4dundefined
      e4d
      last edited by

      Hello, I want to control a proportionnal pneumatic valve that need a PWM signal between 45% and 70%. I have it configured as a fan using theses commands :

      M950 F0 C"0.out2" Q1000
      M106 P0 S0 C"T0" B0.1 L0.45 X0.7
      

      In my understanding the value chose between 0% and 100% should be a proportionnal of the values between 45% and 70%. However when I try to plot the actual vs expected value I have the following curve :

      alt text

      Can you tel me why nothing change before S0.6 ? And how can I fix this ?

      deckingmanundefined gloomyandyundefined 2 Replies Last reply Reply Quote 0
      • deckingmanundefined
        deckingman @e4d
        last edited by deckingman

        @e4d Just a guess but maybe your pneumatic valve doesn't play nicely with a high PWM frequency. I'd be tempted to try something like 10Hz (the "Q" value in M106).

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

        1 Reply Last reply Reply Quote 0
        • gloomyandyundefined
          gloomyandy @e4d
          last edited by

          @e4d The way it is working is as intended (at least it is how it is coded and documented). So I'm afraid that your understanding does not match the current implementation (though arguably the way you expect it to work would perhaps be better).

          From the docs:

          The requested PWM value (S parameter) is scaled to be between 0 and X parameter value, and rounded up to the minimum
          

          and from the code:

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

          https://github.com/Duet3D/DuetWebControl/blob/master/src/components/panels/FanPanel.vue#L64

          So basically it takes the requested value (0.0...1.0) and scales that by the maximum set value, it then compares that with the minimum set value and uses the larger of the two.

          I'm not totally sure why the current implementation is the way it is, there may be a good reason. Perhaps @dc42 would like to comment.

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