The correct way of calculating the rate limit

This commit is contained in:
Noisyfox 2024-02-29 11:22:16 +08:00
parent 0f6cbace22
commit 05961f7c98

View file

@ -633,7 +633,7 @@ void PressureEqualizer::adjust_volumetric_rate(const size_t fist_line_idx, const
}
if (line.adjustable_flow) {
float rate_start = rate_end + rate_slope * line.time_corrected();
float rate_start = sqrt(rate_end * rate_end + 2 * line.volumetric_extrusion_rate * line.dist_xyz() * rate_slope / line.feedrate());
if (rate_start < line.volumetric_extrusion_rate_start) {
// Limit the volumetric extrusion rate at the start of this segment due to a segment
// of ExtrusionType iRole, which will be extruded in the future.
@ -690,7 +690,7 @@ void PressureEqualizer::adjust_volumetric_rate(const size_t fist_line_idx, const
}
if (line.adjustable_flow) {
float rate_end = rate_start + rate_slope * line.time_corrected();
float rate_end = sqrt(rate_start * rate_start + 2 * line.volumetric_extrusion_rate * line.dist_xyz() * rate_slope / line.feedrate());
if (rate_end < line.volumetric_extrusion_rate_end) {
// Limit the volumetric extrusion rate at the start of this segment due to a segment
// of ExtrusionType iRole, which was extruded before.