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

    ATX power ON/OFF for non atx power supply?

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    6
    14
    1.6k
    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.
    • matej1006undefined
      matej1006
      last edited by

      Hello,

      can I use this output to control my power supply which in meanwell 600W 24V.

      if is how?

      i would like mainly just to turn off, i was thinking to do that way that i turn on printer with hardware button, and then if i am home to turn off with same hardware button or if I am away to turn off with macro or this output for ATX power.

      Greatings Matej

      Richard Fundefined 1 Reply Last reply Reply Quote 0
      • Jacotheronundefined
        Jacotheron
        last edited by

        Some other power supplies have a remote function to turn it on or off, if yours have it, read the manual on how to use it.

        My own setup is similar to what you describe:

        The parts:

        • 1 Relay (I used a relay module, that is rated at 24V for the signal, and 10A Mains for the switching side).
        • 1 Momentary Switch (this should also be mains rated, and at least 2A - the printer will startup through this switch).

        How it is connected:

        1. On my printer I had an IEC (computer power cable) plug, with fuse and switch (this is how the power enters the printer, and this switch is also the master switch).
        2. From the IEC plug, the live wire splits into 2:
          2.1. The first wire goes to the Common on the Relay; and a wire goes from the Normally Open on the Relay to the live input on the Power Supply.
          2.2. The second wire goes to the switch, with once again a wire from the switch to the Power Supply live input.
        3. The idea of this nr 2 is to provide a Relay and a Bypass line for the power (bypass allows the power supply to power on, supplying power to the Duet which in turn will enable and keep the Relay enabled).
        4. a +24V wire should then go to the Relay's signal/coil side (some of these modules have a Positive, Signal and Ground terminal; in this case, get 24V to both Positive and Signal).
        5. The Relay's Ground should run to the Duet's PS_ON pin (when this pin is enabled in software, it will become Ground potential, thus the relay is enabled).
        6. Further you wire everything like normal.

        Note that the M80 command should be in your config, as otherwise the relay will not engage (when I upgraded to RRF3, I forgot about that - had to keep the switch pressed while sending M80, before I could edit the config).

        As to the Macro, here is what I use to turn the printer off:

        M291 P"Turn printer off? Move axis now or cancel." R"Shutdown Printer?" S3 X1 Y1 Z1
        M81 ; Turn ATX Power Off
        

        The idea is very simple: macros can be triggered by accident, and shutting down mid print is bad. The first line asks if you are sure to shut it down (while having the axis jog buttons on screen - useful to move the head, if you need to move it before shutting down), with a Cancel button that simply exists. If you select Ok, M81 is run, which release the relay, and the printer is off.

        In my configuration, I only need to press the button for less than a second, and the printer is on.

        Note that the firmware does not currently use the PS_ON for safety etc, but it may be implemented in the future (where the printer can shut itself down if a thermal runaway was detected).

        1 Reply Last reply Reply Quote 0
        • matej1006undefined
          matej1006
          last edited by

          Wow nice idea even better.

          I would then like also to park actvie tool back to garage then i just add T-1 below M291?
          Would you please skecth up this setup how did you connect together that configuration.

          Please @Jacotheron

          Matej

          1 Reply Last reply Reply Quote 0
          • piperswundefined
            pipersw
            last edited by

            I use it on my Meanwell SP-480-24, I use directly the pins RC with a pull-up to 5V, no need for a relay.

            1 Reply Last reply Reply Quote 0
            • matej1006undefined
              matej1006
              last edited by matej1006

              I have that one: https://www.meanwell-web.com/en-gb/ac-dc-single-output-enclosed-power-supply-output-hrp--600--24

              piperswundefined 1 Reply Last reply Reply Quote 0
              • piperswundefined
                pipersw @matej1006
                last edited by

                @matej1006 said in ATX power ON/OFF for non atx power supply?:

                I have that one: https://www.meanwell-web.com/en-gb/ac-dc-single-output-enclosed-power-supply-output-hrp--600--24

                This PSU don't have a remote control, so use a relay on main of the PSU

                1 Reply Last reply Reply Quote 0
                • Jacotheronundefined
                  Jacotheron
                  last edited by

                  I have quickly created the image below showing the relevant wiring. The relay shown is rated at 5V, however I recommend a 24V (otherwise you will need to step the voltage from the power supply down). Also note that the relay module needs the fly-back diode for protection (if you implement your own relay, make sure the diode is in place).

                  Legend is at bottom left.

                  Duet-PS_ON-Wiring.jpg

                  So basic functionality:

                  1. Both the switch and the relay is between the IEC Mains input and the Power Supply on the Live wire. This allows either to allow power through (switch is meant as Bypass, so when printer is on, it have no effect).
                  2. With the switch pressed, power supply starts up, gives 24V to Duet and Relay Module (note that at this time, PS_ON is in high-impedance, thus it lifts to 24V).
                  3. Duet starts up, and runs the config.g file, which should contain M80.
                  4. M80 force the PS_ON line to 0V/GND; causing a voltage over relay, thus enabling it. With the relay active, it close the circuit of the Live wire, taking over to supply the Power Supply.
                  matej1006undefined 1 Reply Last reply Reply Quote 1
                  • matej1006undefined
                    matej1006 @Jacotheron
                    last edited by matej1006

                    @Jacotheron Thanks 😉

                    1 Reply Last reply Reply Quote 0
                    • matej1006undefined
                      matej1006
                      last edited by

                      @Jacotheron

                      The M80 in config file must be on the top I guess?
                      And if i press second time button then printer will turn off?

                      or only way to turn off printer is with macro?

                      Matej

                      1 Reply Last reply Reply Quote 0
                      • Jacotheronundefined
                        Jacotheron
                        last edited by

                        The M80 can be anywhere in the config.g, most times it takes very little time to process the config.g file (I had mine at the top and bottom and no noticeable difference).

                        As to the button being pressed more times: it does nothing. As can be seen in the diagram, it simply bypass the relay to start powering the power supply; when relay is engaged, and the button is pressed, the mains have 2 paths to get to the power supply. I typically switch off using the macro (have it numbered to display on the PanelDue).

                        A while back my PanelDue stopped responding (not sure what happened); that time something was also wrong with the networking, so did not have DWC access (started the print on PanelDue, before the not responding). This is why having a backup/master switch at the IEC is useful.

                        1 Reply Last reply Reply Quote 1
                        • mitchundefined
                          mitch
                          last edited by

                          I wanted to go a step further and also have soft power control over the 5VDC portion.

                          https://www.randoprojects.com/2020/07/30/duet-2-soft-power-control/

                          1 Reply Last reply Reply Quote 0
                          • matej1006undefined
                            matej1006
                            last edited by

                            Hello,

                            i have problem now after i did upgrade to 3.4.0.rc2, my printer won't stay turned on when i release button.
                            i did change to this in my M98"Turn printer on" and still won't work ? and is still same pin out for that or it's different.
                            where then i put Turn printer off code in config file?

                            M81 C"pson" ; allocate the PS_ON pin to power control but leave power off
                            M81         ; turn power off immediately
                            M81 S1      ; turn power off when all thermostatic fans have turned off
                            

                            My Turn printer on code :

                            M80          ; sets pin in the power on state
                            M80 C"pson"  ; allocates the pin and sets the pin in the power on state.
                            M80 C"!pson" ; inverts the PS_ON output for Meanwell power supplies
                            
                            rjenkinsgbundefined 1 Reply Last reply Reply Quote 0
                            • rjenkinsgbundefined
                              rjenkinsgb @matej1006
                              last edited by rjenkinsgb

                              @matej1006
                              You only need the

                              M80 C"!pson"
                              M80

                              in config.g, and do not include any M81 in config.g, otherwise it will turn off again.

                              The setup line with the pson in it should only appear once, ever, to define the pin.

                              After that, M80 turns power on and M81 turns it off etc. You do not need to repeat the setup for M81.

                              You would normally only use M81 in a shutdown macro or at the end of a print, in the slicer post-print gcode.

                              Put the M80 lines near the start of your config, so the power enable is set fairly soon after power-up.

                              Robert J.

                              Printers: Overlord pro, Kossel XL+ with Duet 6HC and "Frankentron", TronXY X5SA Pro converted to E3D toolchange with Duet 6HC and 1LC toolboards.

                              1 Reply Last reply Reply Quote 1
                              • Richard Fundefined
                                Richard F @matej1006
                                last edited by

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