Skip to content

Commit

Permalink
Feat: chamber temp control and chamber fan (#2483)
Browse files Browse the repository at this point in the history
* init

* tweak
  • Loading branch information
SoftFever authored Oct 22, 2023
1 parent 809e6d1 commit 90601c0
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 65 deletions.
2 changes: 1 addition & 1 deletion doc/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Welcome to the OrcaSlicer WIKI!
We have divided it roughly into the following pages:

* [Calibration](wiki/Calibration)
* [Seam](wiki/Seam)
* [Print settings](wiki/Print-settings/Home)
* [How to build Orca Slicer](wiki/How-to-build)
6 changes: 6 additions & 0 deletions doc/Print-settings/Home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Print settings:

* [Seam](wiki/Print-settings/Seam)
* [Axiliary fan](wiki/Print-settings/auxiliary-fan)
* [Chamber temperature](wiki/Print-settings/chamber-temperature)
* [Air filtration](wiki/Print-settings/air-filtration)
32 changes: 16 additions & 16 deletions doc/Seam.md → doc/Print-settings/Seam.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
WIP...

### Seam gap
![image](https://user-images.githubusercontent.com/103989404/215331359-236874c9-ca91-4dd4-b969-3cefc70ebe1b.png)

### Role-based wipe speed(auto)
### Wipe speed
### Wipe on loop(inward movement)
![image](https://user-images.githubusercontent.com/103989404/215334479-2687c518-1931-46a9-a363-7ae57a0aecf6.png)

Use outer wall speed and acceleration instead of travel speed and acceleration.
Added an option to disable this feature
### Support Cura style outer wall wipe(100% retract before wipe)
![image](https://user-images.githubusercontent.com/103989404/215334900-97c75010-4752-45f1-a57c-f0b723a8cb3f.png)
![image](https://user-images.githubusercontent.com/103989404/215335212-3253061d-bb7b-4853-a86c-10ff54cc8df5.png)

WIP...

### Seam gap
![image](https://user-images.githubusercontent.com/103989404/215331359-236874c9-ca91-4dd4-b969-3cefc70ebe1b.png)

### Role-based wipe speed(auto)
### Wipe speed
### Wipe on loop(inward movement)
![image](https://user-images.githubusercontent.com/103989404/215334479-2687c518-1931-46a9-a363-7ae57a0aecf6.png)

Use outer wall speed and acceleration instead of travel speed and acceleration.
Added an option to disable this feature
### Support Cura style outer wall wipe(100% retract before wipe)
![image](https://user-images.githubusercontent.com/103989404/215334900-97c75010-4752-45f1-a57c-f0b723a8cb3f.png)
![image](https://user-images.githubusercontent.com/103989404/215335212-3253061d-bb7b-4853-a86c-10ff54cc8df5.png)

Extra length on restart
6 changes: 6 additions & 0 deletions resources/images/param_chamber_temp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 31 additions & 18 deletions src/libslic3r/GCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2240,6 +2240,17 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
// adds tag for processor
file.write_format(";%s%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Role).c_str(), ExtrusionEntity::role_to_string(erCustom).c_str());

// Orca: set chamber temperature at the beginning of gcode file
bool activate_chamber_temp_control = false;
auto max_chamber_temp = 0;
for (const auto &extruder : m_writer.extruders()) {
activate_chamber_temp_control |= m_config.activate_chamber_temp_control.get_at(extruder.id());
max_chamber_temp = std::max(max_chamber_temp, m_config.chamber_temperature.get_at(extruder.id()));
}

if (activate_chamber_temp_control && max_chamber_temp > 0)
file.write(m_writer.set_chamber_temperature(max_chamber_temp, true)); // set chamber_temperature

// Write the custom start G-code
file.writeln(machine_start_gcode);

Expand All @@ -2262,10 +2273,19 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
*/
if (is_bbl_printers) {
this->_print_first_layer_extruder_temperatures(file, print, machine_start_gcode, initial_extruder_id, true);
if (m_config.support_air_filtration.getBool() && m_config.activate_air_filtration.get_at(initial_extruder_id)) {
file.write(m_writer.set_exhaust_fan(m_config.during_print_exhaust_fan_speed.get_at(initial_extruder_id), true));
}
}
// Orca: when activate_air_filtration is set on any extruder, find and set the highest during_print_exhaust_fan_speed
bool activate_air_filtration = false;
int during_print_exhaust_fan_speed = 0;
for (const auto &extruder : m_writer.extruders()) {
activate_air_filtration |= m_config.activate_air_filtration.get_at(extruder.id());
if (m_config.activate_air_filtration.get_at(extruder.id()))
during_print_exhaust_fan_speed = std::max(during_print_exhaust_fan_speed,
m_config.during_print_exhaust_fan_speed.get_at(extruder.id()));
}
if (activate_air_filtration)
file.write(m_writer.set_exhaust_fan(during_print_exhaust_fan_speed, true));

print.throw_if_canceled();

// Set other general things.
Expand Down Expand Up @@ -2528,10 +2548,16 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
file.write(m_writer.update_progress(m_layer_count, m_layer_count, true)); // 100%
file.write(m_writer.postamble());

if (print.config().support_chamber_temp_control.value || print.config().chamber_temperature.values[0] > 0)
if (activate_chamber_temp_control && max_chamber_temp > 0)
file.write(m_writer.set_chamber_temperature(0, false)); //close chamber_temperature


if (activate_air_filtration) {
int complete_print_exhaust_fan_speed = 0;
for (const auto& extruder : m_writer.extruders())
if (m_config.activate_air_filtration.get_at(extruder.id()))
complete_print_exhaust_fan_speed = std::max(complete_print_exhaust_fan_speed, m_config.complete_print_exhaust_fan_speed.get_at(extruder.id()));
file.write(m_writer.set_exhaust_fan(complete_print_exhaust_fan_speed, true));
}
// adds tags for time estimators
file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Last_Line_M73_Placeholder).c_str());
file.write_format("; EXECUTABLE_BLOCK_END\n\n");
Expand Down Expand Up @@ -2581,19 +2607,6 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
}
file.write("\n");

bool activate_air_filtration = false;
for (const auto& extruder : m_writer.extruders())
activate_air_filtration |= m_config.activate_air_filtration.get_at(extruder.id());
activate_air_filtration &= m_config.support_air_filtration.getBool();

if (activate_air_filtration) {
int complete_print_exhaust_fan_speed = 0;
for (const auto& extruder : m_writer.extruders())
if (m_config.activate_air_filtration.get_at(extruder.id()))
complete_print_exhaust_fan_speed = std::max(complete_print_exhaust_fan_speed, m_config.complete_print_exhaust_fan_speed.get_at(extruder.id()));
file.write(m_writer.set_exhaust_fan(complete_print_exhaust_fan_speed, true));
}

print.throw_if_canceled();
}

Expand Down
10 changes: 7 additions & 3 deletions src/libslic3r/GCodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,13 @@ std::string GCodeWriter::set_chamber_temperature(int temperature, bool wait)

if (wait)
{
gcode<<"M106 P2 S255 \n";
gcode<<"M191 S"<<std::to_string(temperature)<<" ;"<<"set chamber_temperature and wait for it to be reached\n";
gcode<<"M106 P2 S0 \n";
// Orca: should we let the M191 command to turn on the auxiliary fan?
if (config.auxiliary_fan)
gcode << "M106 P2 S255 \n";
gcode << "M191 S" << std::to_string(temperature) << " ;"
<< "set chamber_temperature and wait for it to be reached\n";
if (config.auxiliary_fan)
gcode << "M106 P2 S0 \n";
}
else {
code = "M141";
Expand Down
4 changes: 2 additions & 2 deletions src/libslic3r/Preset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -803,8 +803,8 @@ static std::vector<std::string> s_Preset_filament_options {
"filament_loading_speed", "filament_loading_speed_start", "filament_load_time",
"filament_unloading_speed", "filament_unloading_speed_start", "filament_unload_time", "filament_toolchange_delay", "filament_cooling_moves",
"filament_cooling_initial_speed", "filament_cooling_final_speed", "filament_ramming_parameters",
"filament_multitool_ramming", "filament_multitool_ramming_volume", "filament_multitool_ramming_flow",
};
"filament_multitool_ramming", "filament_multitool_ramming_volume", "filament_multitool_ramming_flow", "activate_chamber_temp_control"
};

static std::vector<std::string> s_Preset_machine_limits_options {
"machine_max_acceleration_extruding", "machine_max_acceleration_retracting", "machine_max_acceleration_travel",
Expand Down
21 changes: 14 additions & 7 deletions src/libslic3r/PrintConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ void PrintConfigDef::init_fff_params()

def = this->add("activate_air_filtration",coBools);
def->label = L("Activate air filtration");
def->tooltip = L("Activate for better air filtration");
def->tooltip = L("Activate for better air filtration. G-code command: M106 P3 S(0-255)");
def->mode = comSimple;
def->set_default_value(new ConfigOptionBools{false});

Expand Down Expand Up @@ -2173,7 +2173,7 @@ def = this->add("filament_loading_speed", coFloats);

def = this->add("auxiliary_fan", coBool);
def->label = L("Auxiliary part cooling fan");
def->tooltip = L("Enable this option if machine has auxiliary part cooling fan");
def->tooltip = L("Enable this option if machine has auxiliary part cooling fan. G-code command: M106 P2 S(0-255).");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));

Expand Down Expand Up @@ -2217,18 +2217,19 @@ def = this->add("filament_loading_speed", coFloats);
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloat(0));

// Orca: may remove this option later
def =this->add("support_chamber_temp_control",coBool);
def->label=L("Support control chamber temperature");
def->tooltip=L("This option is enabled if machine support controlling chamber temperature");
def->tooltip=L("This option is enabled if machine support controlling chamber temperature\nG-code command: M141 S(0-255)");
def->mode=comDevelop;
def->set_default_value(new ConfigOptionBool(false));
def->set_default_value(new ConfigOptionBool(true));
def->readonly=false;

def =this->add("support_air_filtration",coBool);
def->label=L("Support air filtration");
def->tooltip=L("Enable this if printer support air filtration");
def->tooltip=L("Enable this if printer support air filtration\nG-code command: M106 P3 S(0-255)");
def->mode=comDevelop;
def->set_default_value(new ConfigOptionBool(false));
def->set_default_value(new ConfigOptionBool(true));

def = this->add("gcode_flavor", coEnum);
def->label = L("G-code flavor");
Expand Down Expand Up @@ -2661,7 +2662,7 @@ def = this->add("filament_loading_speed", coFloats);
def = this->add("additional_cooling_fan_speed", coInts);
def->label = L("Fan speed");
def->tooltip = L("Speed of auxiliary part cooling fan. Auxiliary fan will run at this speed during printing except the first several layers "
"which is defined by no cooling layers");
"which is defined by no cooling layers.\nPlease enable auxiliary_fan in printer settings to use this feature. G-code command: M106 P2 S(0-255)");
def->sidetext = L("%");
def->min = 0;
def->max = 100;
Expand Down Expand Up @@ -3897,6 +3898,12 @@ def = this->add("filament_loading_speed", coFloats);
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(false));

def = this->add("activate_chamber_temp_control",coBools);
def->label = L("Activate temperature control");
def->tooltip = L("Enable this option for chamber temperature control. An M191 command will be added before \"machine_start_gcode\"\nG-code commands: M141/M191 S(0-255)");
def->mode = comSimple;
def->set_default_value(new ConfigOptionBools{false});

def = this->add("chamber_temperature", coInts);
def->label = L("Chamber temperature");
def->tooltip = L("Higher chamber temperature can help suppress or reduce warping and potentially lead to higher interlayer bonding strength for high temperature materials like ABS, ASA, PC, PA and so on."
Expand Down
4 changes: 3 additions & 1 deletion src/libslic3r/PrintConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,6 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
((ConfigOptionBool, spiral_mode))
((ConfigOptionInt, standby_temperature_delta))
((ConfigOptionInts, nozzle_temperature))
((ConfigOptionInts , chamber_temperature))
((ConfigOptionBools, wipe))
// BBS
((ConfigOptionInts, nozzle_temperature_range_low))
Expand Down Expand Up @@ -1137,6 +1136,9 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
((ConfigOptionString, notes))
((ConfigOptionString, printer_notes))

((ConfigOptionBools, activate_chamber_temp_control))
((ConfigOptionInts , chamber_temperature))



)
Expand Down
11 changes: 3 additions & 8 deletions src/slic3r/GUI/OptionsGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1250,14 +1250,9 @@ wxString OptionsGroup::get_url(const std::string& path_end)
anchor.Replace(L" ", "-");
str = str.Left(pos) + anchor;
}
// Softfever: point to sf wiki for seam parameters
if (path_end == "Seam") {
return wxString::Format(L"https://github.com/SoftFever/OrcaSlicer/wiki/%s", from_u8(path_end));
}
else {
//BBS
return wxString::Format(L"https://wiki.bambulab.com/%s/software/bambu-studio/%s", L"en", str);
}
// Orca: point to sf wiki for seam parameters
return wxString::Format(L"https://github.com/SoftFever/OrcaSlicer/wiki/Print-settings/%s", from_u8(path_end));

}

bool OptionsGroup::launch_browser(const std::string& path_end)
Expand Down
20 changes: 11 additions & 9 deletions src/slic3r/GUI/Tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2725,11 +2725,14 @@ void TabFilament::build()
optgroup->append_line(line);


optgroup = page->new_optgroup(L("Print temperature"), L"param_temperature");
optgroup->append_single_option_line("chamber_temperature","chamber-temperature");
optgroup = page->new_optgroup(L("Print chamber temperature"), L"param_chamber_temp");
optgroup->append_single_option_line("chamber_temperature", "chamber-temperature");
optgroup->append_single_option_line("activate_chamber_temp_control", "chamber-temperature");

optgroup->append_separator();


optgroup = page->new_optgroup(L("Print temperature"), L"param_temperature");
line = { L("Nozzle"), L("Nozzle temperature when printing") };
line.append_option(optgroup->get_option("nozzle_temperature_initial_layer"));
line.append_option(optgroup->get_option("nozzle_temperature"));
Expand Down Expand Up @@ -2829,11 +2832,11 @@ void TabFilament::build()
optgroup->append_single_option_line("support_material_interface_fan_speed");

optgroup = page->new_optgroup(L("Auxiliary part cooling fan"), L"param_cooling_fan");
optgroup->append_single_option_line("additional_cooling_fan_speed");
optgroup->append_single_option_line("additional_cooling_fan_speed", "auxiliary-fan");

optgroup = page->new_optgroup(L("Exhaust fan"),L"param_cooling_fan");

optgroup->append_single_option_line("activate_air_filtration");
optgroup->append_single_option_line("activate_air_filtration", "air-filtration");

line = {L("During print"), ""};
line.append_option(optgroup->get_option("during_print_exhaust_fan_speed"));
Expand Down Expand Up @@ -3004,8 +3007,7 @@ void TabFilament::toggle_options()
toggle_line("cool_plate_temp_initial_layer", is_BBL_printer);
toggle_line("eng_plate_temp_initial_layer", is_BBL_printer);
toggle_line("textured_plate_temp_initial_layer", is_BBL_printer);
// bool support_chamber_temp_control = this->m_preset_bundle->printers.get_selected_preset().config.opt_bool("support_chamber_temp_control");
// toggle_option("chamber_temperature", !is_BBL_printer || support_chamber_temp_control);

}
if (m_active_page->title() == L("Setting Overrides"))
update_filament_overrides_page();
Expand Down Expand Up @@ -3166,9 +3168,9 @@ void TabPrinter::build_fff()
optgroup = page->new_optgroup(L("Accessory") /*, L"param_accessory"*/);
optgroup->append_single_option_line("nozzle_type");
optgroup->append_single_option_line("nozzle_hrc");
optgroup->append_single_option_line("auxiliary_fan");
optgroup->append_single_option_line("support_chamber_temp_control");
optgroup->append_single_option_line("support_air_filtration");
optgroup->append_single_option_line("auxiliary_fan", "auxiliary-fan");
optgroup->append_single_option_line("support_chamber_temp_control", "chamber-temperature");
optgroup->append_single_option_line("support_air_filtration", "air-filtration");

const int gcode_field_height = 15; // 150
const int notes_field_height = 25; // 250
Expand Down

0 comments on commit 90601c0

Please sign in to comment.