A repetitive controller (RC) is implemented to control the Z-axis movements of a piezo-scanner used for AFM scanning and then tested through scan experiments and numerical simulations. The experimental and simulation results show that the RC compensates phase delays better than the standard PI controller at high scan speeds, which leads to less scan error and lower interaction forces between the scanning probe and the surface being scanned. Since the AFM experiments are not perfectly repeatable in the physical world, the optimum phase compensators of the RC resulting this performance are determined through the numerical simulations performed in MATLAB/Simulink. Furthermore, the numerical simulations are also performed to show that the proposed RC is robust and does not require re-tuning of these compensators when the consecutive scan lines are not similar and a change occurs in the probe characteristics. (C) 2011 Elsevier Ltd. All rights reserved.