-
Notifications
You must be signed in to change notification settings - Fork 1
/
macro_general.cfg
102 lines (95 loc) · 2.77 KB
/
macro_general.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
# G29 that does (1) home all (2) get bed mesh (3) move nozzle to corner so it doesnt ooze on the bed while heating up.
[gcode_macro G29]
gcode:
G28
BED_MESH_CALIBRATE
G0 X0 Y0 Z10 F6000
BED_MESH_PROFILE save=default
# Park toolhead
[gcode_macro M125]
gcode:
SAVE_GCODE_STATE NAME=parking
M117 Parking toolhead
G91
G1 Z20 F600 # move up 5 mm
G90
G1 X125 Y0 F4000 # move to park position
RESTORE_GCODE_STATE NAME=parking
# LOW_TEMP_CHECK checks if there is a setpoint for the extruder. Untested!
# - If this setpoint is reached, continue.
# - If not, heat to setpoint.
# - If no setpoint, heat to parameter T (default@200)
[gcode_macro LOW_TEMP_CHECK]
gcode:
{% set EXTRUDER_TEMP = params.T | default (200) | int%}
{% if printer.extruder.target != 0 %} # if there is a setpoint for extruder
{% if printer.extruder.temperature < printer.extruder.target %} # if not reached, heat
M118 Heating from {printer.extruder.temperature} to {printer.extruder.target}.
M109 S{printer.extruder.target|float}
{% endif %}
{% else %} # if no setpoint for extruder
{% if printer.extruder.target < EXTRUDER_TEMP %} # heat to T.
M118 No setpoint, heating to {EXTRUDER_TEMP}.
M109 S{EXTRUDER_TEMP}
{% endif %}
{% endif %}
# load filament
[gcode_macro M701]
gcode:
SAVE_GCODE_STATE NAME=loading_filament
M117 Loading Filament
M83
G92 E0.0
LOW_TEMP_CHECK
G1 E420 F6000 # length of bowden tube till cold-end (~420mm)
G1 E100 F200 # some extra to prime the nozzle --> slower
G92 E0.0
RESTORE_GCODE_STATE NAME=loading_filament
# unload filament
[gcode_macro M702]
gcode:
SAVE_GCODE_STATE NAME=unloading_filament
M125 # park
M117 Unloading Filament
LOW_TEMP_CHECK
G91 # set relative
G1 E10 F100
G92 E0.0
G1 E-530 F6000 # the E is the length of the bowden tube (420mm) + 100 mm.
G92 E0.0
RESTORE_GCODE_STATE NAME=unloading_filament
# filament change
[gcode_macro M600]
gcode:
M117 Filament Change
M118 Filament Change
SAVE_GCODE_STATE NAME=filament_change
PAUSE
LOW_TEMP_CHECK
G91 # relative
G1 E-1 F300 # retract 1
M125 # park
M702 # unload
M117 New filament
M118 New filament
COUNTDOWN TIME=25 MSG="Switch"
M701
COUNTDOWN TIME=10 MSG="Clean"
RESUME
M117 Resuming
M118 Resuming
RESTORE_GCODE_STATE NAME=filament_change
M117 Printing..
M118 Printing..
[gcode_macro COUNTDOWN]
# default_parameter_MSG: "Time: "
# default_parameter_TIME: 10
gcode:
# countdown
{% for s in range(TIME|int, 0, -1) %}
# dwell 1 second
G4 P1000
# echo
M117 {params.MSG} {s}s
M118 {params.MSG} {s}s
{% endfor %}