Homing backoff enhancements
- Define homing bump as an array - Add pre and post homing backoff options - Consolidate homing config options
This commit is contained in:
committed by
Scott Lahteine
parent
cbf349b5eb
commit
a794538c54
@ -280,8 +280,8 @@ void home_delta() {
|
||||
|
||||
sync_plan_position();
|
||||
|
||||
#if DISABLED(DELTA_HOME_TO_SAFE_ZONE) && defined(HOMING_BACKOFF_MM)
|
||||
constexpr xyz_float_t endstop_backoff = HOMING_BACKOFF_MM;
|
||||
#if DISABLED(DELTA_HOME_TO_SAFE_ZONE) && defined(HOMING_BACKOFF_POST_MM)
|
||||
constexpr xyz_float_t endstop_backoff = HOMING_BACKOFF_POST_MM;
|
||||
if (endstop_backoff.z) {
|
||||
current_position.z -= ABS(endstop_backoff.z) * Z_HOME_DIR;
|
||||
line_to_current_position(homing_feedrate(Z_AXIS));
|
||||
|
@ -74,15 +74,6 @@
|
||||
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
|
||||
#include "../core/debug_out.h"
|
||||
|
||||
#define XYZ_CONSTS(T, NAME, OPT) const PROGMEM XYZval<T> NAME##_P = { X_##OPT, Y_##OPT, Z_##OPT }
|
||||
|
||||
XYZ_CONSTS(float, base_min_pos, MIN_POS);
|
||||
XYZ_CONSTS(float, base_max_pos, MAX_POS);
|
||||
XYZ_CONSTS(float, base_home_pos, HOME_POS);
|
||||
XYZ_CONSTS(float, max_length, MAX_LENGTH);
|
||||
XYZ_CONSTS(float, home_bump_mm, HOME_BUMP_MM);
|
||||
XYZ_CONSTS(signed char, home_dir, HOME_DIR);
|
||||
|
||||
/**
|
||||
* axis_homed
|
||||
* Flags that each linear axis was homed.
|
||||
@ -1567,14 +1558,13 @@ void homeaxis(const AxisEnum axis) {
|
||||
if (axis == Z_AXIS && bltouch.deploy()) return; // The initial DEPLOY
|
||||
#endif
|
||||
|
||||
do_homing_move(axis, 1.5f * max_length(
|
||||
#if ENABLED(DELTA)
|
||||
Z_AXIS
|
||||
#else
|
||||
axis
|
||||
#endif
|
||||
) * axis_home_dir
|
||||
);
|
||||
#if DISABLED(DELTA) && defined(SENSORLESS_BACKOFF_MM)
|
||||
const xy_float_t backoff = SENSORLESS_BACKOFF_MM;
|
||||
if (((ENABLED(X_SENSORLESS) && axis == X_AXIS) || (ENABLED(Y_SENSORLESS) && axis == Y_AXIS)) && backoff[axis])
|
||||
do_homing_move(axis, -ABS(backoff[axis]) * axis_home_dir, homing_feedrate(axis));
|
||||
#endif
|
||||
|
||||
do_homing_move(axis, 1.5f * max_length(TERN(DELTA, Z_AXIS, axis)) * axis_home_dir);
|
||||
|
||||
#if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH) && DISABLED(BLTOUCH_HS_MODE)
|
||||
if (axis == Z_AXIS) bltouch.stow(); // Intermediate STOW (in LOW SPEED MODE)
|
||||
@ -1583,14 +1573,14 @@ void homeaxis(const AxisEnum axis) {
|
||||
// When homing Z with probe respect probe clearance
|
||||
const float bump = axis_home_dir * (
|
||||
#if HOMING_Z_WITH_PROBE
|
||||
(axis == Z_AXIS && (Z_HOME_BUMP_MM)) ? _MAX(Z_CLEARANCE_BETWEEN_PROBES, Z_HOME_BUMP_MM) :
|
||||
(axis == Z_AXIS && home_bump_mm(Z_AXIS)) ? _MAX(Z_CLEARANCE_BETWEEN_PROBES, home_bump_mm(Z_AXIS)) :
|
||||
#endif
|
||||
home_bump_mm(axis)
|
||||
);
|
||||
|
||||
// If a second homing move is configured...
|
||||
if (bump) {
|
||||
// Move away from the endstop by the axis HOME_BUMP_MM
|
||||
// Move away from the endstop by the axis HOMING_BUMP_MM
|
||||
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("Move Away:");
|
||||
do_homing_move(axis, -bump
|
||||
#if HOMING_Z_WITH_PROBE
|
||||
@ -1785,8 +1775,8 @@ void homeaxis(const AxisEnum axis) {
|
||||
if (axis == Z_AXIS && probe.stow()) return;
|
||||
#endif
|
||||
|
||||
#if DISABLED(DELTA) && defined(HOMING_BACKOFF_MM)
|
||||
const xyz_float_t endstop_backoff = HOMING_BACKOFF_MM;
|
||||
#if DISABLED(DELTA) && defined(HOMING_BACKOFF_POST_MM)
|
||||
const xyz_float_t endstop_backoff = HOMING_BACKOFF_POST_MM;
|
||||
if (endstop_backoff[axis]) {
|
||||
current_position[axis] -= ABS(endstop_backoff[axis]) * axis_home_dir;
|
||||
line_to_current_position(
|
||||
|
@ -114,20 +114,25 @@ extern int16_t feedrate_percentage;
|
||||
extern float e_move_accumulator;
|
||||
#endif
|
||||
|
||||
FORCE_INLINE float pgm_read_any(const float *p) { return pgm_read_float(p); }
|
||||
FORCE_INLINE signed char pgm_read_any(const signed char *p) { return pgm_read_byte(p); }
|
||||
inline float pgm_read_any(const float *p) { return pgm_read_float(p); }
|
||||
inline signed char pgm_read_any(const signed char *p) { return pgm_read_byte(p); }
|
||||
|
||||
#define XYZ_DEFS(T, NAME, OPT) \
|
||||
extern const XYZval<T> NAME##_P; \
|
||||
FORCE_INLINE T NAME(AxisEnum axis) { return pgm_read_any(&NAME##_P[axis]); }
|
||||
|
||||
inline T NAME(const AxisEnum axis) { \
|
||||
static const XYZval<T> NAME##_P PROGMEM = { X_##OPT, Y_##OPT, Z_##OPT }; \
|
||||
return pgm_read_any(&NAME##_P[axis]); \
|
||||
}
|
||||
XYZ_DEFS(float, base_min_pos, MIN_POS);
|
||||
XYZ_DEFS(float, base_max_pos, MAX_POS);
|
||||
XYZ_DEFS(float, base_home_pos, HOME_POS);
|
||||
XYZ_DEFS(float, max_length, MAX_LENGTH);
|
||||
XYZ_DEFS(float, home_bump_mm, HOME_BUMP_MM);
|
||||
XYZ_DEFS(signed char, home_dir, HOME_DIR);
|
||||
|
||||
inline float home_bump_mm(const AxisEnum axis) {
|
||||
static const xyz_pos_t home_bump_mm_P PROGMEM = HOMING_BUMP_MM;
|
||||
return pgm_read_any(&home_bump_mm_P[axis]);
|
||||
}
|
||||
|
||||
#if HAS_WORKSPACE_OFFSET
|
||||
void update_workspace_offset(const AxisEnum axis);
|
||||
#else
|
||||
|
Reference in New Issue
Block a user