Polynomial Software Compensation of Piezoelectric Hysteresis in NV-Based Scanning Magnetometry
Seokmin Lee, Yuhan Lee, Sungjin Jang, Sunwoo Kim, Seonho Lee, Seok-Kyun Son, Andreas J. Heinrich, Donghun LeeScanning magnetometry based on diamond nitrogen-vacancy (NV) centers enables quantitative magnetic imaging with nanoscale spatial resolution. However, large-area scanning is often limited by geometric distortion arising from the nonlinear hysteresis of piezoelectric positioners, leading to non-uniform pixel spacing and reduced image fidelity. Here, we present a software-based polynomial compensation method that corrects piezoelectric hysteresis without requiring additional hardware or closed-loop position control. By calibrating and analytically inverting the forward and backward hysteresis responses, compensated driving voltages are generated and directly applied during scanning. The method is experimentally validated using a current-carrying patterned gold device and magnetic domains in a hard-disk sample, demonstrating significantly improved geometric accuracy and the removal of scanning artifacts in both topographic and magnetic images. This simple and cost-effective approach provides an effective solution for improving large-area NV scanning magnetometry and other scanning probe imaging techniques based on open-loop piezoelectric positioners.