Index: firmware/App/Controllers/Heaters.c =================================================================== diff -u -re6f434d5316d647bdcafd12d60c9ae2cdaa1af76 -r35b79680b35e741c9b3928068ea1d3b029f42877 --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision e6f434d5316d647bdcafd12d60c9ae2cdaa1af76) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 35b79680b35e741c9b3928068ea1d3b029f42877) @@ -219,6 +219,18 @@ /*********************************************************************//** * @brief + * The isHeaterOn function returns the heater status whether it is on or off + * @details Inputs: heaterStatus + * @details Outputs: none + * @return heater on/off status + *************************************************************************/ +BOOL isHeaterOn( DG_HEATERS_T heater ) +{ + return heatersStatus[ heater ].isHeaterOn; +} + +/*********************************************************************//** + * @brief * The startPrimaryHeater function starts the primary heaters. It resets * the primary heaters state and sets the main primary heater duty cycle. * @details Inputs: primaryHeaterTargetTemperature @@ -518,11 +530,13 @@ } else if ( ( DG_MODE_HEAT == opMode ) || ( DG_MODE_CHEM == opMode ) ) { - // If the mode is any of the disinfects, especially heat, use the target flow rate instead of the avg. flow - // Most of the times the heater should be running at 100% duty cycle since the target temperature is 81 C - targetFlow = getTargetROPumpFlowRateLPM(); - dutyCycle = calculatePrimaryHeaterDutyCycle( targetTemperature, inletTemperature, targetFlow, FALSE ); - state = HEATER_EXEC_STATE_CONTROL_TO_DISINFECT_TARGET; + // If the mode is any of the disinfects, specially heat, use the target flow rate instead of the avg. flow + // Most of the times the heater should be running at 100% duty cycle since the target temperature is far from + // the inlet temperature + targetFlow = getTargetROPumpFlowRateLPM(); + inletTemperature = getTemperatureValue( (U32)TEMPSENSORS_OUTLET_PRIMARY_HEATER ); + dutyCycle = calculatePrimaryHeaterDutyCycle( targetTemperature, inletTemperature, targetFlow, FALSE ); + state = HEATER_EXEC_STATE_CONTROL_TO_DISINFECT_TARGET; } else { @@ -588,8 +602,8 @@ static HEATERS_STATE_T handleHeaterStateControlToDisinfectTarget( DG_HEATERS_T heater ) { HEATERS_STATE_T state = HEATER_EXEC_STATE_CONTROL_TO_DISINFECT_TARGET; - F32 currentTemperature = getTemperatureValue( TEMPSENSORS_HEAT_DISINFECT ); - F32 targetTemperature = heatersStatus[ DG_PRIMARY_HEATER ].targetTemp; + F32 currentTemperature = getTemperatureValue( TEMPSENSORS_OUTLET_PRIMARY_HEATER ); + F32 targetTemperature = heatersStatus[ heater ].targetTemp; if ( currentTemperature < targetTemperature ) {