power loss with UPS
-
I connected a power loss sensor to my printer and wrote a trigger file for it but trigger pauses the print very slowly and doesn't immediately turn of my bed and hotend so my capacitor runs out of power. does anyone know how to make the trigger to react faster.
I put this at the end of config.g
M950 J3 C"nil"
M950 J3 C"PWRDET" ; input 1 e0 filament sensor
M581 P3 T3 S0 R1 ; PLR sensor P1 triggers Trigger3.g always (R0) TRIGGER OFFand following is the trigger 3
M140 S0 R0 ; set bed temperature to 0C
M140 S-1 ; set bed temperature to 0K to turn it off
M104 S0 T0 ; set extruder temperature to 0C
M107 ; turn off fan
M913 X0 Y0 Z0.3 ;turn motors off
M226 ; Pause the print
G91 ;Set to Relative Positioning
M83 ;Set extruder to relative mode
G1 Z5 E-5 F1000 ;raise Extruder 5mmplease help me fix this. my apartment have crazy power fluctuation because of over population of this area.
-
Triggers 2 and up don't react until the current move is finished - that may be what you are seeing.
Frederick
-
@fcwilt thanks, so if the move is long it wont trigger on time to save the print.
-
@sinole M226 is the wrong command to use in this situation as it will wait for all moves in the queue to be completed. Use M25 instead which will take a maximum of one move plus 2 seconds.
In fact, the macro "pause.g" will run after movement stops so all you need to have in your trigger3 file is that one M25 command, then move all the other commands into the pause.g file which will be tidier. You might also want to do the G1 Z move before you reduce the motor currents. Better still, use M84 at the end of pause.g.
-
@sinole said in power loss with UPS:
@fcwilt thanks, so if the move is long it wont trigger on time to save the print.
There is a command (which I cannot remember) which will breakup long moves so they are done as a series of short moves.
This will reduce the time before the trigger is acted upon but it still won't be immediate.
I think the only trigger that is immediate is trigger 0
Frederick
-
@deckingman If all the trigger file does is M25 it may be better to just use trigger 1, which according to the docs...
" Trigger number 1 causes the print to be paused as if M25 had been received. "
-
@sinole I have tried M25 as well, It was same.
-
@deckingman M669 S1 t1?
-
@gloomyandy said in power loss with UPS:
@deckingman If all the trigger file does is M25 it may be better to just use trigger 1, which according to the docs...
" Trigger number 1 causes the print to be paused as if M25 had been received. "
Good point!
-
@sinole said in power loss with UPS:
@deckingman M669 S1 t1?
Hmm - that's a fairly recent addition with limited documentation so I'm unable to comment. Give it a try but use with caution. I wouldn't go for too short a segment length say 10mm as a minimum?
-
@deckingman I run M669 S1 T1 on my CNC no issue
-
if I want to write a "if" function how should I address endstop swtich status. like
if {endstop.swtich[n] == 1}
it want to just do everything in pause.g and not write a trigger that addresses pause. according to gloomyandy that doesn't work great. with the "if" I can make pause.g to also turn of bed and motors when switch is triggered. and in case of normal pause just pauses.
-
@jay_s_uk said in power loss with UPS:
@deckingman I run M669 S1 T1 on my CNC no issue
Good to know - thanks.
-