A method implemented in an ophthalmic laser system, the ophthalmic laser system comprising a laser source for generating a light beam, a moveable objective lens for focusing the light beam, a light intensity detector for detecting a light signal from the objective lens, and a controller, the method comprising:
- mounting a patient interface device on the ophthalmic laser system, the patient interface device having an optical element with a distal optical surface;
- using the objective lens to focus the light beam generated by the laser source to a focus point located inside the patient interface optical element;
- moving the objective lens to move the focus point;
- using the light intensity detector, detecting a back-reflected light that has been reflected by the distal optical surface of the patient interface optical element and has passed through the objective lens, to generate a light intensity signal, wherein the back-reflected light travels from the objective lens to the light intensity detector without passing through any other lens;
- analyzing the light intensity signal to determine a first position of the objective lens that corresponds to a peak position in the light intensity signal;
- determining a second position of the objective lens that focuses the light beam to the distal optical surface of the patient interface optical element;
- calculating a difference between the first and second positions of the objective lens as an offset value;
- and
- storing the offset value.