Index: firmware/App/Controllers/Heaters.c =================================================================== diff -u -r885c00adcbedd23bea67e495d6f2ee291f878b37 -rede98c647eb388e121bdd7c07dc8ef134c04e5bd --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 885c00adcbedd23bea67e495d6f2ee291f878b37) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision ede98c647eb388e121bdd7c07dc8ef134c04e5bd) @@ -55,6 +55,7 @@ #define HEATERS_MIN_EST_GAIN 0.2F ///< Heaters minimum estimation gain. #define HEATERS_MAX_EST_GAIN 5.0F ///< Heaters maximum estimation gain. #define HEATERS_NEUTRAL_EST_GAIN 1.0F ///< Heaters neutral estimation gain. +#define HEATERS_ZERO_DELTA_TEMP_C 0.0F ///< Heaters zero delta temperature in C. #define HEATERS_DATA_PUBLISH_INTERVAL ( MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) ///< Heaters data publish interval. @@ -780,7 +781,7 @@ // Duty cycle = ( 69.73 * flow rate * deltaT / primary heater maximum power ) ^ 1/2 // Multiply the duty cycle to the heater efficiency F32 deltaTempC = targetTemperature - currentTemperature; - F32 capDeltaTempC = MAX( deltaTempC, 0.0F ); + F32 capDeltaTempC = MAX( deltaTempC, HEATERS_ZERO_DELTA_TEMP_C ); F32 dutyCycle = sqrt( ( WATER_SPECIFIC_HEAT_DIVIDED_BY_MINUTES * capDeltaTempC * flow ) / PRIMARY_HEATERS_MAXIMUM_POWER_WATTS ); dutyCycle *= heatersStatus[ DG_PRIMARY_HEATER ].heaterEstGain; dutyCycle = MIN( dutyCycle, HEATERS_MAX_DUTY_CYCLE );