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

    RepRap Configuration - 5V Relay

    Scheduled Pinned Locked Moved
    Firmware installation
    3
    15
    627
    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.
    • SANJRundefined
      SANJR
      last edited by

      Hi,

      I am connecting a 5V Relay to 5V PWM Pin which is located in between the out9 and temp3 pin for controlling the ON & OFF operation of an plasma torch. I am not able to configure this in the RepRap config Tool. Does this has to be done manually in config.g file?

      1. What are the G Codes to configure and is there any example of the same to recreate for this operation?

      2. And where should be these G Codes placed? Like in the Config.g file or someother files

      3. Could the ON & OFF Operation be controlled by DWC?

      dc42undefined 1 Reply Last reply Reply Quote 0
      • Phaedruxundefined
        Phaedrux Moderator
        last edited by Phaedrux

        It sounds like you want to switch an IO pin.

        See M42 and M950

        M950 to create the pin and its roll, and M42 to switch it on and off.

        https://docs.duet3d.com/User_manual/Reference/Gcodes#m950-create-heater-fan-spindle-or-gpioservo-pin

        https://docs.duet3d.com/User_manual/Reference/Gcodes#m42-switch-io-pin

        @SANJR said in RepRap Configuration - 5V Relay:

        And where should be these G Codes placed? Like in the Config.g file or someother files

        M950 would go in config.g usually and M42 would be used to control it.

        @SANJR said in RepRap Configuration - 5V Relay:

        Could the ON & OFF Operation be controlled by DWC?

        You could create a macro with the M42 commands and control it that way. There is also an extension to DWC called BtnCmd that lets you do more complex button creation.

        https://forum.duet3d.com/topic/22776/btncmd-dwc-plugin-customise-dwc-v01-01-02-13-01-22?_=1673671092541

        Z-Bot CoreXY Build | Thingiverse Profile

        SANJRundefined 1 Reply Last reply Reply Quote 0
        • SANJRundefined
          SANJR @Phaedrux
          last edited by

          Have tried creating a G-Code for the ON & OFF Operation of a Torch as follows,
          M950 P3 C“5V PWM“ ; allocate GPIO port 3 to 5V_PWM (vfd/laser/servo)
          M42 P3 S1 ; set 100% PWM on GPIO port 3
          The M950 Command pin name "5V PWM" refers to the pin used for VFD/LASER/SERVO, which is positioned between Out9 & Temp 3 pin.
          In the G Code M950 Command

          1. Is the name "5V PWM" mentioned is correct?
          2. And at the last is it necessary to mention (vfd/laser/servo)?
          3. Q is not mentioned because there is no speed change only ON & OFF the relay?
            In the G Code M42 Command
          4. The Pin value is set as S1 to perform ON operation. Will the OFF operation value 0% will be considered automatically?

          Request to provide feedback whether the G-Code suffice or if it has corrected?

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

            @SANJR is it a bare relay, or a relay board? It makes a big difference.

            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

            SANJRundefined 1 Reply Last reply Reply Quote 0
            • SANJRundefined
              SANJR @dc42
              last edited by SANJR

              @dc42 Hi,

              Planning to use an Keyes SR1y relay module, image of the same shown below.
              5V Relay Module.webp

              The Hardware Wiring of the same is as follows
              Torch Connection.png

              1 Reply Last reply Reply Quote 0
              • Phaedruxundefined
                Phaedrux Moderator @SANJR
                last edited by

                @SANJR said in RepRap Configuration - 5V Relay:

                Is the name "5V PWM" mentioned is correct?

                No. It would be out9.

                https://docs.duet3d.com/Duet3D_hardware/Duet_3_family/Duet_3_Mainboard_6HC_Hardware_Overview#pin-names

                Z-Bot CoreXY Build | Thingiverse Profile

                SANJRundefined 1 Reply Last reply Reply Quote 0
                • SANJRundefined
                  SANJR @Phaedrux
                  last edited by

                  @Phaedrux Thanks

                  Would the pin name be "out9" (or) "out9,laser,vfd"?
                  Because the out9 refers to the two pin while the pin trying to use is a 4 pin which is next to the out9.

                  1 Reply Last reply Reply Quote 0
                  • Phaedruxundefined
                    Phaedrux Moderator
                    last edited by

                    Let's start from the top. Which board are you using exactly?

                    Z-Bot CoreXY Build | Thingiverse Profile

                    SANJRundefined 1 Reply Last reply Reply Quote 0
                    • SANJRundefined
                      SANJR @Phaedrux
                      last edited by

                      @Phaedrux Thanks

                      I will be using an Duet 3 Mainboard 6HC for building an DIY Research Project. I am planning to install and 5V Relay module for Switching ON and OFF a torch. Planning to control this Relay Module by 4 Pin Laser/VFD/Servo which is between the out9 and Temp3 pins.

                      Wiring of the same is shown below for reference
                      Torch.png

                      Certain set G-Codes would be required to control this operation. I am unable to find a example or reference for this purpose. Requesting support from members..........

                      1 Reply Last reply Reply Quote 0
                      • Phaedruxundefined
                        Phaedrux Moderator
                        last edited by

                        LASER/VFD v1.0 and later boards only. This provides 5V power and a 5V level signal for a TTL-compatible input to a laser controller, a PWM-to-0 to 10V converter (for variable-frequency drives), or a servo. The control signal for this output is shared with OUT9, so don't use OUT9 if you use this connector.

                        OUT 7, OUT 8, OUT 9 These are intended for fans. Maximum recommended current 2.5A each when supplied by VIN.
                        Note: These outputs are protected by a flyback diode connected to V_OUT_LC_2. Do not mix loads connected to V_OUT_LC_2 with the jumper set to 12V and loads connected to V_FUSED on the same bank.

                        OUT7-OUT9_SelectV The positive supply to the OUT 7, OUT 8 and OUT 9 connectors is the centre pin of the 3-pin jumper block labeled OUT7-OUT9_SelectV. A jumper in the top position will power them from the fused VIN supply. Alternatively you can connect a 3-terminal buck regulator to the 3-pin jumper block to supply the required voltage to the centre pin.

                        The pin name is still out9, but you can also use laser, or VFD.

                        In your case I'm not sure if it makes sense to use VFD or laser. What mode of operation will you be running in normally? If you just need to switch the relay, out9 seems to make sense to me.

                        Perhaps @DC42 has better advice though.

                        Z-Bot CoreXY Build | Thingiverse Profile

                        SANJRundefined 1 Reply Last reply Reply Quote 0
                        • SANJRundefined
                          SANJR @Phaedrux
                          last edited by

                          @Phaedrux Thanks for Your Feedback.

                          I have got some clarity the name of the pin is out9. I would be doing a simple ON & OFF Operation.

                          The Relay module is a simple 5V relay. This is my first time doing an DIY project so wanted it to as simple as it could be. That's the main reason of using an "5V PWM".

                          If I could use any other with a simple plug and play similar to that of an stepper motor would be of a great help. However in certain cases need to customize or change as required.

                          Request the users to support for a simple hardware wiring and to validate the G-Code Macro as per the trailing.

                          1 Reply Last reply Reply Quote 0
                          • Phaedruxundefined
                            Phaedrux Moderator
                            last edited by

                            Have you reviewed the M950 and M42 commands? Do you require more examples?

                            Z-Bot CoreXY Build | Thingiverse Profile

                            SANJRundefined 1 Reply Last reply Reply Quote 0
                            • SANJRundefined
                              SANJR @Phaedrux
                              last edited by

                              @Phaedrux

                              Yes. I have gone through commands M950 and M42. Tried to write this ON & OFF program as shown below

                              M950 P3 C“out9“ ; allocate GPIO port 3 to OUT_9 (fan output),
                              M42 P3 S1 ; set 100% PWM on GPIO port 3

                              In the M950 line G-Code have removed the the Q parameter since the speed is not going to be varied.

                              Would the above program suffice the Relay Module ON & OFF? Requesting your feedback.

                              1 Reply Last reply Reply Quote 0
                              • Phaedruxundefined
                                Phaedrux Moderator
                                last edited by

                                That looks ok, except the quotes around out9 don't look correct.

                                C“out9“ versus C"out9"

                                Z-Bot CoreXY Build | Thingiverse Profile

                                SANJRundefined 1 Reply Last reply Reply Quote 0
                                • SANJRundefined
                                  SANJR @Phaedrux
                                  last edited by

                                  @Phaedrux Thanks for the feedback would be changing the quotes.

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