A system that integrates prediction, optimization and control with an emphasis on product quality in view of the surface roughness. The choice of cutting parameters that ensure the desired product quality in a known unit time. The flexibility of the system according to the current demands on product quality.