-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpause.g
More file actions
46 lines (38 loc) · 2 KB
/
Copy pathpause.g
File metadata and controls
46 lines (38 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
; pause.g
; Called when a job is paused.
; Written by Diabase Engineering
; Last Updated: February 24, 2021
G60 S0 ; save current tool information
if state.machineMode="FFF"
M83 ; Set extruder to relative mode
G1 E-10 F6000 ; Retract 10mm of filament at 6000 mm/min
G91 ; Relative Positioning
M574 Z2 S1 P"zstop" ; Configure Z endstop position at high end, it's a microswitch on pin "zstop"
if move.axes[2].machinePosition + 40 <= move.axes[2].max ; If we have enough room for a normal tool change Z-hop, do it.
G1 Z40 F6000 ; Move Z +40mm at 6000 mm/min
elif move.axes[2].machinePosition + 40 > move.axes[2].max ; If we don't have enough room, move as high as we can.
M574 Z2 S1 P"zstop" ; Configure Z endstop position at high end, it's a microswitch on pin "zstop"
M400 ; Wait for all moves to finish
M913 Z50; Reduce Z-axis motor current to 50%
G1 Z40 F1000 H3 ; Attempt to move Z +40mm at 1000 mm/min, but halt if endstop triggered and set axis limit current position, overriding value set by previous M208 or G1 H3 special move
M400 ; Wait for all moves to finish
M913 Z100 ; Restore Z-axis motor current to 100%
G90 ; Set to Absolute Positioning
G1 Y85 F6000 ; Move Y to 85 mm at 6000 mm/min
if {state.currentTool} != -1 ; If we have a tool selected...
if #tools[{state.currentTool}].name == 9 ; If this tool is a spindle...
while iterations < #spindles ; ...loop over all defined spindles.
if state.currentTool == spindles[{iterations}].tool ; If we find a spindle associated with the current tool...
M3 P{iterations} S0 ; ...set it to 0 RPM, clockwise.
M400 ; Wait for current moves to finish
; Put all the tools into standby mode and leave no tool selected
T1 P0
T2 P0
T3 P0
T4 P0
T5 P0
T10 P0
T{state.restorePoints[0].toolNumber}
if heat.heaters[0] != null ; ...and we have defined a bed heater...
if {heat.heaters[0].state != "fault" && heat.heaters[0].current != -273.15} ; ...and it's not in a fault state...
M144 S0 ; Set bed to standby