Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -r19a4dfeb95b7bc9b8688e32c55b76a244f0de18d -rc4117345916148c4f48a0a83831204201444dc99 --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 19a4dfeb95b7bc9b8688e32c55b76a244f0de18d) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision c4117345916148c4f48a0a83831204201444dc99) @@ -116,6 +116,7 @@ #define SIZE_OF_ROLLING_AVG 10 #define PUMP_DIR_ERROR_COUNT_MASK 0x3F ///< Bit mask for pump direction error counter. +#define DIP_MIN_DIR_CHECK_SPEED_RPM 10.0F ///< Minimum motor speed before we check pump direction. #define DATA_PUBLISH_COUNTER_START_COUNT 30 ///< Data publish counter start count. @@ -1022,7 +1023,9 @@ { MOTOR_DIR_T dipMCDir, dipDir; U08 dirErrorCnt = getFPGADialInPumpHallSensorStatus() & PUMP_DIR_ERROR_COUNT_MASK; - BOOL isHallSensorFailed = ( lastDialInPumpDirectionCount != dirErrorCnt ? TRUE : FALSE ); + F32 measMCSpeed = getMeasuredDialInPumpMCSpeed(); + BOOL minDirSpeed = ( measMCSpeed >= DIP_MIN_DIR_CHECK_SPEED_RPM ? TRUE : FALSE ); + BOOL isHallSensorFailed = ( TRUE == minDirSpeed && lastDialInPumpDirectionCount != dirErrorCnt ? TRUE : FALSE ); // Check pump direction error count if ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_PUMP_DIRECTION_STATUS_ERROR, isHallSensorFailed ) ) @@ -1040,7 +1043,7 @@ dipDir = ( getMeasuredDialInPumpSpeed() >= 0.0 ? MOTOR_DIR_FORWARD : MOTOR_DIR_REVERSE ); // Check set direction vs. direction from hall sensors - if ( dialInPumpDirectionSet != dipDir ) + if ( ( dialInPumpDirectionSet != dipDir ) && ( TRUE == minDirSpeed ) ) { if ( ++errorDialInPumpDirectionPersistTimerCtr >= DIP_DIRECTION_ERROR_PERSIST ) { @@ -1053,7 +1056,7 @@ } } // Check set direction vs. direction from sign of motor controller speed - else if ( dialInPumpDirectionSet != dipMCDir ) + else if ( ( dialInPumpDirectionSet != dipMCDir ) && ( TRUE == minDirSpeed ) ) { if ( ++errorDialInPumpDirectionPersistTimerCtr >= DIP_DIRECTION_ERROR_PERSIST ) {