-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcalibration.cfg
259 lines (229 loc) · 7.05 KB
/
calibration.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
################CALIBRATION MACROS####################
[homing_override] #SAFE HOMING
gcode:
{% set CONFIG_A = printer.configfile.settings['tmc2209 stepper_a'].run_current|float %}
{% set CONFIG_B = printer.configfile.settings['tmc2209 stepper_b'].run_current|float %}
{% set CONFIG_C = printer.configfile.settings['tmc2209 stepper_c'].run_current|float %}
{% set SAFE = 0.75 %}
SET_VELOCITY_LIMIT velocity=60
SET_TMC_CURRENT STEPPER=stepper_a CURRENT={SAFE}
SET_TMC_CURRENT STEPPER=stepper_b CURRENT={SAFE}
SET_TMC_CURRENT STEPPER=stepper_c CURRENT={SAFE}
G28
SET_TMC_CURRENT STEPPER=stepper_a CURRENT={CONFIG_A}
SET_TMC_CURRENT STEPPER=stepper_b CURRENT={CONFIG_B}
SET_TMC_CURRENT STEPPER=stepper_c CURRENT={CONFIG_C}
SET_VELOCITY_LIMIT velocity={printer.configfile.settings.printer.max_velocity}
[gcode_macro PRESSURE_ADVANCE_TESTING]
description: Pressure Advance
gcode:
{% if printer.idle_timeout.state == "Printing" %}
RESPOND TYPE=error MSG="This macro cannot be used while printing!"
{% else %}
SET_PRESSURE_ADVANCE ADVANCE=0
SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=1 ACCEL=500
TUNING_TOWER COMMAND=SET_PRESSURE_ADVANCE PARAMETER=ADVANCE START=0 FACTOR=.005
{% endif %}
[gcode_macro MOVE_TO_Z0]
description: Move to Z=0
gcode:
{% if printer.idle_timeout.state == "Printing" %}
RESPOND TYPE=error MSG="This macro cannot be used while printing!"
{% else %}
{% if printer.toolhead.homed_axes != "xyz" %}
G28
{% endif %}
LED_HOTEND_ON
G1 Z0 F2500
{% endif %}
[gcode_macro Z_UP]
description: Raise Nozzle
gcode:
SET_GCODE_OFFSET Z_ADJUST=0.025 MOVE=1
[gcode_macro Z_DOWN]
description: Lower Nozzle
gcode:
SET_GCODE_OFFSET Z_ADJUST=-0.025 MOVE=1
#######ADXL###########
#[gcode_macro ACCELEROMETER_QUERY]
#description: ADXL Test
#gcode:
#ACCELEROMETER_QUERY
#[gcode_macro MEASURE_AXES_NOISE]
#description: Measure Accelerometer Noise
#gcode:
#MEASURE_AXES_NOISE
#gcode_macro SHAPER_CALIBRATE_X]
#escription: Measure X axis resonances
#gcode:
#SHAPER_CALIBRATE AXIS=X
#[gcode_macro SHAPER_CALIBRATE_Y]
#description: Measure Y axis resonances
#gcode:
#SHAPER_CALIBRATE AXIS=Y
############PROBE AND MESH##########
[gcode_macro Probe_Calibrate_Zoffset_install_probe]
description: Probe_calibrate
gcode:
PROBE_CALIBRATE
[delayed_gcode CALIBRATION_ROUTINE]
initial_duration: 7
gcode:
{% set svv = printer.save_variables.variables %}
{% if svv.calibration_active == 0 %} # If calibration wasn't stopped early, run calibration at boot
M117 Preheating bed
M190 S{svv.bed_temp}
M117 Running delta calibrate
SAVE_VARIABLE VARIABLE=calibration_active VALUE=3
_DELTA_CALIBRATE_SAFE
M400
SAVE_VARIABLE VARIABLE=calibration_active VALUE=1
SAVE_CONFIG
{% elif svv.calibration_active == 1 %}
SAVE_VARIABLE VARIABLE=calibration_active VALUE=3
M117 Preheating bed
M190 S{svv.bed_temp}
M117 Preheat finsihed calibrating bed mesh
_CALIBRATE_BED_MESH
{% else %}
SAVE_VARIABLE VARIABLE=calibration_active VALUE=3
{% endif %}
[gcode_macro CALIBRATE]
gcode:
SAVE_VARIABLE VARIABLE=bed_temp VALUE='"{printer.heater_bed.target}"'
SAVE_VARIABLE VARIABLE=calibration_active VALUE=3
G28
G91
G0 Z-50 F1500
G28
G91
G0 Z-50 F1500
G28
G91
G0 Z-50 F1500
G28
G91
G0 Z-50 F1500
G28
G91
G0 Z-50 F1500
ENDSTOP_PHASE_CALIBRATE stepper=stepper_a
ENDSTOP_PHASE_CALIBRATE stepper=stepper_b
ENDSTOP_PHASE_CALIBRATE stepper=stepper_c
M400
G28
SAVE_VARIABLE VARIABLE=calibration_active VALUE=0
[gcode_macro _DELTA_CALIBRATE_SAFE]
gcode:
{% set CONFIG_A = printer.configfile.settings['tmc2209 stepper_a'].run_current|float %}
{% set CONFIG_B = printer.configfile.settings['tmc2209 stepper_b'].run_current|float %}
{% set CONFIG_C = printer.configfile.settings['tmc2209 stepper_c'].run_current|float %}
{% set SAFE = 0.75 %}
G28
G91
SET_GCODE_OFFSET Z=0 MOVE=0
g0 z-150 F6000 #40 stock
SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=1
SET_VELOCITY_LIMIT ACCEL=650
SET_VELOCITY_LIMIT VELOCITY=50
SET_TMC_CURRENT STEPPER=stepper_a CURRENT={SAFE}
SET_TMC_CURRENT STEPPER=stepper_b CURRENT={SAFE}
SET_TMC_CURRENT STEPPER=stepper_c CURRENT={SAFE}
DELTA_CALIBRATE
M400
G0 Z20 F3000
G0 Y0 F7800
G0 X0 F7800
G28
[gcode_macro _CALIBRATE_BED_MESH]
gcode:
{% set CONFIG_A = printer.configfile.settings['tmc2209 stepper_a'].run_current|float %}
{% set CONFIG_B = printer.configfile.settings['tmc2209 stepper_b'].run_current|float %}
{% set CONFIG_C = printer.configfile.settings['tmc2209 stepper_c'].run_current|float %}
{% set SAFE = 0.75 %}
G28
SET_GCODE_OFFSET Z=0 MOVE=0
SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=1
SET_VELOCITY_LIMIT ACCEL=650
SET_VELOCITY_LIMIT VELOCITY=80
SET_TMC_CURRENT STEPPER=stepper_a CURRENT={SAFE}
SET_TMC_CURRENT STEPPER=stepper_b CURRENT={SAFE}
SET_TMC_CURRENT STEPPER=stepper_c CURRENT={SAFE}
BED_MESH_CALIBRATE
G1 Z50 F3000
G1 X0 F7800
G1 Y0 F7800
G28
SET_TMC_CURRENT STEPPER=stepper_a CURRENT={CONFIG_A}
SET_TMC_CURRENT STEPPER=stepper_b CURRENT={CONFIG_B}
SET_TMC_CURRENT STEPPER=stepper_c CURRENT={CONFIG_C}
M117 Calibration Complete
SAVE_VARIABLE VARIABLE=calibration_active VALUE=3
SAVE_VARIABLE VARIABLE=bed_temp VALUE='"{0}"'
SET_VELOCITY_LIMIT velocity={printer.configfile.settings.printer.max_velocity}
SAVE_CONFIG
######TEMP#########
[gcode_macro PID_BED_65]
description: Start Bed PID
gcode:
{% if printer.idle_timeout.state == "Printing" %}
RESPOND TYPE=error MSG="This macro cannot be used while printing!"
{% else %}
{% if printer.toolhead.homed_axes != "xyz" %}
G28
{% endif %}
M106
G1 Z50 F1500
RESPOND MSG="Bed PID in progress..."
PID_CALIBRATE HEATER=heater_bed TARGET={params.TEMP|default(65)}
G28
SAVE_CONFIG
{% endif %}
[gcode_macro PID_BED_90]
description: Start Bed PID
gcode:
{% if printer.idle_timeout.state == "Printing" %}
RESPOND TYPE=error MSG="This macro cannot be used while printing!"
{% else %}
{% if printer.toolhead.homed_axes != "xyz" %}
G28
{% endif %}
M106
G1 Z50 F1500
RESPOND MSG="Bed PID in progress..."
PID_CALIBRATE HEATER=heater_bed TARGET=90{params.TEMP|default(65)}
G28
SAVE_CONFIG
{% endif %}
[gcode_macro PID_HOTEND_220]
description: Start Hotend PID
gcode:
{% if printer.idle_timeout.state == "Printing" %}
RESPOND TYPE=error MSG="This macro cannot be used while printing!"
{% else %}
{% if printer.toolhead.homed_axes != "xyz" %}
G28
{% endif %}
M106
G1 Z50 F1500
RESPOND MSG="Hotend PID in progress..."
PID_CALIBRATE HEATER=extruder TARGET={params.TEMP|default(220)}
G28
SAVE_CONFIG
{% endif %}
[gcode_macro PID_HOTEND_260]
description: Start Hotend PID
gcode:
{% if printer.idle_timeout.state == "Printing" %}
RESPOND TYPE=error MSG="This macro cannot be used while printing!"
{% else %}
{% if printer.toolhead.homed_axes != "xyz" %}
G28
{% endif %}
M106
G1 Z50 F1500
RESPOND MSG="Hotend PID in progress..."
PID_CALIBRATE HEATER=extruder TARGET=260{params.TEMP|default(220)}
G28
SAVE_CONFIG
{% endif %}