mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 07:34:03 -06:00
Vfa calibs - Input Shaping & Junction Deviation (#9160)
@RF47 and I have been working on a **two-step input shaping calibration** to help fine-tune print quality and Junction Deviation Test for Marlin2 printers. This is based on [Klipper's Resonance Compensation](https://www.klipper3d.org/Resonance_Compensation.html#resonance-compensation), [Marlin’s M593 G-code](https://marlinfw.org/docs/gcode/M593.html), discussions from [SoftFever/OrcaSlicer#1820](https://github.com/SoftFever/OrcaSlicer/issues/1820), some elements from the [input_shaping branch](https://github.com/SoftFever/OrcaSlicer/tree/feature/input_shaping) and Junction Deviation [Marlin Documentation](https://marlinfw.org/docs/configuration/configuration.html#junction-deviation-) This is for Marlin only, but I'm working on a future Klipper-compatible version here: [VFA-Calibs+Klipper](https://github.com/ianalexis/OrcaSlicer/tree/VFA-Calibs%2BKlipper). However, we don't own a Klipper machine, so we're unsure how to improve it or verify if it works correctly. ### Calibration Steps 1. **Frequency Test** – Helps identify the optimal input shaping frequency. 2. **Damping Test** – Fine-tunes the damping ratio for smoother prints. ### Screenshots         ## Tests - Marlin tested on **Ender 3-class printers** (@RF47 and @ianalexis) - Klipper tested in Voron 2.4 and an FLSun T1 Pro @ShaneDelmore - Tested in Windows and MacOs.
This commit is contained in:
commit
32efc176d9
16 changed files with 925 additions and 35 deletions
|
@ -10192,6 +10192,124 @@ void Plater::calib_VFA(const Calib_Params& params)
|
|||
|
||||
p->background_process.fff_print()->set_calib_params(params);
|
||||
}
|
||||
|
||||
void Plater::calib_input_shaping_freq(const Calib_Params& params)
|
||||
{
|
||||
const auto calib_input_shaping_name = wxString::Format(L"Input shaping Frequency test");
|
||||
new_project(false, false, calib_input_shaping_name);
|
||||
wxGetApp().mainframe->select_tab(size_t(MainFrame::tp3DEditor));
|
||||
if (params.mode != CalibMode::Calib_Input_shaping_freq)
|
||||
return;
|
||||
|
||||
add_model(false, Slic3r::resources_dir() + (params.test_model < 1 ? "/calib/input_shaping/ringing_tower.stl" : "/calib/input_shaping/fast_input_shaping_test.stl"));
|
||||
auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
|
||||
auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
|
||||
filament_config->set_key_value("slow_down_layer_time", new ConfigOptionFloats { 0.0 });
|
||||
filament_config->set_key_value("slow_down_min_speed", new ConfigOptionFloats { 0.0 });
|
||||
filament_config->set_key_value("slow_down_for_layer_cooling", new ConfigOptionBools{false});
|
||||
filament_config->set_key_value("filament_max_volumetric_speed", new ConfigOptionFloats { 200 });
|
||||
filament_config->set_key_value("enable_pressure_advance", new ConfigOptionBools {false });
|
||||
filament_config->set_key_value("pressure_advance", new ConfigOptionFloats { 0.0 });
|
||||
print_config->set_key_value("enable_overhang_speed", new ConfigOptionBool { false });
|
||||
print_config->set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(tlTraditional));
|
||||
print_config->set_key_value("wall_loops", new ConfigOptionInt(1));
|
||||
print_config->set_key_value("top_shell_layers", new ConfigOptionInt(0));
|
||||
print_config->set_key_value("bottom_shell_layers", new ConfigOptionInt(1));
|
||||
print_config->set_key_value("sparse_infill_density", new ConfigOptionPercent(0));
|
||||
print_config->set_key_value("detect_thin_wall", new ConfigOptionBool(false));
|
||||
print_config->set_key_value("spiral_mode", new ConfigOptionBool(true));
|
||||
print_config->set_key_value("spiral_mode_smooth", new ConfigOptionBool(true));
|
||||
model().objects[0]->config.set_key_value("brim_type", new ConfigOptionEnum<BrimType>(btOuterOnly));
|
||||
model().objects[0]->config.set_key_value("brim_width", new ConfigOptionFloat(3.0));
|
||||
model().objects[0]->config.set_key_value("brim_object_gap", new ConfigOptionFloat(0.0));
|
||||
|
||||
changed_objects({ 0 });
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINT)->update_dirty();
|
||||
wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_dirty();
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINT)->update_ui_from_settings();
|
||||
wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_ui_from_settings();
|
||||
|
||||
p->background_process.fff_print()->set_calib_params(params);
|
||||
}
|
||||
|
||||
void Plater::calib_input_shaping_damp(const Calib_Params& params)
|
||||
{
|
||||
const auto calib_input_shaping_name = wxString::Format(L"Input shaping Damping test");
|
||||
new_project(false, false, calib_input_shaping_name);
|
||||
wxGetApp().mainframe->select_tab(size_t(MainFrame::tp3DEditor));
|
||||
if (params.mode != CalibMode::Calib_Input_shaping_damp)
|
||||
return;
|
||||
|
||||
add_model(false, Slic3r::resources_dir() + (params.test_model < 1 ? "/calib/input_shaping/ringing_tower.stl" : "/calib/input_shaping/fast_input_shaping_test.stl"));
|
||||
auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
|
||||
auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
|
||||
filament_config->set_key_value("slow_down_layer_time", new ConfigOptionFloats { 0.0 });
|
||||
filament_config->set_key_value("slow_down_min_speed", new ConfigOptionFloats { 0.0 });
|
||||
filament_config->set_key_value("slow_down_for_layer_cooling", new ConfigOptionBools{false});
|
||||
filament_config->set_key_value("filament_max_volumetric_speed", new ConfigOptionFloats { 200 });
|
||||
filament_config->set_key_value("enable_pressure_advance", new ConfigOptionBools{false});
|
||||
filament_config->set_key_value("pressure_advance", new ConfigOptionFloats{0.0});
|
||||
print_config->set_key_value("enable_overhang_speed", new ConfigOptionBool{false});
|
||||
print_config->set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(tlTraditional));
|
||||
print_config->set_key_value("wall_loops", new ConfigOptionInt(1));
|
||||
print_config->set_key_value("top_shell_layers", new ConfigOptionInt(0));
|
||||
print_config->set_key_value("bottom_shell_layers", new ConfigOptionInt(1));
|
||||
print_config->set_key_value("sparse_infill_density", new ConfigOptionPercent(0));
|
||||
print_config->set_key_value("detect_thin_wall", new ConfigOptionBool(false));
|
||||
print_config->set_key_value("spiral_mode", new ConfigOptionBool(true));
|
||||
print_config->set_key_value("spiral_mode_smooth", new ConfigOptionBool(true));
|
||||
model().objects[0]->config.set_key_value("brim_type", new ConfigOptionEnum<BrimType>(btOuterOnly));
|
||||
model().objects[0]->config.set_key_value("brim_width", new ConfigOptionFloat(3.0));
|
||||
model().objects[0]->config.set_key_value("brim_object_gap", new ConfigOptionFloat(0.0));
|
||||
|
||||
changed_objects({ 0 });
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINT)->update_dirty();
|
||||
wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_dirty();
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINT)->update_ui_from_settings();
|
||||
wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_ui_from_settings();
|
||||
|
||||
p->background_process.fff_print()->set_calib_params(params);
|
||||
}
|
||||
|
||||
void Plater::calib_junction_deviation(const Calib_Params& params)
|
||||
{
|
||||
const auto calib_junction_deviation = wxString::Format(L"Input shaping Damping test");
|
||||
new_project(false, false, calib_junction_deviation);
|
||||
wxGetApp().mainframe->select_tab(size_t(MainFrame::tp3DEditor));
|
||||
if (params.mode != CalibMode::Calib_Junction_Deviation)
|
||||
return;
|
||||
|
||||
add_model(false, Slic3r::resources_dir() + (params.test_model < 1 ? "/calib/input_shaping/ringing_tower.stl" : "/calib/input_shaping/fast_input_shaping_test.stl"));
|
||||
auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
|
||||
auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
|
||||
filament_config->set_key_value("slow_down_layer_time", new ConfigOptionFloats { 0.0 });
|
||||
filament_config->set_key_value("slow_down_min_speed", new ConfigOptionFloats { 0.0 });
|
||||
filament_config->set_key_value("slow_down_for_layer_cooling", new ConfigOptionBools{false});
|
||||
filament_config->set_key_value("filament_max_volumetric_speed", new ConfigOptionFloats{200});
|
||||
filament_config->set_key_value("enable_pressure_advance", new ConfigOptionBools{false});
|
||||
filament_config->set_key_value("pressure_advance", new ConfigOptionFloats{0.0});
|
||||
print_config->set_key_value("enable_overhang_speed", new ConfigOptionBool{false});
|
||||
print_config->set_key_value("timelapse_type", new ConfigOptionEnum<TimelapseType>(tlTraditional));
|
||||
print_config->set_key_value("wall_loops", new ConfigOptionInt(1));
|
||||
print_config->set_key_value("top_shell_layers", new ConfigOptionInt(0));
|
||||
print_config->set_key_value("bottom_shell_layers", new ConfigOptionInt(1));
|
||||
print_config->set_key_value("sparse_infill_density", new ConfigOptionPercent(0));
|
||||
print_config->set_key_value("detect_thin_wall", new ConfigOptionBool(false));
|
||||
print_config->set_key_value("spiral_mode", new ConfigOptionBool(true));
|
||||
print_config->set_key_value("spiral_mode_smooth", new ConfigOptionBool(true));
|
||||
model().objects[0]->config.set_key_value("brim_type", new ConfigOptionEnum<BrimType>(btOuterOnly));
|
||||
model().objects[0]->config.set_key_value("brim_width", new ConfigOptionFloat(3.0));
|
||||
model().objects[0]->config.set_key_value("brim_object_gap", new ConfigOptionFloat(0.0));
|
||||
|
||||
changed_objects({ 0 });
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINT)->update_dirty();
|
||||
wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_dirty();
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINT)->update_ui_from_settings();
|
||||
wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_ui_from_settings();
|
||||
|
||||
p->background_process.fff_print()->set_calib_params(params);
|
||||
}
|
||||
|
||||
BuildVolume_Type Plater::get_build_volume_type() const { return p->bed.get_build_volume_type(); }
|
||||
|
||||
void Plater::import_zip_archive()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue