diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index b0bc50aeeb..81b87f7150 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -111,8 +111,10 @@ public: WipeTowerWriter& feedrate(float f) { - if (f != m_current_feedrate) + if (f != m_current_feedrate) { m_gcode += "G1" + set_format_F(f) + "\n"; + m_current_feedrate = f; + } return *this; } @@ -523,9 +525,14 @@ WipeTower::WipeTower(const PrintConfig& config, const std::vector WipeTower::prime( if (m_set_extruder_trimpot) writer.set_extruder_trimpot(550); writer.speed_override_restore() - .feedrate(6000) + .feedrate(m_travel_speed * 60.f) .flush_planner_queue() .reset_extruder() .append("; CP PRIMING END\n" @@ -762,7 +769,7 @@ WipeTower::ToolChangeResult WipeTower::tool_change(size_t tool) if (m_set_extruder_trimpot) writer.set_extruder_trimpot(550); // Reset the extruder current to a normal value. writer.speed_override_restore(); - writer.feedrate(6000) + writer.feedrate(m_travel_speed * 60.f) .flush_planner_queue() .reset_extruder() .append("; CP TOOLCHANGE END\n" @@ -933,7 +940,10 @@ void WipeTower::toolchange_Change( // gcode could have left the extruder somewhere, we cannot just start extruding. We should also inform the // postprocessor that we absolutely want to have this in the gcode, even if it thought it is the same as before. Vec2f current_pos = writer.pos_rotated(); - writer.append(std::string("G1 X") + std::to_string(current_pos.x()) + " Y" + std::to_string(current_pos.y()) + never_skip_tag() + "\n"); + writer.feedrate(m_travel_speed * 60.f) // see https://github.com/prusa3d/PrusaSlicer/issues/5483 + .append(std::string("G1 X") + std::to_string(current_pos.x()) + + " Y" + std::to_string(current_pos.y()) + + never_skip_tag() + "\n"); // The toolchange Tn command will be inserted later, only in case that the user does // not provide a custom toolchange gcode. diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp index cfd3a9e116..fd9fbe57b2 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -259,6 +259,8 @@ private: float m_layer_height = 0.f; // Current layer height. size_t m_max_color_changes = 0; // Maximum number of color changes per layer. int m_old_temperature = -1; // To keep track of what was the last temp that we set (so we don't issue the command when not neccessary) + float m_travel_speed = 0.f; + float m_first_layer_speed = 0.f; // G-code generator parameters. float m_cooling_tube_retraction = 0.f; @@ -383,6 +385,6 @@ private: -}; // namespace Slic3r +} // namespace Slic3r #endif // WipeTowerPrusaMM_hpp_