Clamp Z movements to machine limits

This commit is contained in:
Alex Voinea 2022-07-04 18:26:14 +02:00
parent 44fce0696b
commit 253b14def1
2 changed files with 3 additions and 1 deletions

View File

@ -3688,6 +3688,7 @@ static void gcode_M600(bool automatic, float x_position, float y_position, float
//Lift Z
current_position[Z_AXIS] += z_shift;
clamp_to_software_endstops(current_position);
plan_buffer_line_curposXYZE(FILAMENTCHANGE_ZFEED);
st_synchronize();
@ -10734,7 +10735,7 @@ void long_pause() //long pause print
//lift z
current_position[Z_AXIS] += Z_PAUSE_LIFT;
if (current_position[Z_AXIS] > Z_MAX_POS) current_position[Z_AXIS] = Z_MAX_POS;
clamp_to_software_endstops(current_position);
plan_buffer_line_curposXYZE(15);
//Move XY to side

View File

@ -6309,6 +6309,7 @@ void lcd_print_stop()
if (axis_known_position[Z_AXIS]) {
current_position[Z_AXIS] += Z_CANCEL_LIFT;
clamp_to_software_endstops(current_position);
plan_buffer_line_curposXYZE(manual_feedrate[Z_AXIS] / 60);
}