Lateral error compensation for stitching-free measurement with focus variation microscopy

This paper proposes a practical methodology to quantify and compensate lateral errors for focus variation microscopy measurements without stitching. The main advantages of this new methodology are its fast and simple implementation using any uncalibrated artefact. The methodology is applied by performing measurements with multiple image fields with and without stitching on an uncalibrated artefact and using the stitched measurements as reference. To quantify the lateral errors, the determination of their geometrical components is carried out through kinematic modelling. With the quantified errors, compensation can be applied for lateral measurements without stitching. Over the entire 200 mm lateral range, the lateral errors without stitching and without compensation can reach up to 180 µm. With the proposed error compensation methodology, the lateral errors have been reduced to around 15 µm. The proposed methodology can be applied to any Cartesian-based optical measuring instrument.


Focus variation microscopy
Focus variation microscopy (FVM) has the capability to mea sure both the form and surface texture of a component. In contrast to the standard measuring mode which uses stitching of overlapping measurement areas to improve the lateral acc uracy of measurements over large areas (larger than the field of view of objective lenses), measurements without stitching are less accurate on most FVM instruments [1]. FVM com bined with a multiaxis motion stage provides the function ality of a coordinate measuring machine (CMM) and a surface texture measuring instrument [2,3]. Due to this combination, FVM is widely used for both form and surface texture mea surements in industry, research and academic institutions [3][4][5]. To improve the lateral accuracy and precision of its measurement results, commonly available FVM often stitches multiple overlapping measurement areas to compensate its lateral stage error. The main drawback of this stitching tech nique is that measurements with multiple overlapping areas (imagefield measurements) are time consuming and limited by the capacity of the host computer memory to process a large number of raw datasets (a stack of images). Using un stitched image fields is not a typical measuring mode of the instrument; nevertheless, in many cases, dimensional and geo metrical measurements require measurement of two or more features that are spatially separated over a wide area. Hence, measurements with multiple areas are not applicable in this case; however, measurements without the overlapping area (Some figures may appear in colour only in the online journal) Original content from this work may be used under the terms of the Creative Commons Attribution 3.0 licence. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI. may cause the lateral errors to significantly affect the mea surement results. It is worth noting that a new FVM instru ment that allows highaccuracy measurements over large areas without stitching and without any lateral error compensations has been recently reported elsewhere [6].
In this work, a practical methodology to compensate the lateral stage error of FVM using an uncalibrated artefact is presented and is applicable to commonly available FVM instruments. The developed methodology can be generalised to any Cartesianbased CMM. The objective of this method is to be able to measure features without overlapping areas (multiple imagefield measurements) and to compensate the lateral stage error to improve the accuracy of the measure ment. The proposed methodology requires the measurement of an uncalibrated artefact with and without overlapping areas (the multiple imagefield method) and quantifies the lateral errors. The concept of the method is to measure the artefact in a number of carefully chosen positions and from the measure ment results separate the lateral errors and the artefact errors [7][8][9].
The FVM instrument used is an Alicona G5 Infinite Focus (figure 1) based at the University of Nottingham. All meas urements in this study were carried out by using 5× and 10× magnification objective lenses. The total measuring volume of the FVM instrument was (200 × 200 × 100) mm.
In the following section, an analysis of the effect of over lapping area measurements on the errors is presented. In section 2, a kinematic model of FVM and a procedure to esti mate the lateral errors using a proposed uncalibrated artefact are presented. Section 3 contains the results of the accuracy improvement of measurements applying the proposed lateral error compensation method. Finally, section 4 presents con clusions and future work.

Effect of different stitching strategies on lateral stage errors
FVM captures highresolution images to construct a 3D surface model but is limited by a relatively small field of view, (2.8 × 2.8) mm for the 5× objective and (1.4 × 1.4) mm for the 10× objective, compared to the size of measured surfaces. Therefore, motorised stages that move a sample being measured are used to tilescan the entire surface area. The acquired data are combined into one final output dataset by a process referred to as stitching. If the data are properly stitched, the FVM system numerically compensates the lateral error of the stage. However, without stitching the lateral errors significantly reduce the accuracy of lateral measurements. To solve this problem, the lateral errors should be quantified and compensated. For a better understanding of the stitching pro cess, a calibrated artefact (figure 2) has been measured with a 10× magnification objective lens.
The artefact is a stainless steel block with overall dimen sions of (28 × 28 × 5) mm, whose upper surface has a grid of calottes (semispherical holes 0.5 mm in diameter) dis tributed as a 6 × 6 grid array with a nominal separation of 4 mm between the centres of two consecutive calottes (see [1] for the detailed geometry of the artefact). This calibrated artefact has been previously used for lateral scale calibration for FVM [1].
The holes are numbered starting from left to right and from up to down, therefore the four corners are numbered 1, 6, 31 and 36, as shown in figure 2. For the measurements, row 1-6 is aligned with the xaxis and column 1-31 is aligned with the y axis. When a measurement is carried out, the first step is to determine the size of the image field that covers a meas urement area by selecting an initial and final position of the measurement process. After the preview before capturing raw data, the measuring software shows the whole image field and allows the user to select which image tiles should be avoided during the measurement. This option is used to create discon tinuities in the measurement to highlight the specific func tionality under investigation. Figure 3 shows the six different stitching strategies used to study the lateral error.
Case (a) is a fully stitched image field and will be used as a reference. Case (b) only has information about the two calottes studied: 1 and 6 for the xaxis (table 1), 1 and 31 for the y axis (table 2). Cases (c)-(e) are image fields with only one image tile missing, but in different positions, at the beginning, at the centre and at the end respectively. Finally, case (f) alternates one image tile with one missing  tile. In table 1, the coordinates of the centre of holes 1 and 6 (along the xaxis) are shown for the different stitching con figurations. The distances between those two calottes can be compared with case (a), where the stitching was carried out for the entire surface area. The maximum differences with the reference measurement (case (a)) are cases (b), (e) and (f) with differences of −14.6 µm, −14.8 µm and −15 µm respectively. These three cases have in common that they have missed the area tile that is adjacent to calotte 6. It is also relevant that in cases (c)-(e), which have only missed  one area tile, the position of the missed image tile determines the magnitude of the error. When the image tile missed is near to the first calotte measured, the error is smaller (−1.5 µm). In the centre position, the error is slightly higher (−8.9 µm) and, finally, when it is furthest from the first position measured, the error is higher (−14.8 µm). These measure ment results suggest that the FVM system takes informa tion about its position from the encoders for the first data tile; for the next data tiles the FVM system calculates its position using the stitching software and does not take into account the information from the encoders. When the system cannot stitch a data tile, to locate this tile the system again takes information from the encoders, but this position will be affected by the errors from the xystage. Without moving the artefact, the same experiment has been carried out with the y axis. In this case, the calottes measured are numbers 1 and 31. The results are shown in table 2.
Once again, cases (b), (e) and (f) have the biggest differ ence with respect to the reference case. Case (c) is the closest to (a) and case (d) has around one half of the error present in cases (b), (e) and (f). Therefore, the behaviour of the stitching is similar to that seen in the experiment carried out in the x axis; the principal difference is the magnitude of the maximum error, for the xaxis this is around five times larger than for the y axis. This is probably due to the propagation of errors, as the xaxis is mounted directly above the y axis.

Methodology
The methodology to quantify and compensate the lateral errors of the xystage is as follows. Firstly, the kinematic model of the FVM is determined. In the kinematic model, all errors related to the lateral stage of the FVM system are con sidered, both translational and rotational. These errors repre sent all the geometrical components of error that can affect the result of a lateral measurement. Once the kinematic model has been defined, an uncalibrated artefact is measured. The artefact is a metal block consisting of calotte features (see section 2.2). The artefact is measured with the 5× objective lens twice: with stitching and, in the same position, without stitching. The measurements with stitching are the reference data used to deduce the kinematic errors. The stitching mea surement can be used as a reference since it has been shown to improve the lateral accuracy [1]. Hence, the limitation of the compensation is dependent on the accuracy of the stitching. From the measurements, the centre locations of all the calottes are determined by fitting a nominal sphere to the measured calottes. These centre locations are used in the kinematic model to determine the value of each error component by an optimisation procedure to solve an overconstrained system of linear equations [10].

Kinematic model
The proposed kinematic model for the xystage of the FVM is represented with the following equation: where T P are the coordinates of a threedimensional (3D) point without stage errors (from results of stitching), T L con tains the zcoordinate (height) of the measured points, and T X and T Y are vectors representing the translational errors of the x and y axes. R X and R Y are matrices representing rotational errors, thus where k = {x, y }, and The notation used for the geometric errors is taken from VDI 26173 [11]. Table 3 shows the different components of error with a description and how they have been modelled.
The perpendicularity errors (xWy, xWz and yWz) have been modelled as a constant value, as they represent the perpend icularity error of two axes (angles with unit of radians) and, therefore, are independent of the position. However, the rotational errors (xRx, xRy, xRz, yRx, yRy and yRz) and the Pitch of x axis xRy 1 · x + xRy 0 xRz Yaw of x axis Roll of y axis yRx 1 · y + yRx 0 yRy Pitch of y axis yRy 1 · y + yRy 0 yRz Yaw of y axis yRz 1 · y + yRz 0 translational errors (xTx, xTy, xTz, yTx, yTy and yTz) have been modelled as firstorder polynomials, as they are dependent on position (see section 3 for a more detailed explanation). Therefore, the system has 27 unknown variables. Only lat eral errors are considered, zaxis errors have been neglected because in the measurements the zaxis movement is limited to less than a millimetre. With the kinematic model and the measurements of the artefact, with and without stitching, we can estimate the kin ematic and geometrical errors of the lateral stage and use the quantified errors to numerically compensate a measurement in the lateral direction.

Artefact
The uncalibrated artefact used for the lateral error quantifica tion and compensation ( figure 4) is a rectangular aluminium block with dimensions of (180 × 18 × 18) mm. On its upper surface it has 17 calottes of 2 mm diameter, having a 10 mm distance between two consecutive centres. The holes are manufactured by a milling process with a ballnose tool. With the uncalibrated artefact and the proposed procedure, a lat eral measurement can be compensated with a small number of measurements to characterise the lateral stage errors for the compensation, so that the procedure is easy to implement and practical for industry. Note that the lateral scale of the FVM must have been calibrated prior to the procedure presented here [12].
The methodology is implemented by measuring the arte fact in different positions twice: with and without stitching. Three positions are chosen to introduce coordinates in to the kinematic model to estimate the error components: (1) aligned with the xaxis, (2) aligned with the y axis and (3) at a random angle position of the xystage, as shown in figure 4(b). The method is independent of the positions chosen because it compares each point with itself, with and without stitching. For the three measurements, the first centre hole is located at the same physical position. The coordinates of the measurement, used as the reference for the lateral errors with stitching, are introduced in to the kinematic model as the T P vector, while the coordinates without stitching are introduced in to the kinematic model as the x, y and z coordinates inside the vectors T X , T Y and (T L ). With the kinematic model, and several measurements with and without stitching, an over constrained system of equations can be obtained and solved to estimate the lateral stage error. With the estimated errors, compensation can be applied to lateral measurement without stitching to improve the measurement accuracy. In the case presented in this paper, to estimate the error components we have used the coordinates of 45 hole centres measured from the artefact in the three directions: xaxis, y axis and in the diagonal.
For the purpose of verification of the proposed method ology, additional measurements of the artefact are taken at other positions, also aligned with the axes, and in diagonal orientations. A total of 162 3D centre coordinates were meas ured with and without stitching for the entire range of the xy stage. These measurements will be used to verify that the error compensation can be applied for the entire xyrange.

Results
The kinematic model is presented as a system of equa tions with 27 unknown variables (see equation (1) and table 3), which are the rotational and translational errors. To estimate the values of the unknown variables, we are using information from the three coordinates of the 45 centre loca tions measured. The Levenberg-Marquardt (LM) algorithm has been used for optimisation of this nonlinear system of equations [13], where the objective function is the Euclidean error. The parameter minimised is the residual error, which is defined as the difference between the coordinates without stitching (x, y , z coordinates of the vectors T X , T Y , and T L ) passed through the kinematic model, and the coordinates with stitching (T P ): Even though the system is overconstrained, the function is nonlinear with many local optimum solutions. The iterative LM algorithm to solve the optimisation requires a good ini tial solution so that the results converge to an optimum solu tion [13]. In our objective function (equation (6)) there are some parameters interfering with others (while one param eter  grows, another decreases to compensate its effect), this way the optimal solution cannot be found and the solution is deter mined by the maximum number of iterations allowed by the optimization stopping criteria (figure 5).
Setting this value in one iteration, the 27 parameters of the geometric errors can be calculated and a correction can be performed. Figure 6 shows the initial error when meas uring distances between centres, and the residual error after   applying the correction. The error components have been obtained after optimising the nonlinear function with a total number of 45 equations. To verify that the correction is giving optimum results in the whole work space, the correction has been applied to the measurements over 162 calottes in dif ferent positions. It can be seen that the correction obtained is optimum for most of the points (with residual errors between +5 µm and −8 µm), although there is a case which has some points only partially compensated and its residual error reaches the value of −25 µm. This is due to the interfer ence among some parameters. To find which parameters are interfering, we develop the equations of the kinematic model (equations (7)-(9)): (9) Neglecting the coupled parameters, we obtain the following: The simplified model becomes As we are measuring with a zcoordinate as approximately constant, we cannot obtain accurate information about the parameters that are coupled to the zcoordinate: xRy, yRy, xRx and yRx. Moreover, some of those parameters interfere with other parameters in the model, for example, yRx and xRx interfere with yWz, or xRy interferes with xWz. Therefore, xRy, yRy, xRx and yRx have been neglected. The parameter xRz interferes with the perpendicularity xWy and the rotational error yRz. This information can be used to simplify some poly nomials of the parameter used in the model in equation (13), thus The parameters xTz 0 and yTz 0 may be treated as one com bined parameter (xTz 0 + yTz 0 ). The parameters yWz, xWz, xWy, yRz, xTy, yTx, xTz and yTz have been modelled as zero order polynomials (constant terms); xTx and yTy have been modelled as linear polynomials and their constant terms xTx 0 and yTy 0 have been combined with the parameters yTx 0 and xTy 0 respectively: (15) These simplifications make the model more robust, reaching an optimum solution with only three iterations. Figure 7 shows the geometrical errors of the lateral stage of the FVM obtained from the proposed methodology. A total of nine rotational and translational errors of the lateral stage have been estimated.
With the estimation of the errors, it is possible to perform an error compensation of any lateral measurements, where the measurements are carried out without stitching. The param eters estimated are used in the original kinematic model (equa tion (1)) to calculate the corrected position of each centre. With the corrected positions, the distance measurement error can be calculated (figure 8).
A significant error reduction of the lateral measurements without stitching can be obtained with the proposed error compensation methodology and with the uncalibrated arte fact. Figure 9(a) shows that the residual error obtained in dis tance measurement with the nineparameter kinematic model is improved compared to the residual error in distance meas urement obtained with the 27parameter kinematic model ( figure 9(b)). Though from a physical point of view all the errors are completely independent variables, from a mathe matical point of view a problem with parameter redundancy arises: the higher the order of the polynomials used to model the errors, the greater this redundancy, therefore the simplifi cation is justified.
These results have been obtained for measurements with the 5× magnification objective lens. As these geometrical errors are due to manufacturing errors and misalignments, they may change when other magnification objective lenses are used. The same procedure has been used to estimate the errors for the 10× magnification objective lens. In this case, the artefact used in section 2 has been measured twice (figure 2), with and without stitching, as shown in figure 10. Figure 11 shows the new estimation of the geometrical errors obtained with the 10× magnification objective lens.
The difference between the coordinates measured with and without stitching is considered as the initial error. The coordinates of the workpiece obtained on the measurement without stitching ( figure 10(b)) are corrected by applying the kinematic model (equation (1)) and the estimated errors are obtained ( figure 11).
Comparing the geometric errors between the 5× magnifi cation objective and 10× magnification objective lenses ( fig  ures 7 and 11), it can be seen that xTx and yTy have similar values; these two components are the ones more related to the overlapping of image tiles. The translational components have smaller values for the 10× magnification objective than   those obtained for the 5× magnification objective, but the signs and relationships between them are similar: xTy 0 and yTx 0 have negative values and magnitudes three times higher than xTz 0 + yTz 0 , which has a positive value. The squareness errors yWz and xWz are different for both lenses but xWy has a similar value. This error may be because yWz and xWz are optical configuration related errors, so different lenses will have different perpendicularity errors and xWy will depend on the xystage so it does not change with different lenses. But it should also be taken into account that volumetric solutions do not have a real physical equivalence as they only provide optimum values for the joint set of all parameters.
In figure 12, the errors in distance measurements before and after applying the correction of the calibrated stainless steel artefact (figure 2) are represented. The initial error is defined as the difference between the coordinates measured with stitching ( figure 10(a)) and the coordinates measured without stitching ( figure 10(b)). The residual error is defined as the difference between the coordinates measured with stitching (figure 10(a)) and coordinates obtained after cor recting the measurement without stitching (figure 10(b)), with the geometrical errors estimated ( figure 11).
The lateral error of a measurement without stitching is reduced from an amplitude of 18 µm over measurements of 20 mm, to an amplitude of 2.5 µm over the whole space measured. Moreover, a considerable amount of computational time and data storage saving are gained with the nonstitching measurements. In the first case (measurement with stitching), the number of image tiles measured is 225 and in the second case it is 49.

Conclusions and future work
Generally, it is worth noting that measurement without image stitching is not the normal operating mode of commonly avail able FVM instruments. Moreover, typical measurements with the instrument are usually not over a large area of (180 × 180) mm. Nevertheless, we have shown that it is possible to char acterise the xystage of a FVM by performing two types of measurement (with stitching and without stitching) with an uncalibrated artefact. The methodology allows compensa tion of lateral errors of nonstitching measurements of dif ferent features on a surface. The corrections obtained can significantly reduce the error of lateral measurements. The lateral error of the uncompensated nonstitching measure ments can reach values of 200 µm over a measurement length of 200 mm. Typically measurements are not performed over such large ranges ((200 × 200) mm), and thus, the maximum errors are not representative for common FVM measurements. Nevertheless, after the compensation, the residual error is less than 15 µm. The correction allows measurement of relevant features independently of features in between them so that a considerable saving on computation and data storage can be obtained. Future work includes the manufacture of an artefact with features at different z heights to extend the analysis to the zaxis so that 3D dimensional error compensation can be applied.