One word, PREACT. Make an adjustable preact that you subtract from your setpoint. This is the amount of ingredient that flows while the valve is closing. Then have a timer that starts after the valve is de-energized. This timer should be slightly longer than the time it takes the valve to close. Keep totalizing until the timer is done. With practice you'll be spot on in no time.