-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmacros.cfg
More file actions
233 lines (205 loc) · 7.87 KB
/
macros.cfg
File metadata and controls
233 lines (205 loc) · 7.87 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
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
#####################################################################
# Macros
#####################################################################
[include print_area_bed_mesh.cfg]
[virtual_sdcard]
path: ~/gcode_files
[display_status]
[pause_resume]
[gcode_macro PAUSE]
description: Pause the actual running print
rename_existing: PAUSE_BASE
# change this if you need more or less extrusion
variable_extrude: 1.0
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
##### 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 %}
##### 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 - 2.0) %}
{% set z_safe = 2.0 %}
{% else %}
{% set z_safe = max_z - act_z %}
{% endif %}
##### end of definitions #####
PAUSE_BASE
G91
{% if printer.extruder.can_extrude|lower == 'true' %}
G1 E-{E} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
{% if "xyz" in printer.toolhead.homed_axes %}
G1 Z{z_safe} F900
G90
G1 X{x_park} Y{y_park} F6000
{% else %}
{action_respond_info("Printer not homed")}
{% endif %}
[gcode_macro RESUME]
description: Resume the actual running print
rename_existing: RESUME_BASE
gcode:
##### read E from pause macro #####
{% set E = printer["gcode_macro PAUSE"].extrude|float %}
#### 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' %}
G91
G1 E{E} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
RESUME_BASE {get_params}
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
TURN_OFF_HEATERS
CANCEL_PRINT_BASE
[gcode_macro PRINT_START]
# Use PRINT_START for the slicer starting script - please customise for your slicer of choice
gcode:
# default_parameter_BED: 60 #target bed temperature
# default_parameter_EXTRUDER: 210 #target extruder temperature
STATUS_HOMING
G28
#Get Printer built volume dimensions
{% set X_MAX = printer.toolhead.axis_maximum.x|default(100)|float %}
{% set Y_MAX = printer.toolhead.axis_maximum.y|default(100)|float %}
{% set Z_MAX = printer.toolhead.axis_maximum.z|default(100)|float %}
#Get Nozzle diameter and filament width for conditioning
{% set NOZZLE = printer.extruder.nozzle_diameter|default(0.4)|float %}
{% set FILADIA = printer.extruder.filament_diameter|default(1.75)|float %}
#Set Start coordinates of priming lines
{% set X_START = 10.0|default(10.0)|float %}
{% set Y_START = 20.0|default(20.0)|float %}
#Calculate Primer line extrusion volume and filament length
{% set PRIMER_WIDTH = 0.75 * NOZZLE %}
{% set PRIMER_HEIGHT = 0.70 * NOZZLE %}
{% set PRIMER_SECT = PRIMER_WIDTH * PRIMER_HEIGHT %}
{% set PRIMER_VOL = PRIMER_SECT * (X_MAX - 3 * X_START) %}
{% set FILA_SECT = 3.1415 * ( FILADIA / 2.0)**2 %}
{% set FILA_LENGTH = 1.55 * PRIMER_VOL / FILA_SECT %}
#Get Bed and Extruder temperature from Slicer GCode
{% set BED_TEMP = params.BED_TEMP|default(40)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}
#attach probe
ATTACH_PROBE
#Preheat nozzle and bed
STATUS_HEATING
M104 S{EXTRUDER_TEMP} T0
M140 S{BED_TEMP}
#Move up to clean bed
G1 Y{Y_MAX - 20} Z{Z_MAX/4.0} F6000
#Heat nozzle and bed
M190 S{BED_TEMP}
M109 S{EXTRUDER_TEMP} T0
#Mesh Bed
#STATUS_MESHING
#BED_MESH_CALIBRATE
G32
#detach probe
DOCK_PROBE
#Precondition extruder
STATUS_CLEANING
G92 E0
G1 X{X_START} Y{Y_START} Z{PRIMER_HEIGHT} F6000.0
G1 X{X_MAX - 2 * X_START} Y{Y_START} Z{PRIMER_HEIGHT} F2000.0
G1 X{X_MAX - 2 * X_START} Y{Y_START + PRIMER_WIDTH} Z{PRIMER_HEIGHT}
G1 X{X_START} Y{Y_START + PRIMER_WIDTH} Z{PRIMER_HEIGHT} F2000.0
G92 E0
G1 Z2.0 F600
G1 Z0.2 F600
G1 Z2.0 F600
STATUS_BUSY
[gcode_macro G32]
gcode:
ATTACH_PROBE_LOCK
BED_MESH_CLEAR
STATUS_HOMING ; Home if not homed to get everything turned on
CG28
STATUS_LEVELING
Z_TILT_ADJUST
STATUS_MESHING
BED_MESH_CALIBRATE
DOCK_PROBE_UNLOCK
#G28 X Y ; Home the X and Y
#G0 X130 Y355 Z2 F9000 ; Move to brush
#G0 X75 F750 ; Move across the brush
#G0 X130 F750 ; Move across the brush
#G28 Z ; Home the Z now that nozzle is clean
#G0 X175 Y175 Z20 F6000 ; Return to center of bed
# Conditional G28 (home if not already homed)
[gcode_macro CG28]
gcode:
{% if "x" not in printer.toolhead.homed_axes or "y" not in printer.toolhead.homed_axes or "z" not in printer.toolhead.homed_axes %}
STATUS_HOMING
G28
{% endif %}
[gcode_macro PRINT_END]
# Use PRINT_END for the slicer ending script - please customise for your slicer of choice
gcode:
STATUS_BUSY
#Get Printer built volume dimensions
{% set X_MAX = printer.toolhead.axis_maximum.x|default(100)|float %}
{% set Y_MAX = printer.toolhead.axis_maximum.y|default(100)|float %}
#Fix-up extruder
G91
G1 E-2 F2700
G1 E-1.5 Z0.2 F2400
G1 X5 Y5 F6000
G1 Z10
G90
#Present print
G1 Z{printer.toolhead.position.z + 10} F600
G1 X{X_MAX / 2} Y{Y_MAX} F6000
M106 S0
M104 S0
M140 S0
#Disable Steppers
M84 X Y E
STATUS_READY
[z_tilt]
z_positions:
15, 10
188.5, 360
365, 11
# A list of X,Y coordinates (one per line; subsequent lines
# indented) describing the location of each bed "pivot point". The
# "pivot point" is the point where the bed attaches to the given Z
# stepper. It is described using nozzle coordinates (the XY position
# of the nozzle if it could move directly above the point). The
# first entry corresponds to stepper_z, the second to stepper_z1,
# the third to stepper_z2, etc. This parameter must be provided.
points:
30, 30
188.5, 330
367, 31
# A list of X,Y coordinates (one per line; subsequent lines | back |
# indented) that should be probed during a Z_TILT_ADJUST command. | |
# Specify coordinates of the nozzle and be sure the probe is above L z1 z R
# the bed at the given nozzle coordinates. This parameter must be | |
# provided. | front |
speed: 400
horizontal_move_z: 25
retries: 3
# Number of times to retry if the probed points aren't within
# tolerance.
retry_tolerance:0.01
# If retries are enabled then retry if largest and smallest probed
# points differ more than retry_tolerance. Note the smallest unit of
# change here would be a single step. However if you are probing
# more points than steppers then you will likely have a fixed
# minimum value for the range of probed points which you can learn
# by observing command output.