  The distance dependence and atomic-scale contrast observed in nominal contact
potential difference (CPD) signals recorded by KPFM on surfaces of insulating
and semiconducting samples, have stimulated theoretical attempts to explain
such effects. We attack this problem in two steps. First, the electrostatics of
the macroscopic tip-cantilever-sample system is treated by a finite-difference
method on an adjustable nonuniform mesh. Then the resulting electric field
under the tip apex is inserted into a series of atomistic wavelet-based density
functional theory (DFT) calculations. Results are shown for a realistic neutral
but reactive silicon nano-scale tip interacting with a NaCl(001) sample.
Bias-dependent forces and resulting atomic displacements are computed to within
an unprecedented accuracy. Theoretical expressions for amplitude modulation
(AM) and frequency modulation (FM) KPFM signals and for the corresponding local
contact potential differences (LCPD) are obtained by combining the macroscopic
and atomistic contributions to the electrostatic force component generated at
the voltage modulation frequency, and evaluated for several tip oscillation
amplitudes A up to 10 nm. Being essentially constant over a few Volts, the
slope of atomistic force versus bias is the basic quantity which determines
variations of the atomic-scale LCPD contrast. Already above A = 0.1 nm, the
LCPD contrasts in both modes exhibit almost the same spatial dependence as the
slope. In the AM mode, this contrast is approximately proportional to
$A^{-1/2}$, but remains much weaker than the contrast in the FM mode, which
drops somewhat faster as A is increased. These trends are a consequence of the
macroscopic contributions to the KPFM signal, which are stronger in the AM-mode
and especially important if the sample is an insulator even at sub-nanometer
separations where atomic-scale contrast appears.
