Piezoelectric actuators are popularly used in scanning tunneling microscopy to measure the three-dimensional profiles of ultraprecision surfaces. The actuators control the measuring tip at a certain distance above the surface so that a constant tunneling current is maintained during scanning. The features of surfaces are reconstructed with the voltage applied to the actuator. Therefore, the overall measurement accuracy of the scanning tunneling microscopy is limited by the hysteresis effects inherent in piezoelectric materials. For this reason, in order to measure with more accuracy, the general nonlinear modeling of a stacked piezoelectric actuator should be considered. And this nonlinear model is simplified for applications to actual system. To improve the measurement accuracy, the scanning speed determined by both the dynamics of actuator and the feature of surface is used and the measured feature is calibrated by the nonlinear model. The experimental results prove that the scanning speed used in this study can be good for real patterns and the nonlinear model can improve the measurement accuracy by an order of ten, compared with the conventional linear model.