Index: firmware/App/Controllers/BloodFlow.c =================================================================== diff -u -r19a4dfeb95b7bc9b8688e32c55b76a244f0de18d -rc4117345916148c4f48a0a83831204201444dc99 --- firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 19a4dfeb95b7bc9b8688e32c55b76a244f0de18d) +++ firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision c4117345916148c4f48a0a83831204201444dc99) @@ -117,6 +117,7 @@ #define SIZE_OF_ROLLING_AVG ( ( MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) * 1 ) #define PUMP_DIR_ERROR_COUNT_MASK 0x3F ///< Bit mask for pump direction error counter. +#define BP_MIN_DIR_CHECK_SPEED_RPM 10.0F ///< Minimum motor speed before we check pump direction. #define BP_FLOW_ALPHA_Y_INTERCEPT 1.1970F ///< Y intercept used for alpha flow coefficient calculation. #define BP_FLOW_WEAR_A_TERM 0.000000029F ///< A term used for wear portion of alpha flow coefficient. @@ -1085,8 +1086,10 @@ { MOTOR_DIR_T bpMCDir, bpDir; BOOL isDirIncorrect; - U08 dirErrorCnt = getFPGABloodPumpHallSensorStatus() & PUMP_DIR_ERROR_COUNT_MASK; - BOOL isHallSensorFailed = ( lastBloodPumpDirectionCount != dirErrorCnt ? TRUE : FALSE ); + U08 dirErrorCnt = getFPGABloodPumpHallSensorStatus() & PUMP_DIR_ERROR_COUNT_MASK; + F32 measMCSpeed = getMeasuredBloodPumpMCSpeed(); + BOOL minDirSpeed = ( measMCSpeed >= BP_MIN_DIR_CHECK_SPEED_RPM ? TRUE : FALSE ); + BOOL isHallSensorFailed = ( TRUE == minDirSpeed && lastBloodPumpDirectionCount != dirErrorCnt ? TRUE : FALSE ); // Check pump direction error count if ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_PUMP_DIRECTION_STATUS_ERROR, isHallSensorFailed ) ) @@ -1104,7 +1107,7 @@ bpDir = ( getMeasuredBloodPumpSpeed() >= 0.0 ? MOTOR_DIR_FORWARD : MOTOR_DIR_REVERSE ); // Check set direction vs. direction from hall sensors vs. direction from sign of motor controller speed - isDirIncorrect = ( bloodPumpDirectionSet != bpDir ) || ( bloodPumpDirectionSet != bpMCDir ); + isDirIncorrect = ( ( ( bloodPumpDirectionSet != bpDir ) || ( bloodPumpDirectionSet != bpMCDir ) ) && ( TRUE == minDirSpeed ) ); if ( TRUE == isPersistentAlarmTriggered( ALARM_ID_BLOOD_PUMP_MC_DIRECTION_CHECK, isDirIncorrect ) ) { #ifndef _RELEASE_