Aiming at the CNC machine tools vibration due to unsmoothed velocity and jerk during starting/stopping stage,A new s-curve acceleration and deceleration algorithm is proposed combining the cubic polynomial model with the moving average filtering technique.Theoretical analysis of the velocity model,acceleration model,and jerk model shows that the method can ensure the continuity of velocity acceleration and jerk.Practical application on CNC system shows the effectiveness of the method.