A system for controlling the position of a substrate, the system being adapted to process height measurements from a level sensor for a number of gridlines, each gridline comprising a plurality of level sensor spots, and the system further comprising a processor and a memory, the memory being encoded with a computer program containing instructions that are executable by the processor to perform, using height data, a method for positioning a target portion of the substrate with respect to a focal plane of a projection system such that the substrate is in a position for exposure, wherein the method comprises:
- performing height measurements of at least part of the substrate to generate the height data for the plurality of levels sensor spots of each gridline, wherein, for a first portion of the gridlines and a second portion of the gridlines exposed in a single scan during exposure, the at least part of the substrate is partially inside and partially outside the target portion, respectively, that is to be positioned with respect to the projection system;
- computing, using predetermined correction heights, corrected height data for the height data corresponding to at least one area of the at least part of the substrate located outside the target portion;
- computing, using predetermined correction heights, corrected height data for the height data corresponding to at least one area of the at least part of the substrate located inside the target portion;
- and
- positioning the target portion of the substrate with respect to the focal plane of the projection system at least partially based on the corrected height data.