// check against maximum speeds and return the rate modifier
float Extruder::check_max_speeds(float delta, float isecs)
{
float rm = 1.0F; // default no rate modification
if(this->max_volumetric_rate > 0 && this->filament_diameter > 0.01F) {
// volumetric enabled and check for volumetric rate
float v = delta * isecs; // the flow rate in mm³/sec
// return the rate change needed to stay within the max rate
if(v > max_volumetric_rate) {
rm = max_volumetric_rate / v;
}
//THEKERNEL->streams->printf("requested flow rate: %f mm³/sec, corrected flow rate: %f mm³/sec\n", v, v * rm);
}
return rm;
}