Index: firmware/.launches/DG.launch =================================================================== diff -u -rbbf67569fc5f34815c0e0855dd452de2be5a7976 -re86af65442a36724461317980814f0868bd8c995 --- firmware/.launches/DG.launch (.../DG.launch) (revision bbf67569fc5f34815c0e0855dd452de2be5a7976) +++ firmware/.launches/DG.launch (.../DG.launch) (revision e86af65442a36724461317980814f0868bd8c995) @@ -1,6 +1,6 @@ - + Index: firmware/App/Modes/ModeFlush.c =================================================================== diff -u -r34ed52c598042fdcfa5526e3b1d46fa09b040199 -re86af65442a36724461317980814f0868bd8c995 --- firmware/App/Modes/ModeFlush.c (.../ModeFlush.c) (revision 34ed52c598042fdcfa5526e3b1d46fa09b040199) +++ firmware/App/Modes/ModeFlush.c (.../ModeFlush.c) (revision e86af65442a36724461317980814f0868bd8c995) @@ -44,7 +44,7 @@ #define DRAIN_PUMP_TARGET_RPM 1800 ///< Drain pump target RPM during drain. // Drain R1 & R2 states defines -#define DRAIN_WEIGHT_UNCHANGE_TIMEOUT ( 6 * MS_PER_SECOND ) ///< Time period of unchanged weight during draining before timeout. +#define DRAIN_WEIGHT_UNCHANGE_TIMEOUT ( 6 * MS_PER_SECOND ) ///< Time period of unchanged weight during draining before timeout. // Flush drain path state defines #define FLUSH_DRAIN_WAIT_TIME_MS ( 1 * 60 * MS_PER_SECOND ) ///< Flush Drain path wait time in milliseconds. TODo original time is 2 minutes @@ -286,6 +286,9 @@ { DG_FLUSH_STATE_T state = DG_FLUSH_STATE_START; + // Reset the load cells lowest weight prior to starting the run + resetReservoirsLowestWeight(); + // Start overall flush timer overallFlushElapsedTimeStart = getMSTimerCount(); @@ -590,13 +593,13 @@ U32 drainPumpRPM = getTargetDrainPumpRPM(); // Keep monitoring the status of reservoir 1 as the same time - rsrvr1Status = getRsrvrFillStatus( DG_RESERVOIR_1, RSRVRS_PARTIAL_FILL_VOL_ML, RSRVRS_PARTIAL_FILL_TIMEOUT_MS ); + F32 volume = getLoadCellSmallFilteredWeight( LOAD_CELL_RESERVOIR_1_PRIMARY ); // Reservoir 1 cannot be filled before reservoir 2 is filled and is overflowing to reservoir 1. If reservoir 1 has already // reached to target volume, it means reservoir 2's load cell might be reading incorrect values. This situation might continue // until reservoir 1 is filled up and the tubing might expand or leak. // Before checking whether reservoir 1 is filled pre-maturely, we have to make sure reservoir 1 is drained completely to make // sure the extra volume that is read is not because of previous water that is being drained currently and it is above 500 mL - if ( ( DG_RESERVOIR_REACHED_TARGET == rsrvr1Status ) && ( 0 == drainPumpRPM ) ) + if ( ( volume > RSRVRS_PARTIAL_FILL_VOL_ML ) && ( 0 == drainPumpRPM ) ) { prevFlushState = state; alarmDetectedPendingTrigger = ALARM_ID_DG_INVALID_LOAD_CELL_VALUE; @@ -664,6 +667,7 @@ setValveState( VPD, VALVE_STATE_DRAIN_C_TO_NC ); setValveState( VRC, VALVE_STATE_RECIRC_C_TO_NC ); setValveState( VDR, VALVE_STATE_RECIRC_C_TO_NC ); + setValveState( VPO, VALVE_STATE_NOFILL_C_TO_NO ); setROPumpTargetFlowRate( RO_PUMP_TARGET_FLOW_RATE_LPM, RO_PUMP_MAX_PRESSURE_PSI ); stateTimerStart = getMSTimerCount(); Index: firmware/App/Modes/ModeHeatDisinfect.c =================================================================== diff -u -r24fd1893101af40cc6736aacaa20382875c80bf1 -re86af65442a36724461317980814f0868bd8c995 --- firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision 24fd1893101af40cc6736aacaa20382875c80bf1) +++ firmware/App/Modes/ModeHeatDisinfect.c (.../ModeHeatDisinfect.c) (revision e86af65442a36724461317980814f0868bd8c995) @@ -399,6 +399,9 @@ // Set all the actuators to reset and de-energized state resetActuators(); + // Reset the load cells lowest weight prior to starting the run + resetReservoirsLowestWeight(); + F32 ppiPressure = getMeasuredDGPressure( PRESSURE_SENSOR_RO_PUMP_INLET ); F32 TDiTemp = getTemperatureValue( TEMPSENSORS_OUTLET_REDUNDANT ); //TODo change to TDi F32 TRoTemp = getTemperatureValue( TEMPSENSORS_OUTLET_REDUNDANT ); Index: firmware/App/Services/Reservoirs.c =================================================================== diff -u -r24fd1893101af40cc6736aacaa20382875c80bf1 -re86af65442a36724461317980814f0868bd8c995 --- firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 24fd1893101af40cc6736aacaa20382875c80bf1) +++ firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision e86af65442a36724461317980814f0868bd8c995) @@ -361,6 +361,20 @@ /*********************************************************************//** * @brief + * The resetReservoirsLowestWeight function resets the lowest load cell + * weight of the reservoirs. + * @details Inputs: reservoirLowestWeight + * @details Outputs: reservoirLowestWeight + * @return none + *************************************************************************/ +void resetReservoirsLowestWeight( void ) +{ + reservoirLowestWeight[ DG_RESERVOIR_1 ] = MAX_RESERVOIR_WEIGHT; + reservoirLowestWeight[ DG_RESERVOIR_2 ] = MAX_RESERVOIR_WEIGHT; +} + +/*********************************************************************//** + * @brief * The getInactiveReservoir function gets the inactive reservoir. * @details Inputs: activeReservoir * @details Outputs: none Index: firmware/App/Services/Reservoirs.h =================================================================== diff -u -r24fd1893101af40cc6736aacaa20382875c80bf1 -re86af65442a36724461317980814f0868bd8c995 --- firmware/App/Services/Reservoirs.h (.../Reservoirs.h) (revision 24fd1893101af40cc6736aacaa20382875c80bf1) +++ firmware/App/Services/Reservoirs.h (.../Reservoirs.h) (revision e86af65442a36724461317980814f0868bd8c995) @@ -78,6 +78,7 @@ void stopDrainCmd( void ); // handle stop drain command from HD void tareReservoir( void ); +void resetReservoirsLowestWeight( void ); DG_RESERVOIR_ID_T getInactiveReservoir( void ); F32 getReservoirWeight( DG_RESERVOIR_ID_T reservoirId );