Quality control in CNC machining