Selaa lähdekoodia

Manual Bed Leveling: Goto previous Z height at each probe point

Wilfried Chauveau 8 vuotta sitten
vanhempi
commit
894608f8a3
2 muutettua tiedostoa jossa 5 lisäystä ja 4 poistoa
  1. 3
    3
      Marlin/Marlin_main.cpp
  2. 2
    1
      Marlin/ultralcd.cpp

+ 3
- 3
Marlin/Marlin_main.cpp Näytä tiedosto

3998
 
3998
 
3999
   inline void _manual_goto_xy(const float &x, const float &y) {
3999
   inline void _manual_goto_xy(const float &x, const float &y) {
4000
     const float old_feedrate_mm_s = feedrate_mm_s;
4000
     const float old_feedrate_mm_s = feedrate_mm_s;
4001
-
4002
     #if MANUAL_PROBE_HEIGHT > 0
4001
     #if MANUAL_PROBE_HEIGHT > 0
4002
+      const float prev_z = current_position[Z_AXIS];
4003
       feedrate_mm_s = homing_feedrate(Z_AXIS);
4003
       feedrate_mm_s = homing_feedrate(Z_AXIS);
4004
-      current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT;
4004
+      current_position[Z_AXIS] = LOGICAL_Z_POSITION(MANUAL_PROBE_HEIGHT);
4005
       line_to_current_position();
4005
       line_to_current_position();
4006
     #endif
4006
     #endif
4007
 
4007
 
4012
 
4012
 
4013
     #if MANUAL_PROBE_HEIGHT > 0
4013
     #if MANUAL_PROBE_HEIGHT > 0
4014
       feedrate_mm_s = homing_feedrate(Z_AXIS);
4014
       feedrate_mm_s = homing_feedrate(Z_AXIS);
4015
-      current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS); // just slightly over the bed
4015
+      current_position[Z_AXIS] = prev_z; // move back to the previous Z.
4016
       line_to_current_position();
4016
       line_to_current_position();
4017
     #endif
4017
     #endif
4018
 
4018
 

+ 2
- 1
Marlin/ultralcd.cpp Näytä tiedosto

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…
Peruuta
Tallenna