• Tags
  • Documentation
  • Order
  • Register
  • Login
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.
  • undefined
    Nightowl @infiniteloop
    last edited by Nightowl 31 May 2022, 10:31

    @infiniteloop No, sorry. I get exactly the same error 😞

    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

    undefined 1 Reply Last reply 31 May 2022, 10:39 Reply Quote 0
    • undefined
      infiniteloop @Nightowl
      last edited by 31 May 2022, 10:39

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

      No, sorry. I get exactly the same error

      OK, let's see … Could you please compare your RestoreSpindleSpeed.g with this here:

      ; RestoreSpindleSpeed.g
      ; Spindle speed saved from running "null" 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
      ; now comes the dialog:
      M291 S3 R"Resurrect:" P"Continue with <null>?"
      ; we will only arrive here if the dialog was closed with OK:
      set global.abort_process = false
      M3 S0
      ;EOF

      I generated this without a job running, that's why the CNC file name is "null", and without a spindle, M3 will always be told a speed of 0 RPM.

      undefined 1 Reply Last reply 31 May 2022, 10:41 Reply Quote 0
      • undefined
        Nightowl @infiniteloop
        last edited by 31 May 2022, 10:41

        @infiniteloop Erm, my file looks like this...

        ; 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)}

        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

        undefined 1 Reply Last reply 31 May 2022, 10:52 Reply Quote 0
        • undefined
          infiniteloop @Nightowl
          last edited by infiniteloop 31 May 2022, 10:46

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

          I just noted a difference between your resurrect-prologue.g and the template I sent you - here's my version:

          if {global.abort_process == true}
          

          and here's your corresponding line:

          if global.abort_process == true
          

          You see the difference? 😌

          undefined 1 Reply Last reply 31 May 2022, 10:47 Reply Quote 0
          • undefined
            Nightowl @infiniteloop
            last edited by Nightowl 31 May 2022, 10:47

            @infiniteloop I do, yes. I tried it at that, but changed it back to using the squiggly brackets, as it made no difference.

            They're currently in place, as per your version.

            ; resurrect-prologue.g
            M98 P"RestoreSpindleSpeed.g"
            if {global.abort_process == true}
            abort
            ; abort terminates this and all other macros in the call chain, so 'rien ne va plus'
            ; Continuation has been approved, so here we go:"
            M98 P"homeall.g" ; homes all axes before restarting the job
            {1}

            I don't know why there are two {1} showing at the end of the file, though. There's only 1 in the actual file!

            Where is the global.abort_process declared, or is it a ssytem variable?

            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

            undefined 1 Reply Last reply 31 May 2022, 10:53 Reply Quote 0
            • undefined
              infiniteloop @Nightowl
              last edited by infiniteloop 31 May 2022, 10:52

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

              Erm, my file looks like this...

              That's a radically abbreviated version… πŸ€”

              Either, your SaveSpindleSpeed.g has been truncated so that it just generates 4 lines of output, or we see the result of too little power left after pulling the plug.

              [Edit] First, please check your copy of SaveSpindleSpeed.g carefully against the posted version. If both are equal, call SaveSpindleSpeed.g from the console:

              • throws it an error?
              • looks the resulting RestoreSpindleSpeed.g like the one I posted above?
              1 Reply Last reply Reply Quote 0
              • undefined
                infiniteloop @Nightowl
                last edited by 31 May 2022, 10:53

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

                I don't know why there are two {1} showing at the end of the file

                I'm not quite sure, either, but I think they indicate empty lines.

                undefined 1 Reply Last reply 31 May 2022, 10:55 Reply Quote 1
                • undefined
                  Nightowl @infiniteloop
                  last edited by Nightowl 31 May 2022, 10:55

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

                  but I think they indicate empty lines.

                  Maybe you're right about the powerloss, then, or (sorry for asking again) the global.abort_process variable hasn't been declared?

                  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

                  undefined 1 Reply Last reply 31 May 2022, 11:03 Reply Quote 0
                  • undefined
                    infiniteloop @Nightowl
                    last edited by 31 May 2022, 11:03

                    @nightowl999 I've added some hints to my post above. Please try them …

                    undefined 3 Replies Last reply 31 May 2022, 11:05 Reply Quote 1
                    • undefined
                      Nightowl @infiniteloop
                      last edited by Nightowl 31 May 2022, 11:05

                      @infiniteloop It says the file's not found, but it's deffo there in my \sys folder!

                      Error: in file macro line 28 column 26: meta command: control character in string

                      OK, there was a " missing on the last line...

                      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
                      • undefined
                        Nightowl @infiniteloop
                        last edited by Nightowl 31 May 2022, 11:09

                        @infiniteloop Now the file looks like this:

                        ; RestoreSpindleSpeed.g
                        ; Spindle speed saved from running "null" 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
                        ; now comes the dialog:
                        M291 S3 R"Resurrect:" P"Continue with <null>?"
                        ; we will only arrive here if the dialog was closed with OK:
                        set global.abort_process = false
                        M3 S0
                        ;EOF

                        I'll have another go at the power fail 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

                        undefined 1 Reply Last reply 31 May 2022, 11:15 Reply Quote 0
                        • undefined
                          infiniteloop @Nightowl
                          last edited by 31 May 2022, 11:15

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

                          Now the file looks like this:

                          That's perfect. Before pulling the plug again, you should call resurrect-prologue.g from the console to see if you still get an error. Note, however, that your router might execute the homing moves if the construct works as expected.

                          undefined 1 Reply Last reply 31 May 2022, 11:21 Reply Quote 1
                          • undefined
                            Nightowl @infiniteloop
                            last edited by 31 May 2022, 11:16

                            @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

                            undefined 1 Reply Last reply 31 May 2022, 11:22 Reply Quote 0
                            • undefined
                              Nightowl @infiniteloop
                              last edited by Nightowl 31 May 2022, 11:21

                              @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

                              undefined 1 Reply Last reply 31 May 2022, 11:27 Reply Quote 0
                              • undefined
                                infiniteloop @Nightowl
                                last edited by 31 May 2022, 11:22

                                @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 ☺

                                undefined 1 Reply Last reply 31 May 2022, 11:27 Reply Quote 1
                                • undefined
                                  Nightowl @infiniteloop
                                  last edited by 31 May 2022, 11:27

                                  @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

                                  undefined 1 Reply Last reply 31 May 2022, 11:30 Reply Quote 0
                                  • undefined
                                    infiniteloop @Nightowl
                                    last edited by 31 May 2022, 11:27

                                    @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
                                    • undefined
                                      infiniteloop @Nightowl
                                      last edited by 31 May 2022, 11:30

                                      @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"? πŸ€”

                                      undefined 1 Reply Last reply 31 May 2022, 11:31 Reply Quote 1
                                      • undefined
                                        Nightowl @infiniteloop
                                        last edited by 31 May 2022, 11:31

                                        @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

                                        undefined 1 Reply Last reply 31 May 2022, 11:34 Reply Quote 0
                                        • undefined
                                          infiniteloop @Nightowl
                                          last edited by 31 May 2022, 11:34

                                          @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?

                                          undefined 1 Reply Last reply 31 May 2022, 11:36 Reply Quote 1
                                          59 out of 108
                                          • First post
                                            59/108
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA