Positioning calibration under dynamic conditions is becoming increasingly of interest for high precision fields, such as additive manufacturing and semiconductor lithography. Heterodyne interferometry is often used to calibrate a stage's position because interferometry has a high dynamic range and direct traceability to the meter. When using heterodyne interferometry, filtering is routinely performed to process and determine the measured phase change, which is proportional to the displacement from one target location to another. The filtering in the signal processing introduces a phase delay dependent on the detection frequency, which leads to displacement errors when target velocity is non-constant as is the case in dynamic calibrations. This paper presents a phase delay compensation method by measuring instantaneous detection frequency and solving for the corresponding phase delay in a field-programmable gate array (FPGA) in real time. The FPGA hardware-in-the-loop simulation shows that this method can significantly decrease the displacement error from ±100's nm to ±3 nm in dynamic cases and it will still keep subnanometer resolution for quasi-static calibrations.Index Terms-Displacement measurement, dynamic response, field-programmable gate arrays (FPGAs), interferometry, phase measurement.