extruder: Extend over extrusion checks to retractions

Ensure a move with a retraction (negative extrude) is also checked for
sane extrusion rates.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-05-02 07:50:58 -04:00
parent 0fa35254c6
commit 253517096e
1 changed files with 4 additions and 3 deletions

View File

@ -51,12 +51,13 @@ class PrinterExtruder:
move.end_pos, "Extrude below minimum temp") move.end_pos, "Extrude below minimum temp")
if not move.is_kinematic_move: if not move.is_kinematic_move:
# Extrude only move - limit accel and velocity # Extrude only move - limit accel and velocity
if move.axes_d[3] > self.max_e_dist: if abs(move.axes_d[3]) > self.max_e_dist:
raise homing.EndstopMoveError( raise homing.EndstopMoveError(
move.end_pos, "Extrude only move too long") move.end_pos, "Extrude only move too long")
move.limit_speed(self.max_e_velocity, self.max_e_accel) move.limit_speed(self.max_e_velocity, self.max_e_accel)
elif (move.extrude_r > self.max_extrude_ratio elif (abs(move.extrude_r) > self.max_extrude_ratio
and move.axes_d[3] > self.nozzle_diameter*self.max_extrude_ratio): and (abs(move.axes_d[3])
> self.nozzle_diameter*self.max_extrude_ratio)):
logging.debug("Overextrude: %s vs %s" % ( logging.debug("Overextrude: %s vs %s" % (
move.extrude_r, self.max_extrude_ratio)) move.extrude_r, self.max_extrude_ratio))
raise homing.EndstopMoveError( raise homing.EndstopMoveError(