Browse Source

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

FB4S_WIFI
Bob Kuhn 3 years ago
committed by Scott Lahteine
parent
commit
58239c65cb
  1. 4
      Marlin/src/MarlinCore.cpp
  2. 7
      Marlin/src/module/delta.cpp
  3. 2
      Marlin/src/module/delta.h
  4. 2
      Marlin/src/module/motion.cpp

4
Marlin/src/MarlinCore.cpp

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

7
Marlin/src/module/delta.cpp

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

2
Marlin/src/module/delta.h

@ -82,6 +82,8 @@ void inverse_kinematics(const xyz_pos_t &raw);
*/
float delta_safe_distance_from_top();
void refresh_delta_clip_start_height();
/**
* Delta Forward Kinematics
*

2
Marlin/src/module/motion.cpp

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

Loading…
Cancel
Save