forked from strayr/strayr-k-macros
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_macros.cfg
197 lines (167 loc) · 5.8 KB
/
setup_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
## Warning, some of the helper macros in start print have been masked with a leading "_"
[gcode_macro SETUP_BED]
gcode:
{% set TOL_CORNERS = params.TOL_CORNERS|default(10)|float %}
{% set my_tg = params.TOL_GANTRY|default(0.025)|float %}
status_homing
G28
{% if printer.z_tilt %}
M117 Tilting Gantry {my_tg}
UPDATE_DELAYED_GCODE ID=clear_display DURATION=10
Z_TILT_ADJUST RETRY_TOLERANCE={my_tg}
{% endif %}
{% if printer.screws_tilt_adjust %}
M117 Checking corners {TOL_CORNERS}
UPDATE_DELAYED_GCODE ID=clear_display DURATION=10
SCREWS_TILT_CALCULATE MAX_DEVIATION={TOL_CORNERS}
{% endif %}
PARK
[gcode_macro INTRO_LINE]
gcode:
{ action_respond_info("INTRO_LINE is depricated, call _INTRO_LINE from START_PRINT")}
# Requires a 200mm bed
[gcode_macro _INTRO_LINE]
gcode:
M117 Intro Line
UPDATE_DELAYED_GCODE ID=clear_display DURATION=10
{% set travel_speed = printer.toolhead.max_velocity * 0.7 * 60 %}
{% set z_travel_speed = printer.configfile.settings.printer.max_z_velocity * 60 %}
G1 Y1 X0 F{travel_speed} ; go to edge of print
G1 Z0.3 F{z_travel_speed} ;drop to height
G92 E0.0
M82 ;Absolute
G1 Y100.0 E22.5 F1000.0 ; intro line
G1 Y200.0 E37.5 F1000.0 ; intro line
G1 Z1 F{z_travel_speed} ;lift, NO RETRACT
G1 X1
G1 F {travel_speed}
G92 E0.0
[gcode_macro PRINT_START]
description: wrapper for START_PRINT
gcode:
START_PRINT {rawparams}
[gcode_macro START_PRINT]
variable_version: 0.4
description: Does everythin to go from a cold printer to a successful print except a purge line.
gcode:
_SOUND_YES
{% set svv = printer.save_variables.variables %}
{% set BED_TEMP = params.BED_TEMP|default(svv.setup_default_bed_temp)|float %}
{% set EXTRUDER_TEMP = params.EXTRUDER_TEMP|default(svv.setup_default_nozzle_temp)|float %}
## Check for alternate params
{% if "BED" in params %}
{% set BED_TEMP = params.BED|float %}
{ action_respond_info("Using alternate param BED=" + params.BED|string)}
{% endif %}
{% if "EXTRUDER" in params %}
{% set EXTRUDER_TEMP = params.EXTRUDER|float %}
{ action_respond_info("Using alternate param EXTRUDER=" + params.EXTRUDER|string)}
{% endif %}
{% if "HOTEND" in params %}
{% set EXTRUDER_TEMP = params.HOTEND|float %}
{ action_respond_info("Using alternate param HOTEND=" + params.HOTEND|string)}
{% endif %}
{% if svv.setup_version|float < version|float %}
{ action_raise_error("Setup data is older than macro version. You should check the values in INIT_SETUP and run it to update") }
{% endif %}
{% if svv.setup_use_bed_offset == 1 %}
BED_DETAILS # tell us about the bed
#{else}
{% endif %}
SET_ENCLOSURE preheat=1
G92 E0 ; reset extruder
G90 ; absolute
M82 ; extruder absolute
G92 E0 ; reset extruder
M107 S0; turn off fan
status_heating
M117 Heating Bed to {BED_TEMP}
UPDATE_DELAYED_GCODE ID=clear_display DURATION=10
#M104 S120 ; set extruder warmup temp
M140 S{BED_TEMP} ; start heating
SETUP_BED TOL_CORNERS=0.2 TOL_GANTRY=0.02
status_heating
M190 S{BED_TEMP} ; wait for bed temp
PARK
M109 S{svv.setup_idle_temp}
M117 Preheat Extruder
UPDATE_DELAYED_GCODE ID=clear_display DURATION=10
#SETUP_BED TOL_CORNERS=0.2 TOL_GANTRY=0.02
status_leveling
_LOAD_MESH_TEMP BED_TEMP={BED_TEMP}
status_heating
M104 S{EXTRUDER_TEMP}
PARK
#Set our baseline offset for nozzle height, this is based PROBE_CALIBRATE result
#And apply changes for a different bed
_BED_START_PRINT_OFFSETS
M117 Heating Extruder to {EXTRUDER_TEMP}
UPDATE_DELAYED_GCODE ID=clear_display DURATION=10
M109 S{EXTRUDER_TEMP} ; wait for extruder temp
M117 Starting Print
UPDATE_DELAYED_GCODE ID=clear_display DURATION=10
status_homing
_SOUND_YES
G28 #Try homing at end to fix gcode
SET_ENCLOSURE on=1
status_printing
SET_SKEW CLEAR=1
_INTRO_LINE
#SKEW_PROFILE LOAD=default
[gcode_macro PRINT_END]
description: wrapper for END_PRINT
gcode:
END_PRINT {rawparams}
[gcode_macro END_PRINT]
description: Clean up after a print, save mesh if SAVE_AT_END was used.
gcode:
{% set svv = printer.save_variables.variables %}
G91
G1 E-6 F300 ;big retract/wipe
G1 X-2 Y-2 F3000 ;big retract/wipe
G90
SET_SKEW CLEAR=1
PRESENT
M140 S0 ; turn off heatbed
M104 S0 ; turn off hotend
M107 S0; turn off fan
SET_ENCLOSURE cooldown=1
M84 X Y E ; disable motors
# BED_MESH_CLEAR ;We want this
#SET_GCODE_OFFSET Z=0 ; We might want this
# SET_PRESSURE_ADVANCE ADVANCE=0 ; same here
## What Should remain here is any adjustment we made to Z-Offset
## this way we can apply our live Z change to the probe offset without
## bed offsets and setups offsets getting in the way
## We might be able to remove setup_nozzle_offset
_BED_END_PRINT_OFFSETS
M117 Print Done
#FORCE_MESH_LOAD #removed becasue not needed
_SAVE_IF_SET
[gcode_macro CANCEL_PRINT]
rename_existing: BASE_CANCEL_PRINT
gcode:
TURN_OFF_HEATERS
CLEAR_PAUSE
SDCARD_RESET_FILE
M107 S0 ; turn off fans
SET_SKEW CLEAR=1
PRESENT
#ENCLOSURE_PURGE
BASE_CANCEL_PRINT
status_off
SET_ENCLOSURE cooldown=1
[gcode_macro MY_PROBE_CALIBRATE]
description: Homes, removes bed mesh, does probe_calibrate in a defined position, remember to PARK affter ACCEPT and before SAVE_CONFIG
gcode:
SET_GCODE_OFFSET Z=0
G28
{% if printer.z_tilt %}
Z_TILT_ADJUST
{% endif %}
{% if printer["gcode_macro PROBE_OUT"] %}
PROBE_OUT
{% endif %}
G1 Z30
G1 X110 Y93
PROBE_CALIBRATE