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

Need a 0.5 sec UPS (prolonging agony for resurrection)

Scheduled Pinned Locked Moved
Duet Hardware and wiring
6
22
675
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
    Triet
    last edited by 11 Jan 2025, 23:06

    Hello
    I have experienced short voltage outages leaving the 3D printer in an undefined state or knocking it off. While implementing the resurrection procedure I found that the printer does not live long enough to prepare for the resurrection, so I need a way to extend the working time of the printer when voltage gets below 22.5v for, let's say, 0.5 sec (I actually don't know how long I need).

    My 3D printer uses a Duet 2 Wifi and there is nothing special to consider regarding power consumption. Of course power consumers are switched off or cut down as the first step when the outage procedure is triggered at 22.5 v.

    In short, I don't really need a UPS, but a way to dampen the voltage decay. What would be the best way to achieve this? Should I simply connect a capacitor in parallel to the 24v, something like a supercap? How many farads would be appropriate? Or perhaps a small 24v pack of rechargeable Li-Ion batteries instead? I am afraid it won't be that simple, which is why I am asking help here. If there is a DIY solution I would willingly try to build it.

    Thanks in advance.

    undefined 1 Reply Last reply 11 Jan 2025, 23:12 Reply Quote 0
    • undefined
      droftarts administrators @Triet
      last edited by 11 Jan 2025, 23:12

      @Triet See https://docs.duet3d.com/en/User_manual/Tuning/Resume#power

      Adding a 10000uF capacitor across the VIN rail (between positive and negative terminals) can help increase the amount of stored power giving enough time to write to the SD card. Some PSUs have several sets of output terminals all connected in parallel, so you can connect the capacitor to a spare pair of terminals. However, the PSU may false-detect a short circuit and turn off when the machine is powered on. In this case, we suggest using a high-current Schottky diode and parallel resistor, connected between the VIN line and the capacitor. The resistor is for charging the cap. When the power goes off, the capacitor powers VIN via the diode. Make sure the diode is sufficient to handle the bed heater current (if powered from VIN) for at least a few seconds; in the fraction of a second between the mains failing and the VIN voltage dropping low enough for RRF to detect the loss of power, the capacitor will be supplying the bed through the diode.

      Ian

      Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

      undefined 1 Reply Last reply 12 Jan 2025, 00:32 Reply Quote 0
      • undefined
        samlogan87
        last edited by 12 Jan 2025, 00:28

        You could try using a DC UPS. @deckingman who unfortunately passed away but you can search his posts, where I pointed him to one we used on remote sites to keep PLC’s and RTU’s up for compliance in pump stations. We used Phoenix contact UPS’s but he had good luck with a mean well one. The beauty of the DC UPS, is everything is 24VDC, they are cheaper than a traditional one, and you can change the size of the battery you need

        Custom Core-XY

        undefined 1 Reply Last reply 12 Jan 2025, 01:05 Reply Quote 0
        • undefined
          Triet @droftarts
          last edited by 12 Jan 2025, 00:32

          @droftarts Thanks a lot! OK, a 10mF capacitor, connected to the two 24v leads via a Schottky diode and a resistor (both in parallel to each other) would do the trick. I understand how this works. I would figure out the value of the resistor to limit the current, but I have no idea how to choose the Schottky diode.

          Would anyone indicate a particular Schottky diode as a possible example for this purpose? Otherwise this will be trial and error for me.

          And yes, I know that I have to care about the polarity 🙂 . This simple circuit is nothing more than a kind of downsized DC UPS controler, and I would even have expected to find a board with a similar function but I couldn't. I don't think I am the first one coping with such a question, as many different devices need to be shut down in a controlled fashion (think of a NAS storage for example).

          1 Reply Last reply Reply Quote 0
          • undefined
            Triet @samlogan87
            last edited by 12 Jan 2025, 01:05

            @samlogan87 Yes, I have already read that article a couple of hours ago. I found the solution very attractive but my concern is not to run the printer any long time at an outage. There are virtually no power outages in the country where I live, except very short ones most people won't even notice (probably caused by a more challenging management of the public power grid due to a large and increasing share of renewable, but discontinuous power sources). Right now I am running a 23 h print and I have no ambition to use a UPS for that. Frankly, I even suspect something is wrong in the electrical installation of my house.

            After looking at the DC UPS mentioned in the article I found them to be oversized solutions for a 0.5 sec problem, and I thought I would find something similar, but self-powered, essentially like a supercap. I could only find supercaps for 12v only, for whatever reason.

            Deckingman passed by? Well that's a loss indeed. He was an enthusiastic and respected comrade in the 3D printer community.

            undefined 1 Reply Last reply 12 Jan 2025, 08:18 Reply Quote 0
            • undefined
              dc42 administrators @Triet
              last edited by 12 Jan 2025, 08:18

              @Triet you can connect supercaps of the same type and value in series, with parallel resistors to help keep the voltages balanced. For example, ten 10F 2.7V caps in series with a 100 ohm resistor in parallel with each one will give you a 1F 27V capacitor. Charge/discharge them through a 100 ohm 6W resistor and parallel Schottky diode.

              Don't forget that after turning power off the supercaps will still power the board for some time, so wait until the LEDs have all turned off before doing any work on the system.

              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

              undefined 2 Replies Last reply 12 Jan 2025, 13:39 Reply Quote 0
              • undefined
                Triet @dc42
                last edited by 12 Jan 2025, 13:39

                @dc42 Of course! Why didn't I myself come to the idea of combining several capacitors, so having even more design flexibility.

                You gave me the decisive impulse to start this task. I would even use the remaining power to run the hotend fan a bit longer to avoid nozzle clogging after a sudden heater shutoff.

                By the way: What I most appreciate using Duet hardware is... this help forum, definitely (beside their indisputable quality). Sincere thanks!

                undefined 1 Reply Last reply 14 Jan 2025, 11:03 Reply Quote 1
                • undefined
                  Triet @Triet
                  last edited by 14 Jan 2025, 11:03

                  @dc42 I wanted to wrap up some informations about this topic but found that I am not allowed to post links - I need two "reputations".

                  That's a pity. Would anyone be so kind to enable posting links for me? At least for this time. (Assuming that my findings are of general interest for the furure).

                  undefined 1 Reply Last reply 14 Jan 2025, 11:25 Reply Quote 2
                  • undefined
                    T3P3Tony administrators @Triet
                    last edited by 14 Jan 2025, 11:25

                    @Triet you should be able to now

                    www.duet3d.com

                    undefined 1 Reply Last reply 14 Jan 2025, 17:47 Reply Quote 0
                    • undefined
                      stuartofmt @T3P3Tony
                      last edited by 14 Jan 2025, 17:47

                      @Triet

                      There is quite a discussion here:

                      https://forum.duet3d.com/topic/19468/resume-from-power-outage-really-only-with-24v/36?_=1736875384534

                      Also - if you don't want to build - something like this may be OK for your needs.
                      https://github.com/bigtreetech/BIGTREETECH-MINI-UPS-V2.0/tree/master/BTT UPS 24V V1.0

                      undefined 1 Reply Last reply 15 Jan 2025, 02:19 Reply Quote 0
                      • undefined
                        Triet @stuartofmt
                        last edited by 15 Jan 2025, 02:19

                        @stuartofmt I just read that discussion, looks a bit chaotic but the hint about the BTT Supercap UPS is valuable.
                        @T3P3Tony Thanks!

                        I just wanted to clarify that it is really not necessary to build a pack of supercaps yourself. I was looking around and found some solutions. Often, supercap modules are offered to be used in automotive applications to protect the vehicle battery from to sudden current surge or to stabilize board voltage to satisfy hifi equipment (music listening people tend to be very demanding when it comes to sound quality).

                        For example, this one:
                        5PCS 1Set Super Capacitor 13.5V 12F Single Row Farad Capacitor2.7V 60F Automotive Super Farad Capacitor Module Supply Rectifier
                        Of course this would only be suitable for a 12V power supply, but you can connect two of them in series. This boards have voltage protection and balancing built-in. They are even oversized for this case (remember: the purpose is to allow a controlled shutdown, not to run the printer on UPS).

                        For more ambitious people, a 24V module is also available, for about $100 on Amazon, or around $21 on AliExpress:
                        GDCPH 24V5.5F Supercapacitor Electronic Rectifier Module 2.7V50F Super Farad Capacitor Backup Power Supply 24.3V Electrolysis
                        Note that it is composed of 9x50F supercaps in series (resulting in 5.5F), which is plenty of energy.
                        Still, these are not full fledged UPS - you still need the combo of resistor and Shottky (in parallel to each other) between the module and the PSU.

                        I even found a supercap module exactly as @dc42 proposed, if using two of them in series:
                        [16V 1F/2F Farad Capacitor Module 2.7V 10F Super Capacitors With Protection Board]
                        (https://www.aliexpress.com/item/1005002715223142.html)
                        You get one module for $6 or two for about $12, fairly affordable. That is currently my preferred option. The BigTreeTech 24V UPS mentioned above does not add any value because the Duet already has a power failure detection built-in.

                        My impression is that supercap based UPS are becoming popular. There are some professional solutions, for example customized for a Raspberry Pi (if you use one):
                        Andino-UPS - Supercapacitor UPS for the Raspberry Pi
                        but I also found some DIY projects. They should be considered as "emergency power supply" rather than UPS due to the limited length of time they can keep a printer running.

                        Engaging in this matter I have some new questions and ideas, namely: I would like to switch my printer on remotely (it is in an attic and I always have to go upstairs to switch it on) - a reversed question in comparison.

                        But also: What happens when I just switch the printer off in a regular manner when resurrection has been configured? The voltage will drop to the defined threshold in this situation too- will then the power failure procedure defined by M911 be executed? I have never checked that. OK, as a rule, no print job is running when I deliberately switch my printer off, so I suppose the procedure is only triggered in this case.

                        Why I come up with this question?
                        Assume that I have a small UPS that is able to detect failure of the mains power. It does not have to wait until DC voltage drops below say 22.5V to kick in. I can then save current coordinates and take some other precautions to prepare the resurrection, even before the voltage threshold is reached. Will then the power failure procedure defined with M911 still be executed a 2nd time when the DC voltage falls?

                        A real UPS has one key advantage compared to an emergency power supply, even when it is not meant to run the printer accross the powerless time, since it allows to keep the hotend fan running for a couple of minutes until the hotend gets cold enough, so to avoid nozzle clogging. In this case, the question whether M911 kicks in and saves the current state a 2nd time would be relevant.

                        I am done.
                        Thanks again.

                        undefined undefined 2 Replies Last reply 15 Jan 2025, 09:45 Reply Quote 1
                        • undefined
                          droftarts administrators @Triet
                          last edited by 15 Jan 2025, 09:45

                          @Triet said in Need a 0.5 sec UPS (prolonging agony for resurrection):

                          But also: What happens when I just switch the printer off in a regular manner when resurrection has been configured? The voltage will drop to the defined threshold in this situation too- will then the power failure procedure defined by M911 be executed? I have never checked that. OK, as a rule, no print job is running when I deliberately switch my printer off, so I suppose the procedure is only triggered in this case.

                          M911 is only triggered when the supply voltage falls below the auto save threshold while a print from SD card is in progress. So turning off the printer when idle will not trigger it.

                          @Triet said in Need a 0.5 sec UPS (prolonging agony for resurrection):

                          A real UPS has one key advantage compared to an emergency power supply, even when it is not meant to run the printer accross the powerless time, since it allows to keep the hotend fan running for a couple of minutes until the hotend gets cold enough, so to avoid nozzle clogging. In this case, the question whether M911 kicks in and saves the current state a 2nd time would be relevant.

                          M911 is triggered by a voltage drop. If there's no voltage drop, because the UPS has kicked in, then the firmware would be oblivious. If there's an output from the UPS to indicate that it's running, that can be connected to a Duet input, then you could create a trigger and macro to accomplish this.

                          Ian

                          Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                          1 Reply Last reply Reply Quote 0
                          • undefined
                            stuartofmt @Triet
                            last edited by stuartofmt 15 Jan 2025, 10:56

                            Triet
                            15 Jan 2025, 02:19
                            @Triet said in Need a 0.5 sec UPS (prolonging agony for resurrection):
                            I just read that discussion, looks a bit chaotic ...

                            Fee flowing discussions usually are 🙂

                            @Triet said in Need a 0.5 sec UPS (prolonging agony for resurrection):
                            I would like to switch my printer on remotely (it is in an attic and I always have to go upstairs to switch it on) - a reversed question in comparison.

                            I use Shelly products for this type of functionality (there are of course others). They are essentially WIFI equipped relays with built in http commands. The ones I use are powered by and switch mains voltage.

                            https://www.shelly.com/collections/smart-switches-dimmers

                            They are small and can even be fitted in a wall socket (if its deep enough). I have a Shelly 1 mounted in a small box (printed of course!) attached to my printer. That way I can remotely turned the printer on / off from a browser (or app that issues http).

                            Hope this helps.

                            undefined 1 Reply Last reply 16 Jan 2025, 00:34 Reply Quote 1
                            • undefined
                              Triet @stuartofmt
                              last edited by 16 Jan 2025, 00:34

                              @stuartofmt I am looking at different options and learned about a switch with a ESP8266 NodeMCU microprocessor, which is more elegant and flexible. It runs a Webserver as well.
                              If you are interested:
                              ESP8266 Button

                              undefined 1 Reply Last reply 16 Jan 2025, 11:14 Reply Quote 0
                              • undefined
                                stuartofmt @Triet
                                last edited by 16 Jan 2025, 11:14

                                @Triet said in Need a 0.5 sec UPS (prolonging agony for resurrection):

                                @stuartofmt ...which is more elegant and flexible.

                                Than ? I guess it all depends on build vs buy. If you want to go down the buy route - you will find the Shelly has way more out-of-the box capability (than ESP8266 NodeMCU microprocessor) with no need for programming / building.

                                I'm not plugging Shelly just offering an idea. Way back, I considered building but for ~$15 to buy ... well you see where I am coming from 🙂

                                1 Reply Last reply Reply Quote 0
                                • undefined
                                  Triet @dc42
                                  last edited by Triet 28 Mar 2025, 12:51

                                  @dc42 I followed your advice and installed two supercap boards, connected through Schottky diode and resistor (both in parallel).

                                  The printer is kept alive for about ten seconds after disrupting power supply - enough for any preparation for resurrection.

                                  BUT:

                                  I have an unexpected effect I dislike: When trying to switch off the printer from the PanelDue ("STOP") or from the DWC ("Emergency Stop") the printer shows a short flickering and... stays "alive". I can't switch the printer off remotely anymore 😠

                                  I suspect this is because PS_ON will still be kept high as the emergency power supply seems to be quite brisk, a good thing in principle. I don't like that I have to completely separate the mains leads to switch the printer off (I do have such a mains switch installed, but it is on the back side and it is intended for emergency cases, but I have to be physically in front of the printer to do that). My printer has no "soft" off switcher.

                                  Interestingly, after every print job I execute

                                  M81 S1               ; shutdown after all thermostatic fans have turned off
                                  

                                  in my end-gcode script, and that seems to work well until now (why?). I will have to try the "M81" command from the console and check if it works manually when no print is running.

                                  I am thinking about a solution to this - perhaps disrupting the PS_ON line using a mechanical momentary switch that I would press longer? But how long??

                                  I just wanted to let you know, in case anyone tries such a solution.

                                  undefined 1 Reply Last reply 28 Mar 2025, 14:20 Reply Quote 0
                                  • undefined
                                    stuartofmt @Triet
                                    last edited by 28 Mar 2025, 14:20

                                    @Triet said in Need a 0.5 sec UPS (prolonging agony for resurrection):

                                    I don't like that I have to completely separate the mains leads to switch the printer off (I do have such a mains switch installed, but it is on the back side and it is intended for emergency cases, but I have to be physically in front of the printer to do that). My printer has no "soft" off switcher.

                                    Can you show us a drawing on how you have things (electrically) connected. From your description, it almost sounds like the results could be as expected.

                                    How long does it take for your UPS to completely run out of power? If the UPS is triggered by a power outage - its not clear what the comment about manually turning off the power means.

                                    In the documentation for M112 it states:
                                    "PSU power (if controlled by the Duet via the PS_ON pin) is NOT turned off"

                                    Also the "Emergency Stop" in DWC (M112 followed by M999) will restart the board - so it sounds like your UPS is still providing enough power to allow this to happen.

                                    undefined 1 Reply Last reply 28 Mar 2025, 16:45 Reply Quote 0
                                    • undefined
                                      Triet @stuartofmt
                                      last edited by Triet 28 Mar 2025, 16:45

                                      @stuartofmt Yes, I think I can follow, after reviewing the Duet3D documentation, particularly:
                                      Connecting an Emergency Stop

                                      The board is switched on by mechanically closing the lead going through the SSR (purple) for at least 1 sec, thus enabling PSU and allowing the board to start, and then it would maintain PS_ON by itself, at which point the momentary start switch can be released. The board keeps itself alive by keeping the SSR output closed.

                                      652a1f77-3db9-496e-9a19-4b2600d01b9a-image.png ```

                                      In order to get the "Stop" button in the PanelDue and the "Emergency Stop" button from the DWC to work as usual, they would need to have the M81 command before the M112. The "Emergency Stop" has never reset my printer, the printer has always been shut down.

                                      Describing what behaves "as expected" is relative to your expectation. I would expect an Emergency Stop to always unconditionally stop the printer if it is an emergency.

                                      Anyway, if I can't redefine those buttons (and I think I can't without recompiling something) I will need to
                                      a) install and configure a mechanical emergency stop as per docu
                                      b) use M81 on the console, or use the BtnCmd plugin to create my own "Emergency Stop" button on the DWC.

                                      undefined 1 Reply Last reply 29 Mar 2025, 11:03 Reply Quote 0
                                      • undefined
                                        stuartofmt @Triet
                                        last edited by 29 Mar 2025, 11:03

                                        @Triet
                                        A few questions to better understand your goal and in what circumstance? Sometimes that will free up some suggestions from others.

                                        Is it to provide enough time to gracefully shutdown in the event of a power failure? If so how are you detecting that?

                                        Emergency Stop is defined in a particular way. It will stop a print job and turn off heaters etc. It will not, with your design, cut the power because you have effectively latched the SSR.

                                        Why are you using an SSR in this manner? What functionality does it provide in your intended use-case? Earlier you mentioned that your printer is in the attic and you wanted to be able to remotely turn it on / off I can see that the current design does not allow turning off but how are you turning on?

                                        Simple solutions usually take longer to think through the alternative strategies 🙂

                                        undefined 1 Reply Last reply 29 Mar 2025, 19:38 Reply Quote 0
                                        • undefined
                                          Triet @stuartofmt
                                          last edited by Triet 29 Mar 2025, 19:38

                                          @stuartofmt I wanted an emergency power supply, and I got it (thanks again to all participants in this thread). I won't have more spurious short plunges of the power supply. As a side effect, I can more comfortably rely on preparing resurrection.

                                          My last comment was about a new issue, which is a consequence of this mod: Not being able to shut down the printer remotely as I was used to. But I just checked: Using M81 on the DWC console works; the printer has a delayed/starving shutdown and after about 10-12 sec it will be completely off. That is OK for me for the time being.

                                          I expressed my surprise about how the term "Emergency Stop" is intended to work but ultimately I accept its definition, although it does not match my expectation. I can technically comprehend the modus operandi but since I prefer a more explicite, unconditional and reliable way of shutting down the printer (also remotely) I still have a follow-up task and depicted two solutions for that - feel free to contribute yours.

                                          Until now and still currently, I can only switch the printer on when physically present in front of it - that's a different question that I will also address in the future and the modification should consider the option to keep an attached SBC alive if present. This is not an "issue" as such, just my belatedly request while modifying my custom printer.

                                          So I am in peace with Duet and the world. Just a bit surprised, and not yet done (I think I will never be).

                                          undefined 1 Reply Last reply 29 Mar 2025, 22:58 Reply Quote 0
                                          • First post
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA