|
|
@ -6492,12 +6492,12 @@ inline void gcode_M17() {
|
|
|
|
stepper.synchronize();
|
|
|
|
stepper.synchronize();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static bool pause_print(const float &retract, const float &z_lift, const float &x_pos, const float &y_pos,
|
|
|
|
static bool pause_print(const float &retract, const point_t &park_point, const float &unload_length = 0,
|
|
|
|
const float &unload_length = 0 , const int8_t max_beep_count = 0, const bool show_lcd = false
|
|
|
|
const int8_t max_beep_count = 0, const bool show_lcd = false
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
if (move_away_flag) return false; // already paused
|
|
|
|
if (move_away_flag) return false; // already paused
|
|
|
|
|
|
|
|
|
|
|
|
if (!DEBUGGING(DRYRUN) && (unload_length != 0 || retract != 0)) {
|
|
|
|
if (!DEBUGGING(DRYRUN) && unload_length != 0) {
|
|
|
|
#if ENABLED(PREVENT_COLD_EXTRUSION)
|
|
|
|
#if ENABLED(PREVENT_COLD_EXTRUSION)
|
|
|
|
if (!thermalManager.allow_cold_extrude &&
|
|
|
|
if (!thermalManager.allow_cold_extrude &&
|
|
|
|
thermalManager.degTargetHotend(active_extruder) < thermalManager.extrude_min_temp) {
|
|
|
|
thermalManager.degTargetHotend(active_extruder) < thermalManager.extrude_min_temp) {
|
|
|
@ -6534,14 +6534,11 @@ inline void gcode_M17() {
|
|
|
|
COPY(resume_position, current_position);
|
|
|
|
COPY(resume_position, current_position);
|
|
|
|
|
|
|
|
|
|
|
|
// Initial retract before move to filament change position
|
|
|
|
// Initial retract before move to filament change position
|
|
|
|
if (retract) do_pause_e_move(retract, PAUSE_PARK_RETRACT_FEEDRATE);
|
|
|
|
if (retract && !thermalManager.tooColdToExtrude(active_extruder))
|
|
|
|
|
|
|
|
do_pause_e_move(retract, PAUSE_PARK_RETRACT_FEEDRATE);
|
|
|
|
|
|
|
|
|
|
|
|
// Lift Z axis
|
|
|
|
// Park the nozzle by moving up by z_lift and then moving to (x_pos, y_pos)
|
|
|
|
if (z_lift > 0)
|
|
|
|
Nozzle::park(2, park_point);
|
|
|
|
do_blocking_move_to_z(current_position[Z_AXIS] + z_lift, PAUSE_PARK_Z_FEEDRATE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Move XY axes to filament exchange position
|
|
|
|
|
|
|
|
do_blocking_move_to_xy(x_pos, y_pos, PAUSE_PARK_XY_FEEDRATE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (unload_length != 0) {
|
|
|
|
if (unload_length != 0) {
|
|
|
|
if (show_lcd) {
|
|
|
|
if (show_lcd) {
|
|
|
@ -6683,28 +6680,30 @@ inline void gcode_M17() {
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(ULTIPANEL) && ADVANCED_PAUSE_EXTRUDE_LENGTH > 0
|
|
|
|
#if ENABLED(ULTIPANEL) && ADVANCED_PAUSE_EXTRUDE_LENGTH > 0
|
|
|
|
|
|
|
|
|
|
|
|
float extrude_length = initial_extrude_length;
|
|
|
|
if (!thermalManager.tooColdToExtrude(active_extruder)) {
|
|
|
|
|
|
|
|
float extrude_length = initial_extrude_length;
|
|
|
|
|
|
|
|
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
if (extrude_length > 0) {
|
|
|
|
if (extrude_length > 0) {
|
|
|
|
// "Wait for filament extrude"
|
|
|
|
// "Wait for filament extrude"
|
|
|
|
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_EXTRUDE);
|
|
|
|
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_EXTRUDE);
|
|
|
|
|
|
|
|
|
|
|
|
// Extrude filament to get into hotend
|
|
|
|
// Extrude filament to get into hotend
|
|
|
|
do_pause_e_move(extrude_length, ADVANCED_PAUSE_EXTRUDE_FEEDRATE);
|
|
|
|
do_pause_e_move(extrude_length, ADVANCED_PAUSE_EXTRUDE_FEEDRATE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Show "Extrude More" / "Resume" menu and wait for reply
|
|
|
|
// Show "Extrude More" / "Resume" menu and wait for reply
|
|
|
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
|
KEEPALIVE_STATE(PAUSED_FOR_USER);
|
|
|
|
wait_for_user = false;
|
|
|
|
wait_for_user = false;
|
|
|
|
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_OPTION);
|
|
|
|
lcd_advanced_pause_show_message(ADVANCED_PAUSE_MESSAGE_OPTION);
|
|
|
|
while (advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_WAIT_FOR) idle(true);
|
|
|
|
while (advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_WAIT_FOR) idle(true);
|
|
|
|
KEEPALIVE_STATE(IN_HANDLER);
|
|
|
|
KEEPALIVE_STATE(IN_HANDLER);
|
|
|
|
|
|
|
|
|
|
|
|
extrude_length = ADVANCED_PAUSE_EXTRUDE_LENGTH;
|
|
|
|
extrude_length = ADVANCED_PAUSE_EXTRUDE_LENGTH;
|
|
|
|
|
|
|
|
|
|
|
|
// Keep looping if "Extrude More" was selected
|
|
|
|
// Keep looping if "Extrude More" was selected
|
|
|
|
} while (advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE);
|
|
|
|
} while (advanced_pause_menu_response == ADVANCED_PAUSE_RESPONSE_EXTRUDE_MORE);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
@ -6718,8 +6717,8 @@ inline void gcode_M17() {
|
|
|
|
planner.set_e_position_mm(current_position[E_AXIS]);
|
|
|
|
planner.set_e_position_mm(current_position[E_AXIS]);
|
|
|
|
|
|
|
|
|
|
|
|
// Move XY to starting position, then Z
|
|
|
|
// Move XY to starting position, then Z
|
|
|
|
do_blocking_move_to_xy(resume_position[X_AXIS], resume_position[Y_AXIS], PAUSE_PARK_XY_FEEDRATE);
|
|
|
|
do_blocking_move_to_xy(resume_position[X_AXIS], resume_position[Y_AXIS], NOZZLE_PARK_XY_FEEDRATE);
|
|
|
|
do_blocking_move_to_z(resume_position[Z_AXIS], PAUSE_PARK_Z_FEEDRATE);
|
|
|
|
do_blocking_move_to_z(resume_position[Z_AXIS], NOZZLE_PARK_Z_FEEDRATE);
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
|
|
|
|
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
|
|
|
|
filament_ran_out = false;
|
|
|
|
filament_ran_out = false;
|
|
|
@ -8601,6 +8600,7 @@ inline void gcode_M121() { endstops.enable_globally(false); }
|
|
|
|
* Z = override Z raise
|
|
|
|
* Z = override Z raise
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
inline void gcode_M125() {
|
|
|
|
inline void gcode_M125() {
|
|
|
|
|
|
|
|
point_t park_point = NOZZLE_PARK_POINT;
|
|
|
|
|
|
|
|
|
|
|
|
// Initial retract before move to filament change position
|
|
|
|
// Initial retract before move to filament change position
|
|
|
|
const float retract = parser.seen('L') ? parser.value_axis_units(E_AXIS) : 0
|
|
|
|
const float retract = parser.seen('L') ? parser.value_axis_units(E_AXIS) : 0
|
|
|
@ -8610,35 +8610,26 @@ inline void gcode_M121() { endstops.enable_globally(false); }
|
|
|
|
;
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
// Lift Z axis
|
|
|
|
// Lift Z axis
|
|
|
|
const float z_lift = parser.linearval('Z')
|
|
|
|
if (parser.seenval('Z'))
|
|
|
|
#ifdef PAUSE_PARK_Z_ADD
|
|
|
|
park_point.z = parser.linearval('Z');
|
|
|
|
+ PAUSE_PARK_Z_ADD
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Move XY axes to filament change position or given position
|
|
|
|
// Move XY axes to filament change position or given position
|
|
|
|
const float x_pos = parser.linearval('X')
|
|
|
|
if (parser.seenval('X'))
|
|
|
|
#ifdef PAUSE_PARK_X_POS
|
|
|
|
park_point.x = parser.linearval('X');
|
|
|
|
+ PAUSE_PARK_X_POS
|
|
|
|
|
|
|
|
#endif
|
|
|
|
if (parser.seenval('Y'))
|
|
|
|
#if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE)
|
|
|
|
park_point.y = parser.linearval('Y');
|
|
|
|
+ (active_extruder ? hotend_offset[X_AXIS][active_extruder] : 0)
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE)
|
|
|
|
;
|
|
|
|
park_point.x += (active_extruder ? hotend_offset[X_AXIS][active_extruder] : 0);
|
|
|
|
const float y_pos = parser.linearval('Y')
|
|
|
|
park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0);
|
|
|
|
#ifdef PAUSE_PARK_Y_POS
|
|
|
|
#endif
|
|
|
|
+ PAUSE_PARK_Y_POS
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE)
|
|
|
|
|
|
|
|
+ (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0)
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if DISABLED(SDSUPPORT)
|
|
|
|
#if DISABLED(SDSUPPORT)
|
|
|
|
const bool job_running = print_job_timer.isRunning();
|
|
|
|
const bool job_running = print_job_timer.isRunning();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
if (pause_print(retract, z_lift, x_pos, y_pos)) {
|
|
|
|
if (pause_print(retract, park_point)) {
|
|
|
|
#if DISABLED(SDSUPPORT)
|
|
|
|
#if DISABLED(SDSUPPORT)
|
|
|
|
// Wait for lcd click or M108
|
|
|
|
// Wait for lcd click or M108
|
|
|
|
wait_for_filament_reload();
|
|
|
|
wait_for_filament_reload();
|
|
|
@ -10030,6 +10021,7 @@ inline void gcode_M502() {
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
inline void gcode_M600() {
|
|
|
|
inline void gcode_M600() {
|
|
|
|
|
|
|
|
point_t park_point = NOZZLE_PARK_POINT;
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(HOME_BEFORE_FILAMENT_CHANGE)
|
|
|
|
#if ENABLED(HOME_BEFORE_FILAMENT_CHANGE)
|
|
|
|
// Don't allow filament change without homing first
|
|
|
|
// Don't allow filament change without homing first
|
|
|
@ -10044,23 +10036,20 @@ inline void gcode_M502() {
|
|
|
|
;
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
// Lift Z axis
|
|
|
|
// Lift Z axis
|
|
|
|
const float z_lift = parser.linearval('Z', 0
|
|
|
|
if (parser.seenval('Z'))
|
|
|
|
#ifdef PAUSE_PARK_Z_ADD
|
|
|
|
park_point.z = parser.linearval('Z');
|
|
|
|
+ PAUSE_PARK_Z_ADD
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Move XY axes to filament exchange position
|
|
|
|
// Move XY axes to filament change position or given position
|
|
|
|
const float x_pos = parser.linearval('X', 0
|
|
|
|
if (parser.seenval('X'))
|
|
|
|
#ifdef PAUSE_PARK_X_POS
|
|
|
|
park_point.x = parser.linearval('X');
|
|
|
|
+ PAUSE_PARK_X_POS
|
|
|
|
|
|
|
|
#endif
|
|
|
|
if (parser.seenval('Y'))
|
|
|
|
);
|
|
|
|
park_point.y = parser.linearval('Y');
|
|
|
|
const float y_pos = parser.linearval('Y', 0
|
|
|
|
|
|
|
|
#ifdef PAUSE_PARK_Y_POS
|
|
|
|
#if HOTENDS > 1 && DISABLED(DUAL_X_CARRIAGE)
|
|
|
|
+ PAUSE_PARK_Y_POS
|
|
|
|
park_point.x += (active_extruder ? hotend_offset[X_AXIS][active_extruder] : 0);
|
|
|
|
#endif
|
|
|
|
park_point.y += (active_extruder ? hotend_offset[Y_AXIS][active_extruder] : 0);
|
|
|
|
);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Unload filament
|
|
|
|
// Unload filament
|
|
|
|
const float unload_length = parser.seen('U') ? parser.value_axis_units(E_AXIS) : 0
|
|
|
|
const float unload_length = parser.seen('U') ? parser.value_axis_units(E_AXIS) : 0
|
|
|
@ -10086,7 +10075,7 @@ inline void gcode_M502() {
|
|
|
|
|
|
|
|
|
|
|
|
const bool job_running = print_job_timer.isRunning();
|
|
|
|
const bool job_running = print_job_timer.isRunning();
|
|
|
|
|
|
|
|
|
|
|
|
if (pause_print(retract, z_lift, x_pos, y_pos, unload_length, beep_count, true)) {
|
|
|
|
if (pause_print(retract, park_point, unload_length, beep_count, true)) {
|
|
|
|
wait_for_filament_reload(beep_count);
|
|
|
|
wait_for_filament_reload(beep_count);
|
|
|
|
resume_print(load_length, ADVANCED_PAUSE_EXTRUDE_LENGTH, beep_count);
|
|
|
|
resume_print(load_length, ADVANCED_PAUSE_EXTRUDE_LENGTH, beep_count);
|
|
|
|
}
|
|
|
|
}
|
|
|
|