Index: firmware/App/Controllers/DryBiCart.c =================================================================== diff -u -rc5ffb798313c4179717f45b6485cebcb45e6fd5d -r8b2c714710d2d533c876614ab3d0a59df10a9ee9 --- firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision c5ffb798313c4179717f45b6485cebcb45e6fd5d) +++ firmware/App/Controllers/DryBiCart.c (.../DryBiCart.c) (revision 8b2c714710d2d533c876614ab3d0a59df10a9ee9) @@ -43,6 +43,7 @@ #define DRY_BICART_VENT_TIME_MS ( 1 * MS_PER_SECOND ) ///< Wait time to vent dry bibag gas before actuating Bicarb chamber(F) venting. #define DRY_BICART_VENT_MAX_TIME_MS ( 10 * MS_PER_SECOND ) ///< Max time to vent both bicart and Chamber F. #define DRY_BICART_FILL_DURATION_DIFF_MS 800 ///< Fill duration difference between last and current fill cycle. +#define DRY_BICART_FILL_DURATION_MIN_MS 1000 ///< Minimum fill duration to be met to end the fill cycle. #define DRY_BICART_DEFAULT_MAX_FILL_CYCLE_CNT 10 ///< Default max fill cycle allowed for dry bicart fill/mix with water. #define DRY_BICART_MAX_FILL_CYCLE_CNT 30 ///< Max fill cycle allowed (by override) for dry bicart fill/mix with water. @@ -328,12 +329,13 @@ static DRY_BICART_FILL_EXEC_STATE_T handleDryBicartFillDurationCheckState( void ) { DRY_BICART_FILL_EXEC_STATE_T state = DRY_BICART_FILL_DURATION_CHECK_STATE; - U32 diffInFillDuration = calcTimeBetween( currentFillDurationInMS ,lastFillDurationInMS ); + U32 diffInFillDuration = fabs( currentFillDurationInMS - lastFillDurationInMS ); U32 dryBiCartMaxFillCount = getU32OverrideValue( &biCartMaxFillCycleCount ); F32 d66Pressure = getFilteredPressure( D66_PRES ); // Fill time shortens over the period or number of fill cycle exceeded - if ( ( diffInFillDuration <= DRY_BICART_FILL_DURATION_DIFF_MS ) || + if ( ( ( currentFillDurationInMS <= DRY_BICART_FILL_DURATION_MIN_MS ) && + ( diffInFillDuration <= DRY_BICART_FILL_DURATION_DIFF_MS ) ) || ( biCartFillCycleCounter >= dryBiCartMaxFillCount ) ) { state = DRY_BICART_FILL_COMPLETE_STATE; @@ -525,6 +527,7 @@ if ( d66Pressure >= DRY_BICART_FILL_COMPLETE_PRESSURE ) { setValveState( D65_VALV, VALVE_STATE_CLOSED ); + setValveState( D80_VALV, VALVE_STATE_CLOSED ); state = BICARB_CHAMBER_START_STATE; } Index: firmware/App/DDCommon.h =================================================================== diff -u -rc5ffb798313c4179717f45b6485cebcb45e6fd5d -r8b2c714710d2d533c876614ab3d0a59df10a9ee9 --- firmware/App/DDCommon.h (.../DDCommon.h) (revision c5ffb798313c4179717f45b6485cebcb45e6fd5d) +++ firmware/App/DDCommon.h (.../DDCommon.h) (revision 8b2c714710d2d533c876614ab3d0a59df10a9ee9) @@ -55,7 +55,7 @@ #define __MAXON_SPEED_UPDATE__ 1 //UnComment below for DryBicarb testing -//#define __DRY_BICARB__ 1 +#define __DRY_BICARB__ 1 //Uncomment below to disable heaters debug message #define __HEATERS_DEBUG__ 1 Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r96672fa4b57d15c36d8aaa73d6f50ea0fe7fda66 -r8b2c714710d2d533c876614ab3d0a59df10a9ee9 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 96672fa4b57d15c36d8aaa73d6f50ea0fe7fda66) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 8b2c714710d2d533c876614ab3d0a59df10a9ee9) @@ -156,7 +156,7 @@ DD_STANDBY_MODE_STATE_T state = DD_STANDBY_MODE_STATE_IDLE; //Testing - //hydChamberWaterInletControl(); + hydChamberWaterInletControl(); //TODO : Define comm loss alarm when TD is turned off or stops communicating // if ( FALSE == isTDCommunicating() )