Prediction and control of vibrations and chatter in machining