During machining, compare simulated with detected profile, correct, modify program