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

PWM support for M42

Scheduled Pinned Locked Moved
Firmware wishlist
3
5
1.4k
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.
  • undefined
    W3DRK
    last edited by 8 Apr 2016, 18:21 4 Aug 2016, 16:41

    Unlike the current Duet boards that only support digital on/off, adding PWM support to output pins via M42 would be handy! I assume the upgraded µC on the DuetWifi could hopefully support this? Having used this ability in Smoothieware, this is one feature I really miss with my current Duet.

    W3DRK

    1 Reply Last reply Reply Quote 0
    • undefined
      dc42 administrators
      last edited by 5 Aug 2016, 06:31

      In fact the firmware does allow PWM to be specified with M42. However, all the PWM pins are allocated to heaters and fans (including the heater pins on the expansion connector). If you use M42 to setup PWM on an unused heater output, the PID controller will turn it off (high) after a short time. Maybe we need an M command to specify how many heaters are connected, so that heater outputs beyond that can be used as general I/O pins.

      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

      1 Reply Last reply Reply Quote 0
      • undefined
        W3DRK
        last edited by 5 Aug 2016, 14:39

        That would be fantastic!

        It's nice to be able to control LEDs and things this way and I usually prefer to use my own galvanically isolated mosfets so I can use devices with various voltage requirements (for example 5V and 12V fans/LEDs on a 24V system) without any risk of ground loops and to protect the uC. So having direct access to multiple unused PWM capable I/O pins would be a nice touch.

        I also see there is thermostatic control available for the 2nd fan output. Is it possible to independently configure more than one I/O for thermostatic control, each with different temperature thresholds?

        I'm certainly looking forward to getting my DuetWifi. Very nice work! To be honest I'm a die-hard fan of Smoothieware and how flexible their firmware is, but once I started tinkering with a Duet v0.6 it's really been growing on me….

        Cheers!
        Dieter

        @dc42:

        In fact the firmware does allow PWM to be specified with M42. However, all the PWM pins are allocated to heaters and fans (including the heater pins on the expansion connector). If you use M42 to setup PWM on an unused heater output, the PID controller will turn it off (high) after a short time. Maybe we need an M command to specify how many heaters are connected, so that heater outputs beyond that can be used as general I/O pins.

        1 Reply Last reply Reply Quote 0
        • undefined
          T3P3Tony administrators
          last edited by 5 Aug 2016, 16:23

          Another option would be to add software PWM to any unused GPIO pin that can currently be used by M42 depending on the PWM frequency wanted this could add too much overhead though.

          Regarding deciding if a heater output is used or not, rather than a new M code, why not just allow all heaters that are not added to a tool to be used as PWM?

          www.duet3d.com

          1 Reply Last reply Reply Quote 0
          • undefined
            dc42 administrators
            last edited by 5 Aug 2016, 22:00

            @T3P3Tony:

            Another option would be to add software PWM to any unused GPIO pin that can currently be used by M42 depending on the PWM frequency wanted this could add too much overhead though.

            The overhead would be high unless the PWM resolution were limited to 1ms or the timing were done in the step ISR, which I would rather avoid because of the impact on maximum step generation speed.

            Regarding deciding if a heater output is used or not, rather than a new M code, why not just allow all heaters that are not added to a tool to be used as PWM?

            For safety reasons I would rather the user made a definite statement that there is no heater attached to the pin. But perhaps we don't need a new M code, we could add an option to M305 instead.

            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

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