The principle of Hartmann-Shack wavefront sensor decided that the distance between micro-lens array and the CCD is the essence of reconstruction algorithm. Because of lacking way to measure the parameter and the existing of assembly error, it will obviously cause error by using the micro-lens focus instead of actual parameter. After analyzing the Zernike polynomial for describing wavrfront aberration, a new Self-reference method is given in this paper to calibrate the parameter. The method is based on the truth that the primary aberration of point light source is defocusing amount. Through this way, the requirement of sensor assembly-precision is reduced, and the detection accuracy of Hartmann-Shack sensor is also improved in the meanwhile. Satisfying results has been achieved under the normal experimental condition using the method given in this paper.