The contact rigidity and damping between joints of machine tools could vary greatly because of the difference of static and dynamic loading conditions. The pseudo-random gashing cutting is adopted in this paper, which makes the identification of structure transfer function of machine tools close to actual machining condition and improve the identification accuracy. The main idea of this method is to decouple the transfer function in two directions based on left edge and right edge cutting. Therefore, the structure transfer function identification of machine tools in actual cutting excitation is implemented. Finally, this method is compared with the traditional transfer function identification based on electromagnetism excitation and the qualified error is given.