the programming analysis and definition of the G-Code and the function of error detection are introduced.The motion trajectory planning of the friction stir welding machine is discussed.The trajectory planning algorithm of the space straight lines and space arc is studied and its feasibility is verified through the practice