Tweak MBL move to bed code

This commit is contained in:
Scott Lahteine 2018-04-12 22:36:38 -05:00
parent cc6d41e1d3
commit bb7064cc30

View file

@ -104,6 +104,8 @@ void GcodeSuite::G29() {
// For the initial G29 S2 save software endstop state // For the initial G29 S2 save software endstop state
enable_soft_endstops = soft_endstops_enabled; enable_soft_endstops = soft_endstops_enabled;
#endif #endif
// Move close to the bed before the first point
do_blocking_move_to_z(Z_MIN_POS);
} }
else { else {
// For G29 S2 after adjusting Z. // For G29 S2 after adjusting Z.
@ -114,22 +116,14 @@ void GcodeSuite::G29() {
} }
// If there's another point to sample, move there with optional lift. // If there's another point to sample, move there with optional lift.
if (mbl_probe_index < GRID_MAX_POINTS) { if (mbl_probe_index < GRID_MAX_POINTS) {
mbl.zigzag(mbl_probe_index, px, py);
_manual_goto_xy(mbl.index_to_xpos[px], mbl.index_to_ypos[py]);
#if HAS_SOFTWARE_ENDSTOPS #if HAS_SOFTWARE_ENDSTOPS
// Disable software endstops to allow manual adjustment // Disable software endstops to allow manual adjustment
// If G29 is not completed, they will not be re-enabled // If G29 is not completed, they will not be re-enabled
soft_endstops_enabled = false; soft_endstops_enabled = false;
#endif #endif
// Move close to the bed for the first point mbl.zigzag(mbl_probe_index++, px, py);
if (!mbl_probe_index) { _manual_goto_xy(mbl.index_to_xpos[px], mbl.index_to_ypos[py]);
current_position[Z_AXIS] = Z_MIN_POS;
buffer_line_to_current_position();
}
mbl_probe_index++;
} }
else { else {
// One last "return to the bed" (as originally coded) at completion // One last "return to the bed" (as originally coded) at completion