Duet 3 RRF3.3 pause.g not stopping spindle
-
Hi,
I have a workbee 1010 with Duet 3 and RRF 3.3.
I have spindle control via the duet which starts and stops the spindle at beginning and end of job.
However if I PAUSE a job part way through, the spindle rises but does not stop, before waiting 10 seconds and then travelling to rear right of machine. I can however send M5 directly to switch it off from DWC so I know M5 works.
Any ideas?
TIAPAUSE.g
; pause.g
; called when a print from SD card is paused
G90
G53 G1 Z{move.axes[2].max} F1500 ; move the Z-Axis to the maximum position
M5 ; turn off spindle
G4 S10 : wait for spindle to stop
G53 G1 X{move.axes[0].max} F2500 ; move the X-Axis to the maximum position
G53 G1 Y{move.axes[1].max} F2500 ; move the Y-Axis to the maximum positionRESUME.g
; resume.g
; called before a print from SD card is resumedM3 R1 ;restore
G4 S10 ;wait for spindle to reach full speed
G1 H1 Z1500 F1500 ; raise the Z to the highest position
G1 R1 X0 Y0 ; go to directly above position of the last print move
G1 R1 X0 Y0 Z0 ; go back to the last print move -
@peteupshall What happens if you put
M5
right at the start of your pause.g? At present it comes after the firstG1
move, so I'd expect it to stop when it reaches Zmax. -
@chrishamm Yep that sorted it. Thanks for your help.
-
There might be a safety issue here, in that keeping the spindle running until it moves to the safe place might prevent the bit from snapping (or worse, damaging the milling motor) if it were to hit the stock.
This is my pause.g file (it includes triggering a LED to show it's in Pause mode and a method of storing the spindle speed on resume*):
; pause.g M42 P8 S0 ; pause/resume LED off set global.PausePress = !global.PausePress ; toggle the value from whatever it was before set global.savedSpindleSpeed = spindles[0].active ; sets the global variable echo "Spindle speed saved at ", {global.savedSpindleSpeed}, "RPM" ; shows saved spindle speed in the Console G1 Z{max(move.axes[2].userPosition+5,move.axes[2].max-5)} F2400 ; move the Z axis to a safe height G0 X273.5 Y560 ; move XY to a safe place M5 ; turn the spindle off
...and the respective resume.g (with a bit of tool confirmation, but some of this might be spurious - but it works!) but note the indents are critical:
; resume.g M42 P8 S1 ; pause/resume LED off set global.PausePress = !global.PausePress ; toggle the value from whatever it was before if state.currentTool =-1 echo "No tool active. Selecting tool zero" T0 ; select tool zero if state.currentTool >= 0 echo "Spindle state on tool ", state.currentTool, " is ", spindles[state.currentTool].state if {state.currentTool >= 0} & {tools[state.currentTool].spindleRpm >= 0} M3 S{global.savedSpindleSpeed} ; resume saved spindle speed G4 S1 ; wait 1 second to allow the spindle to spin up echo "Spindle speed resumed at " ^ {global.savedSpindleSpeed} ^ "RPM" ; this should show that the setting was successful G0 R1 X0 Y0 ; move X and Y back to saved work XY location G1 R1 Z0 F240 ; move Z slowly down to saved work Z location
*I'm happy to provide the configuration lines from the config.g, stop.g and trigger2.g files, if you want to incorporate those features, too?