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
 
4077
 
4078
   inline void _manual_goto_xy(const float &x, const float &y) {
4078
   inline void _manual_goto_xy(const float &x, const float &y) {
4079
     const float old_feedrate_mm_s = feedrate_mm_s;
4079
     const float old_feedrate_mm_s = feedrate_mm_s;
4080
-
4081
     #if MANUAL_PROBE_HEIGHT > 0
4080
     #if MANUAL_PROBE_HEIGHT > 0
4081
+      const float prev_z = current_position[Z_AXIS];
4082
       feedrate_mm_s = homing_feedrate(Z_AXIS);
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
       line_to_current_position();
4084
       line_to_current_position();
4085
     #endif
4085
     #endif
4086
 
4086
 
4091
 
4091
 
4092
     #if MANUAL_PROBE_HEIGHT > 0
4092
     #if MANUAL_PROBE_HEIGHT > 0
4093
       feedrate_mm_s = homing_feedrate(Z_AXIS);
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
       line_to_current_position();
4095
       line_to_current_position();
4096
     #endif
4096
     #endif
4097
 
4097
 

+ 2
- 1
Marlin/ultralcd.cpp View File

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

Loading…
Cancel
Save