Browse Source

Merge pull request #7379 from thinkyhead/bf_manual_bed_level_floor

Manual Bed Leveling: Goto previous Z height at each probe point
Scott Lahteine 7 years ago
parent
commit
08b0456d91
2 changed files with 5 additions and 4 deletions
  1. 3
    3
      Marlin/Marlin_main.cpp
  2. 2
    1
      Marlin/ultralcd.cpp

+ 3
- 3
Marlin/Marlin_main.cpp View File

@@ -4077,10 +4077,10 @@ void home_all_axes() { gcode_G28(true); }
4077 4077
 
4078 4078
   inline void _manual_goto_xy(const float &x, const float &y) {
4079 4079
     const float old_feedrate_mm_s = feedrate_mm_s;
4080
-
4081 4080
     #if MANUAL_PROBE_HEIGHT > 0
4081
+      const float prev_z = current_position[Z_AXIS];
4082 4082
       feedrate_mm_s = homing_feedrate(Z_AXIS);
4083
-      current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT;
4083
+      current_position[Z_AXIS] = LOGICAL_Z_POSITION(MANUAL_PROBE_HEIGHT);
4084 4084
       line_to_current_position();
4085 4085
     #endif
4086 4086
 
@@ -4091,7 +4091,7 @@ void home_all_axes() { gcode_G28(true); }
4091 4091
 
4092 4092
     #if MANUAL_PROBE_HEIGHT > 0
4093 4093
       feedrate_mm_s = homing_feedrate(Z_AXIS);
4094
-      current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS); // just slightly over the bed
4094
+      current_position[Z_AXIS] = prev_z; // move back to the previous Z.
4095 4095
       line_to_current_position();
4096 4096
     #endif
4097 4097
 

+ 2
- 1
Marlin/ultralcd.cpp View File

@@ -1586,13 +1586,14 @@ void kill_screen(const char* lcd_msg) {
1586 1586
       // Utility to go to the next mesh point
1587 1587
       inline void _manual_probe_goto_xy(float x, float y) {
1588 1588
         #if MANUAL_PROBE_HEIGHT > 0
1589
+          const float prev_z = current_position[Z_AXIS];
1589 1590
           line_to_z(LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT);
1590 1591
         #endif
1591 1592
         current_position[X_AXIS] = LOGICAL_X_POSITION(x);
1592 1593
         current_position[Y_AXIS] = LOGICAL_Y_POSITION(y);
1593 1594
         planner.buffer_line_kinematic(current_position, MMM_TO_MMS(XY_PROBE_SPEED), active_extruder);
1594 1595
         #if MANUAL_PROBE_HEIGHT > 0
1595
-          line_to_z(LOGICAL_Z_POSITION(Z_MIN_POS));
1596
+          line_to_z(prev_z);
1596 1597
         #endif
1597 1598
         lcd_synchronize();
1598 1599
       }

Loading…
Cancel
Save