Browse Source

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

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

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

1339
 
1339
 
1340
   SETUP_RUN(endstops.init());         // Init endstops and pullups
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
   SETUP_RUN(stepper.init());          // Init stepper. This enables interrupts!
1346
   SETUP_RUN(stepper.init());          // Init stepper. This enables interrupts!
1343
 
1347
 
1344
   #if HAS_SERVOS
1348
   #if HAS_SERVOS

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

63
 
63
 
64
 float delta_safe_distance_from_top();
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
  * Recalculate factors used for delta kinematics whenever
74
  * Recalculate factors used for delta kinematics whenever
68
  * settings have been changed (e.g., by M665).
75
  * settings have been changed (e.g., by M665).

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

82
  */
82
  */
83
 float delta_safe_distance_from_top();
83
 float delta_safe_distance_from_top();
84
 
84
 
85
+void refresh_delta_clip_start_height();
86
+
85
 /**
87
 /**
86
  * Delta Forward Kinematics
88
  * Delta Forward Kinematics
87
  *
89
  *

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

743
           delta_max_radius_2 = sq(delta_max_radius);
743
           delta_max_radius_2 = sq(delta_max_radius);
744
           break;
744
           break;
745
         case Z_AXIS:
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
         default: break;
747
         default: break;
748
       }
748
       }
749
 
749
 

Loading…
Cancel
Save