Prioritization the factors was made which affected the value of tracking error using the orthogonal test, and the key factors were found. The relationship between key factors and tracking error was analyzed through test, and a dynamic calculation method for tracking error alarm threshold was raised using the relationship, which could calculate the alarm threshold according to the feed speed in realtime. As compared with the traditional method which used static parameters to set tracking error alarm threshold in domestic numercial control (NC) system, it can reduce the number of false alarm and assure the NC machining accuracy.