Besides imaging, AFM can be used for force spectroscopy, the direct measurement of tip-sample interaction forces as a function of the gap between the tip and sample. The result of this measurement is called a force-distance curve. For this method, the AFM tip is extended towards and retracted from the surface as the deflection of the cantilever is monitored as a function of piezoelectric displacement. These measurements have been used to measure nanoscale contacts, atomic bonding, Van der Waals forces, and Casimir forces, dissolution forces in liquids and single molecule stretching and rupture forces. AFM has also been used to measure, in an aqueous environment, the dispersion force due to polymer adsorbed on the substrate. Forces of the order of a few piconewtons can now be routinely measured with a vertical distance resolution of better than 0.1 nanometers.  Force spectroscopy can be performed with either static or dynamic modes.  In dynamic modes, information about the cantilever vibration is monitored in addition to the static deflection.
Problems with the technique include no direct measurement of the tip-sample separation and the common need for low-stiffness cantilevers, which tend to "snap" to the surface. These problems are not insurmountable.  An AFM that directly measures the tip-sample separation has been developed.  The snap-in can be reduced by measuring in liquids or by using stiffer cantilevers, but in the latter case a more sensitive deflection sensor is needed. By applying a small dither to the tip, the stiffness (force gradient) of the bond can be measured as well.