Bladeren bron

Add Z_AFTER_HOMING to raise Z more in G28 (#16755)

Scott Lahteine 4 jaren geleden
bovenliggende
commit
72b4d91d2e
No account linked to committer's email address
3 gewijzigde bestanden met toevoegingen van 18 en 9 verwijderingen
  1. 6
    4
      Marlin/Configuration.h
  2. 9
    1
      Marlin/src/gcode/calibrate/G28.cpp
  3. 3
    4
      Marlin/src/module/motion.cpp

+ 6
- 4
Marlin/Configuration.h Bestand weergeven

@@ -1065,12 +1065,14 @@
1065 1065
 
1066 1066
 // @section homing
1067 1067
 
1068
-//#define NO_MOTION_BEFORE_HOMING  // Inhibit movement until all axes have been homed
1068
+//#define NO_MOTION_BEFORE_HOMING // Inhibit movement until all axes have been homed
1069 1069
 
1070
-//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off.
1070
+//#define UNKNOWN_Z_NO_RAISE      // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off.
1071 1071
 
1072
-//#define Z_HOMING_HEIGHT 4  // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ...
1073
-                             // Be sure you have this distance over your Z_MAX_POS in case.
1072
+//#define Z_HOMING_HEIGHT  4      // (mm) Minimal Z height before homing (G28) for Z clearance above the bed, clamps, ...
1073
+                                  // Be sure to have this much clearance over your Z_MAX_POS to prevent grinding.
1074
+
1075
+//#define Z_AFTER_HOMING  10      // (mm) Height to move to after homing Z
1074 1076
 
1075 1077
 // Direction of endstops when homing; 1=MAX, -1=MIN
1076 1078
 // :[-1,1]

+ 9
- 1
Marlin/src/gcode/calibrate/G28.cpp Bestand weergeven

@@ -405,6 +405,7 @@ void GcodeSuite::G28(const bool always_home_all) {
405 405
 
406 406
     // Home Z last if homing towards the bed
407 407
     #if Z_HOME_DIR < 0
408
+
408 409
       if (doZ) {
409 410
         #if ENABLED(BLTOUCH)
410 411
           bltouch.init();
@@ -416,10 +417,17 @@ void GcodeSuite::G28(const bool always_home_all) {
416 417
         #endif
417 418
 
418 419
         #if HOMING_Z_WITH_PROBE && defined(Z_AFTER_PROBING)
419
-          probe.move_z_after_probing();
420
+          #if Z_AFTER_HOMING > Z_AFTER_PROBING
421
+            do_blocking_move_to_z(Z_AFTER_HOMING);
422
+          #else
423
+            probe.move_z_after_probing();
424
+          #endif
425
+        #elif defined(Z_AFTER_HOMING)
426
+          do_blocking_move_to_z(Z_AFTER_HOMING);
420 427
         #endif
421 428
 
422 429
       } // doZ
430
+
423 431
     #endif // Z_HOME_DIR < 0
424 432
 
425 433
     sync_plan_position();

+ 3
- 4
Marlin/src/module/motion.cpp Bestand weergeven

@@ -1755,10 +1755,9 @@ void homeaxis(const AxisEnum axis) {
1755 1755
   #endif
1756 1756
 
1757 1757
   #if DISABLED(DELTA) && defined(HOMING_BACKOFF_MM)
1758
-    constexpr xyz_float_t endstop_backoff = HOMING_BACKOFF_MM;
1759
-    const float backoff_mm = endstop_backoff[axis];
1760
-    if (backoff_mm) {
1761
-      current_position[axis] -= ABS(backoff_mm) * axis_home_dir;
1758
+    const xyz_float_t endstop_backoff = HOMING_BACKOFF_MM;
1759
+    if (endstop_backoff[axis]) {
1760
+      current_position[axis] -= ABS(endstop_backoff[axis]) * axis_home_dir;
1762 1761
       line_to_current_position(
1763 1762
         #if HOMING_Z_WITH_PROBE
1764 1763
           (axis == Z_AXIS) ? MMM_TO_MMS(Z_PROBE_SPEED_FAST) :

Laden…
Annuleren
Opslaan