Index: firmware/App/Modes/Prime.c =================================================================== diff -u -rd28280f1054fc9ddf9304a11373dc9ee963425e3 -r69ed3f91919e50b68ea448a70db81456fb4946a0 --- firmware/App/Modes/Prime.c (.../Prime.c) (revision d28280f1054fc9ddf9304a11373dc9ee963425e3) +++ firmware/App/Modes/Prime.c (.../Prime.c) (revision 69ed3f91919e50b68ea448a70db81456fb4946a0) @@ -14,7 +14,6 @@ * @date (original) 08-Dec-2020 * ***************************************************************************/ - #include "AirTrap.h" #include "AlarmMgmt.h" #include "BloodFlow.h" @@ -39,7 +38,7 @@ #define MAX_PRIME_TIME ( 15 * SEC_PER_MIN ) ///< Maximum prime time (in seconds). #define PRIME_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< Interval (ms/task time) at which the prime data is published on the CAN bus. -#define BLOOD_PUMP_FAST_FLOW_RATE_PURGE_AIR_ML_MIN 150 ///< Blood pump fast flow rate to fill fluid. +#define BLOOD_PUMP_FAST_FLOW_RATE_PURGE_AIR_ML_MIN 300 ///< Blood pump fast flow rate to fill fluid. #define BLOOD_PUMP_SLOW_FLOW_RATE_PURGE_AIR_ML_MIN 150 ///< Blood pump slow flow rate after fluid reach lower level of air trap sensor. #define BLOOD_PUMP_SALINE_FLOW_RATE_PURGE_AIR_ML_MIN 200 ///< Blood pump very slow flow rate during prime saline dialyzer state #define BLOOD_PUMP_FLOW_RATE_CIRC_BLOOD_CIRCUIT_ML_MIN 150 ///< Blood pump flow rate during prime recirculate blood circuit state. @@ -51,8 +50,9 @@ #define DIALYZER_DVI_PATH_VOLUME_ML 17 ///< Path volume from the dialyzer to the VDI valve in mL. #define DIALYZER_VOLUME_SCALE_FACTOR 0.5F ///< Half of the dialyzer total volume. -#define NO_AIR_DETECTED_COUNT ( 20 * MS_PER_SECOND ) ///< No air detected time period count. -#define PURGE_AIR_TIME_OUT_COUNT ( 120 * MS_PER_SECOND ) ///< Time period count for purge air time out. +#define NO_AIR_DETECTED_COUNT ( 40 * MS_PER_SECOND ) ///< No air detected time period count. +#define PURGE_AIR_TIME_OUT_COUNT ( 120 * MS_PER_SECOND ) ///< Time period count for purge air time out. +#define PRIME_SALINE_DIALYZER_TIME_OUT_COUNT ( 60 * MS_PER_SECOND ) ///< Time period count for prime saline dialyzer time out. #define LOAD_CELL_STEADY_VOLUME_SAMPLING_TIME ( 1 * MS_PER_SECOND ) ///< Time load cell reading steady state detection sampling time in seconds. #define PRIME_DIALYSATE_BYPASS_TIME_LIMIT ( 15 * MS_PER_SECOND ) ///< Time limit for priming dialysate bypass circuit. #define STEADY_VOLUME_COUNT_SEC ( 10000 / LOAD_CELL_STEADY_VOLUME_SAMPLING_TIME ) ///< Counter must be greater than 10 seconds before steady volume is true. @@ -86,7 +86,8 @@ { 100, 200 }, // DIALYZER_TYPE_BBRAUN_PRO_16H { 120, 257 }, // DIALYZER_TYPE_BBRAUN_PRO_19H { 87, 233 }, // DIALYZER_TYPE_FRESENIUS_OPTIFLUX_F160NRE - { 102, 280 } }; // DIALYZER_TYPE_FRESENIUS_OPTIFLUX_F180NRE + { 102, 280 }, // DIALYZER_TYPE_FRESENIUS_OPTIFLUX_F180NRE + { 113, 348 } }; // DIALYZER_TYPE_FRESENIUS_OPTIFLUX_F200NRE static U32 primeDialysateDialyzerTimeLimit; ///< Time limit in msec for priming dialysate dialyzer path. static U32 primeSalineDialyzerTimeLimit; ///< Time limit in msec for priming saline dialyzer path. @@ -101,6 +102,7 @@ static BOOL primeStartRequested; ///< Flag indicates user requesting to start prime. static BOOL primeResumeRequested; ///< Flag indicates user requesting prime resume. +static BOOL primeFirstPurgePass; ///< Flag indicates to transition to a faster purge speed. static U32 noAirDetectedStartTime; ///< starting time when detecting no air. static U32 purgeAirTimeOutStartTime; ///< Starting time for purge air state time out. @@ -161,6 +163,7 @@ void transitionToPrime( void ) { primeStartTime = getMSTimerCount(); + primeFirstPurgePass = TRUE; setAlarmUserActionEnabled( ALARM_USER_ACTION_RESUME, TRUE ); setAlarmUserActionEnabled( ALARM_USER_ACTION_RINSEBACK, FALSE ); @@ -426,7 +429,14 @@ signalDialOutPumpHardStop(); signalDialInPumpHardStop(); - setBloodPumpTargetFlowRate( BLOOD_PUMP_FAST_FLOW_RATE_PURGE_AIR_ML_MIN, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); + if (FALSE == primeFirstPurgePass ) + { + setBloodPumpTargetFlowRate( BLOOD_PUMP_FAST_FLOW_RATE_PURGE_AIR_ML_MIN, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); + } + else + { + setBloodPumpTargetFlowRate( BLOOD_PUMP_SLOW_FLOW_RATE_PURGE_AIR_ML_MIN, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); + } } /*********************************************************************//** @@ -546,7 +556,12 @@ { purgeAirValvesBloodPumpControl(); purgeAirTimeOutStartTime = getMSTimerCount(); + if ( TRUE == primeFirstPurgePass ) + { + primeFirstPurgePass = FALSE; + } state = HD_PRIME_SALINE_PURGE_AIR_STATE; + } if ( TRUE == didTimeout( noAirDetectedStartTime, NO_AIR_DETECTED_COUNT ) ) @@ -731,6 +746,11 @@ state = HD_PRIME_RESERVOIR_TWO_FILL_COMPLETE_STATE; } + if ( TRUE == didTimeout( primeSalineDialyzerStartTime, PRIME_SALINE_DIALYZER_TIME_OUT_COUNT ) ) + { + activateAlarmNoData( ALARM_ID_PRIME_SALINE_DIALYZER_TIME_OUT ); // Trigger HD prime saline dialyzer time out alarm. + } + if ( TRUE == doesAlarmStatusIndicateStop() ) { setupForPrimePause();