-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacros.cfg
286 lines (187 loc) · 9.82 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
277
278
279
280
281
282
283
######################################################################
# Print Start Macro
######################################################################
# Add this to Orcaslicer custom start GCODE section: START_PRINT EXTRUDER_TEMP=[first_layer_temperature] BED_TEMP=[first_layer_bed_temperature]
[gcode_macro START_PRINT]
gcode:
# verify that the necessary parameters are in the g-code file
{% set BED_TEMP = params.BED_TEMP|default(60)|float %}
{% set CHAMBER_TEMP = params.CHAMBER_TEMP|default(0)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(190)|float %}
{% set MIN_X = params.MIN_X|default(10)|float %}
{% set MIN_Y = params.MIN_Y|default(10)|float %}
# Turn on case light
SET_PIN PIN=caselight VALUE=1
# I don't know what I'm doing fan activation
# M106 P3 S255
# Use absolute coordinates
G90
# Reset the G-Code Z offset (adjust Z offset if needed)
SET_GCODE_OFFSET Z=0.0
# Home the printer
G28
G0 Z50 F600 # Lower the bed while pre-heating the bed and chamber
# Heat the bed and chamber
M140 S{CHAMBER_TEMP} # Start heating the chamber (if set) #!was M141 before...
M190 S{BED_TEMP} # Heat the bed and wait for it to finish
M191 S{CHAMBER_TEMP} # Wait for the chamber to finish heating
# Nozzle pre heat
G1 Z5 F3000 # Move the nozzle near the bed
M109 S150 # Heats the nozzle to 150c
# Bed meshing
G28 Z # Re-probe the center of the bed before leveling
BED_MESH_CLEAR # Clears old saved bed mesh (if any)
BED_MESH_CALIBRATE ADAPTIVE=1 # Starts bed mesh via Klipper Adaptive MeshingG0 X0 Y0 Z50 F6000
# Smart_Park # Utilize KAMP Smart_Park Macro
# Heat the extruder and prepare for printing
M109 S{EXTRUDER_TEMP} # Heat the extruder
SET_FILAMENT_SENSOR SENSOR=filament ENABLE=1 # Enable the filament runout sensor
G91 # Incremental positioning
#M83 # Set extruder to relative mode
# Priming Section
# LINE_PURGE # KAMP Purging
G90 # Absolute positioning
#####################################################################
# Print End Macro
#####################################################################
[gcode_macro END_PRINT]
gcode:
# Turn off bed, extruder, and fan
M140 S0
M104 S0
M107 # Turn fan off: M107
# Move nozzle away from print while retracting
G91
G1 X-15 Y-15 Z100 E-3 F3000
# Raise nozzle by 10mm
# G1 Z100 F3000
G90
# Disable steppers
M84
[gcode_macro M106]
gcode:
{% set fan = 'fan' + (params.P|int if params.P is defined else 0)|string %}
{% set speed = (params.S|float / 255 if params.S is defined else 1.0) %}
SET_FAN_SPEED FAN={fan} SPEED={speed}
# Chamber heating macro from Orca
[gcode_macro M191]
gcode:
{% set s = params.S|float %}
{% if s == 0 %}
# If target temperature is 0, do nothing
M117 Chamber heating cancelled
{% else %}
SET_HEATER_TEMPERATURE HEATER=chamber_heater TARGET={s}
# Orca: uncomment the following line if you want to use heat bed to assist chamber heating
M140 S90
TEMPERATURE_WAIT SENSOR="heater_generic chamber_heater" MINIMUM={s-1} MAXIMUM={s+1}
M117 Chamber at target temperature
{% endif %}
# Copied and untested yet from Scott Qidi Standard macros
[gcode_macro M141]
gcode:
SET_HEATER_TEMPERATURE HEATER=chamber TARGET={params.S}
[gcode_macro PAUSE]
rename_existing: BASE_PAUSE
gcode:
# Parameters
{% set z = params.Z|default(10)|int %} ; z hop amount
{% if printer['pause_resume'].is_paused|int == 0 %}
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE={z} ; set z hop variable for reference in resume macro
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=etemp VALUE={printer['extruder'].target} ; set hotend temp variable for reference in resume macro
SET_FILAMENT_SENSOR SENSOR=filament ENABLE=0 ; disable filament sensor
SAVE_GCODE_STATE NAME=PAUSE
RESPOND TYPE=command MSG='Save Position PAUSE' ; save current print position for resume
BASE_PAUSE ; pause print
{% if (printer.gcode_move.position.z + z) < printer.toolhead.axis_maximum.z %} ; check that zhop doesn't exceed z max
G91 ; relative positioning
G1 Z{z} F900 ; raise Z up by z hop amount
{% else %}
{ action_respond_info("Pause zhop exceeds maximum Z height.") } ; if z max is exceeded, show message and set zhop value for resume to 0
SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=zhop VALUE=0
{% endif %}
SAVE_GCODE_STATE NAME=HOVER
RESPOND TYPE=command MSG='Save Position HOVER'
G90 ; absolute positioning
G1 X10 Y60 F6000 ; park toolhead at front left
SAVE_GCODE_STATE NAME=PAUSEPARK
RESPOND TYPE=command MSG='Save Position PAUSEPARK' ; save parked position in case toolhead is moved during the pause (otherwise the return zhop can error)
M104 S0 ; turn off hotend
SET_IDLE_TIMEOUT TIMEOUT=43200 ; set timeout to 12 hours
{% endif %}
[gcode_macro RESUME]
rename_existing: BASE_RESUME
variable_zhop: 0
variable_etemp: 0
gcode:
# Parameters
{% set e = params.E|default(2.5)|int %} ; hotend prime amount (in mm)
{% if printer['pause_resume'].is_paused|int == 1 %}
SET_FILAMENT_SENSOR SENSOR=filament ENABLE=1 ; enable filament sensor
#INITIAL_RGB ; reset LCD color
SET_IDLE_TIMEOUT TIMEOUT={printer.configfile.settings.idle_timeout.timeout} ; set timeout back to configured value
{% if etemp > 0 %}
M109 S{etemp|int} ; wait for hotend to heat back up
{% endif %}
RESTORE_GCODE_STATE NAME=PAUSEPARK MOVE=1 MOVE_SPEED=100
RESPOND TYPE=command MSG='Restore Position PAUSEPARK' ; go back to parked position in case toolhead was moved during pause (otherwise the return zhop can error)
G91 ; relative positioning
M83 ; relative extruder positioning
{% if printer[printer.toolhead.extruder].temperature >= printer.configfile.settings.extruder.min_extrude_temp %}
G1 E{e} F900 ; prime nozzle by E
{% endif %}
RESTORE_GCODE_STATE NAME=HOVER MOVE=1 MOVE_SPEED=100
RESPOND TYPE=command MSG='Restore Position HOVER'
RESTORE_GCODE_STATE NAME=PAUSE MOVE=1 MOVE_SPEED=60
RESPOND TYPE=command MSG='Restore Position PAUSE' ; restore position
BASE_RESUME ; resume print
{% endif %}
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
BASE_CANCEL_PRINT
END_PRINT
[gcode_macro M0]
gcode:
PAUSE
[screws_tilt_adjust]
horizontal_move_z: 4
screw_thread: CCW-M4
speed: 300
screw1: 31,6.5
screw1_name: front left screw
screw2: 287,6.5
screw2_name: front right screw
screw3: 287,263
screw3_name: rear right screw
screw4: 31,263
screw4_name: rear left screw
#horizontal_move_z: 10
#screw1:
# The (X, Y) coordinate of the first bed leveling screw. This is a
# position to command the nozzle to so that the probe is directly
# above the bed screw (or as close as possible while still being
# above the bed). This is the base screw used in calculations. This
# parameter must be provided.
#screw1_name:
# An arbitrary name for the given screw. This name is displayed when
# the helper script runs. The default is to use a name based upon
# the screw XY location.
#screw2:
#screw2_name:
#...
# Additional bed leveling screws. At least two screws must be
# defined.
#speed: 50
# The speed (in mm/s) of non-probing moves during the calibration.
# The default is 50.
#horizontal_move_z: 5
# The height (in mm) that the head should be commanded to move to
# just prior to starting a probe operation. The default is 5.
#screw_thread: CW-M3
# The type of screw used for bed leveling, M3, M4, or M5, and the
# rotation direction of the knob that is used to level the bed.
# Accepted values: CW-M3, CCW-M3, CW-M4, CCW-M4, CW-M5, CCW-M5.
# Default value is CW-M3 which most printers use. A clockwise
# rotation of the knob decreases the gap between the nozzle and the
# bed. Conversely, a counter-clockwise rotation increases the gap.