Merge pull request #8523 from GMagician/2.0-Tool-change-bad-behaviour-fix

[2.0.x] Tool change bad behaviour fix
This commit is contained in:
Scott Lahteine 2017-11-22 21:29:33 -06:00 committed by GitHub
commit 8602461da8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -493,11 +493,10 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
SYNC_PLAN_POSITION_KINEMATIC(); SYNC_PLAN_POSITION_KINEMATIC();
// Move to the "old position" (move the extruder into place) // Move to the "old position" (move the extruder into place)
#if ENABLED(SWITCHING_NOZZLE)
destination[Z_AXIS] += z_diff; // Include the Z restore with the "move back"
#endif
if (!no_move && IsRunning()) { if (!no_move && IsRunning()) {
#if ENABLED(SWITCHING_NOZZLE)
if (z_raise != z_diff)
destination[Z_AXIS] += z_diff; // Include the Z restore with the "move back"
#endif
#if ENABLED(DEBUG_LEVELING_FEATURE) #if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) DEBUG_POS("Move back", destination); if (DEBUGGING(LEVELING)) DEBUG_POS("Move back", destination);
#endif #endif
@ -505,12 +504,9 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
do_blocking_move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS]); do_blocking_move_to(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS]);
} }
#if ENABLED(SWITCHING_NOZZLE) #if ENABLED(SWITCHING_NOZZLE)
// Move back down, if needed. (Including when the new tool is higher.) else {
else if (z_raise != z_diff) { // Move back down. (Including when the new tool is higher.)
set_destination_from_current(); // Prevent any XY move do_blocking_move_to_z(destination[Z_AXIS], planner.max_feedrate_mm_s[Z_AXIS]);
destination[Z_AXIS] += z_diff;
feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS];
prepare_move_to_destination();
} }
#endif #endif
} // (tmp_extruder != active_extruder) } // (tmp_extruder != active_extruder)