|
|
@ -2429,7 +2429,7 @@ static void clean_up_after_endstop_or_probe_move() { |
|
|
|
ubl.state.active = enable; |
|
|
|
//set_current_from_steppers_for_axis(Z_AXIS);
|
|
|
|
|
|
|
|
#elif HAS_ABL |
|
|
|
#else |
|
|
|
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_BILINEAR) |
|
|
|
const bool can_change = (!enable || (bilinear_grid_spacing[0] && bilinear_grid_spacing[1])); |
|
|
@ -3750,9 +3750,6 @@ inline void gcode_G28() { |
|
|
|
|
|
|
|
// Disable the leveling matrix before homing
|
|
|
|
#if HAS_LEVELING |
|
|
|
#if ENABLED(AUTO_BED_LEVELING_UBL) |
|
|
|
const bool bed_leveling_state_at_entry = ubl.state.active; |
|
|
|
#endif |
|
|
|
set_bed_leveling_enabled(false); |
|
|
|
#endif |
|
|
|
|
|
|
@ -3895,25 +3892,6 @@ inline void gcode_G28() { |
|
|
|
do_blocking_move_to_z(delta_clip_start_height); |
|
|
|
#endif |
|
|
|
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_UBL) |
|
|
|
set_bed_leveling_enabled(bed_leveling_state_at_entry); |
|
|
|
#endif |
|
|
|
|
|
|
|
// Enable mesh leveling again
|
|
|
|
#if ENABLED(MESH_BED_LEVELING) |
|
|
|
if (mbl.reactivate()) { |
|
|
|
set_bed_leveling_enabled(true); |
|
|
|
if (home_all_axis || (axis_homed[X_AXIS] && axis_homed[Y_AXIS] && homeZ)) { |
|
|
|
#if ENABLED(MESH_G28_REST_ORIGIN) |
|
|
|
current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS); |
|
|
|
set_destination_to_current(); |
|
|
|
line_to_destination(homing_feedrate_mm_s[Z_AXIS]); |
|
|
|
stepper.synchronize(); |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
clean_up_after_endstop_or_probe_move(); |
|
|
|
|
|
|
|
// Restore the active tool after homing
|
|
|
@ -3982,6 +3960,18 @@ void home_all_axes() { gcode_G28(); } |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
void mesh_probing_done() { |
|
|
|
mbl.set_has_mesh(true); |
|
|
|
home_all_axes(); |
|
|
|
set_bed_leveling_enabled(true); |
|
|
|
#if ENABLED(MESH_G28_REST_ORIGIN) |
|
|
|
current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS); |
|
|
|
set_destination_to_current(); |
|
|
|
line_to_destination(homing_feedrate_mm_s[Z_AXIS]); |
|
|
|
stepper.synchronize(); |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
/**
|
|
|
|
* G29: Mesh-based Z probe, probes a grid and produces a |
|
|
|
* mesh to compensate for variable bed height |
|
|
@ -4072,14 +4062,12 @@ void home_all_axes() { gcode_G28(); } |
|
|
|
line_to_current_position(); |
|
|
|
stepper.synchronize(); |
|
|
|
|
|
|
|
// After recording the last point, activate the mbl and home
|
|
|
|
SERIAL_PROTOCOLLNPGM("Mesh probing done."); |
|
|
|
// After recording the last point, activate home and activate
|
|
|
|
mbl_probe_index = -1; |
|
|
|
mbl.set_has_mesh(true); |
|
|
|
mbl.set_reactivate(true); |
|
|
|
enqueue_and_echo_commands_P(PSTR("G28")); |
|
|
|
SERIAL_PROTOCOLLNPGM("Mesh probing done."); |
|
|
|
BUZZ(100, 659); |
|
|
|
BUZZ(100, 698); |
|
|
|
mesh_probing_done(); |
|
|
|
} |
|
|
|
break; |
|
|
|
|
|
|
@ -5015,7 +5003,7 @@ void home_all_axes() { gcode_G28(); } |
|
|
|
SYNC_PLAN_POSITION_KINEMATIC(); |
|
|
|
} |
|
|
|
|
|
|
|
#endif // HAS_ABL && DISABLED(AUTO_BED_LEVELING_UBL)
|
|
|
|
#endif // HAS_ABL && !AUTO_BED_LEVELING_UBL
|
|
|
|
|
|
|
|
#if HAS_BED_PROBE |
|
|
|
|
|
|
@ -6200,10 +6188,6 @@ inline void gcode_M42() { |
|
|
|
* regenerated. |
|
|
|
*/ |
|
|
|
inline void gcode_M48() { |
|
|
|
#if ENABLED(AUTO_BED_LEVELING_UBL) |
|
|
|
bool bed_leveling_state_at_entry=0; |
|
|
|
bed_leveling_state_at_entry = ubl.state.active; |
|
|
|
#endif |
|
|
|
|
|
|
|
if (axis_unhomed_error(true, true, true)) return; |
|
|
|
|
|
|
@ -6222,8 +6206,8 @@ inline void gcode_M42() { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
float X_current = current_position[X_AXIS], |
|
|
|
Y_current = current_position[Y_AXIS]; |
|
|
|
float X_current = current_position[X_AXIS], |
|
|
|
Y_current = current_position[Y_AXIS]; |
|
|
|
|
|
|
|
bool stow_probe_after_each = code_seen('E'); |
|
|
|
|
|
|
@ -6269,8 +6253,17 @@ inline void gcode_M42() { |
|
|
|
SERIAL_PROTOCOLLNPGM("Positioning the probe..."); |
|
|
|
|
|
|
|
// Disable bed level correction in M48 because we want the raw data when we probe
|
|
|
|
#if HAS_ABL |
|
|
|
const bool abl_was_enabled = planner.abl_enabled; |
|
|
|
|
|
|
|
#if HAS_LEVELING |
|
|
|
const bool was_enabled = |
|
|
|
#if ENABLED(AUTO_BED_LEVELING_UBL) |
|
|
|
ubl.state.active |
|
|
|
#elif ENABLED(MESH_BED_LEVELING) |
|
|
|
mbl.active() |
|
|
|
#else |
|
|
|
planner.abl_enabled |
|
|
|
#endif |
|
|
|
; |
|
|
|
set_bed_leveling_enabled(false); |
|
|
|
#endif |
|
|
|
|
|
|
@ -6422,14 +6415,9 @@ inline void gcode_M42() { |
|
|
|
|
|
|
|
clean_up_after_endstop_or_probe_move(); |
|
|
|
|
|
|
|
// Re-enable bed level correction if it has been on
|
|
|
|
// Re-enable bed level correction if it had been on
|
|
|
|
#if HAS_ABL |
|
|
|
set_bed_leveling_enabled(abl_was_enabled); |
|
|
|
#endif |
|
|
|
|
|
|
|
#if ENABLED(AUTO_BED_LEVELING_UBL) |
|
|
|
set_bed_leveling_enabled(bed_leveling_state_at_entry); |
|
|
|
ubl.state.active = bed_leveling_state_at_entry; |
|
|
|
set_bed_leveling_enabled(was_enabled); |
|
|
|
#endif |
|
|
|
|
|
|
|
report_current_position(); |
|
|
|