Index: firmware/App/Controllers/BalancingChamber.c =================================================================== diff -u -r2582d728ac1be6d159fa0ef37b1d443f09d7a168 -r8e93a6e39b2c7af5f0b47ef1272a2b53446fab0b --- firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 2582d728ac1be6d159fa0ef37b1d443f09d7a168) +++ firmware/App/Controllers/BalancingChamber.c (.../BalancingChamber.c) (revision 8e93a6e39b2c7af5f0b47ef1272a2b53446fab0b) @@ -46,6 +46,7 @@ #define SPENT_DIFF_COUNT_ZERO 0 ///< Zero count difference for spent side fill comparing target count #define SPENT_DIFF_COUNT_DEADBAND 1 ///< Stop changing D48 pump speed when fill difference reaches close to 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) /// Payload record structure for balancing chamber switch only request typedef struct @@ -1189,6 +1190,10 @@ U32 absDiffSpentFillCount = 0; U32 adjustedSpeed = 0; U32 spentDialPumpSpeed = getD48PumpSpeedForBCFill(); + U32 initialD48PumpSpeed = calculateD48PumpSpeedForBCFill(); + U32 minD48Speed = initialD48PumpSpeed - ( initialD48PumpSpeed * D48_SPEED_RANGE_LIMIT ); + U32 maxD48Speed = initialD48PumpSpeed + ( initialD48PumpSpeed * D48_SPEED_RANGE_LIMIT ); + U32 d48SpeedPostRangeCheck = 0; // Collect the next sample of spent pressure lastPrevSpentDialPressure = prevSpentDialPressure; @@ -1217,8 +1222,10 @@ spentDialPumpSpeed -= adjustedSpeed; } + d48SpeedPostRangeCheck = RANGE( spentDialPumpSpeed, minD48Speed, maxD48Speed ); + // Update the D48 pump speed - setD48PumpSpeedForBCFill( spentDialPumpSpeed ); + setD48PumpSpeedForBCFill( d48SpeedPostRangeCheck ); } //Update spent fill is complete