Index: firmware/App/Controllers/Heaters.c =================================================================== diff -u -rfc78b1e5af6d7ab8f7656b410c4cacdfd76a49e6 -r3d87e97b9345aec63ca88d741e3bcd548f90422b --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision fc78b1e5af6d7ab8f7656b410c4cacdfd76a49e6) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 3d87e97b9345aec63ca88d741e3bcd548f90422b) @@ -584,7 +584,7 @@ } else if ( TRUE == heatersStatus[ heater ].hasTargetTempChanged ) { - F32 inletTemperature = getTemperatureValue( (U32)TEMPSENSORS_HEAT_DISINFECT ); + F32 inletTemperature = getTemperatureValue( TEMPSENSORS_HEAT_DISINFECT ); F32 targetTemperature = heatersStatus[ heater ].targetTempC; F32 targetFlow = getTargetROPumpFlowRateLPM(); F32 dutyCycle = calculatePrimaryHeaterDutyCycle( targetTemperature, inletTemperature, targetFlow, TRUE ); @@ -677,15 +677,15 @@ // If the mode is heat disinfect, 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 and // it is far from the inlet temperature. - currentTemperature = getTemperatureValue( (U32)TEMPSENSORS_HEAT_DISINFECT ); + currentTemperature = getTemperatureValue( TEMPSENSORS_HEAT_DISINFECT ); targetFlowLPM = getTargetROPumpFlowRateLPM(); dutyCycle = calculateTrimmerHeaterDutyCycle( targetTemperature, currentTemperature, targetFlowLPM, FALSE ); state = HEATER_EXEC_STATE_CONTROL_TO_DISINFECT_TARGET; } else { // If not any of the above modes, just calculate the energy equation based on TRo - currentTemperature = getTemperatureValue( (U32)TEMPSENSORS_OUTLET_REDUNDANT ); + currentTemperature = getTemperatureValue( TEMPSENSORS_OUTLET_REDUNDANT ); dutyCycle = calculateTrimmerHeaterDutyCycle( targetTemperature, currentTemperature, targetFlowLPM, TRUE ); state = HEATER_EXEC_STATE_TRIMMER_CONTROL_TO_TARGET; } @@ -734,10 +734,10 @@ // When the trimmer heater is on, its duty cycle is adjusted at the control interval. For this control check, // dialysate inlet temperature sensor is used rather than the theoretical calculations. - F32 outletRedundantTemperature = getTemperatureValue( TEMPSENSORS_OUTLET_REDUNDANT ); - F32 targetTemperature = heatersStatus[ heater ].targetTempC; - F32 targetFlowLPM = heatersStatus[ heater ].targetFlowLPM; - F32 dutyCycle = calculateTrimmerHeaterDutyCycle( targetTemperature, outletRedundantTemperature, targetFlowLPM, TRUE ); + F32 dialysateInletTemperature = getTemperatureValue( TEMPSENSORS_OUTLET_REDUNDANT ); + F32 targetTemperature = heatersStatus[ heater ].targetTempC; + F32 targetFlowLPM = getTargetDialysateFlowLPM(); + F32 dutyCycle = calculateTrimmerHeaterDutyCycle( targetTemperature, dialysateInletTemperature, targetFlowLPM, TRUE ); tempDutyCycle = heatersStatus[ heater ].dutyCycle.data + dutyCycle; tempDutyCycle = MIN( tempDutyCycle, HEATERS_MAX_DUTY_CYCLE );