M911 on a CNC machine
-
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
-
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
-
@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? -
@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) -