The control performance of the control system directly affects the running performance of the product. In order to solve the problem that the dynamics characteristics of mechanical systems are affected by the performance degradation of the controller, a digital twin-driven PID controller tuning method for dynamics is proposed. In this paper, firstly, the structure and operation mechanism of digital twin model for PID controller tuning are described. By using the advantages of virtual real mapping and data fusion of digital twin model, combined with the online identification of controlled object model, the problems of real-time feedback of actual control effect of the controller and unreal virtual model of control system caused by time-varying working conditions are effectively solved, and the closed-loop self-tuning of PID controller is realized. At the same time, intelligent optimization algorithm is integrated to improve the efficiency and accuracy of PID controller parameter tuning. Secondly, the modeling method of digital twin model is described from three aspects of physical prototyping, twin service system, and virtual prototyping. Finally, the controller tuning for gear transmission stability is taken as an example to verify the practicability of the proposed method.