An electrical potential difference between a slider body and a hard disk
of a hard disk drive is eliminated based on the flying-height spacing of
the slider body between the slider body and the hard disk. A
predetermined bias voltage is applied between the slider body and the
hard disk that includes a DC component and an AC component and that is
based on the detected flying-height spacing of the slider body. The
flying-height spacing can be detected based a minimum slider-to-disk
clearance change from a design flying height of the slider at a frequency
of the AC component as the DC component of the predetermined bias voltage
is varied. Alternatively, the flying-height spacing can be detected based
on a minimum electrodynamic response of the slider to a first harmonic of
the AC frequency of the AC component as the DC component is varied.