An enhanced primary treatment (EPT) system includes an EPT settling tank. A sludge drain discharges a sludge including BOD from the EPT settling tank and a clarified effluent discharge recovers decanted fluid from the EPT settling tank. A controller has at least one computer processor. A sludge sensor is communicatively coupled to the controller. The sludge sensor provides a sludge BOD concentration measurement, or a measurement from which the sludge BOD concentration is calculated. A process algorithm controls the sludge valve to control the discharge of the sludge by gravity or by pumping in response to data from the sludge sensor of the sludge BOD concentration. A method of controlling an enhanced primary treatment (EPT) system is also described.