Index: firmware/App/Controllers/SyringePump.c =================================================================== diff -u -rbc538f960d0bc8c72991817ea52efac4775ce953 -rd57c55e32e449059a9b07a3ae1d3ec15c9f40f05 --- firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision bc538f960d0bc8c72991817ea52efac4775ce953) +++ firmware/App/Controllers/SyringePump.c (.../SyringePump.c) (revision d57c55e32e449059a9b07a3ae1d3ec15c9f40f05) @@ -248,7 +248,7 @@ static void calcMeasRate( void ); static void calcSafetyVolumeDelivered( void ); static BOOL checkDirection( BOOL stopPump, MOTOR_DIR_T expDir ); -static BOOL checkOcclusionOrEmpty( BOOL stopPump ); +static BOOL checkSyringeEmpty( BOOL stopPump ); static BOOL checkSyringeRemoved( BOOL stopPump ); static BOOL checkMaxTravel( BOOL stopPump, S32 maxPos ); static BOOL checkMeasRate( BOOL stopPump, F32 pctMargin ); @@ -1425,8 +1425,8 @@ // Check volume vs. safety volume stopPump = checkVolumeVsSafetyVolume( stopPump, SYRINGE_PUMP_VOLUME_CHECK_MARGIN ); - // Check for occlusion - stopPump = checkOcclusionOrEmpty( stopPump ); + // Check for syringe pump empty + stopPump = checkSyringeEmpty( stopPump ); // Check for commanded vs. meas. rate stopPump = checkMeasRate( stopPump, SYRINGE_PUMP_RATE_CHECK_MARGIN ); @@ -1466,8 +1466,8 @@ // Has syringe been removed? stopPump = checkSyringeRemoved( stopPump ); - // Check for occlusion - stopPump = checkOcclusionOrEmpty( stopPump ); + // Check for syringe pump empty + stopPump = checkSyringeEmpty( stopPump ); // Check position > empty + 0.5 mL stopPump = checkMaxTravel( stopPump, SYRINGE_PUMP_EMPTY_POS + SYRINGE_PUMP_EMPTY_POS_MARGIN ); @@ -1555,32 +1555,24 @@ /*********************************************************************//** * @brief - * The checkOcclusionOrEmpty function checks the force sensor for excessive - * pressure. Would indicate occlusion or jam or empty syringe. + * The checkSyringeEmpty function checks the force sensor position + * to determine if the syringe pump is empty. * @details Inputs: syringePumpMeasForce.data, syringePumpPosition.data - * @details Outputs: alarm triggered if max force detected + * @details Outputs: alarm triggered if position is empty. * @param stopPump flag passed in by caller indicating whether pump should be stopped * @return TRUE if pump should be stopped, FALSE if not *************************************************************************/ -static BOOL checkOcclusionOrEmpty( BOOL stopPump ) +static BOOL checkSyringeEmpty( BOOL stopPump ) { BOOL result = stopPump; F32 force = getSyringePumpForceV(); + S32 pos = getSyringePumpPosition(); - if ( TRUE == isPersistentAlarmTriggered( ALARM_ID_HD_SYRINGE_PUMP_OCCLUSION, ( force >= SYRINGE_FORCE_OCCLUSION_THRESHOLD_V ) ) ) + // If near empty position, assume syringe is empty + if ( fabs( pos - SYRINGE_PUMP_EMPTY_POS ) < SYRINGE_PUMP_EMPTY_POS_MARGIN ) { - S32 pos = getSyringePumpPosition(); - - // If near empty position, assume syringe is empty - if ( fabs( pos - SYRINGE_PUMP_EMPTY_POS ) < SYRINGE_PUMP_EMPTY_POS_MARGIN ) - { - heparinDeliveryState = HEPARIN_STATE_EMPTY; - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_HD_SYRINGE_PUMP_SYRINGE_EMPTY, (F32)pos, force ) - } - else - { - SET_ALARM_WITH_2_F32_DATA( ALARM_ID_HD_SYRINGE_PUMP_OCCLUSION, (F32)pos, force ) - } + heparinDeliveryState = HEPARIN_STATE_EMPTY; + SET_ALARM_WITH_2_F32_DATA( ALARM_ID_HD_SYRINGE_PUMP_SYRINGE_EMPTY, (F32)pos, force ) result = TRUE; } Index: firmware/App/Modes/SelfTests.c =================================================================== diff -u -ra7bcdd1b6cd1d0cf0a3856aa8212938092c26ebd -rd57c55e32e449059a9b07a3ae1d3ec15c9f40f05 --- firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision a7bcdd1b6cd1d0cf0a3856aa8212938092c26ebd) +++ firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision d57c55e32e449059a9b07a3ae1d3ec15c9f40f05) @@ -164,6 +164,7 @@ { selfTestStartTime = 0; selfTestPreviousPublishDataTime = 0; + syringeOcclusionDelayStartTime = 0; } /*********************************************************************//** @@ -1023,8 +1024,8 @@ /*********************************************************************//** * @brief - * The handleDrySelfTestSyringePumpPrimeState function handles the prime - * operation for syringe pump. + * The handleDrySelfTestSyringePumpOcclusionDetectionState function handles + * occlusion detection after prime has completed. * @details Inputs: none * @details Outputs: none * @return the next state of dry self-tests state machine