A method of operating a scanning probe microscope (SPM) having a probe including a cantilever supporting a tip , the method comprising: generating periodic relative motion between the probe and a sample ; detecting motion of the probe ; recovering, from the detected probe motion, a substantially instantaneous force (δF r ) between the tip and the sample by performing hydrodynamic background substraction using either lock-in amplification or synchronous averaging of the detected motion of the probe , wherein the recovering step includes recovering a probe-sample interaction that is substantially independent of parasitic probe deflection, wherein the parasitic probe deflection is caused by a hydrodynamic background associated with operation of the SPM; automatically controlling the generating step to maintain a feedback setpoint, wherein the feedback control is able to maintain a substantially identical peak interaction force in each modulation period of probe oscillation/tip-sample interaction and the setpoint associated with the peak interaction force is automatically determined based on noise background which is detected by lifting the tip so that there is no tip-sample interaction; and wherein said automatically controlling step includes automatically controlling a gain in a corresponding feedback loop by using a gain control circuit , wherein the feedback gain is automatically determined according to an oscillation magnitude of instability by adjusting the gain of a controller in the gain control circuit until the magnitude of the instability signal becomes less than a predetermined noise tolerance margin, and wherein height information is used to determine the level of instability oscillation. generating periodic relative motion between the probe and a sample ; detecting motion of the probe ; recovering, from the detected probe motion, a substantially instantaneous force (δF r ) between the tip and the sample by performing hydrodynamic background substraction using either lock-in amplification or synchronous averaging of the detected motion of the probe , wherein the recovering step includes recovering a probe-sample interaction that is substantially independent of parasitic probe deflection, wherein the parasitic probe deflection is caused by a hydrodynamic background associated with operation of the SPM; automatically controlling the generating step to maintain a feedback setpoint, wherein the feedback control is able to maintain a substantially identical peak interaction force in each modulation period of probe oscillation/tip-sample interaction and the setpoint associated with the peak interaction force is automatically determined based on noise background which is detected by lifting the tip so that there is no tip-sample interaction; and wherein said automatically controlling step includes automatically controlling a gain in a corresponding feedback loop by using a gain control circuit , wherein the feedback gain is automatically determined according to an oscillation magnitude of instability by adjusting the gain of a controller in the gain control circuit until the magnitude of the instability signal becomes less than a predetermined noise tolerance margin, and wherein height information is used to determine the level of instability oscillation. <EOS>