-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacros.cfg
156 lines (137 loc) · 4.72 KB
/
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# --------------------------- Start Print ----------------------------
[gcode_macro START_PRINT]
gcode:
{% set BED_TEMP = params.BED_TEMP|default(80)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}
# Start bed heating
M140 S{BED_TEMP}
# Set extruder temp to 210
M109 S210
# Use absolute coordinates
G90
G28 ; Home all axes
# BED_MESH_CALIBRATE ADAPTIVE=1 ADAPTIVE_MARGIN=0 ADAPTIVE_FUZZ=2
BED_MESH_PROFILE LOAD=default
G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
#G1 X0.1 Y20 Z30 F5000.0 ; Move to start position
# Call Smart Park Macro from KAMP
Smart_Park
# Wait for bed to reach temperature
M190 S{BED_TEMP}
# Set and wait for nozzle to reach temperature
M109 S{EXTRUDER_TEMP}
G92 E0 ; Reset Extruder
G1 Z0.3 ; Start close to bed
LINE_PURGE ;LINE_PURGE Macro
#VORON_PURGE ;LINE_PURGE Macro
M117
# --------------------------- Line Purge ----------------------------
# [gcode_macro LINE_PURGE]
# gcode:
# G92 E0 ; Reset Extruder
# G1 X0.01 Y20 Z0.3 F5000.0 ; Move to start position
# G1 X0.01 Y200.0 Z0.3 F1500.0 E15 ; Draw the first line
# G1 X0.04 Y200.0 Z0.3 F5000.0 ; Move to side a little
# G1 X0.04 Y20 Z0.3 F1500.0 E30 ; Draw the second line
# G92 E0 ; Reset Extruder
# G1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching of Heat Bed
# G1 X5 Y20 Z0.3 F5000.0 ; Move over to prevent blob squish
# M117
# ---------------------------- End Print -----------------------------
[gcode_macro END_PRINT]
variable_machine_depth: 235
gcode:
# Turn off bed, extruder, and fan
M140 S0
M104 S0
M106 S0
# Relative positionning
G91
# Retract and raise Z
G1 Z0.2 E-7 F2400
# Wipe out
G1 X5 Y5 F3000
# Raise Z more
G1 Z10
# Absolute positionning
G90
# Present print
G1 X0 Y{machine_depth}
# Disable steppers
M84
# ---------------------------- Cancel Print -----------------------------
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
variable_park: True
gcode:
## Move head and retract only if not already in the pause state and park set to true
{% if printer.pause_resume.is_paused|lower == 'false' and park|lower == 'true'%}
_TOOLHEAD_PARK_PAUSE_CANCEL
{% endif %}
TURN_OFF_HEATERS
CANCEL_PRINT_BASE
# --------------------------- Resume Print ----------------------------
[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
gcode:
##### read extrude from _TOOLHEAD_PARK_PAUSE_CANCEL macro #####
{% set extrude = printer['gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL'].extrude %}
#### get VELOCITY parameter if specified ####
{% if 'VELOCITY' in params|upper %}
{% set get_params = ('VELOCITY=' + params.VELOCITY) %}
{%else %}
{% set get_params = "" %}
{% endif %}
##### end of definitions #####
{% if printer.extruder.can_extrude|lower == 'true' %}
M83
G1 E{extrude} F2100
{% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
RESUME_BASE {get_params}
# ---------------------------- Pause Print -----------------------------
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
gcode:
PAUSE_BASE
_TOOLHEAD_PARK_PAUSE_CANCEL
# ---------------------------- Park Toolhead -----------------------------
[gcode_macro _TOOLHEAD_PARK_PAUSE_CANCEL]
description: Helper: park toolhead used in PAUSE and CANCEL_PRINT
variable_extrude: 1.0
gcode:
##### set park positon for x and y #####
# default is your max posion from your printer.cfg
{% set x_park = printer.toolhead.axis_maximum.x|float - 5.0 %}
{% set y_park = printer.toolhead.axis_maximum.y|float - 5.0 %}
{% set z_park_delta = 2.0 %}
##### calculate save lift position #####
{% set max_z = printer.toolhead.axis_maximum.z|float %}
{% set act_z = printer.toolhead.position.z|float %}
{% if act_z < (max_z - z_park_delta) %}
{% set z_safe = z_park_delta %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
{% if printer.extruder.can_extrude|lower == 'true' %}
M83
G1 E-{extrude} F2100
{% if printer.gcode_move.absolute_extrude |lower == 'true' %} M82 {% endif %}
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
{% if "xyz" in printer.toolhead.homed_axes %}
G91
G1 Z{z_safe} F900
G90
G1 X{x_park} Y{y_park} F6000
{% if printer.gcode_move.absolute_coordinates|lower == 'false' %} G91 {% endif %}
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}