A flexible tool wear sensor for NC lathes