Browse Source

retraction calibration: now with multiple temperature
update the html

supermerill 4 years ago
parent
commit
8711e9fa37

+ 31 - 7
resources/calibration/retraction/retraction.html

@@ -20,12 +20,36 @@
 </tbody>
 </table>
 
-<p>it's preferable to have done the flow and temperature calibration.
-This calibration will help you to choose the right retraction legnth for your extrudr and the current filament.</p>
-<p>This test will print some retraction test patches</h2>
-<p>The goal is to choose the highest temperature possible that doesn't produce artifacts.</p>
-<p>First, you have to analyse the tower. Each floor has the according temperature written on it.</p>
+<h2>How to</h2>
+<p>It's preferable to have done the flow and temperature calibration.
+This calibration will help you to choose the right retraction length for your extruder and the current filament.</p>
+<p>This test will print a test piece with an increasing retraction length for each millimetre printed in the z axis.</p>
+<h3>Step & Height</h3>
+<p> If you have a direct extruder, it's best to try with a 0.1mm increment and ~ 15 mm height, as it's not common to need more than a mm of retraction.</h2>
+<p> If you have a Bowden extruder, it's best to try with a 0.5mm increment and ~ 15 mm height, as it's not uncommon to need more than 6mm of retraction. You can also use a 0.2 mm increment and a higher height. Be careful, as a high retraction length will greatly increase the risk of a nozzle clog if you have many of them.</h2>
+<h3>Start temp & Decrease temp step</h3>
+<p>By default, it uses the current temp for only one test. So you don't have to touch it unless you also want to optimise the temperature to prevent stringing.</p>
+<p>In the temperature calibration, you got an interval of temperature where your print is "good enough".</p>
+<p>Here, you want to start at the highest temperature acceptable. If you already set it into your filament temperature, you can keep "current" as the Start temp parameter. If you haven't set it yet, select the maximum temperature in the Start temp combo box field.</p>
+<p>After that, choose an option in the "Temp decr" field that won't reduce the temperature too low. "3x10" means that it will print three tests, with the first one at the max temp and each other ones with 10C less temperature.</p>
+<h3>Remove filament slowdown</h3>
+This button will change your settings in filament/cooling to disable all features that trigger when a layer is too small to be able to cool down in time. With these algorithms disabled, your print will be more challenging in terms of retraction, so it's a good stress test. To re-enable them, remove all modifications from the filament tab (the little orange 'back arrow").
+<h3>Results</h3>
+<p>When the test pieces are printed, you can count the millimetre with the ridges on the sides of the print towers. I count them with my nail. When you're at the height where there are no more strings, you can write down the millimetre number. Multiply it by your step parameter (0.2, 0.2, 0.5 or 1) and you have your retraction length number. You can add 20% more length to have a little margin.</p>
+<p>If you have multiple prints with different temperatures, you need to choose the best print, the one with the least amount of stringing, unless the decrease in stringing isn't big enough to warrant the decrease in temperature.
+<h2>Example</h2>
+<table width="100%">
+<tbody>
+<tr>
+<td><img src="./retraction.jpg" width="480" height="270" /></td>
+<td>In this print, the last little string happen at the height of ~10. As I've used a 0.5 step, it means that I need at least 5mm of retraction, but I'll set it to 6 to be sure to remove almost all stringing.</td>
+<td>
+</tr>
+</tbody>
+</table>
+<p> </p>
 <h2>Notes</h2>
-<p>The retraction speed should be set to the maximum value your extruder/drivers/firmware can reliably support.</p>
+<p>The retraction speed should be set to the maximum value your extruder/drivers/firmware can reliably support, with a safety margin. 50mm/s for retraction and 20mm/s for unretraction is a good start for pla.</p>
+<p>Licence for models used for this calibration test: CC BY-SA 3.0</p>
 </body>
-</html>
+</html>

BIN
resources/calibration/retraction/retraction.jpg


+ 62 - 51
src/slic3r/GUI/CalibrationRetractionDialog.cpp

@@ -27,17 +27,21 @@ void CalibrationRetractionDialog::create_buttons(wxStdDialogButtonSizer* buttons
     steps->SetToolTip(_(L("Each militer add this value to the retraction value. ")));
     steps->SetSelection(1);
     wxString choices_nb[] = { "2","4","6","8","10","15","20","25" };
-    nb_steps = new wxComboBox(this, wxID_ANY, wxString{ "10" }, wxDefaultPosition, wxDefaultSize, 8, choices_nb);
+    nb_steps = new wxComboBox(this, wxID_ANY, wxString{ "15" }, wxDefaultPosition, wxDefaultSize, 8, choices_nb);
     nb_steps->SetToolTip(_(L("Select the number milimeters for the tower.")));
-    nb_steps->SetSelection(4);
+    nb_steps->SetSelection(5);
     //wxString choices_start[] = { "current","260","250","240","230","220","210" };
     //start_step = new wxComboBox(this, wxID_ANY, wxString{ "current" }, wxDefaultPosition, wxDefaultSize, 7, choices_start);
     //start_step->SetToolTip(_(L("Select the highest temperature to test for.")));
     //start_step->SetSelection(0);
-    //wxString choices_decr[] = { "one test","2x10°","3x10°","4x10°","3x5°","5x5°" };
-    //decr_temp = new wxComboBox(this, wxID_ANY, wxString{ "current" }, wxDefaultPosition, wxDefaultSize, 6, choices_decr);
-    //decr_temp->SetToolTip(_(L("Select the number tower to print, and by how many degrees C to decrease each time.")));
-    //decr_temp->SetSelection(0);
+    const DynamicPrintConfig* filament_config = this->gui_app->get_tab(Preset::TYPE_FILAMENT)->get_config();
+    int temp = int((2 + filament_config->option<ConfigOptionInts>("temperature")->get_at(0)) / 5) * 5;
+    auto size = wxSize(4 * em_unit(), wxDefaultCoord);
+    temp_start = new wxTextCtrl(this, wxID_ANY, std::to_string(temp), wxDefaultPosition, size);
+    wxString choices_decr[] = { "one test","2x10°","3x10°","4x10°","3x5°","5x5°" };
+    decr_temp = new wxComboBox(this, wxID_ANY, wxString{ "current" }, wxDefaultPosition, wxDefaultSize, 6, choices_decr);
+    decr_temp->SetToolTip(_(L("Select the number tower to print, and by how many degrees C to decrease each time.")));
+    decr_temp->SetSelection(0);
 
     buttons->Add(new wxStaticText(this, wxID_ANY, wxString{ "step:" }));
     buttons->Add(steps);
@@ -46,12 +50,12 @@ void CalibrationRetractionDialog::create_buttons(wxStdDialogButtonSizer* buttons
     buttons->Add(nb_steps);
     buttons->AddSpacer(20);
 
-    //buttons->Add(new wxStaticText(this, wxID_ANY, wxString{ "start temp:" }));
-    //buttons->Add(start_step);
-    //buttons->AddSpacer(15);
-    //buttons->Add(new wxStaticText(this, wxID_ANY, wxString{ "temp decr:" }));
-    //buttons->Add(decr_temp);
-    //buttons->AddSpacer(20);
+    buttons->Add(new wxStaticText(this, wxID_ANY, wxString{ "start temp:" }));
+    buttons->Add(temp_start);
+    buttons->AddSpacer(15);
+    buttons->Add(new wxStaticText(this, wxID_ANY, wxString{ "temp decr:" }));
+    buttons->Add(decr_temp);
+    buttons->AddSpacer(20);
 
     wxButton* bt = new wxButton(this, wxID_FILE1, _(L("Remove fil. slowdown")));
     bt->Bind(wxEVT_BUTTON, &CalibrationRetractionDialog::remove_slowdown, this);
@@ -95,18 +99,20 @@ void CalibrationRetractionDialog::create_geometry(wxCommandEvent& event_args) {
 
     size_t nb_retract = nb_steps->GetSelection() < 4 ? ((int(nb_steps->GetSelection()) + 1) * 2) : ((int(nb_steps->GetSelection()) - 2) * 5);
     size_t nb_items = 1;
-    //if (start_step->GetSelection() == 1) {
-    //    nb_items = 2;
-    //} else if (start_step->GetSelection() == 2 || start_step->GetSelection() == 4) {
-    //    nb_items = 3;
-    //} else if (start_step->GetSelection() == 3) {
-    //    nb_items = 4;
-    //} else if (start_step->GetSelection() == 5) {
-    //    nb_items = 5;
-    //}
- 
+    if (decr_temp->GetSelection() == 1) {
+        nb_items = 2;
+    } else if (decr_temp->GetSelection() == 2 || decr_temp->GetSelection() == 4) {
+        nb_items = 3;
+    } else if (decr_temp->GetSelection() == 3) {
+        nb_items = 4;
+    } else if (decr_temp->GetSelection() == 5) {
+        nb_items = 5;
+    }
+    int temp_decr = (decr_temp->GetSelection() < 4) ? 10 : 5;
+
 
     std::vector<std::string> items;
+    for (size_t i = 0; i < nb_items; i++)
         items.emplace_back(Slic3r::resources_dir() + "/calibration/retraction/retraction_calibration.amf");
     std::vector<size_t> objs_idx = plat->load_files(items, true, false, false);
 
@@ -115,9 +121,12 @@ void CalibrationRetractionDialog::create_geometry(wxCommandEvent& event_args) {
     const DynamicPrintConfig* print_config = this->gui_app->get_tab(Preset::TYPE_PRINT)->get_config();
     const DynamicPrintConfig* printer_config = this->gui_app->get_tab(Preset::TYPE_PRINTER)->get_config();
     const DynamicPrintConfig* filament_config = this->gui_app->get_tab(Preset::TYPE_FILAMENT)->get_config();
-    
+
     double retraction_start = 0;
-    int temp = filament_config->option<ConfigOptionInts>("temperature")->get_at(0);
+    std::string str = temp_start->GetValue().ToStdString();
+    int temp = int((2 + filament_config->option<ConfigOptionInts>("temperature")->get_at(0)) / 5) * 5;
+    if (str.find_first_not_of("0123456789") == std::string::npos)
+        temp = std::atoi(str.c_str());
 
     double retraction_steps = 0.01;
     if (steps->GetSelection() == 0)
@@ -154,12 +163,18 @@ void CalibrationRetractionDialog::create_geometry(wxCommandEvent& event_args) {
     //add sub-part after scale
     float zshift = (1 - scale) / 2 + 0.4 * scale;
     float zscale_number = (first_layer_height + layer_height) / 0.4;
-    std::vector<ModelObject*> part_tower;
-    //add_part(model.objects[objs_idx[0]], Slic3r::resources_dir()+"/calibration/filament_temp/t215.amf", Vec3d{ 0,0,zshift-5.2*scale }, Vec3d{ scale,scale,scale });
-    //model.objects[objs_idx[0]]->volumes[1]->rotate(PI/2, Vec3d(0, 0, 1));
-    //model.objects[objs_idx[0]]->volumes[1]->rotate(-PI / 2, Vec3d(1, 0, 0));
-    for (size_t num_retract = 0; num_retract < nb_retract; num_retract++) {
-        part_tower.push_back(add_part(model.objects[objs_idx[0]], Slic3r::resources_dir()+"/calibration/retraction/retraction_calibration_pillar.amf", Vec3d{ 0,0,zshift + scale * num_retract }, Vec3d{ scale,scale,scale }));
+    std::vector < std::vector<ModelObject*>> part_tower;
+    for (size_t id_item = 0; id_item < nb_items; id_item++) {
+        part_tower.emplace_back();
+        int mytemp = temp - temp_decr * id_item;
+        if (mytemp > 285) mytemp = 285;
+        if (mytemp < 180) mytemp = 180;
+        add_part(model.objects[objs_idx[id_item]], Slic3r::resources_dir() + "/calibration/filament_temp/t"+ std::to_string(mytemp) + ".amf", Vec3d{ 0,0,zshift - 5.2 * scale }, Vec3d{ scale,scale,scale });
+        model.objects[objs_idx[id_item]]->volumes[1]->rotate(PI / 2, Vec3d(0, 0, 1));
+        model.objects[objs_idx[id_item]]->volumes[1]->rotate(-PI / 2, Vec3d(1, 0, 0));
+        for (int num_retract = 0; num_retract < nb_retract; num_retract++) {
+            part_tower.back().push_back(add_part(model.objects[objs_idx[id_item]], Slic3r::resources_dir() + "/calibration/retraction/retraction_calibration_pillar.amf", Vec3d{ 0,0,zshift + scale * num_retract }, Vec3d{ scale,scale,scale }));
+        }
     }
 
     /// --- translate ---;
@@ -168,8 +183,14 @@ void CalibrationRetractionDialog::create_geometry(wxCommandEvent& event_args) {
     const float brim_width = std::max(print_config->option<ConfigOptionFloat>("brim_width")->value, nozzle_diameter * 5.);
     Vec2d bed_size = BoundingBoxf(bed_shape->values).size();
     Vec2d bed_min = BoundingBoxf(bed_shape->values).min;
-    float offsety = 2 + 22 * 1 + extruder_clearance_radius->value + brim_width + (brim_width > extruder_clearance_radius->value ? brim_width - extruder_clearance_radius->value : 0);
-    model.objects[objs_idx[0]]->translate({ bed_min.x() + bed_size.x() / 2, bed_min.y() + bed_size.y() / 2, 0 });
+    float offset = 4 + 26 * 1 + extruder_clearance_radius->value + brim_width + (brim_width > extruder_clearance_radius->value ? brim_width - extruder_clearance_radius->value : 0);
+    if (nb_items == 1) {
+        model.objects[objs_idx[0]]->translate({ bed_min.x() + bed_size.x() / 2, bed_min.y() + bed_size.y() / 2, 0 });
+    } else {
+        for (size_t i = 0; i < nb_items; i++) {
+            model.objects[objs_idx[i]]->translate({ bed_min.x() + bed_size.x() / 2 + (i%2 ==0 ? -offset/2: offset/2), bed_min.y() + bed_size.y() / 2 + ( (i/2) % 2 == 0 ? -1 : 1) * offset * (((i / 2) + 1) / 2), 0 });
+        }
+    }
 
 
 
@@ -178,18 +199,6 @@ void CalibrationRetractionDialog::create_geometry(wxCommandEvent& event_args) {
         //speed
         double perimeter_speed = print_config->option<ConfigOptionFloat>("perimeter_speed")->value;
         double external_perimeter_speed = print_config->option<ConfigOptionFloatOrPercent>("external_perimeter_speed")->get_abs_value(perimeter_speed);
-        //filament test
-        //const ConfigOptionInts* fil_conf = filament_config->option<ConfigOptionInts>("slowdown_below_layer_time");
-        //ConfigOptionInts* new_fil_conf = new ConfigOptionInts();
-        //new_fil_conf->default_value = 5;
-        //new_fil_conf->values = fil_conf->values;
-        //new_fil_conf->values[0] = 0;
-        //model.objects[objs_idx[i]]->config.set_key_value("slowdown_below_layer_time", new_fil_conf);
-        //fil_conf = filament_config->option<ConfigOptionInts>("temperature");
-        //new_fil_conf = new ConfigOptionInts();
-        //new_fil_conf->values = fil_conf->values;
-        //new_fil_conf->values[0] = 150;
-        //model.objects[objs_idx[i]]->config.set_key_value("temperature", new_fil_conf);
         //brim to have some time to build up pressure in the nozzle
         model.objects[objs_idx[i]]->config.set_key_value("brim_width", new ConfigOptionFloat(0));
         model.objects[objs_idx[i]]->config.set_key_value("perimeters", new ConfigOptionInt(2));
@@ -207,14 +216,16 @@ void CalibrationRetractionDialog::create_geometry(wxCommandEvent& event_args) {
         model.objects[objs_idx[i]]->config.set_key_value("gap_fill", new ConfigOptionBool(false));
         model.objects[objs_idx[i]]->config.set_key_value("first_layer_height", new ConfigOptionFloatOrPercent(nozzle_diameter / 2., false));
         model.objects[objs_idx[i]]->config.set_key_value("layer_height", new ConfigOptionFloat(nozzle_diameter / 2.));
+        //temp
+        model.objects[objs_idx[i]]->config.set_key_value("print_temperature", new ConfigOptionInt(int(temp - temp_decr * i)));
         //set retraction override
-        int num_part = 0;
-        for (ModelObject* part : part_tower) {
-            model.objects[objs_idx[i]]->volumes[num_part + 1]->config.set_key_value("print_retract_length", new ConfigOptionFloat(retraction_start + num_part * retraction_steps));
-            model.objects[objs_idx[i]]->volumes[num_part + 1]->config.set_key_value("small_perimeter_speed", new ConfigOptionFloatOrPercent(external_perimeter_speed, false));
-            model.objects[objs_idx[i]]->volumes[num_part + 1]->config.set_key_value("perimeter_speed", new ConfigOptionFloat(std::min(external_perimeter_speed, perimeter_speed)));
-            model.objects[objs_idx[i]]->volumes[num_part + 1]->config.set_key_value("external_perimeter_speed", new ConfigOptionFloatOrPercent(external_perimeter_speed, false));
-            model.objects[objs_idx[i]]->volumes[num_part + 1]->config.set_key_value("small_perimeter_speed", new ConfigOptionFloatOrPercent(external_perimeter_speed, false));
+        size_t num_part = 0;
+        for (ModelObject* part : part_tower[i]) {
+            model.objects[objs_idx[i]]->volumes[num_part + 2]->config.set_key_value("print_retract_length", new ConfigOptionFloat(retraction_start + num_part * retraction_steps));
+            model.objects[objs_idx[i]]->volumes[num_part + 2]->config.set_key_value("small_perimeter_speed", new ConfigOptionFloatOrPercent(external_perimeter_speed, false));
+            model.objects[objs_idx[i]]->volumes[num_part + 2]->config.set_key_value("perimeter_speed", new ConfigOptionFloat(std::min(external_perimeter_speed, perimeter_speed)));
+            model.objects[objs_idx[i]]->volumes[num_part + 2]->config.set_key_value("external_perimeter_speed", new ConfigOptionFloatOrPercent(external_perimeter_speed, false));
+            model.objects[objs_idx[i]]->volumes[num_part + 2]->config.set_key_value("small_perimeter_speed", new ConfigOptionFloatOrPercent(external_perimeter_speed, false));
             //model.objects[objs_idx[i]]->volumes[num_part + 1]->config.set_key_value("infill_speed", new ConfigOptionFloat(std::min(print_config->option<ConfigOptionFloat>("infill_speed")->value, 10.*scale)));
             num_part++;
         }

+ 2 - 1
src/slic3r/GUI/CalibrationRetractionDialog.hpp

@@ -20,7 +20,8 @@ protected:
 
     wxComboBox* steps;
     wxComboBox* nb_steps;
-    wxComboBox* start_step;
+    //wxComboBox* start_step;
+    wxTextCtrl* temp_start;
     wxComboBox* decr_temp;
 };
 

+ 2 - 2
src/slic3r/GUI/MainFrame.cpp

@@ -775,13 +775,13 @@ void MainFrame::init_menubar()
             [this](wxCommandEvent&) { wxGetApp().flow_ratio_dialog(); });
         append_menu_item(calibrationMenu, wxID_ANY, _(L("Filament temperature calibration")), _(L("Create a test print to help you to set your filament temperature.")),
             [this](wxCommandEvent&) { wxGetApp().filament_temperature_dialog(); });
+        append_menu_item(calibrationMenu, wxID_ANY, _(L("Extruder retraction calibration")), _(L("Create a test print to help you to set your retraction length.")),
+            [this](wxCommandEvent&) { wxGetApp().calibration_retraction_dialog(); });
         calibrationMenu->AppendSeparator();
         append_menu_item(calibrationMenu, wxID_ANY, _(L("Bridge flow calibration")), _(L("Create a test print to help you to set your bridge flow ratio.")),
             [this](wxCommandEvent&) { wxGetApp().bridge_tuning_dialog(); });
         append_menu_item(calibrationMenu, wxID_ANY, _(L("Ironing pattern calibration")), _(L("Create a test print to help you to set your over-bridge flow ratio and ironing pattern.")),
             [this](wxCommandEvent&) { wxGetApp().over_bridge_dialog(); });
-        append_menu_item(calibrationMenu, wxID_ANY, _(L("Extruder retraction calibration")), _(L("Create a test print to help you to set your retraction length.")),
-            [this](wxCommandEvent&) { wxGetApp().calibration_retraction_dialog(); });
         calibrationMenu->AppendSeparator();
         append_menu_item(calibrationMenu, wxID_ANY, _(L("Calibration cube")), _(L("Print a calibration cube, for various calibration goals.")),
             [this](wxCommandEvent&) { wxGetApp().calibration_cube_dialog(); });