In order to solve the high-precision machining problems of complex farm machinery parts and components, a five-axis CNC machining technology was introduced into the machining process, and the path of the machining tools was optimized by using the adaptive differential algorithm, thus effectively improving the machining efficiency of complex parts of agricultural machinery And processing accuracy. In the process of five-axis NC machining, the cutting model needs to be established. However, the tool vector in five-axis machining process is constantly changing, and the calculation is complicated. However, the adaptive differential algorithm introduced this time can use the initialization parameter data and the curve fitting Method to determine the best path to go. In order to verify the reliability of the algorithm, the tool path optimization results are simulated and the test results show that the tool path optimization algorithm can get a better path in the corner of complex parts. Finally, the actual machining experiment is carried out on the system. The test results show that the processing effect of complex agricultural machinery parts with high precision can be obtained by the NC machining system, which provides a new direction for the processing of complex agricultural machinery parts.