Smooth and Time-Optimal Trajectory Generation for High Speed Machine Tools