Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -r991b728889da6617433aca9d6fbdcdbc0c16c901 -r31258f2feec374bbb0b62efe4dbb6635e151d767 --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 991b728889da6617433aca9d6fbdcdbc0c16c901) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 31258f2feec374bbb0b62efe4dbb6635e151d767) @@ -49,7 +49,7 @@ #define BAL_CHAMBER_FILL_COMPLETE_MS ( 100 / TASK_GENERAL_INTERVAL ) ///< Time (ms/tasktime) to confirm the balancing chamber fill completed and pressure is within range #define SPENT_FILL_COMPLETE_QD_LOW_RISE_MAX_MLPM 300.0F ///< For Qd <= 300 mL/min (Diener 1000). #define SPENT_FILL_COMPLETE_DP_RISE_PSIG 0.5F ///< Minimum 100 ms spent pressure rise (current minus n-2) to count as a rise hit at low Qd. -#define SPENT_FILL_COMPLETE_DP_RISE_HIGH_QD_PSIG 3.0F ///< Minimum spent pressure rise for Diener 2000 or Qd > 300 mL/min. +#define SPENT_FILL_COMPLETE_DP_RISE_HIGH_QD_PSIG 2.0F ///< Minimum spent pressure rise for Diener 2000 #define SPENT_FILL_SLOPE_SPENT_PRESSURE_HIGH_PSIG 2.0F ///< Above this spent pressure rise, only one rise hit is required. #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 1.0F ///< Allowed detection timing tolerance as a fraction of expected BC switching count. @@ -68,7 +68,7 @@ #define BC_ACID_SPEED_OFFSET_MLPM 160.0F ///< Acid speed formula offset (mL/min). #define BC_ACID_SPEED_DISC_CONSTANT 102400.0F ///< Acid speed formula discriminant constant. #define BC_ACID_SPEED_DISC_VOL_COEF 96000.0F ///< Acid speed formula volume coefficient. -#define BAL_CHAMBER_MAX_SWITCH_TIME_TOL 0.4F ///< Maximum tolerance defined for switching states +#define BAL_CHAMBER_MAX_SWITCH_TIME_TOL 1.0F ///< Maximum tolerance defined for switching states #define BAL_CHAMBER_ABSOLUTE_SPENT_PRESSURE 33.0F ///< Maximum spent(D51) pressure before we declare the fill is complete /// Payload record structure for balancing chamber switch only request @@ -404,7 +404,7 @@ //update the switching period in task interval for balancing chamber fill timeout check balChamberSwitchingPeriod = (U32)( (F32)SEC_PER_MIN / getBalChamberSwitchingFreq() * ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ); - balChamberTolSwitchTime = (F32)balChamberSwitchingPeriod + (F32)balChamberSwitchingPeriod * BAL_CHAMBER_MAX_SWITCH_TIME_TOL; + balChamberTolSwitchTime = (F32)balChamberSwitchingPeriod + ( (F32)balChamberSwitchingPeriod * BAL_CHAMBER_MAX_SWITCH_TIME_TOL ); // finish the balancing chamber fill 50 ms prior completing the regular cycle time. balChamberSwitchingPeriod -= 1;