Browse Source

Tweak MBL move to bed code

Scott Lahteine 7 years ago
parent
commit
bb7064cc30
1 changed files with 4 additions and 10 deletions
  1. 4
    10
      Marlin/src/gcode/bedlevel/mbl/G29.cpp

+ 4
- 10
Marlin/src/gcode/bedlevel/mbl/G29.cpp View File

@@ -104,6 +104,8 @@ void GcodeSuite::G29() {
104 104
           // For the initial G29 S2 save software endstop state
105 105
           enable_soft_endstops = soft_endstops_enabled;
106 106
         #endif
107
+        // Move close to the bed before the first point
108
+        do_blocking_move_to_z(Z_MIN_POS);
107 109
       }
108 110
       else {
109 111
         // For G29 S2 after adjusting Z.
@@ -114,22 +116,14 @@ void GcodeSuite::G29() {
114 116
       }
115 117
       // If there's another point to sample, move there with optional lift.
116 118
       if (mbl_probe_index < GRID_MAX_POINTS) {
117
-        mbl.zigzag(mbl_probe_index, px, py);
118
-        _manual_goto_xy(mbl.index_to_xpos[px], mbl.index_to_ypos[py]);
119
-
120 119
         #if HAS_SOFTWARE_ENDSTOPS
121 120
           // Disable software endstops to allow manual adjustment
122 121
           // If G29 is not completed, they will not be re-enabled
123 122
           soft_endstops_enabled = false;
124 123
         #endif
125 124
 
126
-        // Move close to the bed for the first point
127
-        if (!mbl_probe_index) {
128
-          current_position[Z_AXIS] = Z_MIN_POS;
129
-          buffer_line_to_current_position();
130
-        }
131
-
132
-        mbl_probe_index++;
125
+        mbl.zigzag(mbl_probe_index++, px, py);
126
+        _manual_goto_xy(mbl.index_to_xpos[px], mbl.index_to_ypos[py]);
133 127
       }
134 128
       else {
135 129
         // One last "return to the bed" (as originally coded) at completion

Loading…
Cancel
Save