Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent Z misaligments on tool change #16518

Merged
merged 6 commits into from
Jan 10, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Limit z_max check only when limits are avaiable
  • Loading branch information
GMagician authored Jan 9, 2020
commit d61ec72beeadf8c4c1523b2cf62e4c53ee77f18b
6 changes: 4 additions & 2 deletions Marlin/src/module/tool_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -931,8 +931,10 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
// SWITCHING_NOZZLE_TWO_SERVOS, as both nozzles will lift instead.
current_position.z += _MAX(-diff.z, 0.0);
if (!no_move) {
// Check if Z has space to compensate at least z_offset, if not enough space abort tool change
if (current_position.z > soft_endstop.max.z) return
#if HAS_SOFTWARE_ENDSTOPS
// Check if Z has space to compensate at least z_offset, if not enough space abort tool change
if (current_position.z > soft_endstop.max.z) return
#endif

current_position.z += toolchange_settings.z_raise;
#if HAS_SOFTWARE_ENDSTOPS
Expand Down