Index: firmware/App/Controllers/DialOutFlow.c =================================================================== diff -u -rc4117345916148c4f48a0a83831204201444dc99 -rb1492eff71eab83d55456ad3520ccfd6cda06a77 --- firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision c4117345916148c4f48a0a83831204201444dc99) +++ firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision b1492eff71eab83d55456ad3520ccfd6cda06a77) @@ -111,6 +111,8 @@ #define PUMP_DIR_ERROR_COUNT_MASK 0x3F ///< Bit mask for pump direction error counter. #define DOP_MIN_DIR_CHECK_SPEED_RPM 10.0F ///< Minimum motor speed before we check pump direction. +#define DOP_COMMUTATION_ERROR_MAX_CNT 3 ///< Maximum number of commutation errors within time window before alarm triggered. +#define DOP_COMMUTATION_ERROR_TIME_WIN_MS (15 * MS_PER_SECOND) ///< Time window for DPo commutation error. #define DATA_PUBLISH_COUNTER_START_COUNT 40 ///< Data publish counter start count. /// Enumeration of dialysate outlet pump controller states. @@ -242,6 +244,8 @@ ufMeasuredRate = 0.0; dopRateCorrectionOffset = 0.0; resetDialOutFlowMovingAverage(); + + initTimeWindowedCount( TIME_WINDOWED_COUNT_DOP_COMMUTATION_ERROR, DOP_COMMUTATION_ERROR_MAX_CNT, DOP_COMMUTATION_ERROR_TIME_WIN_MS ); } /*********************************************************************//** @@ -942,7 +946,7 @@ BOOL isHallSensorFailed = ( TRUE == minDirSpeed && lastDialOutPumpDirectionCount != dirErrorCnt ? TRUE : FALSE ); // Check pump direction error count - if ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_PUMP_DIRECTION_STATUS_ERROR, isHallSensorFailed ) ) + if ( ( TRUE == isHallSensorFailed ) && ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_DOP_COMMUTATION_ERROR ) ) ) { #ifndef _RELEASE_ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_PUMP_DIRECTION_CHECKS ) != SW_CONFIG_ENABLE_VALUE )