Phasemeter feedback circuit for AFM metrology