mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-30 12:11:15 -06:00
Wipe Improvements: Removed debug code, removed retract before wipe and made the respect retract speed an option.
This commit is contained in:
parent
273a3bc989
commit
ba515ffb62
5 changed files with 26 additions and 18 deletions
|
|
@ -351,24 +351,22 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
|
|||
|
||||
scale_(gcodegen.config().retraction_speed.get_at(gcodegen.writer().extruder()->id()));
|
||||
|
||||
// Ioannis Giannakas:
|
||||
// Calculate the maximum retraction length possible in the available wipe distance, in order to maintain the same effective
|
||||
// retraction speed as a stationary retraction.
|
||||
double maxRetractionLength = gcodegen.config().retraction_speed.get_at(gcodegen.writer().extruder()->id())
|
||||
* (wipe_path.length() / 1000000)
|
||||
/ _wipe_speed;
|
||||
if (maxRetractionLength < (length - EPSILON)){
|
||||
if(gcodegen.config().respect_retraction_speed_when_wiping){
|
||||
// Ioannis Giannakas:
|
||||
// the maximum retraction length possible in the available wipe path with the current wipe speed is less than the
|
||||
// requested retraction length while wiping. As such, perform an immediate retraction for the difference and proceed to
|
||||
// wipe with the rest.
|
||||
gcode +=";Wipe retraction adjusted: \n;Desired retraction amount: "+std::to_string(length) +
|
||||
"\n;Maximum retraction amount: "+std::to_string(maxRetractionLength)+
|
||||
"\n;Retract before wipe: "+std::to_string(length - maxRetractionLength)+
|
||||
"\n";
|
||||
gcode += gcodegen.writer().retract(length - maxRetractionLength + dE_retracted, toolchange);
|
||||
length = maxRetractionLength;
|
||||
length = length < EPSILON ? EPSILON : length;
|
||||
// Calculate the maximum retraction length possible in the available wipe distance, in order to maintain the same effective
|
||||
// retraction speed as a stationary retraction.
|
||||
double maxRetractionLength = gcodegen.config().retraction_speed.get_at(gcodegen.writer().extruder()->id())
|
||||
* (wipe_path.length() / 1000000)
|
||||
/ _wipe_speed;
|
||||
if (maxRetractionLength < (length - EPSILON)){
|
||||
// Ioannis Giannakas:
|
||||
// the maximum retraction length possible in the available wipe path with the current wipe speed is less than the
|
||||
// requested retraction length while wiping. As such, perform an immediate retraction for the difference and proceed to
|
||||
// wipe with the rest.
|
||||
//gcode += gcodegen.writer().retract(length - maxRetractionLength + dE_retracted, toolchange);
|
||||
length = maxRetractionLength;
|
||||
length = length < EPSILON ? EPSILON : length;
|
||||
}
|
||||
}
|
||||
|
||||
// add tag for processor
|
||||
|
|
|
|||
|
|
@ -161,6 +161,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
|
|||
"filename_format",
|
||||
"retraction_minimum_travel",
|
||||
"retract_before_wipe",
|
||||
"respect_retraction_speed_when_wiping",
|
||||
"retract_when_changing_layer",
|
||||
"retraction_length",
|
||||
"retract_length_toolchange",
|
||||
|
|
|
|||
|
|
@ -3111,6 +3111,12 @@ def = this->add("filament_loading_speed", coFloats);
|
|||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionPercents { 100 });
|
||||
|
||||
def = this->add("respect_retraction_speed_when_wiping", coBool);
|
||||
def->label = L("Respect retraction speed when wiping");
|
||||
def->tooltip = L("Adjust the retraction amount when wiping to ensure the retraction speed is respected. This setting can protect the extruder from stalling in the scenario of too high a retraction amount over too small a wipe distance. However, it may result in a stationary retraction at the end of the wipe move if the retraction speed it too slow, the retraction distance being too high or the wipe distance being too small. \n\nIt is generaly recomended to have this setting on, especially for fast bowden printers or when using high retraction lengths when changing materials.");
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionBool { true });
|
||||
|
||||
def = this->add("retract_when_changing_layer", coBools);
|
||||
def->label = L("Retract when change layer");
|
||||
def->tooltip = L("Force a retraction when changes layer");
|
||||
|
|
@ -4558,7 +4564,7 @@ void PrintConfigDef::init_extruder_option_keys()
|
|||
"retraction_length", "z_hop", "z_hop_types", "retract_lift_above", "retract_lift_below", "retract_lift_enforce", "retraction_speed", "deretraction_speed",
|
||||
"retract_before_wipe", "retract_restart_extra", "retraction_minimum_travel", "wipe", "wipe_distance",
|
||||
"retract_when_changing_layer", "retract_length_toolchange", "retract_restart_extra_toolchange", "extruder_colour",
|
||||
"default_filament_profile"
|
||||
"default_filament_profile", "respect_retraction_speed_when_wiping"
|
||||
};
|
||||
|
||||
m_extruder_retract_keys = {
|
||||
|
|
|
|||
|
|
@ -1084,6 +1084,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
|
|||
((ConfigOptionFloat, extruder_clearance_radius))
|
||||
((ConfigOptionStrings, extruder_colour))
|
||||
((ConfigOptionPoints, extruder_offset))
|
||||
((ConfigOptionBool, respect_retraction_speed_when_wiping))
|
||||
((ConfigOptionBools, reduce_fan_stop_start_freq))
|
||||
((ConfigOptionFloats, fan_cooling_layer_time))
|
||||
((ConfigOptionStrings, filament_colour))
|
||||
|
|
|
|||
|
|
@ -3864,6 +3864,7 @@ if (is_marlin_flavor)
|
|||
optgroup->append_single_option_line("wipe", "", extruder_idx);
|
||||
optgroup->append_single_option_line("wipe_distance", "", extruder_idx);
|
||||
optgroup->append_single_option_line("retract_before_wipe", "", extruder_idx);
|
||||
optgroup->append_single_option_line("respect_retraction_speed_when_wiping", "", extruder_idx);
|
||||
|
||||
optgroup = page->new_optgroup(L("Lift Z Enforcement"), L"param_retraction", -1, true);
|
||||
optgroup->append_single_option_line("retract_lift_above", "", extruder_idx);
|
||||
|
|
@ -4109,6 +4110,7 @@ void TabPrinter::toggle_options()
|
|||
}
|
||||
// BBS
|
||||
toggle_option("wipe_distance", wipe, i);
|
||||
toggle_option("respect_retraction_speed_when_wiping", wipe, i);
|
||||
|
||||
toggle_option("retract_length_toolchange", have_multiple_extruders, i);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue