Browse Source

Merge pull request #4235 from thinkyhead/rc_revert_quickhome_test

Fix quick homing, tweak MIN_Z_HEIGHT_FOR_HOMING
Scott Lahteine 9 years ago
parent
commit
9f42b1a075
1 changed files with 26 additions and 24 deletions
  1. 26
    24
      Marlin/Marlin_main.cpp

+ 26
- 24
Marlin/Marlin_main.cpp View File

@@ -2914,41 +2914,43 @@ inline void gcode_G28() {
2914 2914
 
2915 2915
     #elif defined(MIN_Z_HEIGHT_FOR_HOMING) && MIN_Z_HEIGHT_FOR_HOMING > 0
2916 2916
 
2917
-      // Raise Z before homing, if specified
2918
-      destination[Z_AXIS] = (current_position[Z_AXIS] += MIN_Z_HEIGHT_FOR_HOMING);
2919
-      #if ENABLED(DEBUG_LEVELING_FEATURE)
2920
-        if (DEBUGGING(LEVELING)) {
2921
-          SERIAL_ECHOPAIR("Raise Z (before homing) to ", destination[Z_AXIS]);
2922
-          SERIAL_EOL;
2923
-        }
2924
-      #endif
2917
+      // Raise Z before homing X or Y, if specified
2918
+      if (home_all_axis || homeX || homeY) {
2919
+        float z_dest = home_offset[Z_AXIS] + MIN_Z_HEIGHT_FOR_HOMING;
2920
+        if (z_dest > current_position[Z_AXIS]) {
2925 2921
 
2926
-      feedrate = homing_feedrate[Z_AXIS];
2922
+          #if ENABLED(DEBUG_LEVELING_FEATURE)
2923
+            if (DEBUGGING(LEVELING)) {
2924
+              SERIAL_ECHOPAIR("Raise Z (before homing) to ", z_dest);
2925
+              SERIAL_EOL;
2926
+            }
2927
+          #endif
2927 2928
 
2928
-      #if HAS_BED_PROBE
2929
-        do_blocking_move_to_z(destination[Z_AXIS]);
2930
-      #else
2931
-        line_to_z(destination[Z_AXIS]);
2932
-        stepper.synchronize();
2933
-      #endif
2929
+          feedrate = homing_feedrate[Z_AXIS];
2934 2930
 
2935
-    #endif // MIN_Z_HEIGHT_FOR_HOMING
2931
+          #if HAS_BED_PROBE
2932
+            do_blocking_move_to_z(z_dest);
2933
+          #else
2934
+            line_to_z(z_dest);
2935
+            stepper.synchronize();
2936
+          #endif
2936 2937
 
2937
-    #if ENABLED(QUICK_HOME)
2938
+          destination[Z_AXIS] = current_position[Z_AXIS] = z_dest;
2939
+        }
2940
+      }
2938 2941
 
2939
-      bool quick_homed = home_all_axis || (homeX && homeY);
2940
-      if (quick_homed) quick_home_xy();
2942
+    #endif // MIN_Z_HEIGHT_FOR_HOMING
2941 2943
 
2942
-    #else
2944
+    #if ENABLED(QUICK_HOME)
2943 2945
 
2944
-      const bool quick_homed = false;
2946
+      if (home_all_axis || (homeX && homeY)) quick_home_xy();
2945 2947
 
2946 2948
     #endif
2947 2949
 
2948 2950
     #if ENABLED(HOME_Y_BEFORE_X)
2949 2951
 
2950 2952
       // Home Y
2951
-      if (!quick_homed && (home_all_axis || homeY)) {
2953
+      if (home_all_axis || homeY) {
2952 2954
         HOMEAXIS(Y);
2953 2955
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2954 2956
           if (DEBUGGING(LEVELING)) DEBUG_POS("> homeY", current_position);
@@ -2958,7 +2960,7 @@ inline void gcode_G28() {
2958 2960
     #endif
2959 2961
 
2960 2962
     // Home X
2961
-    if (!quick_homed && (home_all_axis || homeX)) {
2963
+    if (home_all_axis || homeX) {
2962 2964
       #if ENABLED(DUAL_X_CARRIAGE)
2963 2965
         int tmp_extruder = active_extruder;
2964 2966
         extruder_duplication_enabled = false;
@@ -2981,7 +2983,7 @@ inline void gcode_G28() {
2981 2983
 
2982 2984
     #if DISABLED(HOME_Y_BEFORE_X)
2983 2985
       // Home Y
2984
-      if (!quick_homed && (home_all_axis || homeY)) {
2986
+      if (home_all_axis || homeY) {
2985 2987
         HOMEAXIS(Y);
2986 2988
         #if ENABLED(DEBUG_LEVELING_FEATURE)
2987 2989
           if (DEBUGGING(LEVELING)) DEBUG_POS("> homeY", current_position);

Loading…
Cancel
Save