working principle of cnc grinding machine