On-line quality control during production