Spindle inactive on resume
-
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!
-
@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. -
Firmware version?
-
@Phaedrux 3.4.4
-
@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?
-
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.
-
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.
-
@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.
-
Thank you, @dc42 (although you didn't need to say it three times )
Thank you too for implementing the changes in 3.5
-
@Nightowl sorry, there was an error message from the forum software that made me think that my first two attempts to post were unsuccessful.
-
@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.
-
@dc42 Thank you