In the process of development of numerical control system, we would actually go to the processing plant to test a strategy or compare the accuracy of trajectory planning, which is not only inefficient, but may lead to mechanical platform damage or safety incidents due to improper use of the parameters. Therefore, we aim to establish virtual simulation system for the lead screw guide system. Based on the process of CNC machining process, a whole architecture of virtual simulation platform is put forward. Virtual simulation platform can be divided into specific modules, including trajectory planning module» control module, single axis platform module, error analysis module and compensation module. We analyze the mathematical modeling based on a XY table. In order to reflect the characteristics of the system, we mainly focus on the reverse gap, friction force and other nonlinear factors analysis and modeling. We establish the model of a servo drive and mechanical structure. Finally, based on the simulation platform, we add the compensation control module to the virtual simulation system. By comparing contour error of experimental platform and simulation platform before and after compensation, we prove that the compensation is effective.