mirror of
https://github.com/grblHAL/core.git
synced 2026-09-27 19:13:58 +08:00
Fix for issue #191, allow homing of rotary axes with infinite rotation (max travel = 0)
Added spindle type property to HAL, "hardened" code. Added new setting $346 for action to take after tool change: either return controlled point (tool tip) back to the same position as before the M6 command (default) or move spindle to Z home.
This commit is contained in:
+12
-3
@@ -272,14 +272,23 @@ static bool limits_homing_cycle (axes_signals_t cycle, axes_signals_t auto_squar
|
||||
step_pin[idx] = bit(idx);
|
||||
#endif
|
||||
// Set target based on max_travel setting. Ensure homing switches engaged with search scalar.
|
||||
// NOTE: settings.max_travel[] is stored as a negative value.
|
||||
if (bit_istrue(cycle.mask, bit(idx))) {
|
||||
max_travel = max(max_travel,(-HOMING_AXIS_SEARCH_SCALAR) * settings.axis[idx].max_travel);
|
||||
// NOTE: settings.axis[].max_travel is stored as a negative value.
|
||||
if(bit_istrue(cycle.mask, bit(idx))) {
|
||||
#if N_AXIS > 3
|
||||
if(bit_istrue(settings.steppers.is_rotational.mask, bit(idx)))
|
||||
max_travel = max(max_travel, (-HOMING_AXIS_SEARCH_SCALAR) * (settings.axis[idx].max_travel < -0.0f ? settings.axis[idx].max_travel : -360.0f));
|
||||
else
|
||||
#endif
|
||||
max_travel = max(max_travel, (-HOMING_AXIS_SEARCH_SCALAR) * settings.axis[idx].max_travel);
|
||||
|
||||
if(bit_istrue(auto_square.mask, bit(idx)))
|
||||
dual_motor_axis = idx;
|
||||
}
|
||||
} while(idx);
|
||||
|
||||
if(max_travel == 0.0f)
|
||||
return true;
|
||||
|
||||
if(auto_square.mask) {
|
||||
float fail_distance = (-settings.homing.dual_axis.fail_length_percent / 100.0f) * settings.axis[dual_motor_axis].max_travel;
|
||||
fail_distance = min(fail_distance, settings.homing.dual_axis.fail_distance_max);
|
||||
|
||||
Reference in New Issue
Block a user