Skip to content

Commit

Permalink
Make the increase of extruder motor current during MM filament
Browse files Browse the repository at this point in the history
exchange sequences configurable.
  • Loading branch information
bubnikv committed Dec 14, 2018
1 parent 37806c0 commit 6da83c7
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 14 deletions.
24 changes: 13 additions & 11 deletions src/libslic3r/GCode/WipeTowerPrusaMM.cpp
Expand Up @@ -505,8 +505,9 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::prime(
.speed_override(100);

writer.set_initial_position(xy(0.f, 0.f)) // Always move to the starting position
.travel(cleaning_box.ld, 7200)
.set_extruder_trimpot(750); // Increase the extruder driver current to allow fast ramming.
.travel(cleaning_box.ld, 7200);
if (m_set_extruder_trimpot)
writer.set_extruder_trimpot(750); // Increase the extruder driver current to allow fast ramming.

for (size_t idx_tool = 0; idx_tool < tools.size(); ++ idx_tool) {
unsigned int tool = tools[idx_tool];
Expand All @@ -533,8 +534,9 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::prime(
// in the output gcode - we should not remember emitting them (we will output them twice in the worst case)

// Reset the extruder current to a normal value.
writer.set_extruder_trimpot(550)
.feedrate(6000)
if (m_set_extruder_trimpot)
writer.set_extruder_trimpot(550);
writer.feedrate(6000)
.flush_planner_queue()
.reset_extruder()
.append("; CP PRIMING END\n"
Expand Down Expand Up @@ -607,7 +609,8 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::tool_change(unsigned int tool, boo
writer.set_initial_position(initial_position, m_wipe_tower_width, m_wipe_tower_depth, m_internal_rotation);

// Increase the extruder driver current to allow fast ramming.
writer.set_extruder_trimpot(750);
if (m_set_extruder_trimpot)
writer.set_extruder_trimpot(550);

// Ram the hot material out of the melt zone, retract the filament into the cooling tubes and let it cool.
if (tool != (unsigned int)-1){ // This is not the last change.
Expand Down Expand Up @@ -635,8 +638,9 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::tool_change(unsigned int tool, boo
}
}

writer.set_extruder_trimpot(550) // Reset the extruder current to a normal value.
.feedrate(6000)
if (m_set_extruder_trimpot)
writer.set_extruder_trimpot(550); // Reset the extruder current to a normal value.
writer.feedrate(6000)
.flush_planner_queue()
.reset_extruder()
.append("; CP TOOLCHANGE END\n"
Expand Down Expand Up @@ -916,12 +920,10 @@ void WipeTowerPrusaMM::toolchange_Load(
.resume_preview();

// Reset the extruder current to the normal value.
writer.set_extruder_trimpot(550);
if (m_set_extruder_trimpot)
writer.set_extruder_trimpot(550);
}




// Wipe the newly loaded filament until the end of the assigned wipe area.
void WipeTowerPrusaMM::toolchange_Wipe(
PrusaMultiMaterial::Writer &writer,
Expand Down
5 changes: 4 additions & 1 deletion src/libslic3r/GCode/WipeTowerPrusaMM.hpp
Expand Up @@ -44,7 +44,8 @@ class WipeTowerPrusaMM : public WipeTower
// width -- width of wipe tower in mm ( default 60 mm - leave as it is )
// wipe_area -- space available for one toolchange in mm
WipeTowerPrusaMM(float x, float y, float width, float rotation_angle, float cooling_tube_retraction,
float cooling_tube_length, float parking_pos_retraction, float extra_loading_move, float bridging,
float cooling_tube_length, float parking_pos_retraction, float extra_loading_move,
float bridging, bool set_extruder_trimpot,
const std::vector<std::vector<float>>& wiping_matrix, unsigned int initial_tool) :
m_wipe_tower_pos(x, y),
m_wipe_tower_width(width),
Expand All @@ -57,6 +58,7 @@ class WipeTowerPrusaMM : public WipeTower
m_parking_pos_retraction(parking_pos_retraction),
m_extra_loading_move(extra_loading_move),
m_bridging(bridging),
m_set_extruder_trimpot(set_extruder_trimpot),
m_current_tool(initial_tool),
wipe_volumes(wiping_matrix)
{}
Expand Down Expand Up @@ -212,6 +214,7 @@ class WipeTowerPrusaMM : public WipeTower
float m_parking_pos_retraction = 0.f;
float m_extra_loading_move = 0.f;
float m_bridging = 0.f;
bool m_set_extruder_trimpot = false;
bool m_adhesion = true;

float m_perimeter_width = 0.4 * Width_To_Nozzle_Ratio; // Width of an extrusion line, also a perimeter spacing for 100% infill.
Expand Down
4 changes: 3 additions & 1 deletion src/libslic3r/Print.cpp
Expand Up @@ -213,6 +213,7 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
|| opt_key == "filament_cooling_final_speed"
|| opt_key == "filament_ramming_parameters"
|| opt_key == "gcode_flavor"
|| opt_key == "high_current_on_filament_swap"
|| opt_key == "infill_first"
|| opt_key == "single_extruder_multi_material"
|| opt_key == "spiral_vase"
Expand Down Expand Up @@ -1768,7 +1769,8 @@ void Print::_make_wipe_tower()
float(m_config.wipe_tower_width.value),
float(m_config.wipe_tower_rotation_angle.value), float(m_config.cooling_tube_retraction.value),
float(m_config.cooling_tube_length.value), float(m_config.parking_pos_retraction.value),
float(m_config.extra_loading_move.value), float(m_config.wipe_tower_bridging), wipe_volumes,
float(m_config.extra_loading_move.value), float(m_config.wipe_tower_bridging),
m_config.high_current_on_filament_swap.value, wipe_volumes,
m_wipe_tower_data.tool_ordering.first_extruder());

//wipe_tower.set_retract();
Expand Down
9 changes: 9 additions & 0 deletions src/libslic3r/PrintConfig.cpp
Expand Up @@ -925,6 +925,15 @@ void PrintConfigDef::init_fff_params()
def->mode = comExpert;
def->default_value = new ConfigOptionEnum<GCodeFlavor>(gcfRepRap);

def = this->add("high_current_on_filament_swap", coBool);
def->label = L("High extruder current on filament swap");
def->tooltip = L("It may be beneficial to increase the extruder motor current during the filament exchange"
" sequence to allow for rapid ramming feed rates and to overcome resistance when loading"
" a filament with an ugly shaped tip.");
def->cli = "high-current-on-filament-swap!";
def->mode = comExpert;
def->default_value = new ConfigOptionBool(0);

def = this->add("infill_acceleration", coFloat);
def->label = L("Infill");
def->tooltip = L("This is the acceleration your printer will use for infill. Set zero to disable "
Expand Down
2 changes: 2 additions & 0 deletions src/libslic3r/PrintConfig.hpp
Expand Up @@ -627,6 +627,7 @@ class GCodeConfig : public StaticPrintConfig
ConfigOptionBool variable_layer_height;
ConfigOptionFloat cooling_tube_retraction;
ConfigOptionFloat cooling_tube_length;
ConfigOptionBool high_current_on_filament_swap;
ConfigOptionFloat parking_pos_retraction;
ConfigOptionBool remaining_times;
ConfigOptionBool silent_mode;
Expand Down Expand Up @@ -695,6 +696,7 @@ class GCodeConfig : public StaticPrintConfig
OPT_PTR(variable_layer_height);
OPT_PTR(cooling_tube_retraction);
OPT_PTR(cooling_tube_length);
OPT_PTR(high_current_on_filament_swap);
OPT_PTR(parking_pos_retraction);
OPT_PTR(remaining_times);
OPT_PTR(silent_mode);
Expand Down
3 changes: 2 additions & 1 deletion src/slic3r/GUI/Preset.cpp
Expand Up @@ -366,7 +366,8 @@ const std::vector<std::string>& Preset::printer_options()
"host_type", "print_host", "printhost_apikey", "printhost_cafile",
"single_extruder_multi_material", "start_gcode", "end_gcode", "before_layer_gcode", "layer_gcode", "toolchange_gcode",
"between_objects_gcode", "printer_vendor", "printer_model", "printer_variant", "printer_notes", "cooling_tube_retraction",
"cooling_tube_length", "parking_pos_retraction", "extra_loading_move", "max_print_height", "default_print_profile", "inherits",
"cooling_tube_length", "high_current_on_filament_swap", "parking_pos_retraction", "extra_loading_move", "max_print_height",
"default_print_profile", "inherits",
"remaining_times", "silent_mode", "machine_max_acceleration_extruding", "machine_max_acceleration_retracting",
"machine_max_acceleration_x", "machine_max_acceleration_y", "machine_max_acceleration_z", "machine_max_acceleration_e",
"machine_max_feedrate_x", "machine_max_feedrate_y", "machine_max_feedrate_z", "machine_max_feedrate_e",
Expand Down
1 change: 1 addition & 0 deletions src/slic3r/GUI/Tab.cpp
Expand Up @@ -2041,6 +2041,7 @@ void TabPrinter::build_extruder_pages()
optgroup->append_single_option_line("cooling_tube_length");
optgroup->append_single_option_line("parking_pos_retraction");
optgroup->append_single_option_line("extra_loading_move");
optgroup->append_single_option_line("high_current_on_filament_swap");
m_pages.insert(m_pages.end() - n_after_single_extruder_MM, page);
m_has_single_extruder_MM_page = true;
}
Expand Down

0 comments on commit 6da83c7

Please sign in to comment.