Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -r85f1940ac2b4b76181ca364693332c2ae276f2ba -r8ff0ddc0009b5c03c35c3f01db10700e8b98b3dd --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 85f1940ac2b4b76181ca364693332c2ae276f2ba) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 8ff0ddc0009b5c03c35c3f01db10700e8b98b3dd) @@ -79,8 +79,9 @@ static const U32 DIP_OFF_ERROR_PERSIST = ((5 * MS_PER_SECOND) / TASK_PRIORITY_INTERVAL); /// Persist time (task intervals) motor speed error condition. static const U32 DIP_MOTOR_SPEED_ERROR_PERSIST = ((5 * MS_PER_SECOND) / TASK_PRIORITY_INTERVAL); -/// Rotor speed persist time test needs a minimum number of rotations. -static const U32 DIP_ROTOR_ERROR_PERSIST_ROTATION_MIN = 3; +/// Rotor speed persist time test needs a minimum number of rotations or time. +static const U32 DIP_ROTOR_ERROR_PERSIST_ROTATION_MIN = 10; +static const U32 DIP_ROTOR_ERROR_PERSIST_TIME_MIN = (10 * MS_PER_SECOND); /// Persist time (task intervals) pump direction error condition. static const U32 DIP_DIRECTION_ERROR_PERSIST = (250 / TASK_PRIORITY_INTERVAL); /// Time threshold to trigger an alarm if Dialysate flow data has not arrived within 3 seconds @@ -1069,16 +1070,19 @@ U32 getPumpRotorErrorPersistTime( F32 mtr_rpm, F32 gear_ratio ) { U32 err_persist_time = HEX_32_BIT_FULL_SCALE; // 49 days - U32 temporaryPersistentTimeout = 10 * MS_PER_SECOND; F32 absMotRPM = fabs( mtr_rpm ); if ( absMotRPM > NEARLY_ZERO ) { /// Calculate persist time for rotor speed error condition. err_persist_time = ( ( (F32)DIP_ROTOR_ERROR_PERSIST_ROTATION_MIN / ( absMotRPM / gear_ratio / (F32)SEC_PER_MIN ) ) * (F32)MS_PER_SECOND ); + if ( DIP_ROTOR_ERROR_PERSIST_TIME_MIN > err_persist_time ) + { + err_persist_time = DIP_ROTOR_ERROR_PERSIST_TIME_MIN; + } } - return err_persist_time + temporaryPersistentTimeout; + return err_persist_time; } /*********************************************************************//**