Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -red39a4c00ef51318dfced8372eabcbee3ce03c52 -rf7cecfd05b7fd84735ea35b1fa3782d29a786ee0 --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision ed39a4c00ef51318dfced8372eabcbee3ce03c52) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision f7cecfd05b7fd84735ea35b1fa3782d29a786ee0) @@ -491,7 +491,7 @@ if ( ++dialysateFlowDataFreshStatusCounter > DIP_DIALYSATE_FLOW_DATA_ALARM_THRESHOLD ) { filterDialInFlowReadings( 0.0 ); - activateAlarmNoData( ALARM_ID_HD_DIALYSATE_FLOW_DATA_NOT_RECEIVE ); + //activateAlarmNoData( ALARM_ID_HD_DIALYSATE_FLOW_DATA_NOT_RECEIVE ); // TODO: Uncomment this after testing done. DN-17OCT2022 } } else @@ -802,17 +802,17 @@ F32 alpha = wear * Pest + DIAL_IN_FLOW_A_ZERO; F32 calculatedFlow = (alpha * pumpRPM * ML_PER_LITER) / DIP_REV_PER_LITER; - printf("pumpRPM=%f,rotCnt=%d,wear=%f,Pest=%f,alpha=%f,calculatedFlow=%f\n", pumpRPM,rotCnt,wear,Pest,alpha,calculatedFlow); + //printf("pumpRPM=%f,rotCnt=%d,wear=%f,Pest=%f,alpha=%f,calculatedFlow=%f\n", pumpRPM,rotCnt,wear,Pest,alpha,calculatedFlow); if (QdTarget < DIAL_IN_FLOW_QHIGHTRANSITION && QdTarget >= DIAL_IN_FLOW_QLOWTRANSITION) - { // use blended flow rate calculation - estimatedFlow = (QdTarget - DIAL_IN_FLOW_QLOWTRANSITION)/(DIAL_IN_FLOW_QHIGHTRANSITION-DIAL_IN_FLOW_QLOWTRANSITION) * calculatedFlow + - (DIAL_IN_FLOW_QHIGHTRANSITION - QdTarget)/(DIAL_IN_FLOW_QHIGHTRANSITION-DIAL_IN_FLOW_QLOWTRANSITION) * filteredDialInFlowMeterReading; + { // use blended flow rate calculation + estimatedFlow = ( (QdTarget - DIAL_IN_FLOW_QLOWTRANSITION)/(DIAL_IN_FLOW_QHIGHTRANSITION-DIAL_IN_FLOW_QLOWTRANSITION) ) * calculatedFlow + + ( (DIAL_IN_FLOW_QHIGHTRANSITION - QdTarget)/(DIAL_IN_FLOW_QHIGHTRANSITION-DIAL_IN_FLOW_QLOWTRANSITION) ) * filteredDialInFlowMeterReading; } - else - { // use calculated flow rate. Assume target flow rate has already checked for out of bounds on low end. + else + { // use calculated flow rate. Assume target flow rate has already checked for out of bounds on low end. estimatedFlow = calculatedFlow; + } } - } return estimatedFlow; } @@ -848,14 +848,14 @@ void resetDialInPumpRotorCount( void ) { #ifndef _RELEASE_ - if ( getSoftwareConfigStatus( SW_CONFIG_ENABLE_WORN_OUT_CARTRIDGE ) != SW_CONFIG_ENABLE_VALUE ) + if ( getSoftwareConfigStatus( SW_CONFIG_ENABLE_WORN_OUT_CARTRIDGE ) == SW_CONFIG_ENABLE_VALUE ) { - dialysateInPumpRotorCounter.data = 0; + dialysateInPumpRotorCounter.data = DIAL_IN_MAX_ROTOR_COUNT_FOR_WEAR; } else #endif { - dialysateInPumpRotorCounter.data = DIAL_IN_MAX_ROTOR_COUNT_FOR_WEAR; + dialysateInPumpRotorCounter.data = 0; } }