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

    M911 on a CNC machine

    Scheduled Pinned Locked Moved
    CNC
    3
    4
    308
    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
      last edited by

      Has anyone successfully achieved a Resume on Power Fail for a CNC machine.

      Even running my system on 24V, the power drain is too quick to write the necessary file.

      I have tried to translate the Duet guidance into CNC mode to no avail, although I (appear to) have managed to save the speed the spindle is running at.

      This is the relevant line in config.g file:

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

      And this is the file to save the spindle speed:

      ;SaveSpindleSpeed.g
      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}
      

      ...and the resurrect prologue file:

      ; resurrect-prologue.g
      M98 P"RestoreSpindleSpeed.g"
      if {global.abort_process == true}
      	abort
      M98 P"homeall.g"
      

      ...but there isn't enough time for the RestoreSpindleSpeed.g file to be written.

      Thanks

      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

      Dad003undefined chrishammundefined 2 Replies Last reply Reply Quote 0
      • Dad003undefined
        Dad003 @Nightowl
        last edited by

        @Nightowl

        kinda funny what m911 does on the printer because on the cnc milling i work on m911 make the pallet turn of the machine from inside to outside lol

        1 Reply Last reply Reply Quote 0
        • chrishammundefined
          chrishamm administrators @Nightowl
          last edited by

          @Nightowl Are you running your Duet in SBC mode? If yes, you may need to attach a really beefy 5V power supply to maintain power for both boards long enough so that the resurrect file can be safely written. Also note that calling macros from M911 is not really a good idea unless you have a decent separate 5V supply because that will introduce more IOPS which in turn slows down the whole saving process.

          @dc42 It looks like workplace coordinates are written to resume.g but not spindle speeds. Should that be added in v3.5?

          Duet software engineer

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

            @chrishamm said in M911 on a CNC machine:

            @Nightowl Are you running your Duet in SBC mode? If yes, you may need to attach a really beefy 5V power supply to maintain power for both boards long enough so that the resurrect file can be safely written. Also note that calling macros from M911 is not really a good idea unless you have a decent separate 5V supply because that will introduce more IOPS which in turn slows down the whole saving process.

            No Chris, it's connected to a Surface Pro, which is powered independently and has an internal battery, so would keep working in the event of a power failure.

            What might be relevant is that the laptop and controller are connected via a powerline adapter, so if the power fails the connection would be lost (the laptop doesn't have a network connector, so I have to use a dock). Maybe I should think about connecting via USB... 🤔

            @chrishamm said in M911 on a CNC machine:

            @dc42 It looks like workplace coordinates are written to resume.g but not spindle speeds. Should that be added in v3.5?

            I seem to recall @dc42 mentioned this when I first asked the question "back in the day", when he said this would be incorporated into v3.5, so I'm keeping my fingers crossed...
            (https://forum.duet3d.com/topic/28647/power-failure-and-resurrection-on-a-cnc-machine/102)

            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 referenced this topic
            • First post
              Last post
            Unless otherwise noted, all forum content is licensed under CC-BY-SA