In chromatic confocal measurement (CCM), the accuracy and precision of the results rely on the robustness of the spectral power distribution (SPD) signal resolution. However, traditional centroid algorithms struggle with the inherent discretization of the SPD signal, leading to significant measurement errors. To address this issue, a linear interpolation based centroid algorithm is proposed to improve the robustness of the results. In the precision calibration experiment conducted with the in-house developed chromatic confocal sensors, the proposed algorithm demonstrates good robustness. Moreover, it achieves a 50% enhancement in the accuracy of a 4 mm range, improving from 1µm to 0.5µm.