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

auto save on loss of power from a different pin (endstop?)

Scheduled Pinned Locked Moved
General Discussion
3
13
1.5k
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
    dragonn
    last edited by 13 Apr 2018, 17:36

    I want connect my UPS with have a low DC signal when it runs on battery to DuetWiFi.
    For safety I use an optocoupler between Duet and UPS

    And I wont a power save future so when the UPS goes on battery the printers stops printing, moves the head back and only heats the bed up so the print doesn't detach from bed.

    Can I archive it by using M581 command? I am going to use E1 endstop.
    The problem with I see is that when I configure the external trigger as pause I need to modify pause.g to shutdown head heating, lower motor current etc. but this will affect the normal work of the pause button. And when using sys/trigger#.g as far I know it doesn't automatic save the current position.

    undefined 1 Reply Last reply 13 Apr 2018, 17:47 Reply Quote 0
    • undefined
      T3P3Tony administrators @dragonn
      last edited by T3P3Tony 13 Apr 2018, 17:47

      @dragonn What you might want to do is use pause in combination with other steps within your trigger.g so pause first (with the associated head parking etc (at higher current on the motors etc) then turn off/down what you want.

      www.duet3d.com

      1 Reply Last reply Reply Quote 0
      • undefined
        dragonn
        last edited by 13 Apr 2018, 17:53

        You mean use M226 in trigger.g? But when I run this first it will block executing that macro? I could move head back a the point where pause.g moves it, the lower motors current, standby heater and then run M226.

        Will it be possible to configure a second trigger to resume printing?

        1 Reply Last reply Reply Quote 0
        • undefined
          T3P3Tony administrators
          last edited by 13 Apr 2018, 18:01

          Yep should run pause.g... need to check if M226 save the position (I think it does but I have not tested that). Pause is not permanently blocking though, once the macro has finished running you can then carry out other commands.

          I would not have an automatic resume unless you are 100% sure that it wont cause issues. What about different bed temps in different prints, or if the power is down for long enough that the UPS runs out of power, the HB cools down and the print detaches?

          www.duet3d.com

          1 Reply Last reply Reply Quote 0
          • undefined
            dragonn
            last edited by 13 Apr 2018, 18:12

            Hmmm not sure, I think when I configure the resume trigger to rising edge it should not trigger when the UPS loss it power - since the input will be already high before Duet even boots up.

            Only problem will be when a next power cycles goes, this could trigger it.
            But yeah - I wont automatic resume only when the power doesn't go down.

            Different bed temps should be a problem since I will keep the bed on to it's set temperature when running from UPS.

            1 Reply Last reply Reply Quote 0
            • undefined
              T3P3Tony administrators
              last edited by 13 Apr 2018, 18:16

              fair enough. you can test all of this using a switch plugged into the chosen pin before using the UPS so you can see if the ressuract file is being saved.

              www.duet3d.com

              1 Reply Last reply Reply Quote 0
              • undefined
                dragonn
                last edited by 13 Apr 2018, 21:03

                Trigger is already working. Some questions more:
                as far I know it is not possible to have different macros for rising and falling edge? It would be nice to put in on the firmware wish list.
                But I have a different idea - can I use in trigger2.g M583 to wait for E1 endstop to go back to high? When M583 stops executing the macro I could put the restore commands after it.

                And one question more. How can I suspend the hotend so I can restore it temp after power goes back? I see they is a M144 but it only works with beds.

                1 Reply Last reply Reply Quote 0
                • undefined
                  dc42 administrators
                  last edited by dc42 13 Apr 2018, 21:05

                  Yes you can have different macros for rising and falling edge.

                  If you have only one hot end then you can do T-1 when pausing to put the hot end in standby. To reselect it, send T0 (assuming it is tool 0) followed by M116 to wait for it to reach temperature.

                  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 1 Reply Last reply 13 Apr 2018, 21:12 Reply Quote 0
                  • undefined
                    dragonn @dc42
                    last edited by 13 Apr 2018, 21:12

                    @dc42 Wait.. just use next trigger so it runs trigger3.g. Didn't think about that.
                    Yes I have one hotend for now so it will work.

                    But thinking further it would be better to use M583 then a second trigger. This would prevent any triggering when the UPS batteries run out of power and the power goes back. Other option would be to enable the restore trigger in the power save trigger. And with S-1 I can disable a trigger I am right?

                    undefined 1 Reply Last reply 14 Apr 2018, 08:35 Reply Quote 0
                    • undefined
                      dc42 administrators @dragonn
                      last edited by 14 Apr 2018, 08:35

                      @dragonn, yes you can disable a trigger with S-1 in the M581 command.

                      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
                        dragonn
                        last edited by 15 Apr 2018, 19:29

                        It works! Only problem with I had was M226 didn't work, seems like it doesn't stop executing the macro until pause.g is finished. But M25 works perfectly fine, posting this because maybe it will be useful for someone else.

                        1 Reply Last reply Reply Quote 1
                        • undefined
                          dc42 administrators
                          last edited by 16 Apr 2018, 20:28

                          M226 is intended for use in the GCode file being printed, for example to pause after a particular layer has completed. So it waits until all the moves in the queue have been completed. M25 is intended for use from a different source of GCodes.

                          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 2
                          • undefined
                            T3P3Tony administrators
                            last edited by 20 Apr 2018, 16:29

                            @dc42 said in auto save on loss of power from a different pin (endstop?):

                            M226 is intended for use in the GCode file being printed, for example to pause after a particular layer has completed. So it waits until all the moves in the queue have been completed. M25 is intended for use from a different source of GCodes.

                            I have updated the gcode documentation to reflect this.

                            www.duet3d.com

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