CNC machine tool is the basis of equipment manufacturing industry, with the continuous improvement of product precision requirements, the demand for high reliability and high precision machine tools is also more and more urgent, and the reliability of machining accuracy is an important indicator for evaluating the ability of machine tools to maintain machining accuracy. The study introduces the fuzzy logic algorithm, designs the adaptive fuzzy PID control controller for CNC machine tools, and realizes the error compensation according to the sensor fusion technology. The method of this paper is added to the speed loop control to improve the optimization parameters of the system, and then the method of this paper is compared with other control methods to calculate the estimated value of trajectory error in the machining process of CNC machine tools. According to the results of the study, the method of this paper has higher control accuracy and better convergence compared with other control methods, realizes the control of CNC machine tool machining accuracy in adaptive optimization model, effectively reduces the machining error of CNC machine tool, and has high practical application value.