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

Spindle inactive on resume

Scheduled Pinned Locked Moved
CNC
5
13
497
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
    chimaeragh
    last edited by chimaeragh 19 Nov 2022, 18:44

    My spindle does not turn on when a job is resumed from powerloss. Pausing and resuming a job without turning off power works fine. But if the controller is reset (from an emergency stop) or turned off (to continue the job at a later time), the spindle does not turn on. Is there a workaround for this?

    config-spindle.g

    M950 R0 C"!exp.heater6+!exp.heater7" Q100 L1000:20000 ; Spindle settings
    ; Tools
    M563 P1 R0 S"DeWalt"
    T1

    Resume.g

    M98 P"homez.g"
    M3 ; Turn on Spindle Relay
    G4 S2; Dwell for 2 seconds
    G1 R1 X0 Y0 ; go to directly above position of the last print move
    G1 R1 X0 Y0 Z0 ; go back to the last print move

    Resurrect-prologue.g

    ; resurrect-prologue.g
    ; called to resume job after power out.
    M98 P"homeall.g"
    G1 R1 X0 Y0 ; go directly above the saved position
    M3
    G4 S2; Dwell for 2 seconds

    Resurrect.g

    ; File "0:/gcodes/Ibra/Alucoboard.gcode" resume print after print paused at 2022-11-19 18:24
    G21
    G92 X267.659 Y353.891 Z30.800
    G60 S1
    T1 P0
    M98 P"resurrect-prologue.g"
    M116
    M290 X0.000 Y0.000 Z0.000 R0
    T-1 P0
    T1 P6
    ; Workplace coordinates
    G10 L2 P1 X181.00 Y82.00 Z34.00
    G10 L2 P2 X258.00 Y313.00 Z29.28
    G10 L2 P3 X540.00 Y32.00 Z35.00
    G10 L2 P4 X268.00 Y723.00 Z59.00
    G10 L2 P5 X710.00 Y1170.00 Z94.00
    G10 L2 P6 X0.00 Y0.00 Z64.00
    G10 L2 P7 X0.00 Y0.00 Z90.00
    G10 L2 P8 X190.00 Y40.00 Z40.51
    G10 L2 P9 X0.00 Y0.00 Z94.00
    G54
    M106 S0.00
    M116
    G92 E0.00000
    M82
    M486 S-1
    G17
    M23 "0:/gcodes/Ibra/Alucoboard.gcode"
    M26 S32601 P0.143 X281.212 Y353.418
    G0 F6000 Z32.800
    G0 F6000 X267.659 Y353.891
    G0 F6000 Z30.800
    G1 F800.0 P0
    G21
    M24

    Duet 2 Wifi, Ooznest Workbee CNC 1510

    1 Reply Last reply Reply Quote 0
    • undefined
      Nightowl
      last edited by Nightowl 19 Nov 2022, 19:48

      I think there is an issue with the way in which the power-loss function works (or doesn't) with a CNC machine.

      I asked a similar question is this thread, but never really got a definitive response. My understanding is the power drain from a CNC is much quicker than that from a 3D printer, thereby preventing the information required to resume the CNC from being saved in the appropriate file (can't think, it's been a long day). What I was specifically trying to achieve was for the spindle speed to be 'remembered', which clearly isn't necessary for a 3D printer.

      I tried (with a lot of help) to get around this, but I couldn't get all the necessary information written into the resume file for it to be effective, as there wasn't enough time for the lines of code to be written into the file.

      I'll show you where I got to, just in case you might be able to expand further on my efforts...

      In the config.g file, I specified a variable:

      ; Variables definition
      global savedSpindleSpeed = 0

      ...and defined the M911 line like this:

      M911 S23 R23.5 P"M98 P""SaveSpindleSpeed.g""M913 X0 Y0" ; set voltage thresholds and actions to run on power loss

      This is the code in the SaveSpindleSpeed.g file, which should write the RestoreSpindleSpeed.g file:

      var fName = "RestoreSpindleSpeed.g"
      echo >{var.fName} "if {!exists(global.abort_process)}"
      echo >>{var.fName} " global abort_process = true"
      echo >>{var.fName} "else"
      echo >>{var.fName} " set global.abort_process = true"
      echo >>{var.fName} "M291 S3 R""Resurrect:"" P""Continue with <"^{job.file.fileName}^">?"""
      echo >>{var.fName} "set global.abort_process = false"
      echo >>{var.fName} "M3 S"^{spindles[0].active}

      ...but that's it. I don't think we even got as far as the M291 command line before the power had gone.

      Having said that, @dc42 did mention they would work to fix this in RRF3.5, so let's hope so!

      Sorry I can't help more, but you might glean more information if you look at the thread I linked above. It was a while ago and my memory fades, somewhat!

      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 19 Nov 2022, 20:53 Reply Quote 0
      • undefined
        chimaeragh @Nightowl
        last edited by 19 Nov 2022, 20:53

        @Nightowl I don't think it has to do with not having enough time to write anything to the SD card as I do a Controlled Power Off. The job is paused, resume state saved and the Duet tells you you can turn it off.
        I put an M3 command into the resurrect-prologue.g file hoping this would fix the problem. The spindle turns on and dwells for 2 seconds as programmed but then turns off before it rams the endmill into the part. If I am quick enough I am able to turn it on via the dashboard but this is too risky.
        Looking at the resurrect.g file, I think all tools are deselected before the job is resumed.
        If I could find a way to reselect the spindle, it should work.

        Duet 2 Wifi, Ooznest Workbee CNC 1510

        undefined 1 Reply Last reply 20 Nov 2022, 08:52 Reply Quote 0
        • undefined
          Phaedrux Moderator
          last edited by 20 Nov 2022, 05:11

          Firmware version?

          Z-Bot CoreXY Build | Thingiverse Profile

          undefined 1 Reply Last reply 20 Nov 2022, 06:37 Reply Quote 0
          • undefined
            chimaeragh @Phaedrux
            last edited by 20 Nov 2022, 06:37

            @Phaedrux 3.4.4

            Duet 2 Wifi, Ooznest Workbee CNC 1510

            1 Reply Last reply Reply Quote 0
            • undefined
              Nightowl @chimaeragh
              last edited by 20 Nov 2022, 08:52

              @chimaeragh said in Spindle inactive on resume:

              @Nightowl I don't think it has to do with not having enough time to write anything to the SD card as I do a Controlled Power Off.

              I'm not sure, but wouldn't pausing the process and powering down provide enough time for the resurrect file to be written, rather than an instant(ish) power failure?

              Having said that, I think I misread your original post. You appear to want to do this as a matter of routine, for a particularly long job, for example?

              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
                o_lampe
                last edited by 20 Nov 2022, 08:58

                As a casual CNC user, I wouldn't want my spindle to turn on after power failure. I hope that feature is optional in RRF3.5?
                I also have a separate PSU for the spindle and was wondering, if there is a way to have two different power loss command lines? One for Duets power, the other for spindle power.

                Sorry if that was slightly offtopic, but it got me concerned what I read here.

                undefined 1 Reply Last reply 20 Nov 2022, 09:03 Reply Quote 0
                • undefined
                  Nightowl @o_lampe
                  last edited by Nightowl 20 Nov 2022, 09:03

                  Hopefully it won't, @o_lampe

                  The CNC should stay off without user intervention, as the machine would need to be re-homed on all axes before returning to the last known co-ordinates and restarting the cut.

                  I don't know about 3D printer users, but I would never leave a CNC unattended when it's working.

                  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
                    dc42 administrators
                    last edited by 20 Nov 2022, 17:43

                    @chimaeragh I confirm that spindle state and RPM are not saved in resurrect.g. Also the tool select command in resurrect.g that occurs after the command to run resurrect-prologue.g will set the spindle state to stopped, as required by the NIST specification.

                    I have implemented what I hope is a fix in the RRF 3.5 code. I had to include a fixed delay after the M3 or M4 command, and I chose 2 seconds for this.

                    Meanwhile, if you want to resurrect a job with the spindle running, you will need to edit the M3 or M4 command and the G4 delay command into resurrect.g after the T 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

                    undefined undefined 2 Replies Last reply 20 Nov 2022, 17:52 Reply Quote 1
                    • undefined
                      Nightowl @dc42
                      last edited by Nightowl 20 Nov 2022, 17:52

                      Thank you, @dc42 (although you didn't need to say it three times 😵 😁 😁 )

                      Thank you too for implementing the changes in 3.5 👍

                      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 20 Nov 2022, 17:58 Reply Quote 0
                      • undefined
                        dc42 administrators @Nightowl
                        last edited by 20 Nov 2022, 17:58

                        @Nightowl sorry, there was an error message from the forum software that made me think that my first two attempts to post were unsuccessful.

                        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 20 Nov 2022, 18:01 Reply Quote 0
                        • undefined
                          Nightowl @dc42
                          last edited by 20 Nov 2022, 18:01

                          @dc42 said in Spindle inactive on resume:

                          @Nightowl sorry, there was an error message from the forum software that made me think that my first two attempts to post were unsuccessful.

                          👍

                          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
                            chimaeragh @dc42
                            last edited by 20 Nov 2022, 19:42

                            @dc42 Thank you

                            Duet 2 Wifi, Ooznest Workbee CNC 1510

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