In the research of the linear motion of the gear drive mechanism, the measuring platform of the gear rack is designed in order to measure the linear error. using servo motor directly drives the gears on the rack. and is based on the motion control PT point mode to realize the measurement of the Measuring distance and standby control requirements etc.In the process of the linear motion of the gear and rack drive mechanism, the measuring data is obtained by using the laser interferometer to measure the position of the actual movement of the gear axis. Using the least square method to solve the linear equations of contradiction, and to extend it to any number of times and arbitrary number of fitting functions, using MATLAB programming to obtain the actual data curve corresponds with design data curve,and the linear positioning accuracy and repeatability of gear and rack。This technology can be extended to linear measurement and data analysis of the majority of linear motion mechanism. It can also be used as the basis for the automatic compensation algorithm of linear motion control.