Power failure and resurrection on a CNC machine
-
@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?
-
@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.
-
@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?
-
@nightowl999 I've added some hints to my post above. Please try them …
-
@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...
-
@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...
-
@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.
-
Same problem. Only half a RestoreSpindleSpeed.g file...
-
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}
-
@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 -
-
@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 -
@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"?
-
@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
-
@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?
-
@infiniteloop Nope. It's just my 24V PSU
I wouldn't know how to do that, but it's only the Duet that's powered from the 24V, as the spindle has it's own power supply.
Still, the "ultimate" test failed at the same point, so I'm going to need to look at the 5V - or UPS - option!
But surely, if the power fails, it fails. What use is a 5V supply if it's on the same mains circuit?
-
@nightowl999 said in Power failure and resurrection on a CNC machine:
Nope. It's just my 24V PSU
If you put your UPS on that, the Duet won't notice the loss of mains power: Without a voltage drop, M911 won't be executed … until the UPS runs out of juice. But then, you face the same situation as now.
-
@nightowl999 said in Power failure and resurrection on a CNC machine:
What use is a 5V supply if it's on the same mains circuit?
You could either use a large capacitor, a tiny UPS or a power bank to keep the 5V alive for a while.
-
@infiniteloop
If you don't mind, is this something you would plug into the Duet's USB port, and would the power bank stay charged/charging whilst connected, then slowly (slower than the PSU) drain down giving more time to save what I need to save? -
@nightowl999 said in Power failure and resurrection on a CNC machine:
is this something you would plug into the Duet's USB port
Never. All the Duet boards I know of (don't know all of them) have an optional 5V input.
would the power bank stay charged/charging whilst connected
That depends on the power bank. Sorry, but due to my limited knowledge, I can't give you recommendations for specific devices. Have you searched the forum on this topic yet? I didn't, but I stumbled across some related posts in the past.