Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -r43ebe58702128e865210533f9e6deaf13f99d262 -r5a0b55438edfba94b442d8a62384574821cb1679 --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 43ebe58702128e865210533f9e6deaf13f99d262) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 5a0b55438edfba94b442d8a62384574821cb1679) @@ -850,13 +850,8 @@ state = BAL_CHAMBER_STATE_IDLE; } - // If the dry bicarbonate is enabled then we ignore looking at d18 pressure to be in range. - if ( ( FALSE == getTestConfigStatus( TEST_CONFIG_DD_DISABLE_DRY_BICARB ) ) && ( TRUE == getBicarbChamberFillRequested() ) ) - { - isPressureStabilizedDuringFill = TRUE; - } // Check fresh dialysate pressure back in range to indicate fresh fill complete. - else if ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) + if ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) { if ( ++balChamberFillCompleteStablePressureCounter >= BAL_CHAMBER_FILL_COMPLETE_MS ) { @@ -1103,13 +1098,8 @@ freshDialPressure = getFilteredPressure( D18_PRES ); spentDialPressure = getFilteredPressure( D51_PRES ); - // If the dry bicarbonate is enabled then we ignore looking at d18 pressure to be in range. - if ( ( FALSE == getTestConfigStatus( TEST_CONFIG_DD_DISABLE_DRY_BICARB ) ) && ( TRUE == getBicarbChamberFillRequested() ) ) - { - isPressureStabilizedDuringFill = TRUE; - } // Check fresh dialysate pressure back in range to indicate fresh fill complete. - else if ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) + if ( ( freshDialPressure >= FRESH_DIAL_PRESSURE_MIN_PSIG ) && ( freshDialPressure <= FRESH_DIAL_PRESSURE_MAX_PSIG ) ) { if ( ++balChamberFillCompleteStablePressureCounter >= BAL_CHAMBER_FILL_COMPLETE_MS ) { Index: firmware/App/Controllers/DryBiCart.c =================================================================== diff -u -r43ebe58702128e865210533f9e6deaf13f99d262 -r5a0b55438edfba94b442d8a62384574821cb1679 --- firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision 43ebe58702128e865210533f9e6deaf13f99d262) +++ firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision 5a0b55438edfba94b442d8a62384574821cb1679) @@ -73,6 +73,7 @@ #define DRY_BICART_SUPPLY_VENT_TIME_MS ( 1 * MS_PER_SECOND ) ///< Wait time to vent dry bicart gas before actuating Bicarb chamber(F) venting. #define DRY_BICART_SUPPLY_VENT_MAX_TIME_MS ( 1 * MS_PER_SECOND ) ///< Max time to vent both dry bicart and Chamber F. #define DRY_BICART_SUPPLY_COMPLETE_TIME_MS ( 2 * MS_PER_SECOND ) ///< Wait time to close the D80 valve after D65 is closed +#define DRY_BICART_SUPPLY_DECAY_COMPLETE_PRESSURE_PSI 4.0F ///< Minimum decay pressure needed to end the supply process. // Dry Bicart Drain #define LARGE_DRY_BICART_MAX_DRAIN_TIME_MS ( 8 * SEC_PER_MIN * MS_PER_SECOND ) ///< Max drain time for large dry bicart in ms. @@ -544,7 +545,7 @@ * @brief * The isDryBicartBalChamberFillWindowOpen function checks whether D65 may be * opened for dry bicarb refill: fresh-side BC valves closed and BC switch not - * within the 50 ms valve-close window. + * within the 100 ms valve-close window. * @details \b Inputs: getBalChamberFreshSideValvesClosedStatus, isBalChamberSwitchImminent * @details \b Outputs: none * @return TRUE when the BC fresh-side fill window is open for D65. @@ -565,7 +566,7 @@ /*********************************************************************//** * @brief * The closeD65IfBalChamberSwitchImminent function closes D65 when the balancing - * chamber is within 50 ms of switching. + * chamber is within 100 ms of switching. * @details \b Inputs: isBalChamberSwitchImminent * @details \b Outputs: valve states * @return none @@ -1135,18 +1136,13 @@ F32 d66Pressure = getFilteredPressure( D66_PRES ); F32 fillCompletePressure = GET_FILL_COMPLETE_PRESSURE_PSI; - closeD65IfBalChamberSwitchImminent(); - - if ( ( FALSE == isDryBicartBalChamberFillWindowOpen() ) && - ( d66Pressure < fillCompletePressure ) ) + if ( FALSE == isDryBicartBalChamberFillWindowOpen() ) { setValveState( D65_VALV, VALVE_STATE_CLOSED ); } - else if ( ( TRUE == isDryBicartBalChamberFillWindowOpen() ) && - ( d66Pressure < fillCompletePressure ) ) + else if ( TRUE == isDryBicartBalChamberFillWindowOpen() ) { setValveState( D65_VALV, VALVE_STATE_OPEN ); - setValveState( D64_VALV, VALVE_STATE_OPEN ); } // check D66 pressure greater than or equal to 17 PSI @@ -1216,6 +1212,7 @@ F32 d66Pressure = getFilteredPressure( D66_PRES ); LVL_STATE_T bicarbChamberLevel = getBicarbChamberLevelStatus(); + // Close D65 irrespective of pressure for balancing chamber fresh side fill to complete. closeD65IfBalChamberSwitchImminent(); // Once upper level reached high , close the valve, timeout is for safety in case level sensor didn't work(10 sec), or else its a time based filling (3 sec) @@ -1233,7 +1230,7 @@ // do not close the D80 valve, wait till d66 decays to 3 PSI if ( TRUE == didTimeout( dryBiCarbSupplyStartTime, DRY_BICART_SUPPLY_COMPLETE_TIME_MS ) ) { - if ( d66Pressure <= getDryBicartLowerCartPressure() ) + if ( d66Pressure <= DRY_BICART_SUPPLY_DECAY_COMPLETE_PRESSURE_PSI ) { setValveState( D80_VALV, VALVE_STATE_CLOSED ); setValveState( D85_VALV, VALVE_STATE_OPEN );