extruder: Make sure EXTRUDE_DIFF_IGNORE doesn't trigger due to rounding
The code disables lookahead between two extruding moves with significantly different extrude ratios. Unfortunately, it was possible for very tiny moves to show different extrude ratios just due to how the slicer implements rounding when it produces the gcode. Allow lookahead to be enabled between moves with extrude ratios that are different if they don't noticeably produce more or less extrusion. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
f97cf5c3b6
commit
9bf73cd72d
|
@ -56,10 +56,15 @@ class PrinterExtruder:
|
|||
raise homing.EndstopMoveError(
|
||||
move.end_pos, "Move exceeds maximum extrusion cross section")
|
||||
def calc_junction(self, prev_move, move):
|
||||
if move.axes_d[3] or prev_move.axes_d[3]:
|
||||
if (not move.axes_d[3] or not prev_move.axes_d[3]
|
||||
or move.extrude_r > prev_move.extrude_r * EXTRUDE_DIFF_IGNORE
|
||||
or prev_move.extrude_r > move.extrude_r * EXTRUDE_DIFF_IGNORE):
|
||||
extrude = move.axes_d[3]
|
||||
prev_extrude = prev_move.axes_d[3]
|
||||
if extrude or prev_extrude:
|
||||
if not extrude or not prev_extrude:
|
||||
# Extrude move to non-extrude move - disable lookahead
|
||||
return 0.
|
||||
if ((move.extrude_r > prev_move.extrude_r * EXTRUDE_DIFF_IGNORE
|
||||
or prev_move.extrude_r > move.extrude_r * EXTRUDE_DIFF_IGNORE)
|
||||
and abs(move.move_d * prev_move.extrude_r - extrude) >= .001):
|
||||
# Extrude ratio between moves is too different
|
||||
return 0.
|
||||
move.extrude_r = prev_move.extrude_r
|
||||
|
|
Loading…
Reference in New Issue