Index: firmware/App/Modes/ModeFill.c =================================================================== diff -u -rb766ff89da93aeb7f423a61487933477ff3ec82d -r150a74dc4d92472352d14934b4359c4bf7e7450a --- firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision b766ff89da93aeb7f423a61487933477ff3ec82d) +++ firmware/App/Modes/ModeFill.c (.../ModeFill.c) (revision 150a74dc4d92472352d14934b4359c4bf7e7450a) @@ -63,8 +63,8 @@ #define CONC_PUMPS_PRIME_AT_MAX_SPEED_TIME_OUT_MS ( 7 * MS_PER_SECOND ) ///< Concentrate pumps prime at maximum speed timeout in milliseconds. #define CONC_PUMPS_PRIME_CHECK_COND_SNSRS_TIME_OUT_MS ( 10 * MS_PER_SECOND ) ///< Concentrate pumps prime check conductivity sensors timeout in milliseconds. -#define CONC_PUMPS_PRIME_MAX_ALLOWED_PRIME_TIME_OUT_MS ( 25 * MS_PER_SECOND ) ///< Concentrate pumps prime maximum allowed timeout in prime in milliseconds. - +#define CONC_PUMPS_PRIME_MAX_ALLOWED_PRIME_TIME_OUT_MS ( 50 * MS_PER_SECOND ) ///< Concentrate pumps prime maximum allowed timeout in prime in milliseconds. +#define NINTY_FIVE_PERCENT_FACTOR 0.95F ///< Ninety five percent of expected conductivity #define FLOW_INTEGRATED_VOLUME_CHECK_TOLERANCE 0.1F ///< Flow integrated volume has 10% tolerance compare to load cell reading. #define FIVE_PERCENT_FACTOR 0.05F ///< 5.0 / 100.0 used to calculate conductivity within range of -/+ 5%. @@ -80,7 +80,7 @@ // 2m long tubing to cap = 19.5 mL (acid line) + 7.92 mL/m * 2 m (tubing to cap) + 20.82 mL (straw) = 56.15 mL // Prime time in seconds = ( 56.15 mL / 48 mL/min ) x 60 second/min + 25 seconds margin time = 95 seconds. -#define PRIME_CONCENTRATE_LINES_TIME_OUT_MS ( 95 * MS_PER_SECOND ) ///< Time required to prime the concentrate lines. +#define PRIME_CONCENTRATE_LINES_TIME_OUT_MS ( 60 * MS_PER_SECOND ) ///< Time required to prime the concentrate lines. #define FLUSH_BUBBLES_PUMP_TIME_OUT_MS ( 2 * MS_PER_SECOND ) ///< RO pump on during flush bubble interval in ms. #define DIALYSATE_TEMPERATURE_TOLERANCE_C 2.0F ///< Dialysate temperature tolerance in degree C. #define DATA_PUBLISH_COUNTER_START_COUNT 63 ///< Data publish counter start count. @@ -791,15 +791,15 @@ if ( TRUE == didTimeout( concPumpPrimeStartTimeMS, CONC_PUMPS_PRIME_CHECK_COND_SNSRS_TIME_OUT_MS ) ) { /* Once the time for priming the concentrate lines has elapsed, check the mixing conductivity of the sensors - * If the acid and bicarb conductivity values are at about 50% of the target concentrate during fill, transition to the next state - * If the acid and bicarb conductivity values are not at 50% but the maximum prime time has elapsed, transition to the next state + * If the acid and bicarb conductivity values are at about 95% of the target concentrate during fill, transition to the next state + * If the acid and bicarb conductivity values are not at 95% but the maximum prime time has elapsed, transition to the next state */ F32 acidConduSPerCM = getConductivityValue( CONDUCTIVITYSENSORS_CD1_SENSOR ); F32 bicarbConduSPerCM = getConductivityValue( CONDUCTIVITYSENSORS_CD2_SENSOR ); F32 acidFillConduSPerCM = chemicalsCond.fillCondValues[ chemicalsTypes.acidType ][ FILL_COND_NORMAL_OP ].acidConduSPerCM; F32 bicarbFillConduSPerCM = chemicalsCond.fillCondValues[ chemicalsTypes.acidType ][ FILL_COND_NORMAL_OP ].bicarbConduSPerCM; - if ( ( acidConduSPerCM >= ( acidFillConduSPerCM * HALF ) ) && ( bicarbConduSPerCM >= ( bicarbFillConduSPerCM * HALF ) ) ) + if ( ( acidConduSPerCM >= ( acidFillConduSPerCM * NINTY_FIVE_PERCENT_FACTOR ) ) && ( bicarbConduSPerCM >= ( bicarbFillConduSPerCM * NINTY_FIVE_PERCENT_FACTOR ) ) ) { result = DG_FILL_MODE_STATE_DELIVER_DIALYSATE; setModeFillStateTransition( result );