Index: firmware/App/Services/Reservoirs.c =================================================================== diff -u -ra7675f3c917b632cf16207fc7ccfc1f38eb83f9b -r22dc8daefbb24bd2a2ea6f0a2465c6714267638c --- firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision a7675f3c917b632cf16207fc7ccfc1f38eb83f9b) +++ firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 22dc8daefbb24bd2a2ea6f0a2465c6714267638c) @@ -472,7 +472,8 @@ dilutionLevelPct = volSpentUFML / (F32)FILL_RESERVOIR_TO_VOLUME_ML; // Check if the dilution level has exceeded the limit or the spent volume is more than the amount of volume in the reservoir - // If it has, trigger the fill command + // If it has, trigger the fill command. This if should not happen and the predictive dilution level should trigger just in time + // in advance if ( ( dilutionLevelPct >= MAX_RESERVOIR_DILUTION ) || ( volSpentML >= (F32)FILL_RESERVOIR_TO_VOLUME_ML ) ) { if ( DG_GEN_IDLE_MODE_STATE_FLUSH_WATER == dgSubMode ) @@ -590,7 +591,8 @@ TREATMENT_RESERVOIR_MGMT_STATE_T state = TREATMENT_RESERVOIR_MGMT_WAIT_FOR_FILL_SETTLE_STATE; // Wait for the reservoir to settle and then send the commands to switch the active reservoir - if ( ( TRUE == didTimeout( reservoirSwitchStartTimeMS, RESERVOIR_SETTLE_TIME_MS ) ) && ( volSpentML >= (F32)FILL_RESERVOIR_TO_VOLUME_ML ) ) + if ( ( TRUE == didTimeout( reservoirSwitchStartTimeMS, RESERVOIR_SETTLE_TIME_MS ) ) && + ( dilutionLevelPct >= MAX_RESERVOIR_DILUTION ) || ( volSpentML >= (F32)FILL_RESERVOIR_TO_VOLUME_ML ) ) { DG_RESERVOIR_ID_T inactiveRes = getDGInactiveReservoir();