소스 검색

Add R parameter to G28 to specify pre-raise

Scott Lahteine 7 년 전
부모
커밋
7dcd0a1cff
1개의 변경된 파일10개의 추가작업 그리고 7개의 파일을 삭제
  1. 10
    7
      Marlin/src/gcode/calibrate/G28.cpp

+ 10
- 7
Marlin/src/gcode/calibrate/G28.cpp 파일 보기

@@ -152,7 +152,9 @@
152 152
  *  None  Home to all axes with no parameters.
153 153
  *        With QUICK_HOME enabled XY will home together, then Z.
154 154
  *
155
- * Cartesian parameters
155
+ *  Rn  Raise by n mm/inches before homing
156
+ *
157
+ * Cartesian/SCARA parameters
156 158
  *
157 159
  *  X   Home to the X endstop
158 160
  *  Y   Home to the Y endstop
@@ -226,12 +228,13 @@ void GcodeSuite::G28(const bool always_home_all) {
226 228
 
227 229
     #endif
228 230
 
229
-    #if ENABLED(UNKNOWN_Z_NO_RAISE)
230
-      const float z_homing_height = axis_known_position[Z_AXIS] ? Z_HOMING_HEIGHT : 0;
231
-    #else
232
-      constexpr float z_homing_height = Z_HOMING_HEIGHT;
233
-    #endif
234
-
231
+    const float z_homing_height = (
232
+      #if ENABLED(UNKNOWN_Z_NO_RAISE)
233
+        !axis_known_position[Z_AXIS] ? 0 :
234
+      #endif
235
+          (parser.seenval('R') ? parser.value_linear_units() : Z_HOMING_HEIGHT)
236
+    );
237
+ 
235 238
     if (z_homing_height && (home_all || homeX || homeY)) {
236 239
       // Raise Z before homing any other axes and z is not already high enough (never lower z)
237 240
       destination[Z_AXIS] = z_homing_height;

Loading…
취소
저장