Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Duet3D/RepRapFirmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Heating/Heater.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/Heating/Heater.cpp b/src/Heating/Heater.cpp
index fd3742bd..8993610e 100644
--- a/src/Heating/Heater.cpp
+++ b/src/Heating/Heater.cpp
@@ -378,9 +378,21 @@ void Heater::SetAndReportModel(bool usingFans) noexcept
{
const float hRate = (usingFans) ? (fanOffParams.heatingRate + fanOnParams.heatingRate) * 0.5 : fanOffParams.heatingRate;
const float deadTime = (usingFans) ? (fanOffParams.deadTime + fanOnParams.deadTime) * 0.5 : fanOffParams.deadTime;
- const float fanOnCoolingRate = (usingFans)
- ? fanOffParams.coolingRate + (fanOnParams.coolingRate - fanOffParams.coolingRate)/tuningFanPwm
- : fanOffParams.coolingRate;
+
+ float fanOnCoolingRate = fanOffParams.coolingRate;
+ if (usingFans)
+ {
+ // Sometimes the print cooling fan makes no difference to the cooling rate. The SetModel call will fail if the rate with fan on is lower than the rate with fan off.
+ if (fanOnParams.coolingRate > fanOffParams.coolingRate)
+ {
+ fanOnCoolingRate = fanOffParams.coolingRate + (fanOnParams.coolingRate - fanOffParams.coolingRate)/tuningFanPwm;
+ }
+ else
+ {
+ reprap.GetPlatform().Message(WarningMessage, "Turning on the print cooling fan did not increase hot end cooling. Check that the correct fan has been configured.\n");
+ }
+ }
+
String<StringLength256> str;
const GCodeResult rslt = SetModel( hRate,
fanOffParams.coolingRate, fanOnCoolingRate,