forked from moggieuk/ERCF-Software-V3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
client_macros.cfg
76 lines (70 loc) · 1.96 KB
/
client_macros.cfg
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#
# This is an example (but working) macro to park toolhead out of the way of print
# You can also use your existing
#
[gcode_macro _PARK]
description: Park toolhead safely away from print
gcode:
{% set Z_HOP = params.Z_HOP|default(5)|float %}
{% set x_park = printer.toolhead.axis_minimum.x|float + 5.0 %}
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - Z_HOP) %}
{% set z_safe = Z_HOP %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
G91
G1 Z{z_safe} F900
G90
G0 X{x_park} Y{y_park} F6000
#
# This is an example (but working) CANCEL_PRINT macro
# You can also use your existing, but it should follow this pattern
#
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
description: Cancel print
gcode:
TURN_OFF_HEATERS
SDCARD_RESET_FILE
_PARK Z_HOP=20
CLEAR_PAUSE
BASE_CANCEL_PRINT
#
# This is an example (but working) PAUSE macro
# You can also use your existing, but it should follow this pattern
#
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
description: Pause the print and park
gcode:
{% if printer.pause_resume.is_paused %}
RESPOND MSG="Print is already paused"
{% else %}
G92 E0
G1 E-1.0 F1500.0 ; Retract a little to reduce ooze
G90
SAVE_GCODE_STATE NAME=PAUSE_state
BASE_PAUSE
_PARK Z_HOP=5
{% endif %}
#
# This is an example (but working) RESUME macro
# You can also use your existing, but it should follow this pattern
#
[gcode_macro RESUME]
rename_existing: BASE_RESUME
description: Resume the print
gcode:
{% if not printer.pause_resume.is_paused %}
RESPOND MSG="Print is not paused. Resume ignored"
{% else %}
#
# Good place to add other things like purging or nozzle cleaning
#
RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1 MOVE_SPEED=100
G90
BASE_RESUME
{% endif %}