|
@@ -83,6 +83,15 @@ float filament_change_unload_length[EXTRUDERS],
|
83
|
83
|
}
|
84
|
84
|
#endif
|
85
|
85
|
|
|
86
|
+/**
|
|
87
|
+ * Ensure a safe temperature for extrusion
|
|
88
|
+ *
|
|
89
|
+ * - Fail if the TARGET temperature is too low
|
|
90
|
+ * - Display LCD placard with temperature status
|
|
91
|
+ * - Return when heating is done or aborted
|
|
92
|
+ *
|
|
93
|
+ * Returns 'true' if heating was completed, 'false' for abort
|
|
94
|
+ */
|
86
|
95
|
static bool ensure_safe_temperature(const AdvancedPauseMode mode=ADVANCED_PAUSE_MODE_PAUSE_PRINT) {
|
87
|
96
|
|
88
|
97
|
#if ENABLED(PREVENT_COLD_EXTRUSION)
|
|
@@ -115,7 +124,19 @@ static void do_pause_e_move(const float &length, const float &fr) {
|
115
|
124
|
set_current_from_destination();
|
116
|
125
|
}
|
117
|
126
|
|
118
|
|
-bool load_filament(const float &load_length/*=0*/, const float &extrude_length/*=0*/, const int8_t max_beep_count/*=0*/,
|
|
127
|
+/**
|
|
128
|
+ * Load filament into the hotend
|
|
129
|
+ *
|
|
130
|
+ * - Fail if the a safe temperature was not reached
|
|
131
|
+ * - If pausing for confirmation, wait for a click or M108
|
|
132
|
+ * - Show "wait for load" placard
|
|
133
|
+ * - Load and purge filament
|
|
134
|
+ * - Show "Purge more" / "Continue" menu
|
|
135
|
+ * - Return when "Continue" is selected
|
|
136
|
+ *
|
|
137
|
+ * Returns 'true' if load was completed, 'false' for abort
|
|
138
|
+ */
|
|
139
|
+bool load_filament(const float &load_length/*=0*/, const float &purge_length/*=0*/, const int8_t max_beep_count/*=0*/,
|
119
|
140
|
const bool show_lcd/*=false*/, const bool pause_for_user/*=false*/,
|
120
|
141
|
const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/
|
121
|
142
|
) {
|
|
@@ -158,15 +179,15 @@ bool load_filament(const float &load_length/*=0*/, const float &extrude_length/*
|
158
|
179
|
}
|
159
|
180
|
|
160
|
181
|
#if ENABLED(ULTIPANEL)
|
161
|
|
- if (show_lcd) // Show "load" message
|
|
182
|
+ if (show_lcd) // Show "wait for load" message
|
162
|
183
|
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_LOAD, mode);
|
163
|
184
|
#endif
|
164
|
185
|
|
165
|
186
|
// Load filament
|
166
|
|
- do_pause_e_move(load_length, FILAMENT_CHANGE_LOAD_FEEDRATE);
|
|
187
|
+ if (load_length) do_pause_e_move(load_length, FILAMENT_CHANGE_LOAD_FEEDRATE);
|
167
|
188
|
|
168
|
189
|
do {
|
169
|
|
- if (extrude_length > 0) {
|
|
190
|
+ if (purge_length > 0) {
|
170
|
191
|
// "Wait for filament purge"
|
171
|
192
|
#if ENABLED(ULTIPANEL)
|
172
|
193
|
if (show_lcd)
|
|
@@ -174,10 +195,10 @@ bool load_filament(const float &load_length/*=0*/, const float &extrude_length/*
|
174
|
195
|
#endif
|
175
|
196
|
|
176
|
197
|
// Extrude filament to get into hotend
|
177
|
|
- do_pause_e_move(extrude_length, ADVANCED_PAUSE_EXTRUDE_FEEDRATE);
|
|
198
|
+ do_pause_e_move(purge_length, ADVANCED_PAUSE_EXTRUDE_FEEDRATE);
|
178
|
199
|
}
|
179
|
200
|
|
180
|
|
- // Show "Extrude More" / "Resume" menu and wait for reply
|
|
201
|
+ // Show "Purge More" / "Resume" menu and wait for reply
|
181
|
202
|
#if ENABLED(ULTIPANEL)
|
182
|
203
|
if (show_lcd) {
|
183
|
204
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
@@ -188,7 +209,7 @@ bool load_filament(const float &load_length/*=0*/, const float &extrude_length/*
|
188
|
209
|
}
|
189
|
210
|
#endif
|
190
|
211
|
|
191
|
|
- // Keep looping if "Extrude More" was selected
|
|
212
|
+ // Keep looping if "Purge More" was selected
|
192
|
213
|
} while (
|
193
|
214
|
#if ENABLED(ULTIPANEL)
|
194
|
215
|
show_lcd && advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE
|
|
@@ -200,6 +221,16 @@ bool load_filament(const float &load_length/*=0*/, const float &extrude_length/*
|
200
|
221
|
return true;
|
201
|
222
|
}
|
202
|
223
|
|
|
224
|
+/**
|
|
225
|
+ * Unload filament from the hotend
|
|
226
|
+ *
|
|
227
|
+ * - Fail if the a safe temperature was not reached
|
|
228
|
+ * - Show "wait for unload" placard
|
|
229
|
+ * - Retract, pause, then unload filament
|
|
230
|
+ * - Disable E stepper (on most machines)
|
|
231
|
+ *
|
|
232
|
+ * Returns 'true' if unload was completed, 'false' for abort
|
|
233
|
+ */
|
203
|
234
|
bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/,
|
204
|
235
|
const AdvancedPauseMode mode/*=ADVANCED_PAUSE_MODE_PAUSE_PRINT*/
|
205
|
236
|
) {
|
|
@@ -242,6 +273,19 @@ bool unload_filament(const float &unload_length, const bool show_lcd/*=false*/,
|
242
|
273
|
|
243
|
274
|
// public:
|
244
|
275
|
|
|
276
|
+/**
|
|
277
|
+ * Pause procedure
|
|
278
|
+ *
|
|
279
|
+ * - Abort if already paused
|
|
280
|
+ * - Send host action for pause, if configured
|
|
281
|
+ * - Abort if TARGET temperature is too low
|
|
282
|
+ * - Display "wait for start of filament change" (if a length was specified)
|
|
283
|
+ * - Initial retract, if current temperature is hot enough
|
|
284
|
+ * - Park the nozzle at the given position
|
|
285
|
+ * - Call unload_filament (if a length was specified)
|
|
286
|
+ *
|
|
287
|
+ * Returns 'true' if pause was completed, 'false' for abort
|
|
288
|
+ */
|
245
|
289
|
uint8_t did_pause_print = 0;
|
246
|
290
|
|
247
|
291
|
bool pause_print(const float &retract, const point_t &park_point, const float &unload_length/*=0*/, const bool show_lcd/*=false*/) {
|
|
@@ -261,8 +305,10 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
|
261
|
305
|
SERIAL_ERRORLNPGM(MSG_HOTEND_TOO_COLD);
|
262
|
306
|
|
263
|
307
|
#if ENABLED(ULTIPANEL)
|
264
|
|
- if (show_lcd) // Show status screen
|
|
308
|
+ if (show_lcd) { // Show status screen
|
265
|
309
|
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_STATUS);
|
|
310
|
+ LCD_MESSAGEPGM(MSG_M600_TOO_COLD);
|
|
311
|
+ }
|
266
|
312
|
#endif
|
267
|
313
|
|
268
|
314
|
return false; // unable to reach safe temperature
|
|
@@ -275,7 +321,7 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
|
275
|
321
|
#if ENABLED(SDSUPPORT)
|
276
|
322
|
if (card.sdprinting) {
|
277
|
323
|
card.pauseSDPrint();
|
278
|
|
- ++did_pause_print;
|
|
324
|
+ ++did_pause_print; // Indicate SD pause also
|
279
|
325
|
}
|
280
|
326
|
#endif
|
281
|
327
|
print_job_timer.pause();
|
|
@@ -287,7 +333,7 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
|
287
|
333
|
COPY(resume_position, current_position);
|
288
|
334
|
|
289
|
335
|
// Initial retract before move to filament change position
|
290
|
|
- if (retract && !thermalManager.tooColdToExtrude(active_extruder))
|
|
336
|
+ if (retract && thermalManager.hotEnoughToExtrude(active_extruder))
|
291
|
337
|
do_pause_e_move(retract, PAUSE_PARK_RETRACT_FEEDRATE);
|
292
|
338
|
|
293
|
339
|
// Park the nozzle by moving up by z_lift and then moving to (x_pos, y_pos)
|
|
@@ -300,6 +346,13 @@ bool pause_print(const float &retract, const point_t &park_point, const float &u
|
300
|
346
|
return true;
|
301
|
347
|
}
|
302
|
348
|
|
|
349
|
+/**
|
|
350
|
+ * - Show "Insert filament and press button to continue"
|
|
351
|
+ * - Wait for a click before returning
|
|
352
|
+ * - Heaters can time out, reheated before accepting a click
|
|
353
|
+ *
|
|
354
|
+ * Used by M125 and M600
|
|
355
|
+ */
|
303
|
356
|
void wait_for_filament_reload(const int8_t max_beep_count/*=0*/) {
|
304
|
357
|
bool nozzle_timed_out = false;
|
305
|
358
|
|
|
@@ -386,20 +439,37 @@ void wait_for_filament_reload(const int8_t max_beep_count/*=0*/) {
|
386
|
439
|
KEEPALIVE_STATE(IN_HANDLER);
|
387
|
440
|
}
|
388
|
441
|
|
389
|
|
-void resume_print(const float &load_length/*=0*/, const float &extrude_length/*=ADVANCED_PAUSE_EXTRUDE_LENGTH*/, const int8_t max_beep_count/*=0*/) {
|
390
|
|
- bool nozzle_timed_out = false;
|
391
|
|
-
|
|
442
|
+/**
|
|
443
|
+ * Resume or Start print procedure
|
|
444
|
+ *
|
|
445
|
+ * - Abort if not paused
|
|
446
|
+ * - Reset heater idle timers
|
|
447
|
+ * - Load filament if specified, but only if:
|
|
448
|
+ * - a nozzle timed out, or
|
|
449
|
+ * - the nozzle is already heated.
|
|
450
|
+ * - Display "wait for print to resume"
|
|
451
|
+ * - Re-prime the nozzle...
|
|
452
|
+ * - FWRETRACT: Recover/prime from the prior G10.
|
|
453
|
+ * - !FWRETRACT: Retract by resume_position[E], if negative.
|
|
454
|
+ * Not sure how this logic comes into use.
|
|
455
|
+ * - Move the nozzle back to resume_position
|
|
456
|
+ * - Sync the planner E to resume_position[E]
|
|
457
|
+ * - Send host action for resume, if configured
|
|
458
|
+ * - Resume the current SD print job, if any
|
|
459
|
+ */
|
|
460
|
+void resume_print(const float &load_length/*=0*/, const float &purge_length/*=ADVANCED_PAUSE_EXTRUDE_LENGTH*/, const int8_t max_beep_count/*=0*/) {
|
392
|
461
|
if (!did_pause_print) return;
|
393
|
462
|
|
394
|
463
|
// Re-enable the heaters if they timed out
|
|
464
|
+ bool nozzle_timed_out = false;
|
395
|
465
|
HOTEND_LOOP() {
|
396
|
466
|
nozzle_timed_out |= thermalManager.is_heater_idle(e);
|
397
|
467
|
thermalManager.reset_heater_idle_timer(e);
|
398
|
468
|
}
|
399
|
469
|
|
400
|
|
- if (nozzle_timed_out || !thermalManager.tooColdToExtrude(active_extruder)) {
|
|
470
|
+ if (nozzle_timed_out || thermalManager.hotEnoughToExtrude(active_extruder)) {
|
401
|
471
|
// Load the new filament
|
402
|
|
- load_filament(load_length, extrude_length, max_beep_count, true, nozzle_timed_out);
|
|
472
|
+ load_filament(load_length, purge_length, max_beep_count, true, nozzle_timed_out);
|
403
|
473
|
}
|
404
|
474
|
|
405
|
475
|
#if ENABLED(ULTIPANEL)
|
|
@@ -413,7 +483,7 @@ void resume_print(const float &load_length/*=0*/, const float &extrude_length/*=
|
413
|
483
|
if (fwretract.retracted[active_extruder])
|
414
|
484
|
do_pause_e_move(-fwretract.retract_length, fwretract.retract_feedrate_mm_s);
|
415
|
485
|
#else
|
416
|
|
- // If resume_position negative
|
|
486
|
+ // If resume_position is negative
|
417
|
487
|
if (resume_position[E_AXIS] < 0) do_pause_e_move(resume_position[E_AXIS], PAUSE_PARK_RETRACT_FEEDRATE);
|
418
|
488
|
#endif
|
419
|
489
|
|