Index: firmware/App/Controllers/ConcentratePumps.c =================================================================== diff -u -rdf0df237b2a946a1599a45d9e3585194fd550829 -rc20dacdc80635ee4370867e97aba9b00f765ae7e --- firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision df0df237b2a946a1599a45d9e3585194fd550829) +++ firmware/App/Controllers/ConcentratePumps.c (.../ConcentratePumps.c) (revision c20dacdc80635ee4370867e97aba9b00f765ae7e) @@ -992,17 +992,18 @@ static void monitorPumpSpeed( CONCENTRATE_PUMPS_T pumpId, ALARM_ID_T alarm ) { F32 cpTargetSpeed = concentratePumps[ pumpId ].currentPumpSpeed; - F32 cpError = fabs( fabs( getMeasuredPumpSpeedMLPM( pumpId ) ) - cpTargetSpeed ); + F32 cpError = 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 ) + if ( fabs( 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 and flush than the rest of the modes that the concentrate pump are running. - cpError = cpError / cpTargetSpeed; + // NOTE: the target speed should be fabs to check the negative target speed too. Negative speed is used in cleaning modes + cpError = cpError / fabs( cpTargetSpeed ); tolerance = CONCENTRATE_PUMP_TX_SPD_OUT_OF_RANGE_TOL_PCT; if ( ( DG_MODE_HEAT == opMode ) || ( DG_MODE_FLUS == opMode ) )