Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -r2d295ca85f19e95da42476a57ca6b4496baf980a -rc90f3d61bde2a2b47d1048635be4dadf282e2195 --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 2d295ca85f19e95da42476a57ca6b4496baf980a) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision c90f3d61bde2a2b47d1048635be4dadf282e2195) @@ -53,14 +53,14 @@ #define SPENT_FILL_SLOPE_SPENT_PRESSURE_HIGH_PSIG 2.0F ///< Above this absolute spent pressure, only one rise hit is required. #define SPENT_FILL_SLOPE_SPENT_PRESSURE_LOW_PSIG 0.5F ///< Below this absolute spent pressure, use Qd-based required rise hit count. #define SPENT_FILL_SLOPE_MAX_RISE_HITS 2 ///< Rise hits required when Qd <= 150 in the low spent-pressure band. -#define SPENT_FILL_DETECT_COUNT_TOL_PCT 0.20F ///< Allowed detection timing tolerance as a fraction of expected BC switching count. +#define SPENT_FILL_DETECT_COUNT_TOL_PCT 1.0F ///< Allowed detection timing tolerance as a fraction of expected BC switching count. #define QD_THRESHOLD_HIGH_MLPM 400.0F ///< Qd threshold (mL/min) below which mid pressure limit applies. #define SPENT_DIFF_COUNT_ZERO 0 ///< Zero count difference for spent side fill comparing target count #define D48_SPEED_ADJUST_FACTOR 0.5F ///< D48 speed adjustment factor ( 50% of speed adjustment = 0.5) #define D48_SPEED_RANGE_LIMIT 0.25F ///< D48 speed adjustment range check limit ( D48 speed can vary +/-25% of initial calculated speed) #define BICARB_CHAMBER_PERIODIC_FILL_TIME ( 1 * SEC_PER_MIN * \ ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ) ///< Periodic bicarb chamber fill request 60 sec x 20 = 1200 -#define BAL_CHAMBER_FILL_TIMEOUT_FACTOR 1.5 ///< Balancing Chamber fill timeout factor (150% of observed fill count) +#define BAL_CHAMBER_FILL_TIMEOUT_FACTOR 2.5 ///< Balancing Chamber fill timeout factor (150% of observed fill count) /// Payload record structure for balancing chamber switch only request typedef struct @@ -701,7 +701,7 @@ // Check both spent and fresh side fill is complete isBothFillsComplete = ( TRUE == isSpentFillComplete ) && ( TRUE == isPressureStabilizedDuringFill ); - isFirstCycleNotDone = ( FALSE == isFirstCycleBCSwitchingCompleted ); + isFirstCycleNotDone = ( FALSE == isFirstCycleBCSwitchingCompleted ) && ( currentBalChamberSwitchingCounter >= balChamberValveClosePeriod ); if ( FALSE == getBalChamberSwitchingOnlyStatus() ) { @@ -949,7 +949,7 @@ // Check switching cycle time or pressure check for valve closure isBothFillsComplete = ( TRUE == isSpentFillComplete ) && ( TRUE == isPressureStabilizedDuringFill ); - isFirstCycleNotDone = ( FALSE == isFirstCycleBCSwitchingCompleted ); + isFirstCycleNotDone = ( FALSE == isFirstCycleBCSwitchingCompleted ) && ( currentBalChamberSwitchingCounter >= balChamberValveClosePeriod ); if ( FALSE == getBalChamberSwitchingOnlyStatus() ) {