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

    Physical Buttons on Duet 3 MB6HC RRF 3.01+

    Scheduled Pinned Locked Moved
    Using Duet Controllers
    5
    12
    684
    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.
    • fractalengineerundefined
      fractalengineer
      last edited by

      Hi,

      I've installed 4 physical buttons on my front panel and I can't seem to find how to program them to register;

      This guide while very helpful seems obsolete due to the E component removed from the 3.01+ gcode

      Here is my Config file I wrote based on the guide before I found out about the change in gcode, which doesn't seem to work

      ; External Triggers
      M581 T1 E"io1.in" S1 R2					; Green button trigger 1 only when not printing (Load filament)
      M581 T2 E"io1.in" S1 R1					; Green button trigger 2 only when printing (Lower Z)
      M581 T3 E"io4.in" S1 R2					; Red button trigger 3 only when not printing (Unload filament)
      M581 T4 E"io4.in" S1 R1					; Red button trigger 4 only when printing (Raise Z)
      M581 T5 E"io2.in" S1 R2					; Black button trigger 5 only when not printing (Resume)
      M581 T6 E"io2.in" S1 R1					; Black button trigger 6 only when printing (Pause, Stop)
      M581 T7 E"io5.in" S1 R2					; Blue button trigger 7 only when not printing (LED strip on/off)
      M581 T8 E"io5.in" S1 R1					; Blue button trigger 8 only when printing (LED strip on/off)
      

      How are physical button external triggers supposed to be configured in the current RRF version?

      I couldn't quite find a matching example in the M950 part

      Thanks!

      Railcore II ZL

      dc42undefined 1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @fractalengineer
        last edited by

        @fractalengineer use M950 commands with J parameter to configure those pins as general purpose input ports. Then you can use M581 commands to refer to those input ports.

        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

        chimaeraghundefined 1 Reply Last reply Reply Quote 0
        • Gianlucaundefined
          Gianluca
          last edited by Gianluca

          Hi,
          I tried to make a button connected to the GPIO port (io5.in) in my Duer 3 v.1.01, that, when pressed the botton, starts a macro. Unfortunately it still doesn't work.

          I tried to do this:

          wiring:
          wire.jpg

          config.g:
          M950 J5 C"io5.in" ; Trigger n°5 on io5.in
          M581 T5 S1 R0 ; T5=Trigger logico 5, S1=trigger occurs on an inactive-to-active, R0=whether to trigger at any time

          Macro: ( Any trigger number # greater than 1 causes the macro file sys/trigger#.g )

          sys/trigger5.g

          for example

          M106 P3 C"LUCE LED" S0 ;TURN OFF LED

          I need advice to try.

          dc42undefined 1 Reply Last reply Reply Quote 0
          • dc42undefined
            dc42 administrators @Gianluca
            last edited by dc42

            @gianluca in your M581 command you need to add parameter P5 to tell it to monitor the GpIn 5 port that you created in the M950 command. See the M581 documentation.

            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

            Gianlucaundefined 1 Reply Last reply Reply Quote 0
            • chimaeraghundefined
              chimaeragh @dc42
              last edited by

              @dc42 Does this apply to the Duet2 boards running RRF3.3 too? I am also building a control panel for my Ooznest Workbee and was just about to use the guide to configure the buttons.

              Duet 2 Wifi, Ooznest Workbee CNC 1510

              1 Reply Last reply Reply Quote 0
              • Gianlucaundefined
                Gianluca @dc42
                last edited by

                @dc42
                Thanks,
                tonight I try with:
                M950 J5 C "io5.in"
                M581 P5 T5 S1 R0

                I have a doubt.
                Without the parameter "P5", measuring with the GND and io5.in with my tester, there are 3.3v and 3.0A.
                Doesn't the switch in the figure below create a short circuit?
                wire.jpg

                T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
                • T3P3Tonyundefined
                  T3P3Tony administrators @Gianluca
                  last edited by T3P3Tony

                  @gianluca the connection of io5.in to ground is what is measured (if the switch is normally open) or the break of the connection from io5.in to ground (if the switch is normally closed)

                  3.3v with the switch open as you show it is correct. It will not be 3A though, possibly 3mA

                  www.duet3d.com

                  Gianlucaundefined 1 Reply Last reply Reply Quote 0
                  • Gianlucaundefined
                    Gianluca @T3P3Tony
                    last edited by

                    @t3p3tony
                    Thank you,
                    the important thing is that the wiring is correct (switch between GND and io5.in).
                    The measurement of 3.3v is certain, I hope I have used a wrong scale of the multimeter for the measurement of the amperes.
                    Tonight I make other tests and redo the the measurements with the multimeter.

                    1 Reply Last reply Reply Quote 0
                    • fractalengineerundefined
                      fractalengineer
                      last edited by

                      Ok I've got it mostly configured now.

                      I'm trying to have the buttons functions setup now

                      Starting with the LED strip, I'd like the blue button to switch the light on/off: currently wired on a fan output.

                      I came up with this based on the object model plugin and gcode meta pdf but it doesn't seem to work

                      Any tips on fixing it?

                      ; /sys/trigger8.g
                      ; Blue Button only when printing
                      ; 24V LED ON/OFF
                      
                      if fans[3].actualValue < 0
                      	set fans[3].actualValue = 1
                      else 
                      	set fans[3].actualValue = 0
                      

                      Thanks!

                      Railcore II ZL

                      dc42undefined 1 Reply Last reply Reply Quote 0
                      • dc42undefined
                        dc42 administrators @fractalengineer
                        last edited by

                        @fractalengineer said in Physical Buttons on Duet 3 MB6HC RRF 3.01+:

                        if fans[3].actualValue < 0

                        Try replacing 0 by 0.5.

                        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

                        fractalengineerundefined 1 Reply Last reply Reply Quote 1
                        • fractalengineerundefined
                          fractalengineer @dc42
                          last edited by fractalengineer

                          @dc42 thank you, that makes sense, however that still didn't do it; I get this error message:

                          4/21/2022, 2:36:28 AM	Error: expected '=' in line 6 of trigger8.g
                          

                          edit: Actually interesting,

                          I get the error message on line 6 when the fan is on 0
                          And line 8 when on 1

                          I also tried using the requestedvalue objectmodel with the same result

                          Railcore II ZL

                          dc42undefined 1 Reply Last reply Reply Quote 0
                          • dc42undefined
                            dc42 administrators @fractalengineer
                            last edited by

                            @fractalengineer you can only use the 'set' command to set your own global and local variables. Use M106 commands to change the fan speed.

                            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 1
                            • First post
                              Last post
                            Unless otherwise noted, all forum content is licensed under CC-BY-SA