-
Notifications
You must be signed in to change notification settings - Fork 0
/
macros.cfg
206 lines (180 loc) · 9.28 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
#####################################################################
# Macros
#####################################################################
[bed_mesh]
speed: 300
horizontal_move_z: 15
mesh_min: 40, 40
mesh_max: 310,310
#fade_start: 0.6
#fade_end: 10.0
probe_count: 5,5
#zero_reference_position: 125, 110
#algorithm: bicubic
#relative_reference_index: 12
[gcode_macro G32]
gcode:
STATUS_LEVELING
SAVE_GCODE_STATE NAME=STATE_G32
G90
G28
QUAD_GANTRY_LEVEL
G28
STATUS_READY
G0 X175 Y175 Z30 F3600
RESTORE_GCODE_STATE NAME=STATE_G32
[gcode_macro PRINT_START]
# Use PRINT_START for the slicer starting script - please customise for your slicer of choice
gcode:
# Parameters
{% set bedtemp = params.BED|default(0)|int %}
{% set hotendtemp = params.EXTRUDER|default(240)|int %}
{% set chambertemp = params.CHAMBER|default(0)|int %}
G90 ; Set coordinates as absolute
STATUS_HOMING ; Setze LED auf Homing
G28 ; home all axes (Original)
M109 S150 ; set & wait for hotend temp
CLEAN_NOZZLE
G28 Z ; home Z only, for
STATUS_HEATING ; Setze LED auf Heating
M190 S{bedtemp} ; set & wait for bed temp
;TEMPERATURE_WAIT SENSOR="temperature_sensor chamber" MINIMUM={chambertemp} ; wait for chamber temp
QUAD_GANTRY_LEVEL ; QUAD_GANTRY_LEVEL
#STATUS_MESHING ; Setze LED auf Meshing
#BED_MESH_CALIBRATE ; Run BED MESH Calibrate
#STATUS_HOMING ; Setze LED auf Homing
#G28 ; home all axes (Original)
STATUS_HEATING ; Setze LED auf Heating
M109 S{hotendtemp} ; set & wait for hotend temp
#CLEAN_NOZZLE
#STATUS_HOMING
#G28 Z ; home Z axis after cleaning nozzle
G0 X175 Y175 Z10 F3600 ; Go to center
G92 E0 ;Reset Extruder
#G1 Z10 F3000 ;Move Z Axis up
G1 X12.1 Y20 Z0.28 F5000.0 ;Move to start position
STATUS_BUSY
G1 X12.1 Y200.0 Z0.28 F1500.0 E15 ;Draw the first line
G1 X12.6 Y200.0 Z0.28 F5000.0 ;Move to side a little
G1 X12.6 Y20 Z0.28 F1500.0 E30 ;Draw the second line
G92 E0 ;Reset Extruder
#G1 E4 F300 ; Extrude 4mm of Filament
G1 Z10 F3000 ; move nozzle away from bed (Original)
# enable smart filament sensor
SET_FILAMENT_SENSOR SENSOR=switch_sensor ENABLE=1
SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=1
# https://www.teamfdm.com/forums/topic/1115-not-to-g28-or-qgl-every-time-from-start-macro-if-its-already-done/
# https://github.com/Luc1luc/Voron-2.4-350-Configs/blob/main/macros.cfg
[gcode_macro PRINT_END]
# Use PRINT_END for the slicer ending script - please customise for your slicer of choice
gcode:
M400 ; wait for buffer to clear
G92 E0 ; zero the extruder
G1 E-5 F1800 ; retract filament
G91 ; relative positioning
G0 Z1.00 X20.0 Y20.0 F20000 ; move nozzle to remove stringing
M109 S130 ; set & wait for hotend temp
CLEAN_NOZZLE_AFTER_PRINT ; clean nozzle after print for removing ooze for the next Z leveling with TAP
TURN_OFF_HEATERS
M107 ; turn off fan
G1 Z20 F3000 ; move nozzle up 20mm
G90 ; absolute positioning
G0 X45 Y315 F3600 ; park nozzle at rear without change of Z
G0 Z35 F3600 ; Go down at the end
M18 ; disable all steppers
BED_MESH_CLEAR
STATUS_READY
#PRINTER_OFF
[pause_resume]
[delayed_gcode DISABLEFILAMENTSENSOR]
initial_duration: 1
gcode:
SET_FILAMENT_SENSOR SENSOR=switch_sensor ENABLE=0
SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0
[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=switch_sensor ENABLE=0
SET_FILAMENT_SENSOR SENSOR=encoder_sensor ENABLE=0 ; disable filament sensor
SAVE_GCODE_STATE NAME=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 %}
G90 ; absolute positioning
G1 X{printer.toolhead.axis_maximum.x/2} Y{printer.toolhead.axis_minimum.y+5} F6000 ; park toolhead at front center
SAVE_GCODE_STATE NAME=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=switch_sensor ENABLE=1
SET_FILAMENT_SENSOR SENSOR=encoder_sensor 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 ; 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 Z{zhop * -1} E{e} F900 ; prime nozzle by E, lower Z back down
{% else %}
G1 Z{zhop * -1} F900 ; lower Z back down without priming (just in case we are testing the macro with cold hotend)
{% endif %}
RESTORE_GCODE_STATE NAME=PAUSE MOVE=1 MOVE_SPEED=60 ; restore position
BASE_RESUME ; resume print
{% endif %}
[gcode_macro CASELight_OFF]
gcode: SET_PIN PIN=caselight VALUE=0
[gcode_macro CASELight_MIN]
gcode: SET_PIN PIN=caselight VALUE=0.4
[gcode_macro CASELight_MAX]
gcode: SET_PIN PIN=caselight VALUE=1
[gcode_macro CENTER]
gcode:
STATUS_HOMING
G90
G0 X175 Y175 Z30 F3600 ; Go to center
STATUS_READY
##Printer Power Macros
[gcode_macro PRINTER_OFF]
gcode:
{action_call_remote_method("set_device_power",
device="printer",
state="off")}
[gcode_macro PRINTER_ON]
gcode:
{action_call_remote_method("set_device_power",
device="printer",
state="on")}
[delayed_gcode delayed_printer_off]
initial_duration: 0.
gcode:
{% if printer.idle_timeout.state == "Idle" %}
PRINTER_OFF
{% endif %}
[gcode_shell_command backup_cfg]
command: sh /home/pi/printer_data/config/autocommit.sh
timeout: 30.
verbose: True
[gcode_macro BACKUP_CFG]
gcode:
RUN_SHELL_COMMAND CMD=backup_cfg