소스 검색

Add option to configure G28 all axis resting position for MBL

Edward Patel 9 년 전
부모
커밋
c7d90dc5ec
2개의 변경된 파일10개의 추가작업 그리고 6개의 파일을 삭제
  1. 2
    0
      Marlin/Configuration.h
  2. 8
    6
      Marlin/Marlin_main.cpp

+ 2
- 0
Marlin/Configuration.h 파일 보기

@@ -525,6 +525,8 @@ const bool Z_MIN_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the l
525 525
   #define MESH_NUM_Y_POINTS 3
526 526
   #define MESH_HOME_SEARCH_Z 4  // Z after Home, bed somewhere below but above 0.0.
527 527
 
528
+  //#define MESH_G28_REST_ORIGIN // Enable to make 'G28' all axis to rest at origin [0,0,0]
529
+
528 530
   //#define MANUAL_BED_LEVELING  // Add display menu option for bed leveling.
529 531
 
530 532
   #if ENABLED(MANUAL_BED_LEVELING)

+ 8
- 6
Marlin/Marlin_main.cpp 파일 보기

@@ -2918,17 +2918,19 @@ inline void gcode_G28() {
2918 2918
     #endif
2919 2919
   #endif
2920 2920
 
2921
-  // For mesh leveling move back to Z=0
2921
+  // Enable mesh leveling again
2922 2922
   #if ENABLED(MESH_BED_LEVELING)
2923 2923
     if (mbl_was_active && home_all_axis) {
2924 2924
       current_position[Z_AXIS] = MESH_HOME_SEARCH_Z;
2925 2925
       sync_plan_position();
2926 2926
       mbl.active = 1;
2927
-      current_position[Z_AXIS] = 0.0;
2928
-      set_destination_to_current();
2929
-      feedrate = homing_feedrate[Z_AXIS];
2930
-      line_to_destination();
2931
-      stepper.synchronize();
2927
+      #if ENABLED(MESH_G28_REST_ORIGIN)
2928
+        current_position[Z_AXIS] = 0.0;
2929
+        set_destination_to_current();
2930
+        feedrate = homing_feedrate[Z_AXIS];
2931
+        line_to_destination();
2932
+        stepper.synchronize();
2933
+      #endif
2932 2934
       #if ENABLED(DEBUG_LEVELING_FEATURE)
2933 2935
         if (DEBUGGING(LEVELING)) DEBUG_POS("mbl_was_active", current_position);
2934 2936
       #endif

Loading…
취소
저장