A new way of identifying, predicting and regulating residual stress after chip-forming machining