-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacros.cfg
211 lines (188 loc) · 5.12 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
# These macros are required for Fluidd to correctly function.
# You can copy these entries into your printer.cfg.
#
# Alternatively, import this file by adding
# this line into your printer.cfg;
#
# [include macros.cfg]
##############################
#### PAUSE ####
##############################
[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_minimum.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 %}
##############################
#### RESUME ####
##############################
[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}
##############################
#### CANCEL ####
##############################
[gcode_macro CANCEL_PRINT]
description: Cancel the actual running Print
rename_existing: CANCEL_PRINT_BASE
gcode:
TURN_OFF_HEATERS
CLEAR_PAUSE
SDCARD_RESET_FILE
G91
G1 Z20
G90
G1 X20 Y200
CANCEL_PRINT_BASE
##############################
#### M600 ####
##############################
[gcode_macro M600]
description: Filament Change
#default_parameter_X: 10
#default_parameter_Y: 0
#default_parameter_Z: 10
gcode:
{% set X = params.X|default(10)|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
M300 S660 P250
M300 S880 P300
FILAMENT_UNLOAD
RESTORE_GCODE_STATE NAME=M600_state
##############################
#### FILAMENT LOAD ####
##############################
[gcode_macro FILAMENT_LOAD]
description: Filament Load
gcode:
M83
G92 E0.0
G1 E100 F1500
G1 E100 F1500
G1 E100 F1500
G1 E70 F1000
G1 E40 F250
G1 E10 F150
G92 E0.0
M400
##############################
#### FILAMENT UNLOAD ####
##############################
[gcode_macro FILAMENT_UNLOAD]
description: Filament Unload
gcode:
M83
G1 E3 F100
G1 E8 F600
G4 P750
G1 E-6 F2000
G4 P3000
G1 E-100 F1000
G1 E-100 F1500
G1 E-100 F1500
G1 E-100 F1500
G92 E0.0
M400
##############################
#### PURGE ####
##############################
[gcode_macro PURGE]
gcode:
M83
G1 E50.0 F250
G90
M400
##############################
#### BEEPER M300 ####
##############################
[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.5 CYCLE_TIME={ 1.0/S if S > 0 else 1 }
G4 P{P}
SET_PIN PIN=BEEPER_pin VALUE=0
##############################
#### POWER ####
##############################
[gcode_macro POWER_OFF_PRINTER]
gcode:
{action_call_remote_method("set_device_power",
device="printer",
state="off")}
[delayed_gcode delayed_printer_off]
initial_duration: 0.
gcode:
{% if printer.idle_timeout.state == "Idle" %}
POWER_OFF_PRINTER
{% endif %}
[idle_timeout]
gcode:
M84
TURN_OFF_HEATERS
UPDATE_DELAYED_GCODE ID=delayed_printer_off DURATION=600
##############################
#### SCREWS TILT ####
##############################
[gcode_macro bedlevel]
gcode:
G28
SCREWS_TILT_CALCULATE