Abstract: The present invention relates to an apparatus for generating a magnification compensation signal for use in a scanning electron microscope. The apparatus includes an electron beam generator that generates a beam at a predetermined energy level in accordance with a beam energy signal. The apparatus allows for refocussing by varying the beam energy signal about a nominal value corresponding to the predetermined energy level. The apparatus also provides a magnification compensator producing a magnification compensation signal that varies in accordance with the variation of the beam energy signal from the predetermined energy level.