This paper focuses on improving the tracking accuracy for servo systems and increasing the contouring performance of precision machining. The dynamic friction during precision machining is analyzed using the LuGre model. The dynamic and static parameters in the friction model are efficiently and accurately identified using the improved Drosophila swarm algorithm based on cross-mutation. The friction tracking error can be deduced from the friction state space and an expression is derived. To compensate for the tracking error caused by friction, a feedforward compensation control is designed to avoid signal lag in traditional friction controllers. Furthermore, the factors of multi-axis parameter mismatching that impact the machining profile accuracy are analyzed for multi-axis control. An adaptive cross-coupled control-based pre-compensation strategy of contour error is designed to reduce both the tracking error and the contour error. The effectiveness of the proposed method is validated through several experiments, which demonstrate a remarkable improvement in tracking performance and contour accuracy.