For expanding the measurement range and improvement of accuracy of multi-axes grating encoder, a mathematical model of measurement angle and diffraction spot with QPD was established. We proposed a light spot position calculation method with consideration of both the optimized composite algorithm of laser beam feature of Gaussian distribution and the QPD diagonal algorithm. In this method, we use the piecewise polynomial fitting method to fit and solved the parameters of the traditional Infinite integral algorithm and the Boltzmann function fitting algorithm. Meanwhile, we introduce a weight factor and use the Composite algorithm to compensate the spot position error. Based on the given QPD model and the basic parameters of the laser beam, simulation works are carried out and results show that the maximum error of the spot position can reduce to be an order of 10-6 mm within the 2 mm measurement range using piecewise cubic polynomial fitting, around 10% of the traditional methods.