mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-23 11:43:47 +00:00
🐛 Fix init of delta safe height (for G29, G33, etc.) (#23622)
This commit is contained in:
parent
82ae3646cb
commit
58239c65cb
@ -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
|
||||
|
@ -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).
|
||||
|
@ -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
|
||||
*
|
||||
|
@ -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…
Reference in New Issue
Block a user