Browse Source
Don't apply hotend_offset.z to Z soft endstops (#20675)
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
vanilla_fb_2.0.x
zeleps
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
16 additions and
11 deletions
-
Marlin/src/feature/solenoid.cpp
-
Marlin/src/module/motion.cpp
-
Marlin/src/module/tool_change.cpp
-
Marlin/src/module/tool_change.h
|
|
@ -58,6 +58,11 @@ static void set_solenoid(const uint8_t num, const bool active) { |
|
|
|
#endif |
|
|
|
default: SERIAL_ECHO_MSG(STR_INVALID_SOLENOID); break; |
|
|
|
} |
|
|
|
|
|
|
|
#if ENABLED(PARKING_EXTRUDER) |
|
|
|
if (!active && active_extruder == num) // If active extruder's solenoid is disabled, carriage is considered parked
|
|
|
|
parking_extruder_set_parked(true); |
|
|
|
#endif |
|
|
|
} |
|
|
|
|
|
|
|
void enable_solenoid(const uint8_t num) { set_solenoid(num, true); } |
|
|
|
|
|
@ -595,16 +595,17 @@ void restore_feedrate_and_scaling() { |
|
|
|
// Software endstops are relative to the tool 0 workspace, so
|
|
|
|
// the movement limits must be shifted by the tool offset to
|
|
|
|
// retain the same physical limit when other tools are selected.
|
|
|
|
if (old_tool_index != new_tool_index) { |
|
|
|
const float offs = hotend_offset[new_tool_index][axis] - hotend_offset[old_tool_index][axis]; |
|
|
|
soft_endstop.min[axis] += offs; |
|
|
|
soft_endstop.max[axis] += offs; |
|
|
|
} |
|
|
|
else { |
|
|
|
const float offs = hotend_offset[active_extruder][axis]; |
|
|
|
|
|
|
|
if (new_tool_index == old_tool_index || axis == Z_AXIS) { // The Z axis is "special" and shouldn't be modified
|
|
|
|
const float offs = (axis == Z_AXIS) ? 0 : hotend_offset[active_extruder][axis]; |
|
|
|
soft_endstop.min[axis] = base_min_pos(axis) + offs; |
|
|
|
soft_endstop.max[axis] = base_max_pos(axis) + offs; |
|
|
|
} |
|
|
|
else { |
|
|
|
const float diff = hotend_offset[new_tool_index][axis] - hotend_offset[old_tool_index][axis]; |
|
|
|
soft_endstop.min[axis] += diff; |
|
|
|
soft_endstop.max[axis] += diff; |
|
|
|
} |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
|
|
@ -292,8 +292,6 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
void parking_extruder_set_parked() { extruder_parked = true; } |
|
|
|
|
|
|
|
inline void parking_extruder_tool_change(const uint8_t new_tool, bool no_move) { |
|
|
|
if (!no_move) { |
|
|
|
|
|
|
@ -378,7 +376,7 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a |
|
|
|
planner.synchronize(); // Always sync the final move
|
|
|
|
|
|
|
|
DEBUG_POS("PE Tool-Change done.", current_position); |
|
|
|
extruder_parked = false; |
|
|
|
parking_extruder_set_parked(false); |
|
|
|
} |
|
|
|
else if (do_solenoid_activation) { // && nomove == true
|
|
|
|
// Deactivate current extruder solenoid
|
|
|
|
|
|
@ -93,8 +93,9 @@ |
|
|
|
|
|
|
|
void pe_solenoid_init(); |
|
|
|
|
|
|
|
extern bool extruder_parked; |
|
|
|
inline void parking_extruder_set_parked(const bool parked) { extruder_parked = parked; } |
|
|
|
bool parking_extruder_unpark_after_homing(const uint8_t final_tool, bool homed_towards_final_tool); |
|
|
|
void parking_extruder_set_parked(); |
|
|
|
|
|
|
|
#elif ENABLED(MAGNETIC_PARKING_EXTRUDER) |
|
|
|
|
|
|
|