extruder: Rework maximum retraction check

On a retract move (which are common during "wipe" operations), treat
the move as if it were an extrude only move.  It's valid for a retract
move to reverse more filament then it would be practical to push.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-05-02 08:57:38 -04:00
parent c9d21574d8
commit 98f2adbcb5
1 changed files with 8 additions and 7 deletions

View File

@ -49,15 +49,16 @@ class PrinterExtruder:
if not self.heater.can_extrude: if not self.heater.can_extrude:
raise homing.EndstopMoveError( raise homing.EndstopMoveError(
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 or move.extrude_r < 0.:
# Extrude only move - limit accel and velocity # Extrude only move (or retraction move) - limit accel and velocity
if abs(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 move too long")
move.limit_speed(self.max_e_velocity, self.max_e_accel) inv_extrude_r = 1. / abs(move.extrude_r)
elif (abs(move.extrude_r) > self.max_extrude_ratio move.limit_speed(self.max_e_velocity * inv_extrude_r
and (abs(move.axes_d[3]) , self.max_e_accel * inv_extrude_r)
> self.nozzle_diameter*self.max_extrude_ratio)): elif (move.extrude_r > self.max_extrude_ratio
and 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(