Smooth trajectory generation and precision control of 5-axis CNC machine tools