mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-02-03 01:18:44 +03:00
Volume and Pressure Advance
This commit is contained in:
@@ -754,7 +754,14 @@ std::string CoolingBuffer::apply_layer_cooldown(
|
||||
int min_fan_speed = EXTRUDER_CONFIG(min_fan_speed);
|
||||
//B15
|
||||
int enable_auxiliary_fan = EXTRUDER_CONFIG(enable_auxiliary_fan);
|
||||
//B25
|
||||
int enable_volume_fan = EXTRUDER_CONFIG(enable_volume_fan);
|
||||
int fan_speed_new = EXTRUDER_CONFIG(fan_always_on) ? min_fan_speed : 0;
|
||||
//B26
|
||||
bool enable_advance_pressure = EXTRUDER_CONFIG(enable_advance_pressure);
|
||||
float advance_pressure = float(EXTRUDER_CONFIG(advance_pressure));
|
||||
float smooth_time = float(EXTRUDER_CONFIG(smooth_time));
|
||||
|
||||
std::pair<int, int> custom_fan_speed_limits{fan_speed_new, 100 };
|
||||
int disable_fan_first_layers = EXTRUDER_CONFIG(disable_fan_first_layers);
|
||||
// Is the fan speed ramp enabled?
|
||||
@@ -798,11 +805,24 @@ std::string CoolingBuffer::apply_layer_cooldown(
|
||||
custom_fan_speed_limits.second = 0;
|
||||
}
|
||||
//B15
|
||||
if (int(layer_id) == disable_fan_first_layers && enable_auxiliary_fan != 0 && fan_speed_new != m_fan_speed) {
|
||||
if (int(layer_id) >= disable_fan_first_layers && fan_speed_new != m_fan_speed) {
|
||||
std::ostringstream fan_gcode;
|
||||
fan_gcode << "M106 P2 S" << 255.0 * enable_auxiliary_fan / 100.0 << "\n";
|
||||
new_gcode += fan_gcode.str();
|
||||
}
|
||||
//B25
|
||||
if (int(layer_id) == disable_fan_first_layers && enable_volume_fan != 0 && fan_speed_new != m_fan_speed) {
|
||||
std::ostringstream fan_gcode;
|
||||
fan_gcode << "M106 P3 S" << 255.0 * enable_volume_fan / 100.0 << "\n";
|
||||
new_gcode += fan_gcode.str();
|
||||
}
|
||||
//B26
|
||||
if (enable_advance_pressure && fan_speed_new != m_fan_speed) {
|
||||
std::ostringstream pressure_advance_gcode;
|
||||
pressure_advance_gcode << "M900 K" << advance_pressure << " T" << smooth_time << "\n";
|
||||
new_gcode += pressure_advance_gcode.str();
|
||||
}
|
||||
|
||||
if (fan_speed_new != m_fan_speed) {
|
||||
m_fan_speed = fan_speed_new;
|
||||
new_gcode += GCodeWriter::set_fan(m_config.gcode_flavor, m_config.gcode_comments, m_fan_speed);
|
||||
|
||||
@@ -548,8 +548,8 @@ std::string GCodeWriter::set_fan(const GCodeFlavor gcode_flavor, bool gcode_comm
|
||||
case gcfSailfish:
|
||||
gcode << "M127"; break;
|
||||
default:
|
||||
//B15
|
||||
gcode << "M107\nM106 P2 S0"; break;
|
||||
//B15 //B25
|
||||
gcode << "M107\nM106 P2 S0\nM106 P3 S0"; break;
|
||||
}
|
||||
if (gcode_comments)
|
||||
gcode << " ; disable fan";
|
||||
|
||||
@@ -503,7 +503,15 @@ static std::vector<std::string> s_Preset_filament_options {
|
||||
//B15
|
||||
"enable_auxiliary_fan",
|
||||
//B24
|
||||
"volume_temperature", "first_layer_volume_temperature"
|
||||
"volume_temperature", "first_layer_volume_temperature",
|
||||
//B25
|
||||
"enable_volume_fan",
|
||||
//B26
|
||||
"enable_advance_pressure",
|
||||
//B26
|
||||
"advance_pressure",
|
||||
//B26
|
||||
"smooth_time"
|
||||
};
|
||||
|
||||
static std::vector<std::string> s_Preset_machine_limits_options {
|
||||
|
||||
@@ -728,12 +728,6 @@ void PrintConfigDef::init_fff_params()
|
||||
"and fan speed according to layer printing time.");
|
||||
def->set_default_value(new ConfigOptionBools { true });
|
||||
|
||||
//B15
|
||||
// def = this->add("enable_auxiliary_fan", coBools);
|
||||
// def->label = L("Enable Auxiliary Fan");
|
||||
// def->tooltip = L("This flag enables the automatic cooling logic that adjusts print speed "
|
||||
// "and fan speed according to layer printing time.");
|
||||
// def->set_default_value(new ConfigOptionBools { true });
|
||||
|
||||
def = this->add("cooling_tube_retraction", coFloat);
|
||||
def->label = L("Cooling tube position");
|
||||
@@ -1944,6 +1938,15 @@ void PrintConfigDef::init_fff_params()
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionInts { 35 });
|
||||
|
||||
//B25
|
||||
def = this->add("enable_volume_fan", coInts);
|
||||
def->label = L("Volume Fan Speed");
|
||||
def->tooltip = L("This setting represents the PWM your volume fan needs to work.");
|
||||
def->sidetext = L("%");
|
||||
def->min = 0;
|
||||
def->max = 100;
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionInts { 35 });
|
||||
|
||||
def = this->add("min_layer_height", coFloats);
|
||||
def->label = L("Min");
|
||||
@@ -3828,6 +3831,31 @@ void PrintConfigDef::init_sla_params()
|
||||
def->min = 0;
|
||||
def->max = max_temp;
|
||||
def->set_default_value(new ConfigOptionIntsNullable { ConfigOptionIntsNullable::nil_value() });
|
||||
//B26
|
||||
def = this->add("enable_advance_pressure", coBools);
|
||||
def->label = L("Enable pressure advance");
|
||||
def->tooltip = L("Enable pressure advance, auto calibration result will be overwriten once enabled.");
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionBools{ false });
|
||||
|
||||
//B26
|
||||
def = this->add("advance_pressure", coFloats);
|
||||
def->label = L("Pressure advance");
|
||||
def->tooltip = L("Pressure advance(Klipper) AKA Linear advance factor(Marlin)");
|
||||
def->sidetext = L("mm/s");
|
||||
def->min = 0;
|
||||
def->max = 2;
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionFloats { 0.02 });
|
||||
//B26
|
||||
def = this->add("smooth_time", coFloats);
|
||||
def->label = L("Smooth Time");
|
||||
def->tooltip = L("PSmooth Time(Klipper) AKA Linear advance factor(Marlin)");
|
||||
def->sidetext = L("s");
|
||||
def->min = 0;
|
||||
def->max = 1;
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionFloats { 0.02 });
|
||||
|
||||
def = this->add("bottle_volume", coFloat);
|
||||
def->label = L("Bottle volume");
|
||||
|
||||
@@ -764,9 +764,9 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
|
||||
((ConfigOptionBool, complete_objects))
|
||||
((ConfigOptionFloats, colorprint_heights))
|
||||
((ConfigOptionBools, cooling))
|
||||
//B25
|
||||
((ConfigOptionInts, enable_volume_fan))
|
||||
//B15
|
||||
// ((ConfigOptionBools, enable_auxiliary_fan))
|
||||
// ((ConfigOptionInts, enable_auxiliary_fan))
|
||||
((ConfigOptionInts, enable_auxiliary_fan))
|
||||
((ConfigOptionFloat, default_acceleration))
|
||||
((ConfigOptionInts, disable_fan_first_layers))
|
||||
@@ -790,6 +790,10 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
|
||||
((ConfigOptionFloatOrPercent, first_layer_speed))
|
||||
((ConfigOptionInts, first_layer_temperature))
|
||||
((ConfigOptionIntsNullable, idle_temperature))
|
||||
//B26
|
||||
((ConfigOptionBools, enable_advance_pressure))
|
||||
((ConfigOptionFloats, advance_pressure))
|
||||
((ConfigOptionFloats, smooth_time))
|
||||
((ConfigOptionInts, full_fan_speed_layer))
|
||||
((ConfigOptionFloat, infill_acceleration))
|
||||
((ConfigOptionBool, infill_first))
|
||||
|
||||
Reference in New Issue
Block a user