Patent ID: 8791414

Claim:
A method for dynamic adjusting a focus of an electron beam image while inspecting a specimen, the method comprising: providing an electron beam inspection system; providing an optical illumination flux through a pattern plate and a lens to a surface of the specimen to project a pattern onto the surface of the specimen, the pattern being associated with the pattern plate; detecting the illumination flux reflected from the surface of the specimen with a detector; processing information associated with the detected illumination flux; generating optical images based on a portion of the information associated with the detected illumination flux, a first image including a first image part for the pattern and a second image part for the specimen; determining a local height variation of the surface of the specimen within an electron beam field of view according to a position variation of the pattern between these optical images; comparing the local height variation with a depth of focus of an electron beam image; calculating correction factors to perform primary beam shift compensation in order to compensate the local height variation with respect to the depth of focus of the electron beam image within the field of view; generating a control signal based on the portion of the information associated with these optical images; providing the control signal to a controlled objective; adjusting the focus of the electron beam image of the specimen in response to the control signal that apply to the controlled objective; and performing an electron beam inspection for the specimen.