Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -rdb7a07277014e802f582716c4215044ff905266b -rba7e088fc3308f844ea30376a78e1da6d32621c1 --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision db7a07277014e802f582716c4215044ff905266b) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision ba7e088fc3308f844ea30376a78e1da6d32621c1) @@ -52,14 +52,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 @@ -217,6 +217,9 @@ // finish the balancing chamber fill 50 ms prior completing the regular cycle time. balChamberSwitchingPeriod -= 1; + //Update heater control on dialysate flow change + signalHeaterControlOnQDUpdate( lastTdDialysateFlowrate ); + //Update last td dialysate flow rate lastTdDialysateFlowrate = tdDialysateFlowrate; @@ -226,9 +229,6 @@ //Reset the BC switching flag for new Qd. isFirstCycleBCSwitchingCompleted = FALSE; - //Update heater control on dialysate flow change - signalHeaterControlOnQDUpdate(); - //Testing balChamberValveClosePeriod = balChamberSwitchingPeriod; balChamberValveClosePeriod -= 1; // Close valves prior 50 msecond for testing