Browse Source

🐛 Fix init of delta safe height (for G29, G33, etc.) (#23622)

Bob Kuhn 2 years ago
parent
commit
d987e23d5b
No account linked to committer's email address

+ 4
- 0
Marlin/src/MarlinCore.cpp View File

@@ -1339,6 +1339,10 @@ void setup() {
1339 1339
 
1340 1340
   SETUP_RUN(endstops.init());         // Init endstops and pullups
1341 1341
 
1342
+  #if ENABLED(DELTA) && !HAS_SOFTWARE_ENDSTOPS
1343
+    SETUP_RUN(refresh_delta_clip_start_height()); // Init safe delta height without soft endstops
1344
+  #endif
1345
+
1342 1346
   SETUP_RUN(stepper.init());          // Init stepper. This enables interrupts!
1343 1347
 
1344 1348
   #if HAS_SERVOS

+ 7
- 0
Marlin/src/module/delta.cpp View File

@@ -63,6 +63,13 @@ abc_float_t delta_diagonal_rod_trim;
63 63
 
64 64
 float delta_safe_distance_from_top();
65 65
 
66
+void refresh_delta_clip_start_height() {
67
+  delta_clip_start_height = TERN(HAS_SOFTWARE_ENDSTOPS,
68
+    soft_endstop.max.z,
69
+    DIFF_TERN(HAS_BED_PROBE, delta_height, probe.offset.z)
70
+  ) - delta_safe_distance_from_top();
71
+}
72
+
66 73
 /**
67 74
  * Recalculate factors used for delta kinematics whenever
68 75
  * settings have been changed (e.g., by M665).

+ 2
- 0
Marlin/src/module/delta.h View File

@@ -82,6 +82,8 @@ void inverse_kinematics(const xyz_pos_t &raw);
82 82
  */
83 83
 float delta_safe_distance_from_top();
84 84
 
85
+void refresh_delta_clip_start_height();
86
+
85 87
 /**
86 88
  * Delta Forward Kinematics
87 89
  *

+ 1
- 1
Marlin/src/module/motion.cpp View File

@@ -743,7 +743,7 @@ void restore_feedrate_and_scaling() {
743 743
           delta_max_radius_2 = sq(delta_max_radius);
744 744
           break;
745 745
         case Z_AXIS:
746
-          delta_clip_start_height = soft_endstop.max[axis] - delta_safe_distance_from_top();
746
+          refresh_delta_clip_start_height();
747 747
         default: break;
748 748
       }
749 749
 

Loading…
Cancel
Save