The grinding and polishing of the switch rail after CNC shaping and milling in railway turnout is currently conducted manually,resulting in issues such as low efficiency,poor quality consistency,and missed grinding,which hinder meeting the requirements for efficient and high-quality processing of switch rail.While the integration of industrial robot milling technology into the grinding and polishing process can enhance the automation level of switch rail manufacturing,the complexity and variability of the switch rail tip profile and the weak rigidity of robots pose challenges in ensuring the smoothness of the machining trajectory.Therefore,it is imperative to innovate the trajectory planning method of the robot with complex profile on switch rail tip surfaces.Firstly,a kinematics model of robot is established based on MD-H parameter method and its motion characteristics are analyzed.Then,the tip profile of the switch rail is parameterized by cubic NURBS curve.An optimization model for trajectory point pose is developed,with the normal stiffness performance index of the milling operation as the optimization objective.Meanwhile,considering the constraints of robot joint continuity,a pose planning model for robot milling trajectory attitude is established.On this basis,the robot's milling speed is planned using an S-shaped curve algorithm.Finally,simulation and experiments are conducted for verification.The results show that this method can effectively control the trajectory of the robot,address the issue of"over-cutting"and"tool jumping"in the convex-included angle area through the inserted transition curve,and achieve a smoother tip profile of the switch rail after processing,meeting the manufacturing requirements of the switch rail.