The precision of Frequency-scanning interferometer(FSI) for absolute distance measurement depends much on the tunability of its laser source. However, an external cavity laser diode (ECLD) exhibits nonlinearity during optical frequency sweep due to hysteresis inherent to the piezoelectric ceramic transducer (PZT) actuator in the ECDL. As a result, the interference signal become nonstationary, and then extracting the phase of the nonstationary interference signal may cause errors. To address this problem, we propose a new method based on the Prandtl–Ishlinskii (PI) model for suppressing nonlinearity of optical frequency sweeping. For the proposed FSI, the output transmission signal of a Fabry–Perot (F-P) cavity is used to obtain the optical frequency curve of the ECLD. By using the input voltage of the linear driving signal and the optical frequency of the ECLD as input and output of the model respectively, the hysteresis model can be built based on PI modelling method. Hence, the inverse of the rate-independent PI model is employed as a feedforward controller to compensate the nonlinearity of the optical frequency sweeping. In our case, instead of driving the ECLD with a linear signal, we implement a corrected nonlinear driving signal of the PZT to suppress the nonlinearity of the sweeping frequency. Experimental results demonstrate the effectiveness of our proposed method. Compared with an external witness He–Ne incremental interferometer, the proposed method greatly improves the performance of the FSI for absolute distance measurement.