From 0f32223ba0ec19b1e85141d0ccb997574532ad91 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Fri, 16 Aug 2019 00:20:51 +0200 Subject: [PATCH] WipeTower: linear advance is disabled immediately before ramming, not before moving to the wipe tower Linear advance is reset by filament start gcode after a toolchange. However, not all moves to the wipe tower end with a toolchange (brim, empty grid) and it would therefore disable linear advance until the next toolchange This should solve https://github.com/prusa3d/PrusaSlicer/issues/2770 --- src/libslic3r/GCode.cpp | 3 --- src/libslic3r/GCode/WipeTower.cpp | 7 +++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index b691203c9..1e67f0244 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -197,9 +197,6 @@ std::string WipeTowerIntegration::append_tcr(GCode &gcodegen, const WipeTower::T std::string tcr_rotated_gcode = post_process_wipe_tower_moves(tcr, wipe_tower_offset, wipe_tower_rotation); - // Disable linear advance for the wipe tower operations. - gcode += (gcodegen.config().gcode_flavor == gcfRepRap ? std::string("M572 D0 S0\n") : std::string("M900 K0\n")); - if (!tcr.priming) { // Move over the wipe tower. // Retract for a tool change, using the toolchange retract value and setting the priming extra length. diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index e1b34fdea..7a764d0f6 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -113,6 +113,11 @@ public: return (*this); } + WipeTowerWriter& disable_linear_advance() { + m_gcode += (m_gcode_flavor == gcfRepRap ? std::string("M572 D0 S0\n") : std::string("M900 K0\n")); + return *this; + } + // Suppress / resume G-code preview in Slic3r. Slic3r will have difficulty to differentiate the various // filament loading and cooling moves from normal extrusion moves. Therefore the writer // is asked to suppres output of some lines, which look like extrusions. @@ -818,6 +823,8 @@ void WipeTower::toolchange_Unload( } } + writer.disable_linear_advance(); + // now the ramming itself: while (i < m_filpar[m_current_tool].ramming_speed.size()) {