Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pressure advance calibration tool #4115

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9a7c22c
update Archwiki link on readme
supermerill Dec 19, 2023
94cb239
SET_VELOCITY_LIMIT ACCEL_TO_DECEL klipper support added.
legend069 Jan 24, 2024
bfdff0d
small changes
legend069 Jan 29, 2024
cb1e694
improvements
legend069 Feb 7, 2024
36aac66
Revert "improvements"
legend069 Feb 10, 2024
fd0a500
Revert "small changes"
legend069 Feb 10, 2024
30740c0
Revert "SET_VELOCITY_LIMIT ACCEL_TO_DECEL klipper support added."
legend069 Feb 10, 2024
662de89
pressure advance calibration tool
legend069 Feb 10, 2024
f881932
3mf files update
legend069 Mar 6, 2024
de0fdac
moved files new folder
legend069 Mar 7, 2024
e30e639
big scaling improvements
legend069 Mar 7, 2024
d5e5ad2
small changes for positioning/scaling
legend069 Apr 14, 2024
41b0922
right border now scales with numbers!
legend069 Apr 21, 2024
36eb3f2
small changes to the border scale and prefill for 'before_layer_gcode'
legend069 May 4, 2024
164fb0e
Merge branch 'master' into pressure_advance
legend069 Jun 6, 2024
abd6e68
updated to 2.5.59.11
legend069 Jun 13, 2024
fd29e2a
new hidden setting: object_gcode
supermerill Jun 12, 2024
3a083af
new hidden setting: region_gcode
supermerill Jun 12, 2024
2764258
Update to acceleration: move to object/region & cleaning alongside it.
supermerill Jun 13, 2024
ec69553
merged commits for region_gcode
legend069 Jul 4, 2024
a009745
patches for beta v1.00
legend069 Jul 4, 2024
db10740
Merge branch 'supermerill:master' into pressure_advance
legend069 Jul 5, 2024
b22b846
updated with master
legend069 Jul 11, 2024
4e18c6a
CalibrationPressureAdvDialog: patches for beta v1.00
legend069 Jun 13, 2024
d0ac753
files update
legend069 Jul 23, 2024
4f90f10
big overhall, lots of refractoring and improvements.
legend069 Jul 30, 2024
f01651a
welcome page updated. and bug fixes.
legend069 Jul 31, 2024
754cec1
small updates for PA tool
legend069 Aug 27, 2024
2713b54
first_layer gap fill gone!!
legend069 Sep 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added resources/calibration/filament_pressure/0.3mf
Binary file not shown.
Binary file added resources/calibration/filament_pressure/1.3mf
Binary file not shown.
Binary file added resources/calibration/filament_pressure/2.3mf
Binary file not shown.
Binary file added resources/calibration/filament_pressure/3.3mf
Binary file not shown.
Binary file added resources/calibration/filament_pressure/4.3mf
Binary file not shown.
Binary file added resources/calibration/filament_pressure/5.3mf
Binary file not shown.
Binary file added resources/calibration/filament_pressure/6.3mf
Binary file not shown.
Binary file added resources/calibration/filament_pressure/7.3mf
Binary file not shown.
Binary file added resources/calibration/filament_pressure/8.3mf
Binary file not shown.
Binary file added resources/calibration/filament_pressure/9.3mf
Binary file not shown.
Binary file not shown.
108 changes: 108 additions & 0 deletions resources/calibration/filament_pressure/filament_pressure.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Pressure Advance Calibration</title>
<style>
body {
font-family: Arial, sans-serif;
line-height: 1.6;
}
h1, h2 {
color: #333;
text-align: center;
}
ul {
list-style-type: disc;
margin-left: 20px;
}
p, li {
margin: 10px 0;
}
.warning {
color: red;
font-weight: bold;
}
.info {
font-style: italic;
}
.right-align {
text-align: right;
}
</style>
</head>
<body>

<table width="100%">
<tbody>
<tr>
<td style="text-align: center;">
<h1>Pressure Advance Calibration</h1>
</td>
</tr>
<tr>
<td style="text-align: right;">
<strong>
<table><tr><td>Requirements:</td>
<td style="text-align: left;">Perfect Bed Leveling and Layer Squish</td></tr>
</table>
</strong>
</tr>
</tbody>
</table>

<p><span style="color: red; font-weight: bold;">This test is still in development. The beta version should work well, but your current print settings need to be saved before clicking "Generate" since they are used to create the model.</span></p>

<p>Note: This test will automatically pull all your currently saved configuration parameters and generate a model for you to print. For optimal results, depending if you're chasing speed/quality or a mix of both, it is recommended to keep similar speeds for most extrusion roles, (although this is not mandatory).</p>

<h2>How to Tune Your Printer for Pressure/Linear Advance</h2>
<p>To get started:</p>
<ul>
<li>Select the number of tests to create, the <b>max</b> is <b>10</b>.</li>
<li>Each row represents the config parameters for the selected extrusion role (e.g., first row = ExternalPerimeter, second row = FirstLayer).</li>
<li>Select the start/end and increment values, <b>you can manually edit these values if you want larger or smaller values.</b></li>
<li>Since each model will have its own config, one test model might print faster or slower than others. This is expected and normal.</li>
<li>This is the first calibration tool that supports <b>Arachne!</b> so leave it enabled if you use Arachne. </li>
<li>Helpful tip: If you are running multiple tests on a single plate, take a screenshot of the main configuration page (or leave it open and drag the window out of the way) to match the row number to the ID label on the bottom right of the loaded model. (counting starts at '0' ☺)<br>
You can also inspect each 'base model' and view the object modifiers for each 90° bend model, the 'region_gcode' will have a comment for the extrusion role.<br></li>
</ul>

<li>if you use PA/LA commands in your <b>feature_gcode</b> it will be auto commented</li>

<p>Currently unsupported roles:</p>
<ul>
<li>BridgeInfill, InternalBridgeInfill, ThinWall, GapFill, Ironing</li>
</ul>
<p>What is the "Verify" option?<br>
The "Verify" option is an experimental feature. It aims to create a 90° model for each extrusion role, applying specific settings related to that extrusion role. <br>
You need to <b>manually</b> add the pressure advance values into the "per region g-code" box.<br>
However, it currently doesn't work perfectly. Occasionally the models get 'gap fill' and that will produce inaccurate results. Select the "verify" option to identify which extrusion roles need Pressure Advance tuning.</p>

<h2>Known Bugs</h2>
<ul>
<li>Setting the first layer's PA value for multiple tests only applies the last row's value to (before_layer_gcode).</li>
<li>The first layer may receive gap fill on the 90° bend models; it is recommended to disable gap fill in the object modifiers if this occurs.</li>
<li>Occasionally some numbers might get scaled wrong so they won't show up on the G-code preview, this has primarily been for number '1'. If this happens, adjust main config 'thin_perimeters' to '-1'.</li>
<li>Other minor bugs may be present.</li>
</ul>

<h2>Advice</h2>
<p>Before calibrating Pressure/Linear Advance, it is recommended to tune everything else first!<br>
<p>You may need to disable or adjust your part cooling config for this test, including the features that slow down layer times. Note: Large variances in ER speeds can reduce print quality and dimensional accuracy.</p>
<p>It's recommended to set 'first_layer_min_speed' and 'first_layer_speed' to the same values, since the variance in speeds will mess with the first layer's pressure advance adjustments.</p>

<h2>Notes</h2>
<p><strong>TODO: add pictures</p>

<table width="100%">
<tbody>
<tr>
<td style="text-align: right;">
<p>This testing method originated from <a href="https://ellis3dp.com/Print-Tuning-Guide/">ellis3dp.com/Print-Tuning-Guide</a>. You can find the original generator <a href="https://ellis3dp.com/Pressure_Linear_Advance_Tool/">here</a>.</p>
</td>
</tr>
</tbody>
</table>

</body>
</html>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions resources/localization/list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ src/slic3r/GUI/CalibrationCubeDialog.cpp
src/slic3r/GUI/CalibrationFlowDialog.cpp
src/slic3r/GUI/CalibrationOverBridgeDialog.cpp
src/slic3r/GUI/CalibrationRetractionDialog.cpp
src/slic3r/GUI/CalibrationPressureAdvDialog.cpp
src/slic3r/GUI/CalibrationTempDialog.cpp
src/slic3r/GUI/ConfigManipulation.cpp
src/slic3r/GUI/ConfigSnapshotDialog.cpp
Expand Down
2 changes: 1 addition & 1 deletion resources/ui_layout/default/filament.ui
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ group:Fan speed - default
setting:id$0:label_width$12:label$Interface:support_material_interface_fan_speed
line:Bridges fan speed
setting:id$0:label_width$12:label$Bridges:bridge_fan_speed
setting:id$0:label_width$12:label$Internal bridges:bridge_internal_fan_speed
setting:id$0:label_width$12:label$Internal bridges:internal_bridge_fan_speed
line:Overhangs Perimeter fan speed
setting:id$0:label_width$12:label$Overhangs:overhangs_fan_speed
line:Gap fill fan speed
Expand Down
5 changes: 3 additions & 2 deletions resources/ui_layout/default/print.ui
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ group:label_width$8:sidetext_width$7:Speed for print moves
setting:width$4:brim_speed
line:Bridge speed
setting:width$4:bridge_speed
setting:width$4:bridge_speed_internal
setting:width$4:internal_bridge_speed
setting:width$4:overhangs_speed
line:Gap fill speed
setting:width$4:label$Maximum speed:gap_fill_speed
Expand Down Expand Up @@ -384,7 +384,7 @@ group:label_width$9:sidetext_width$8:Acceleration control (advanced)
setting:width$4:brim_acceleration
line:Bridge acceleration
setting:width$4:bridge_acceleration
setting:width$4:bridge_internal_acceleration
setting:width$4:internal_bridge_acceleration
setting:width$4:overhangs_acceleration
line:Other extrusions acceleration
setting:width$4:gap_fill_acceleration
Expand Down Expand Up @@ -507,6 +507,7 @@ group:Output file
setting:full_width:output_filename_format
group:Other
gcode_substitutions
setting:per_objects_gcode
group:Post-processing script
setting:full_width:height$5:post_process
post_process_explanation
Expand Down
2 changes: 1 addition & 1 deletion resources/ui_layout/example/filament.ui
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ group:Fan speed - default
setting:id$0:label_width$12:label$Interface:support_material_interface_fan_speed
line:Bridges fan speed
setting:id$0:label_width$12:label$Bridges:bridge_fan_speed
setting:id$0:label_width$12:label$Internal bridges:bridge_internal_fan_speed
setting:id$0:label_width$12:label$Internal bridges:internal_bridge_fan_speed
line:Overhangs Perimeter fan speed
setting:id$0:label_width$12:label$Overhangs:overhangs_fan_speed
line:Gap fill fan speed
Expand Down
5 changes: 3 additions & 2 deletions resources/ui_layout/example/print.ui
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ group:label_width$8:sidetext_width$7:Speed for print moves
setting:width$4:brim_speed
line:Bridge speed
setting:width$4:bridge_speed
setting:width$4:bridge_speed_internal
setting:width$4:internal_bridge_speed
setting:width$4:overhangs_speed
line:Gap fill speed
setting:width$4:label$maximum speed:gap_fill_speed
Expand Down Expand Up @@ -366,7 +366,7 @@ group:label_width$9:sidetext_width$8:Acceleration control (advanced)
setting:width$4:brim_acceleration
line:Bridge acceleration
setting:width$4:bridge_acceleration
setting:width$4:bridge_internal_acceleration
setting:width$4:internal_bridge_acceleration
setting:width$4:overhangs_acceleration
line:Other extrusions acceleration
setting:width$4:gap_fill_acceleration
Expand Down Expand Up @@ -489,6 +489,7 @@ group:Output file
setting:full_width:output_filename_format
group:Other
gcode_substitutions
setting:per_objects_gcode
group:Post-processing script
setting:full_width:height$5:post_process
post_process_explanation
Expand Down
3 changes: 2 additions & 1 deletion src/libslic3r/BuildVolume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ BuildVolume::ObjectState object_state_templ(const indexed_triangle_set &its, con
const stl_vertex p2 = trafo * its.vertices[tri(iedge)];
assert(sign(p1) == s[iprev]);
assert(sign(p2) == s[iedge]);
assert(p1.z() * p2.z() < 0);
assert(p1.z() * p2.z() <= 0);
assert(std::abs(p2.z() - p1.z()) > EPSILON);
// Edge crosses the z plane. Calculate intersection point with the plane.
const float t = (world_min_z - p1.z()) / (p2.z() - p1.z());
(is_inside(Vec3f(p1.x() + (p2.x() - p1.x()) * t, p1.y() + (p2.y() - p1.y()) * t, world_min_z)) ? inside : outside) = true;
Expand Down
59 changes: 43 additions & 16 deletions src/libslic3r/Fill/Fill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ struct SurfaceFillParams : FillParams
RETURN_COMPARE_NON_EQUAL(can_angle_cross);
RETURN_COMPARE_NON_EQUAL(density);
RETURN_COMPARE_NON_EQUAL(monotonic);
RETURN_COMPARE_NON_EQUAL(max_sparse_infill_spacing);
RETURN_COMPARE_NON_EQUAL_TYPED(unsigned, connection);
RETURN_COMPARE_NON_EQUAL_TYPED(unsigned, dont_adjust);

Expand All @@ -70,16 +71,22 @@ struct SurfaceFillParams : FillParams
assert(this->config != nullptr);
assert(rhs.config != nullptr);
if (config != nullptr && rhs.config != nullptr) {
RETURN_COMPARE_NON_EQUAL(config->infill_acceleration);
RETURN_COMPARE_NON_EQUAL(config->infill_speed);
RETURN_COMPARE_NON_EQUAL(config->solid_infill_acceleration);
RETURN_COMPARE_NON_EQUAL(config->solid_infill_speed);
RETURN_COMPARE_NON_EQUAL(config->top_solid_infill_acceleration);
RETURN_COMPARE_NON_EQUAL(config->top_solid_infill_speed);
RETURN_COMPARE_NON_EQUAL(config->ironing_speed);
RETURN_COMPARE_NON_EQUAL(config->default_acceleration);
RETURN_COMPARE_NON_EQUAL(config->default_speed);
RETURN_COMPARE_NON_EQUAL(config->bridge_acceleration);
RETURN_COMPARE_NON_EQUAL(config->bridge_speed);
RETURN_COMPARE_NON_EQUAL(config->bridge_speed_internal);
RETURN_COMPARE_NON_EQUAL(config->internal_bridge_acceleration);
RETURN_COMPARE_NON_EQUAL(config->internal_bridge_speed);
RETURN_COMPARE_NON_EQUAL(config->gap_fill_acceleration);
RETURN_COMPARE_NON_EQUAL(config->gap_fill_speed);
RETURN_COMPARE_NON_EQUAL(config->print_extrusion_multiplier);
RETURN_COMPARE_NON_EQUAL(max_sparse_infill_spacing);
RETURN_COMPARE_NON_EQUAL(config->region_gcode.value);
}
if (config == nullptr || rhs.config == nullptr || max_sparse_infill_spacing == 0)
RETURN_COMPARE_NON_EQUAL(flow.width());
Expand All @@ -92,14 +99,23 @@ struct SurfaceFillParams : FillParams
if ((config != nullptr) != (rhs.config != nullptr))
return false;
if(config != nullptr && (
config->infill_speed != rhs.config->infill_speed
config->infill_acceleration != rhs.config->infill_acceleration
|| config->infill_speed != rhs.config->infill_speed
|| config->solid_infill_acceleration != rhs.config->solid_infill_acceleration
|| config->solid_infill_speed != rhs.config->solid_infill_speed
|| config->top_solid_infill_acceleration != rhs.config->top_solid_infill_acceleration
|| config->top_solid_infill_speed != rhs.config->top_solid_infill_speed
|| config->ironing_speed != rhs.config->ironing_speed
|| config->default_acceleration != rhs.config->default_acceleration
|| config->default_speed != rhs.config->default_speed
|| config->bridge_acceleration != rhs.config->bridge_acceleration
|| config->bridge_speed != rhs.config->bridge_speed
|| config->bridge_speed_internal != rhs.config->bridge_speed_internal
|| config->gap_fill_speed != rhs.config->gap_fill_speed))
|| config->internal_bridge_acceleration != rhs.config->internal_bridge_acceleration
|| config->internal_bridge_speed != rhs.config->internal_bridge_speed
|| config->gap_fill_acceleration != rhs.config->gap_fill_acceleration
|| config->gap_fill_speed != rhs.config->gap_fill_speed
|| config->print_extrusion_multiplier != rhs.config->print_extrusion_multiplier
|| config->region_gcode != rhs.config->region_gcode
))
return false;
// then check params
return this->extruder == rhs.extruder &&
Expand Down Expand Up @@ -765,6 +781,7 @@ void Layer::make_ironing()
double line_spacing;
// Height of the extrusion, to calculate the extrusion flow from.
double height;
double acceleration;
double speed;
double angle;
IroningType type;
Expand All @@ -786,6 +803,10 @@ void Layer::make_ironing()
return true;
if (this->height > rhs.height)
return false;
if (this->acceleration < rhs.acceleration)
return true;
if (this->acceleration > rhs.acceleration)
return false;
if (this->speed < rhs.speed)
return true;
if (this->speed > rhs.speed)
Expand All @@ -797,11 +818,12 @@ void Layer::make_ironing()
return false;
}

bool operator==(const IroningParams &rhs) const {
bool operator==(const IroningParams &rhs) const
{
return this->extruder == rhs.extruder && this->just_infill == rhs.just_infill &&
this->line_spacing == rhs.line_spacing && this->height == rhs.height && this->speed == rhs.speed &&
this->angle == rhs.angle &&
this->type == rhs.type;
this->line_spacing == rhs.line_spacing && this->height == rhs.height &&
this->acceleration == rhs.acceleration && this->speed == rhs.speed &&
this->angle == rhs.angle && this->type == rhs.type;
}

LayerRegion *layerm = nullptr;
Expand Down Expand Up @@ -847,11 +869,16 @@ void Layer::make_ironing()
ironing_params.type = config.ironing_type;
ironing_params.just_infill = false;
ironing_params.line_spacing = config.ironing_spacing;
ironing_params.height = default_layer_height * 0.01 * config.ironing_flowrate;
ironing_params.speed = config.ironing_speed;
ironing_params.angle = config.ironing_angle <0 ?
compute_fill_angle(config, layerm->layer()->id()) :
float(Geometry::deg2rad(config.ironing_angle.value));
ironing_params.height = default_layer_height * 0.01 * config.ironing_flowrate;
ironing_params.acceleration = config.ironing_acceleration;
ironing_params.speed = config.ironing_speed;
if (config.ironing_angle.value >= 0) {
ironing_params.angle = float(Geometry::deg2rad(config.ironing_angle.value));
} else {
ironing_params.angle = compute_fill_angle(config, layerm->layer()->id());
if (config.ironing_angle.value < -1)
ironing_params.angle += float(Geometry::deg2rad(-config.ironing_angle.value));
}
ironing_params.layerm = layerm;
by_extruder.emplace_back(ironing_params);
}
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/Flow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ float Flow::rounded_rectangle_extrusion_spacing(float width, float height, float
#else
if (width == height && width == 0)
return 0.f;
float out = width - height * float(1. - 0.25 * PI) * m_spacing_ratio;
float out = width - height * float(1. - 0.25 * PI) * m_spacing_ratio;//this calculates the real spacing for widths. i need this one.
if (out <= 0.f)
throw FlowErrorNegativeSpacing();
return out;
Expand Down
2 changes: 1 addition & 1 deletion src/libslic3r/Format/BBConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void init()
//key_translation_map["bridge_angle"] = "bridge_angle";
key_translation_map["bridge_density"] = "bridge_overlap_min";
key_translation_map["bridge_no_support"] = "dont_support_bridges";
key_translation_map["internal_bridge_speed"] = "bridge_speed_internal";
//key_translation_map["internal_bridge_speed"] = "internal_bridge_speed";
//key_translation_map["brim_ears"] = "brim_ears";
//key_translation_map["brim_ears_detection_length"] = "brim_ears_detection_length";
//key_translation_map["brim_ears_max_angle"] = "brim_ears_max_angle";
Expand Down
Loading