Abstract: A new approach for reducing the contour errors in two-dimensional CNC machines is presented in this study. In the approach proposed here, two pre-trained nonlinear autoregressive networks with exogenous inputs (NARX), one for each axis, are used to predict the output position of the machine in the next sampling instant. The contour error in the next instant is then estimated and, based on this, the required compensation terms to be added to the reference input positions to reduce the contour error are determined. In the proposed approach, the compensation terms can be updated through an iteration process which reduces the contour error each time. Simulation experiments applying this approach to linear, circular and parabolic contours show that, even without extensive training of the NARX models, the contour errors can be significantly reduced. Actual experiments conducted on a small two-axis CNC machine confirm the effectiveness of this approach in reducing contour errors for linear, circular, parabolic and a free-form “goggles” contours. [Copyright &y& Elsevier]