Bladeren bron

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

copy of 406992f9dd
Edward Patel 9 jaren geleden
bovenliggende
commit
14afe1a017
2 gewijzigde bestanden met toevoegingen van 9 en 9 verwijderingen
  1. 8
    9
      Marlin/Marlin_main.cpp
  2. 1
    0
      Marlin/ultralcd.cpp

+ 8
- 9
Marlin/Marlin_main.cpp Bestand weergeven

2381
     #endif
2381
     #endif
2382
   #endif
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
   #if ENABLED(MESH_BED_LEVELING)
2385
   #if ENABLED(MESH_BED_LEVELING)
2386
     uint8_t mbl_was_active = mbl.active;
2386
     uint8_t mbl_was_active = mbl.active;
2387
     mbl.active = 0;
2387
     mbl.active = 0;
2680
     enable_endstops(false);
2680
     enable_endstops(false);
2681
   #endif
2681
   #endif
2682
 
2682
 
2683
-  // For manual leveling move back to 0,0
2683
+  // For mesh leveling move back to Z=0
2684
   #if ENABLED(MESH_BED_LEVELING)
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
       current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2686
       current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2693
       sync_plan_position();
2687
       sync_plan_position();
2694
       mbl.active = 1;
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
       #if ENABLED(DEBUG_LEVELING_FEATURE)
2694
       #if ENABLED(DEBUG_LEVELING_FEATURE)
2696
         if (marlin_debug_flags & DEBUG_LEVELING) {
2695
         if (marlin_debug_flags & DEBUG_LEVELING) {
2697
           print_xyz("mbl_was_active > current_position", current_position);
2696
           print_xyz("mbl_was_active > current_position", current_position);

+ 1
- 0
Marlin/ultralcd.cpp Bestand weergeven

2434
         if (_lcd_level_bed_position == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) {
2434
         if (_lcd_level_bed_position == (MESH_NUM_X_POINTS) * (MESH_NUM_Y_POINTS)) {
2435
           current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2435
           current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2436
           line_to_current(Z_AXIS);
2436
           line_to_current(Z_AXIS);
2437
+          st_synchronize();
2437
           mbl.active = 1;
2438
           mbl.active = 1;
2438
           enqueue_and_echo_commands_P(PSTR("G28"));
2439
           enqueue_and_echo_commands_P(PSTR("G28"));
2439
           lcd_return_to_status();
2440
           lcd_return_to_status();

Laden…
Annuleren
Opslaan