In frequency-scanning interferometry using an external cavity laser diode, its precision in measuring absolute distance is hampered by the nonlinear optical frequency sweeping of its laser source, caused by hysteresis and creep inherent to the piezoelectric translator. We modeled the nonlinearity of the external cavity laser diode and inversely compensated it by correcting the driving signal of the piezoelectric translator, using a system identification method based on the subspace-based state space. Experimental results show that our proposed method effectively suppressed the nonlinearity of the optical frequency sweeping. Compared with an external witness HeNe incremental interferometer, the standard deviation of the frequency-scanning interferometry system's measurements was reduced below 7 lm, and the relative residual error of the measurement improved to 7.5 9 10 -5 .