-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathmacros.cfg
279 lines (250 loc) · 9.8 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
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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
#####################################################################
# Start Code Superslicer:
# START_PRINT BED={first_layer_bed_temperature} EXTRUDER={first_layer_temperature}
# Start Code Cura (activate relative extrusion in cura / aktiviere Relative Extrusion in Cura):
# START_PRINT BED={material_bed_temperature_layer_0} EXTRUDER={material_initial_print_temperature}
# Prusa Slicer Startcode
# START_PRINT BED=[first_layer_bed_temperature] EXTRUDER=[first_layer_temperature]
# Orca Slicer
# START_PRINT EXTRUDER=[nozzle_temperature_initial_layer] BED=[hot_plate_temp_initial_layer]
######################################################################
[gcode_macro START_PRINT]
description: All what needs to be done at print start
gcode:
#### set defaults ####
{% set extruder = params.EXTRUDER|default(0) %}
{% set bed = params.BED|default(0) %}
#### end off definition ###
G28 ; Home
M83 ; Extruder relative mode
M104 S140 ; Extruder heat up standby temp 140
M190 S{bed} ; Bed heat up
G1 X0 Y0 F2200 ; Go to front
M109 S{extruder} ; Extruder heat up to target temp
G92 E0.0 ; Reset extruder length
G90 ; Absolute positioning
BED_MESH_PROFILE LOAD="default"
PRIME_LINE ; First move
######################################################################
# PRIME LINE
######################################################################
[gcode_macro PRIME_LINE]
description: Do a prime line
gcode:
G1 X0.1 Y20 F5000.0 ; Move to start position
G1 Z0.2 F240 ; move nozzle and bed closer together
G92 E0.0 ; reset extruder
G1 E5.0 F500 ; pre-purge prime LENGTH SHOULD MATCH YOUR PRINT_END RETRACT
G1 Y190 E15.0 F1500.0 ; intro line
G1 X2.3 F5000 ; move over a bit
G1 Y10 E30 F1200.0 ; intro line
G92 E0.0 ; 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
######################################################################
# Filament Change
######################################################################
# M600: Filament Change. This macro will pause the printer, move the
# tool to the change position, and retract the filament 50mm. Adjust
# the retraction settings for your own extruder. After filament has
# been changed, the print can be resumed from its previous position
# with the "RESUME" gcode.
[pause_resume]
[gcode_macro M600]
gcode:
{% set X = params.X|default(50)|float %}
{% set Y = params.Y|default(0)|float %}
{% set Z = params.Z|default(10)|float %}
SAVE_GCODE_STATE NAME=M600_state
PAUSE
G91
G1 E-.8 F2700
G1 Z{Z}
G90
G1 X{X} Y{Y} F3000
G91
G1 E-50 F1000
RESTORE_GCODE_STATE NAME=M600_state
######################################################################
# END PRINT
######################################################################
[gcode_macro END_PRINT]
description: All what needs to be done at print end
gcode:
TURN_OFF_HEATERS ; Turn off bed and nozzle
G91 ; Relative positioning
G1 E-1 F3000 ; Retract
G1 X-0.5 Y-0.5 Z5 E-5 ; Move a bit and retract filament even more
G90 ; Absolute positioning
G1 X0 Y200 F2200 ; Move bed to front
M107 ; Turn off part fan
M84 ; Steppers off
G90 ; Absolute positioning
M117 Print done ; Send finish to display
M300 S932 P428 ; Airwolf Sound
M300 S0 P214
M300 S1244 P214
M300 S1396 P214
M300 S1661 P214
M300 S932 P214
M300 S0 P428
M300 S2217 P214
M300 S2093 P214
M300 S1661 P214
M300 S932 P428
M300 S0 P428
M300 S2217 P214
M300 S2093 P214
M300 S1661 P214
M300 S932 P428
M300 S0 P214
M300 S1661 P214
M300 S2093 P214
M300 S1396 P428
M300 S1244 P428
M300 S1108 P214
M300 S1244 P214
M300 S1046 P214
M300 S1661 P214
M300 S932 P21
######################################################################
# PAUSE PRINT
######################################################################
[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 %}
{%set min_extrude_temp = printer.configfile.settings["extruder"]["min_extrude_temp"]|int %}
{%set act_extrude_temp = printer.extruder.temperature|int %}
##### end of definitions #####
PAUSE_BASE
G91
{% if act_extrude_temp > min_extrude_temp %}
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 %}
######################################################################
# RESUME PRINT
######################################################################
[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 %}
{%set min_extrude_temp = printer.configfile.settings["extruder"]["min_extrude_temp"]|int %}
{%set act_extrude_temp = printer.extruder.temperature|int %}
#### 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 act_extrude_temp > min_extrude_temp %}
G91
G1 E{E} F2100
{% else %}
{action_respond_info("Extruder not hot enough")}
{% endif %}
RESUME_BASE {get_params}
######################################################################
# CANCEL_PRINT
######################################################################
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running print
rename_existing: CANCEL_PRINT_BASE
gcode:
M220 S100 ; Reset Speed factor override percentage to default (100%)
M221 S100 ; Reset Extrude factor override percentage to default (100%)
G91 ; Set coordinates to relative
{% if printer.extruder.temperature >= 170 %}
G1 F1800 E-1 ; Retract filament 3 mm to prevent oozing
{% endif %}
;if all axis are homed, lift the hotend to leave room for hot filament to ooze and to keep it clear of the bed.
{% if printer.toolhead.homed_axes == "xyz" %}
G1 F6000 Z10 ; Move Z Axis up 10 mm to allow filament ooze freely
G90 ; Set coordinates to absolute
G1 X0 Y150 F1000 ; Move Heat Bed to the front for easy print removal
#M84 ; Disable stepper motors
{% endif %}
;set part fan speed to zero.
M106 S0
CANCEL_PRINT_BASE
######################################################################
# Pressure Advance Calibration
######################################################################
[gcode_macro PA_Calibration]
description: Adjust Velocity and PA parameters for bowden extruder
gcode:
SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=1 ACCEL=500
TUNING_TOWER COMMAND=SET_PRESSURE_ADVANCE PARAMETER=ADVANCE START=0 FACTOR=.020
######################################################################
# PID MACRO
######################################################################
[gcode_macro PID_BED]
gcode:
PID_CALIBRATE HEATER=heater_bed TARGET=60
[gcode_macro PID_Extruder]
gcode:
PID_CALIBRATE HEATER=extruder TARGET=200
######################################################################
# Motor Off
######################################################################
[gcode_macro Motor_aus]
gcode:
M18
######################################################################
# M300 - Pieper
######################################################################
[gcode_macro M300]
gcode:
# Use a default 1kHz tone if S is omitted.
{% set S = params.S|default(1000)|int %}
# Use a 10ms duration is P is omitted.
{% set P = params.P|default(100)|int %}
SET_PIN PIN=beeper_pin VALUE=0.85 CYCLE_TIME={ 1.0/S if S > 0 else 1 }
G4 P{P}
SET_PIN PIN=beeper_pin VALUE=0
######################################################################
# Wartungsposition
######################################################################
[gcode_macro Wartungsposition]
gcode:
G28
# Absolute mode on
G90
# Wartungskoordinate
G1 X110 Y120 Z105 F1000
# Relative Mode on
G91
# Turn off bed, extruder, and fan
M140 S0
M104 S0
M106 S0
# Disable steppers
# M84