Fix likely error in retract/recover

Addressing #10200
2.0.x
Scott Lahteine 7 years ago
parent 49f384a2ab
commit 9ec2c03c5b

@ -148,8 +148,8 @@ void FWRetract::retract(const bool retracting
hop_amount += retract_zlift; // Add to the hop total (again, only once) hop_amount += retract_zlift; // Add to the hop total (again, only once)
destination[Z_AXIS] += retract_zlift; // Raise Z by the zlift (M207 Z) amount destination[Z_AXIS] += retract_zlift; // Raise Z by the zlift (M207 Z) amount
feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS]; // Maximum Z feedrate feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS]; // Maximum Z feedrate
prepare_move_to_destination(); // Raise up to the old current pos prepare_move_to_destination(); // Raise up
current_position[Z_AXIS] = old_z; // Spoof the Z position current_position[Z_AXIS] = old_z; // Spoof the Z position in the planner
SYNC_PLAN_POSITION_KINEMATIC(); SYNC_PLAN_POSITION_KINEMATIC();
} }
} }
@ -157,11 +157,11 @@ void FWRetract::retract(const bool retracting
// If a hop was done and Z hasn't changed, undo the Z hop // If a hop was done and Z hasn't changed, undo the Z hop
if (hop_amount) { if (hop_amount) {
current_position[Z_AXIS] += hop_amount; // Set actual Z (due to the prior hop) current_position[Z_AXIS] += hop_amount; // Set actual Z (due to the prior hop)
SYNC_PLAN_POSITION_KINEMATIC(); // Spoof the Z position in the planner
feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS]; // Z feedrate to max feedrate_mm_s = planner.max_feedrate_mm_s[Z_AXIS]; // Z feedrate to max
prepare_move_to_destination(); // Lower Z and update current_position prepare_move_to_destination(); // Lower Z and update current_position
SYNC_PLAN_POSITION_KINEMATIC(); // Update the planner
hop_amount = 0.0; // Clear the hop amount hop_amount = 0.0; // Clear the hop amount
} }
// A retract multiplier has been added here to get faster swap recovery // A retract multiplier has been added here to get faster swap recovery
feedrate_mm_s = swapping ? swap_retract_recover_feedrate_mm_s : retract_recover_feedrate_mm_s; feedrate_mm_s = swapping ? swap_retract_recover_feedrate_mm_s : retract_recover_feedrate_mm_s;

Loading…
Cancel
Save