Index: firmware/App/Controllers/ConcentratePumps.c =================================================================== diff -u -r6abb2df716c69d47f6093d2c34a1f9c89f439528 -r8a5838d191c389dd3646f171c9ad0df3c5cb88a9 --- firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision 6abb2df716c69d47f6093d2c34a1f9c89f439528) +++ firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision 8a5838d191c389dd3646f171c9ad0df3c5cb88a9) @@ -40,7 +40,8 @@ #define CONCENTRATE_PUMP_SPEED_INCREMENT 2.0F ///< Speed increase (mL/min) when controlling concentrate pump to target step speed. #define CONCENTRATE_PUMP_MIN_SPEED 3.0F ///< Minimum speed for concentrate pump in mL per min. -#define CONCENTRATE_PUMP_SPD_OUT_OF_RANGE_TOL_WHEN_ON_PCT 0.02F ///< Concentrate pump speed out of range tolerance when on in percentage. +#define CONCENTRATE_PUMP_TX_SPD_OUT_OF_RANGE_TOL_PCT 0.02F ///< Concentrate pump treatment speed out of range tolerance when on in percentage. +#define CONCENTRATE_PUMP_HEAT_DIS_SPD_OUT_OF_RANGE_TOL_PCT 0.05F ///< Concentrate pump heat disinfect speed out of range tolerance when on in percentage. #define CONCENTRATE_PUMP_SPD_OUT_OF_RANGE_TOL_WHEN_SLOW_MLPM 1.0F ///< Concentrate pump speed out of range tolerance when slow in mL/min. #define CONCENTRATE_PUMP_LOW_SPEED_THRESHOLD_MLPM 10.0F ///< Concentrate pump low speed threshold in mL/min. #define CONCENTRATE_PUMP_ZERO_FLOW_RATE 0xFFFF ///< Pulse width value when zero flow rate or pump is off. @@ -990,17 +991,19 @@ *************************************************************************/ static void monitorPumpSpeed( CONCENTRATE_PUMPS_T pumpId, ALARM_ID_T alarm ) { - F32 cpTargetSpeed = concentratePumps[ pumpId ].currentPumpSpeed; - F32 cpError = fabs( fabs( getMeasuredPumpSpeedMLPM( pumpId ) ) - cpTargetSpeed ); - BOOL isCpSpeedOut = FALSE; - F32 tolerance = CONCENTRATE_PUMP_SPD_OUT_OF_RANGE_TOL_WHEN_SLOW_MLPM; + F32 cpTargetSpeed = concentratePumps[ pumpId ].currentPumpSpeed; + F32 cpError = fabs( fabs( getMeasuredPumpSpeedMLPM( pumpId ) ) - cpTargetSpeed ); + BOOL isCpSpeedOut = FALSE; + F32 tolerance = CONCENTRATE_PUMP_SPD_OUT_OF_RANGE_TOL_WHEN_SLOW_MLPM; + DG_OP_MODE_T opMode = getCurrentOperationMode(); if ( cpTargetSpeed > CONCENTRATE_PUMP_LOW_SPEED_THRESHOLD_MLPM ) { // Check if the pump is not in the off state and if it is not and greater than the minimum threshold, divide the error // to target speed. If the pump is off the target speed is 0 so the speed check is done differently + // The speed tolerance is looser in heat disinfect that the rest of the modes that the concentrate pump are running. cpError = cpError / cpTargetSpeed; - tolerance = CONCENTRATE_PUMP_SPD_OUT_OF_RANGE_TOL_WHEN_ON_PCT; + tolerance = ( DG_MODE_HEAT == opMode ? CONCENTRATE_PUMP_HEAT_DIS_SPD_OUT_OF_RANGE_TOL_PCT : CONCENTRATE_PUMP_TX_SPD_OUT_OF_RANGE_TOL_PCT ); } isCpSpeedOut = ( cpError > tolerance ? TRUE : FALSE );