|
@ -217,13 +217,13 @@ static void _lcd_level_bed_corners_get_next_position() { |
|
|
|
|
|
|
|
|
bool _lcd_level_bed_corners_probe(bool verify=false) { |
|
|
bool _lcd_level_bed_corners_probe(bool verify=false) { |
|
|
if (verify) do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP); // do clearance if needed
|
|
|
if (verify) do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP); // do clearance if needed
|
|
|
TERN_(BLTOUCH_SLOW_MODE, bltouch.deploy()); // Deploy in LOW SPEED MODE on every probe action
|
|
|
TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.deploy()); // Deploy in LOW SPEED MODE on every probe action
|
|
|
do_blocking_move_to_z(last_z - LEVEL_CORNERS_PROBE_TOLERANCE, MMM_TO_MMS(Z_PROBE_FEEDRATE_SLOW)); // Move down to lower tolerance
|
|
|
do_blocking_move_to_z(last_z - LEVEL_CORNERS_PROBE_TOLERANCE, MMM_TO_MMS(Z_PROBE_FEEDRATE_SLOW)); // Move down to lower tolerance
|
|
|
if (TEST(endstops.trigger_state(), Z_MIN_PROBE)) { // check if probe triggered
|
|
|
if (TEST(endstops.trigger_state(), Z_MIN_PROBE)) { // check if probe triggered
|
|
|
endstops.hit_on_purpose(); |
|
|
endstops.hit_on_purpose(); |
|
|
set_current_from_steppers_for_axis(Z_AXIS); |
|
|
set_current_from_steppers_for_axis(Z_AXIS); |
|
|
sync_plan_position(); |
|
|
sync_plan_position(); |
|
|
TERN_(BLTOUCH_SLOW_MODE, bltouch.stow()); // Stow in LOW SPEED MODE on every trigger
|
|
|
TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.stow()); // Stow in LOW SPEED MODE on every trigger
|
|
|
// Triggered outside tolerance range?
|
|
|
// Triggered outside tolerance range?
|
|
|
if (ABS(current_position.z - last_z) > LEVEL_CORNERS_PROBE_TOLERANCE) { |
|
|
if (ABS(current_position.z - last_z) > LEVEL_CORNERS_PROBE_TOLERANCE) { |
|
|
last_z = current_position.z; // Above tolerance. Set a new Z for subsequent corners.
|
|
|
last_z = current_position.z; // Above tolerance. Set a new Z for subsequent corners.
|
|
@ -249,7 +249,7 @@ static void _lcd_level_bed_corners_get_next_position() { |
|
|
} |
|
|
} |
|
|
idle(); |
|
|
idle(); |
|
|
} |
|
|
} |
|
|
TERN_(BLTOUCH_SLOW_MODE, bltouch.stow()); |
|
|
TERN_(BLTOUCH, if (!bltouch.high_speed_mode) bltouch.stow()); |
|
|
ui.goto_screen(_lcd_draw_probing); |
|
|
ui.goto_screen(_lcd_draw_probing); |
|
|
return (probe_triggered); |
|
|
return (probe_triggered); |
|
|
} |
|
|
} |
|
@ -263,13 +263,14 @@ static void _lcd_level_bed_corners_get_next_position() { |
|
|
do { |
|
|
do { |
|
|
ui.refresh(LCDVIEW_REDRAW_NOW); |
|
|
ui.refresh(LCDVIEW_REDRAW_NOW); |
|
|
_lcd_draw_probing(); // update screen with # of good points
|
|
|
_lcd_draw_probing(); // update screen with # of good points
|
|
|
do_blocking_move_to_z(SUM_TERN(BLTOUCH_HS_MODE, current_position.z + LEVEL_CORNERS_Z_HOP, 7)); // clearance
|
|
|
|
|
|
|
|
|
do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP + TERN0(BLTOUCH, bltouch.z_extra_clearance())); // clearance
|
|
|
|
|
|
|
|
|
_lcd_level_bed_corners_get_next_position(); // Select next corner coordinates
|
|
|
_lcd_level_bed_corners_get_next_position(); // Select next corner coordinates
|
|
|
current_position -= probe.offset_xy; // Account for probe offsets
|
|
|
current_position -= probe.offset_xy; // Account for probe offsets
|
|
|
do_blocking_move_to_xy(current_position); // Goto corner
|
|
|
do_blocking_move_to_xy(current_position); // Goto corner
|
|
|
|
|
|
|
|
|
TERN_(BLTOUCH_HS_MODE, bltouch.deploy()); // Deploy in HIGH SPEED MODE
|
|
|
TERN_(BLTOUCH, if (bltouch.high_speed_mode) bltouch.deploy()); // Deploy in HIGH SPEED MODE
|
|
|
if (!_lcd_level_bed_corners_probe()) { // Probe down to tolerance
|
|
|
if (!_lcd_level_bed_corners_probe()) { // Probe down to tolerance
|
|
|
if (_lcd_level_bed_corners_raise()) { // Prompt user to raise bed if needed
|
|
|
if (_lcd_level_bed_corners_raise()) { // Prompt user to raise bed if needed
|
|
|
#if ENABLED(LEVEL_CORNERS_VERIFY_RAISED) // Verify
|
|
|
#if ENABLED(LEVEL_CORNERS_VERIFY_RAISED) // Verify
|
|
@ -290,10 +291,12 @@ static void _lcd_level_bed_corners_get_next_position() { |
|
|
|
|
|
|
|
|
} while (good_points < nr_edge_points); // loop until all points within tolerance
|
|
|
} while (good_points < nr_edge_points); // loop until all points within tolerance
|
|
|
|
|
|
|
|
|
#if ENABLED(BLTOUCH_HS_MODE) |
|
|
#if ENABLED(BLTOUCH) |
|
|
|
|
|
if (bltouch.high_speed_mode) { |
|
|
// In HIGH SPEED MODE do clearance and stow at the very end
|
|
|
// In HIGH SPEED MODE do clearance and stow at the very end
|
|
|
do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP); |
|
|
do_blocking_move_to_z(current_position.z + LEVEL_CORNERS_Z_HOP); |
|
|
bltouch.stow(); |
|
|
bltouch.stow(); |
|
|
|
|
|
} |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
ui.goto_screen(_lcd_draw_level_prompt); // prompt for bed leveling
|
|
|
ui.goto_screen(_lcd_draw_level_prompt); // prompt for bed leveling
|
|
|