Based on the analysis of the periodic error in the reconstructed image of the ptychographic iterative engine (PIE), the cause in mathematics for this kind of error is found out, and then a method is proposed to eliminate it. By replacing the 2D periodic scanning of fixed step interval in common PIE imaging with the 2D raster scanning of changing step interval, the periodical error in the reconstructed images can be dramatically reduced, and then the accuracy of the PIE imaging is remarkably improved. Both the theoretical investigation and numerical simulations are presented.