瀏覽代碼

Patch the end of G29 to sync plan position

Scott Lahteine 8 年之前
父節點
當前提交
c8c57e59fc
共有 1 個文件被更改,包括 6 次插入8 次删除
  1. 6
    8
      Marlin/Marlin_main.cpp

+ 6
- 8
Marlin/Marlin_main.cpp 查看文件

3710
     if (!dryrun) {
3710
     if (!dryrun) {
3711
       // Re-orient the current position without leveling
3711
       // Re-orient the current position without leveling
3712
       // based on where the steppers are positioned.
3712
       // based on where the steppers are positioned.
3713
-      get_cartesian_from_steppers();
3714
-      memcpy(current_position, cartes, sizeof(cartes));
3713
+      set_current_from_steppers_for_axis(ALL_AXES);
3715
 
3714
 
3716
       // Sync the planner to where the steppers stopped
3715
       // Sync the planner to where the steppers stopped
3717
       planner.sync_from_steppers();
3716
       planner.sync_from_steppers();
4051
         #if ENABLED(DEBUG_LEVELING_FEATURE)
4050
         #if ENABLED(DEBUG_LEVELING_FEATURE)
4052
           if (DEBUGGING(LEVELING)) DEBUG_POS("G29 corrected XYZ", current_position);
4051
           if (DEBUGGING(LEVELING)) DEBUG_POS("G29 corrected XYZ", current_position);
4053
         #endif
4052
         #endif
4054
-
4055
-        SYNC_PLAN_POSITION_KINEMATIC();
4056
-        abl_should_enable = true;
4057
       }
4053
       }
4058
 
4054
 
4059
     #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
4055
     #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
4063
           if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("G29 uncorrected Z:", current_position[Z_AXIS]);
4059
           if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR("G29 uncorrected Z:", current_position[Z_AXIS]);
4064
         #endif
4060
         #endif
4065
 
4061
 
4062
+        // Unapply the offset because it is going to be immediately applied
4063
+        // and cause compensation movement in Z
4066
         current_position[Z_AXIS] -= bilinear_z_offset(current_position);
4064
         current_position[Z_AXIS] -= bilinear_z_offset(current_position);
4067
 
4065
 
4068
         #if ENABLED(DEBUG_LEVELING_FEATURE)
4066
         #if ENABLED(DEBUG_LEVELING_FEATURE)
4069
           if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR(" corrected Z:", current_position[Z_AXIS]);
4067
           if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPAIR(" corrected Z:", current_position[Z_AXIS]);
4070
         #endif
4068
         #endif
4071
-
4072
-        SYNC_PLAN_POSITION_KINEMATIC();
4073
-        abl_should_enable = true;
4074
       }
4069
       }
4075
 
4070
 
4076
     #endif // ABL_PLANAR
4071
     #endif // ABL_PLANAR
4093
 
4088
 
4094
     // Auto Bed Leveling is complete! Enable if possible.
4089
     // Auto Bed Leveling is complete! Enable if possible.
4095
     planner.abl_enabled = dryrun ? abl_should_enable : true;
4090
     planner.abl_enabled = dryrun ? abl_should_enable : true;
4091
+
4092
+    if (planner.abl_enabled)
4093
+      SYNC_PLAN_POSITION_KINEMATIC();
4096
   }
4094
   }
4097
 
4095
 
4098
 #endif // HAS_ABL
4096
 #endif // HAS_ABL

Loading…
取消
儲存