Просмотр исходного кода

Move to Z=0 for G28 when using Manual Bed Leveling

copy of 406992f9dd
Edward Patel 9 лет назад
Родитель
Сommit
14afe1a017
2 измененных файлов: 9 добавлений и 9 удалений
  1. 8
    9
      Marlin/Marlin_main.cpp
  2. 1
    0
      Marlin/ultralcd.cpp

+ 8
- 9
Marlin/Marlin_main.cpp Просмотреть файл

@@ -2381,7 +2381,7 @@ inline void gcode_G28() {
2381 2381
     #endif
2382 2382
   #endif
2383 2383
 
2384
-  // For manual bed leveling deactivate the matrix temporarily
2384
+  // For mesh bed leveling deactivate the mesh calculations, will be turned on again when homing all axis
2385 2385
   #if ENABLED(MESH_BED_LEVELING)
2386 2386
     uint8_t mbl_was_active = mbl.active;
2387 2387
     mbl.active = 0;
@@ -2680,18 +2680,17 @@ inline void gcode_G28() {
2680 2680
     enable_endstops(false);
2681 2681
   #endif
2682 2682
 
2683
-  // For manual leveling move back to 0,0
2683
+  // For mesh leveling move back to Z=0
2684 2684
   #if ENABLED(MESH_BED_LEVELING)
2685
-    if (mbl_was_active) {
2686
-      current_position[X_AXIS] = mbl.get_x(0);
2687
-      current_position[Y_AXIS] = mbl.get_y(0);
2688
-      set_destination_to_current();
2689
-      feedrate = homing_feedrate[X_AXIS];
2690
-      line_to_destination();
2691
-      st_synchronize();
2685
+    if (mbl_was_active && home_all_axis) {
2692 2686
       current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2693 2687
       sync_plan_position();
2694 2688
       mbl.active = 1;
2689
+      current_position[Z_AXIS] = 0.0;
2690
+      set_destination_to_current();
2691
+      feedrate = homing_feedrate[Z_AXIS];
2692
+      line_to_destination();
2693
+      st_synchronize();
2695 2694
       #if ENABLED(DEBUG_LEVELING_FEATURE)
2696 2695
         if (marlin_debug_flags & DEBUG_LEVELING) {
2697 2696
           print_xyz("mbl_was_active > current_position", current_position);

+ 1
- 0
Marlin/ultralcd.cpp Просмотреть файл

@@ -2434,6 +2434,7 @@ char* ftostr52(const float& x) {
2434 2434
         if (_lcd_level_bed_position == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) {
2435 2435
           current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2436 2436
           line_to_current(Z_AXIS);
2437
+          st_synchronize();
2437 2438
           mbl.active = 1;
2438 2439
           enqueue_and_echo_commands_P(PSTR("G28"));
2439 2440
           lcd_return_to_status();

Загрузка…
Отмена
Сохранить