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

    Power failure and resurrection on a CNC machine

    Scheduled Pinned Locked Moved
    CNC
    4
    108
    7.1k
    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.
    • Nightowlundefined
      Nightowl @infiniteloop
      last edited by

      @infiniteloop

      Same problem. Only half a RestoreSpindleSpeed.g file...

      Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
      I'm still on my learning curve, so take everything I say with caution!

      RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

      infiniteloopundefined 1 Reply Last reply Reply Quote 0
      • Nightowlundefined
        Nightowl @infiniteloop
        last edited by Nightowl

        @infiniteloop

        OK, so I called resurret-prologue.g which gave a prompt to carry on. I clicked OK and the homing sequence completed.

        Then i got these errors:

        31/05/2022, 12:19:04 	M292
        Error: Bad command: {1}
        31/05/2022, 12:19:04 	m98 P"resurrect-prologue.g"
        Error: Bad command: {1}
        

        EDIT: I've deleted the {1}

        Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
        I'm still on my learning curve, so take everything I say with caution!

        RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

        infiniteloopundefined 1 Reply Last reply Reply Quote 0
        • infiniteloopundefined
          infiniteloop @Nightowl
          last edited by

          @nightowl999 said in Power failure and resurrection on a CNC machine:

          Same problem. Only half a RestoreSpindleSpeed.g file...

          So we've localised this problem: rapid power loss …

          In the meantime, please test with a RestoreSpindleSpeed.g which you generate from the command line

          M98 P"SaveSpindleSpeed.g"
          

          Proceed as suggested in my last post. Feel free to edit the S parameter of M3 if want your spindle to turn ☺

          Nightowlundefined 1 Reply Last reply Reply Quote 1
          • Nightowlundefined
            Nightowl @infiniteloop
            last edited by

            @infiniteloop

            That seems to work now.

            Shall I try the ultimate test?

            Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
            I'm still on my learning curve, so take everything I say with caution!

            RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

            infiniteloopundefined 1 Reply Last reply Reply Quote 0
            • infiniteloopundefined
              infiniteloop @Nightowl
              last edited by

              @nightowl999 said in Power failure and resurrection on a CNC machine:

              Then i got these errors:

              That are these empty line marks who seem to be generated when I put my stuff into the code (black) box. 😠
              Simply remove all occurrences of {1}… I just see: you did that already while I was writing 😊

              1 Reply Last reply Reply Quote 1
              • infiniteloopundefined
                infiniteloop @Nightowl
                last edited by

                @nightowl999 said in Power failure and resurrection on a CNC machine:

                Shall I try the ultimate test?

                Without enough power to safely complete macro execution at power off, what is the definition of "ultimate"? 🤔

                Nightowlundefined 1 Reply Last reply Reply Quote 1
                • Nightowlundefined
                  Nightowl @infiniteloop
                  last edited by

                  @infiniteloop As everything is hunky dory, the "ultimate" test would be to see if everything does work. If not, a UPS might be in order 😞

                  Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
                  I'm still on my learning curve, so take everything I say with caution!

                  RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

                  infiniteloopundefined 1 Reply Last reply Reply Quote 0
                  • infiniteloopundefined
                    infiniteloop @Nightowl
                    last edited by

                    @nightowl999 said in Power failure and resurrection on a CNC machine:

                    a UPS might be in order

                    Do you have a separated 5V rail (with its own PSU) just to power the Duet?

                    Nightowlundefined 1 Reply Last reply Reply Quote 1
                    • Nightowlundefined
                      Nightowl @infiniteloop
                      last edited by Nightowl

                      @infiniteloop Nope. It's just my 24V PSU

                      I wouldn't know how to do that, but it's only the Duet that's powered from the 24V, as the spindle has it's own power supply.

                      Still, the "ultimate" test failed at the same point, so I'm going to need to look at the 5V - or UPS - option!

                      But surely, if the power fails, it fails. What use is a 5V supply if it's on the same mains circuit?

                      Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
                      I'm still on my learning curve, so take everything I say with caution!

                      RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

                      infiniteloopundefined 2 Replies Last reply Reply Quote 0
                      • infiniteloopundefined
                        infiniteloop @Nightowl
                        last edited by infiniteloop

                        @nightowl999 said in Power failure and resurrection on a CNC machine:

                        Nope. It's just my 24V PSU

                        If you put your UPS on that, the Duet won't notice the loss of mains power: Without a voltage drop, M911 won't be executed … until the UPS runs out of juice. But then, you face the same situation as now.

                        1 Reply Last reply Reply Quote 1
                        • infiniteloopundefined
                          infiniteloop @Nightowl
                          last edited by

                          @nightowl999 said in Power failure and resurrection on a CNC machine:

                          What use is a 5V supply if it's on the same mains circuit?

                          You could either use a large capacitor, a tiny UPS or a power bank to keep the 5V alive for a while.

                          Nightowlundefined 1 Reply Last reply Reply Quote 1
                          • Nightowlundefined
                            Nightowl @infiniteloop
                            last edited by Nightowl

                            @infiniteloop
                            If you don't mind, is this something you would plug into the Duet's USB port, and would the power bank stay charged/charging whilst connected, then slowly (slower than the PSU) drain down giving more time to save what I need to save?

                            Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
                            I'm still on my learning curve, so take everything I say with caution!

                            RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

                            infiniteloopundefined 1 Reply Last reply Reply Quote 0
                            • infiniteloopundefined
                              infiniteloop @Nightowl
                              last edited by

                              @nightowl999 said in Power failure and resurrection on a CNC machine:

                              is this something you would plug into the Duet's USB port

                              Never. All the Duet boards I know of (don't know all of them) have an optional 5V input.

                              would the power bank stay charged/charging whilst connected

                              That depends on the power bank. Sorry, but due to my limited knowledge, I can't give you recommendations for specific devices. Have you searched the forum on this topic yet? I didn't, but I stumbled across some related posts in the past. 👁

                              Nightowlundefined 1 Reply Last reply Reply Quote 1
                              • Nightowlundefined
                                Nightowl @infiniteloop
                                last edited by

                                @infiniteloop OK, thank you. I'll ask this question separately then, burt I didn't want to seem impatient 🙂

                                Again, I really appreciate the time and effort you've put in to help me with this - you've been brilliant 👍 👍

                                Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
                                I'm still on my learning curve, so take everything I say with caution!

                                RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

                                infiniteloopundefined 1 Reply Last reply Reply Quote 0
                                • infiniteloopundefined
                                  infiniteloop @Nightowl
                                  last edited by

                                  @nightowl999 said in Power failure and resurrection on a CNC machine:

                                  I'll ask this question separately

                                  Maybe you search before you ask? Chances are good that then, your questions are more specific. Fore example, I still face the miracle that my Duet doesn't execute the M911 command sequence if I shut off my large power supply but keep the 5V rail alive. Remember, I came across that when I ran some macro tests for this thread on my Duet.

                                  So I'll dive into the ocean of Duet3D documentation and figure out how and when resurrect.g is triggered. This, in turn, seems to depend on how I configure and supply my various voltages.

                                  What I mean is: if you ask how to connect a UPS (or a power bank), the replies don't include the aspect of recovery from power failure. Is the way we elaborated in this thread still viable, or do you then need a different solution? Or: depending on your power setup, you might be able to came along with a simple capacitor - which won't work well if all your steppers suck from that, too.

                                  I suggest you go to the hardware section first (as a first read, I suggest this, this and something like this) and figure out how to separate the 5V from the rest. If you got the idea, ask the forum - not the other way round, because then, there's too much noise in the replies.

                                  1 Reply Last reply Reply Quote 0
                                  • Nightowlundefined
                                    Nightowl
                                    last edited by

                                    Thanks, @infiniteloop. I do try to search the forums and the documentation first, but I don't seem to find anything descriptive enough to work from so ask on the forum.

                                    Of course, as I get to know stuff, I'll be asking fewer questions and giving more help 🙂

                                    Thanks again, my friend 👍

                                    Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
                                    I'm still on my learning curve, so take everything I say with caution!

                                    RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

                                    1 Reply Last reply Reply Quote 0
                                    • Nightowlundefined
                                      Nightowl
                                      last edited by

                                      @infiniteloop
                                      So maybe the issue may not be power decline related...

                                      I changed a couple of things in the M911 line in the config.g file from:

                                      M911 S23 R23.5 P"M98 P""SaveSpindleSpeed.g"" M913 X0 Y0 G91 M83 G1 Z3 E-5 F1000"
                                      

                                      ...to...

                                      M911 S23 R23.5 P"M913 X0 Y0 G91""M98 P""SaveSpindleSpeed.g"
                                      

                                      ...effectively deleting the printer stuff and changing the file order, although I'm not sure if the latter made any difference. I also raised the threshold for power loss.

                                      Now, the ResumeSpidleSpeed.g file is fully formed, which is great, but I'm getting a different error, twice, when I enter M916 in the MDI:

                                      M292 Error: No P parameter and no active tool with spindle
                                      M916 Error: No P parameter and no active tool with spindle
                                      

                                      This clearly relates to the spindle - again - so I think the SaveSpindleSpeed.g file will need to edited to add those variables from the Object Browser.

                                      I'm going to use your lead to see if I can finish this off....

                                      Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
                                      I'm still on my learning curve, so take everything I say with caution!

                                      RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

                                      infiniteloopundefined 1 Reply Last reply Reply Quote 0
                                      • infiniteloopundefined
                                        infiniteloop @Nightowl
                                        last edited by

                                        @nightowl999

                                        I changed a couple of things in the M911 line

                                        M911 S23 R23.5 P"M913 X0 Y0 G91""M98 P""SaveSpindleSpeed.g"
                                        

                                        There's something wrong: the double quotation marks following G91 should not be there (and you can skip G91 completely), then, a second quotation mark to end the M98 argument is missing, finally, the closing quotation mark of M911 is missing, too. So try this instead:

                                        M911 S23 R 23.5 P"M913 X0 Y0 M98 P""SaveSpindleSpeed.g"""
                                        

                                        Let's try and see if the M292 and M916 errors persist.

                                        Nightowlundefined 3 Replies Last reply Reply Quote 0
                                        • Nightowlundefined
                                          Nightowl @infiniteloop
                                          last edited by

                                          @infiniteloo

                                          Ooh, that's a lot of quotation marks...

                                          I'll let you know how it goes...

                                          Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
                                          I'm still on my learning curve, so take everything I say with caution!

                                          RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

                                          1 Reply Last reply Reply Quote 0
                                          • Nightowlundefined
                                            Nightowl @infiniteloop
                                            last edited by Nightowl

                                            @infiniteloop

                                            That change truncated the writing of the RestoreSpindleSpeed. g

                                            This is all I got...

                                            ; RestoreSpindleSpeed.g
                                            ; Spindle speed saved from running "0:/gcodes/Calibration Toolpath.gcode" CNC file
                                            
                                            ; set up the global variable abort_process so we can abort further execution of resurrect.g:
                                            if {!exists(global.abort_process)}
                                                global abort_process = true
                                            else
                                                set global.abort_process = true
                                            

                                            Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
                                            I'm still on my learning curve, so take everything I say with caution!

                                            RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

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