Browse Source

Add R parameter to G28 to specify pre-raise

Scott Lahteine 7 years ago
parent
commit
7dcd0a1cff
1 changed files with 10 additions and 7 deletions
  1. 10
    7
      Marlin/src/gcode/calibrate/G28.cpp

+ 10
- 7
Marlin/src/gcode/calibrate/G28.cpp View File

152
  *  None  Home to all axes with no parameters.
152
  *  None  Home to all axes with no parameters.
153
  *        With QUICK_HOME enabled XY will home together, then Z.
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
  *  X   Home to the X endstop
159
  *  X   Home to the X endstop
158
  *  Y   Home to the Y endstop
160
  *  Y   Home to the Y endstop
226
 
228
 
227
     #endif
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
     if (z_homing_height && (home_all || homeX || homeY)) {
238
     if (z_homing_height && (home_all || homeX || homeY)) {
236
       // Raise Z before homing any other axes and z is not already high enough (never lower z)
239
       // Raise Z before homing any other axes and z is not already high enough (never lower z)
237
       destination[Z_AXIS] = z_homing_height;
240
       destination[Z_AXIS] = z_homing_height;

Loading…
Cancel
Save