Index: firmware/App/Services/Reservoirs.c =================================================================== diff -u -r92708a5ab23026f5c9afce66bfa542c84141011a -r550a5df210ac26217412e5e312d0a08864c5682e --- firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 92708a5ab23026f5c9afce66bfa542c84141011a) +++ firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 550a5df210ac26217412e5e312d0a08864c5682e) @@ -674,6 +674,7 @@ F32 loadcellWeightML = getLoadCellSmallFilteredWeight( associatedLoadCell[ reservoirId ] ); U32 targetDrainVolML = getU32OverrideValue( &drainVolumeTargetMl ); F32 drainFlowML = loadcellWeightML - previousReservoirWeight[ reservoirId ]; + F32 drainThresholdML = ( (F32)getDrainPumpTargetRPM() ) / 2400.0; // Update the structure with the current weight as the previous previousReservoirWeight[ reservoirId ] = getLoadCellSmallFilteredWeight( associatedLoadCell[ reservoirId ] ); @@ -683,11 +684,11 @@ // ready to consider this the end of the reservoir flow // If the wait for drain to steady has elapsed and the drain pump inlet pressure sensor is indicating and increased vacuum, // signal the drain is complete - if ( ( drainFlowML <= DRAIN_THRESHOLD_ML( getDrainPumpTargetRPM() ) ) && ( 0 == reservoirWeightUnchangeStartTime[ reservoirId ] ) ) + if ( ( drainFlowML <= drainThresholdML ) && ( 0 == reservoirWeightUnchangeStartTime[ reservoirId ] ) ) { reservoirWeightUnchangeStartTime[ reservoirId ] = getMSTimerCount(); } - else if ( drainFlowML > DRAIN_THRESHOLD_ML( getDrainPumpTargetRPM() ) ) + else if ( drainFlowML > drainThresholdML ) { reservoirWeightUnchangeStartTime[ reservoirId ] = 0; }