Index: firmware/App/Controllers/Heaters.c =================================================================== diff -u -rfc78b1e5af6d7ab8f7656b410c4cacdfd76a49e6 -rd4f40c48a728c866c24bf44a59ff8ddd1e244ca1 --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision fc78b1e5af6d7ab8f7656b410c4cacdfd76a49e6) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision d4f40c48a728c866c24bf44a59ff8ddd1e244ca1) @@ -186,6 +186,7 @@ if( heater < NUM_OF_DG_HEATERS ) { +#ifndef DISABLE_HEATERS_AND_TEMPS // Assume the target temperature has not changed heatersStatus[ heater ].hasTargetTempChanged = FALSE; @@ -196,6 +197,7 @@ heatersStatus[ heater ].hasTargetTempChanged = TRUE; result = TRUE; } +#endif } else { @@ -241,6 +243,7 @@ { BOOL status = FALSE; + if( heater < NUM_OF_DG_HEATERS ) { if ( HEATER_EXEC_STATE_OFF == heatersStatus[ heater ].state ) @@ -684,8 +687,8 @@ } else { - // If not any of the above modes, just calculate the energy equation based on TRo - currentTemperature = getTemperatureValue( (U32)TEMPSENSORS_OUTLET_REDUNDANT ); + // If not any of the above modes, just calculate the energy equation based on TDi + currentTemperature = getTemperatureValue( (U32)TEMPSENSORS_INLET_DIALYSATE ); dutyCycle = calculateTrimmerHeaterDutyCycle( targetTemperature, currentTemperature, targetFlowLPM, TRUE ); state = HEATER_EXEC_STATE_TRIMMER_CONTROL_TO_TARGET; } @@ -734,10 +737,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( (U32)TEMPSENSORS_INLET_DIALYSATE ); + 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 );