Patent attributes
A machine is cleaned by directing a foam detergent into the machine to remove contaminants from inside the machine. An effluent portion of the foam detergent exits from the machine with some of the contaminants. One or more of a turbidity, a salinity, an amount of total dissolved solids, or a concentration the contaminants in the effluent is measured. A cleaning time period during which the foam detergent is to be directed into the machine is determined based on the turbidity, the salinity, the amount of total dissolved solids, and/or the contaminant concentration that is measured from the effluent. The foam detergent continues to be directed into the machine during the cleaning time period, and the flow of the foam detergent into the machine is terminated on expiration of the time period.