1 Introduction

In-line measurements are required for fast and accurate defect inspection in manufacturing lines without significantly slowing down the process [1,2,3,4]. In addition, advantages with these types of measurements for production systems can be gained through the use of in-line measurement data directly for both process control and optimisation before, during and after the production chain [5]. In-line measuring instruments can be divided into tactile and optical instruments [2]. Tactile instruments rely on the performance of positioning systems and have relatively low speeds, as the stylus traces across a surface to acquire a profile or scans an areal surface to acquire a range image. Optical instruments provide relatively fast and damage-free measurements that make them promising solutions for in-line measurements.

There are many available commercial off-line (desktop) optical instruments for microscale surface measurement [6]. However, measurements typically need to be carried out in an environmentally well-controlled laboratory [2] (the “gauge room”). In-line measurements often need to be performed inside a machine tool or on a production line where environmental noise, for example, vibration and temperature variations, can be significantly worse than the laboratory environment. For these reasons, there has recently been much interest in developing optical in-line measuring instruments (recent reviews are given elsewhere [7,8,9,10,11,12]). However, many in-line instruments are considered limited for full integration into a production line or a machine tool as they are still under laboratory development.

In-line optical measurement instruments can be classified into full-field and probe-scan measuring methods [2]. Full-field measuring methods are generally faster than tactile instruments as they capture areal information about a measured surface, within a specific field of view, within a single measurement cycle and then post-processes the information to reconstruct the areal model of the measured surface. Full-field optical instruments commonly utilise a precision linear vertical motion system for scanning a surface through focus and acquiring a stack of images that are processed by an algorithm to reconstruct the areal surface model [6]. This scanning process considerably increases the measurement time, especially when a large surface area needs to be measured. Therefore, to achieve fast measurements, the measurement method must focus on only measuring critical features during part inspection at the closest location to the process [3].

Focus variation microscopy (FVM) has become increasingly popular for surface topography measurement due to its ability to measure both form and surface texture [13]. Moreover, FVM is considered less sensitive to environmental noise, such as temperature variation, humidity and vibration, because it is not based on interferometry, although it will conversely have less axial resolution [6]. Therefore, FVM is a potential method to be used for in-line measurement with micrometre accuracy in a production line to control the quality of parts [14]. In this paper, we present the development and integration of a novel compact on-machine FVM sensor onto a hybrid ultraprecision machine tool and asses the on-machine measurement performance through detailed comparisons of measurement results and noise measured by the on-machine sensor and an off-line FVM. On-machine measurement is defined in Gao et al. as “a measurement activity of a machined workpiece that is carried out on a production machine” [2]. With on-machine measurements, the efficiency of the quality control of parts can be achieved as the measurements can be performed at specifically desired areas and as close as possible to the manufacturing process.

This paper is structured as follows. In Section 2, the design and the assembly of the on-machine FVM sensor are elaborated, along with a brief overview of the on-machine FVM requirements. In Section 3, comparison measurements of a calibrated artefact between the on-machine and off-line FVM are presented. A case study of on-machine FVM measurements is presented in Section 4. Comparison of measurement results for microscale features, such as channels and dimples, between on-machine and off-line FVM are presented in Section 5. Discussion on the effect of uncontrolled environmental noise on the results of on-machine measurements is presented in Section 6. Finally, Section 7 concludes the paper and discusses future work.

2 Design of the on-machine FVM sensor

2.1 FVM working principle

FVM is a surface topography measurement method where the sharpness of a surface image at optimal focus positions in an optical microscopy system is used to determine the surface height at each position on the surface [15]. Figure 1 shows a curve where the maximum focus value (sharpness) is used to determine the z-position at a lateral image location corresponding to a specific surface location. Using different objectives, measurements can be obtained with different fields of view and lateral resolutions. The fundamental algorithm of FVM requires calculating a focus measure (focus value). The detailed calculation of the focus measure can be found elsewhere [6].

Fig. 1
figure 1

Illustration of the FVM method; the height is determined at the z-position where the image sharpness is a maximum [6]

2.2 Design of the on-machine FVM sensor

One critical component that influences the ability of on-machine FVM sensor to measure microscale features on a part surface at high axial resolution is a linear motion stage, on which the optical tube is mounted that allows precise axial movement while scanning a part surface. In this research, the requirements for the linear stage have been defined based on the consideration of the dimensions of the machining chamber and tool changer system for various microscale milling machines, thus:

  • Maximum travel is 20 mm.

  • Encoder resolution is less than 25 nm.

  • Positioning accuracy is less than 1 μm.

  • Positioning repeatability is less than 250 nm.

  • Maximum overall cylindrical dimensions are 80 mm diameter and 250 mm length.

The design of the on-machine FVM sensor is mainly constrained by the overall maximum required dimensions. Following the required overall dimensions, commercial off-the-shelf mechanical components (ball-bearing and ball-screw), optical setup (tube lens and objective lens) and electronics (motor driver) are used. All off-the-shelf and designed components are configured in such a way that they fit within the maximum overall dimensions.

Figure 2 shows a conceptual diagram of the developed sensor. In Fig. 2, the mechanical and optical components are assembled and linked to electronic and computer systems. The optical setup is composed of a CMOS sensor with 1936 × 1216 pixels and with a high-speed serial data interface, a specially designed tube lens with specific focal length, which corresponds to a 10 × microscope objective lens yielding a field of view of (1.7 × 1.7) mm and lateral pixel distance of (0.8 × 1.4) μm. A ring light is mounted around the objective lens for illuminating a measured surface. In order to make a compact optical setup and reduce optical setup complexity, coaxial illumination is not used in the on-machine sensor. An industrial-grade general motion controller is used to control and drive the motor. The output rotation of the motor is then transferred to the precision mechanical linear actuator to move the carriage. The axial position is measured by a linear encoder with 20 nm resolution. During the carriage motion, to axially scan a part surface, image data are continuously captured by the CMOS sensor. Both the axial position and image data are transferred to a mini-computer for a pre-processing stage (initial stage before reconstructing the areal surface topography), for example, to remove noise on the raw data. The pre-processing data are transferred to a remote computer through Wi-Fi (not discussed in this paper but see [14]) for the final reconstruction process of the measured areal surface topography and further surface texture and geometry characterisation.

Fig. 2
figure 2

Conceptual diagram of the on-machine FVM sensor with the overall dimension of 78 mm diameter and 200 mm length

To minimise Abbe error, the design of the sensor is made in such a way that the measuring axis and the motion axis are coaxial and to occupy the smallest space possible conforming to the required dimensions. In order to minimise the manufacturing cost of the sensor, the design focuses on the ease of the manufacturing and assembly processes. Analysis of the tolerance propagation for the assembly was performed to optimise the part geometrical tolerance allocation. The tolerance propagation is used to estimate the maximum possible deviation between the optical and linear scale axes of the sensor, given the allocated tolerance values of 0.2° and 1.1° for pitch and yaw angle, respectively.

By using finite element analysis (FEA), both the vibration natural frequencies and thermal expansion of the main structure were evaluated. Stainless steel AISI type 416 with coefficient of thermal expansion of 9.9 × 10−6 K−1 is used for the carriage and main structure of the sensor. This material was selected to ensure relatively low thermal expansion of the mechanical structure of the sensor and a higher natural frequency of the system than the environmental vibration frequency of the sensor during operation [16]. Based on the FEA analysis, the first modal natural frequency of the structure is greater than 874.62 Hz which is much higher than the expected workshop vibration frequency in the range 100 to 200 Hz [17]. To minimise the effect of thermal expansion on the accuracy of the motion system of the sensor, the mounting position of the linear scale and its optical head are placed at the location where the thermal expansion effect is minimal based on the FEA analysis. Figure 3 shows the solid model of the sensor design with the mechanical system and optical components assembled.

Fig. 3
figure 3

a Top view of solid model of the on-machine sensor. b 3D isometric view of solid model of the sensor

In the assembly process, we avoid using location pins and holes so that the mating parts can be located by utilising the inherent datum features on each part, which are defined during the design phase. Figure 4 shows the assembled sensor. Figure 5 shows the integration of the sensor and its electronic system onto a hybrid machine tool used for the case study. Based on the current setup, the typical measuring time for a single measurement is less than 20 s. This 20-s measurement time is considered sufficient for the case study and is a significant reduction in measurement time compared with off-line FVM measurements that can be in 1-min period excluding time required to remove parts from the machine tool.

Fig. 4
figure 4

a Top view of full assembly of the developed sensor. b Isometric view of full assembly of the sensor

Fig. 5
figure 5

Setup of the sensor mounted on the hybrid machine tool, its electronic components and ring light

3 Step height measurement and measurement noise comparisons with a calibrated artefact

Measurements of a 1-mm step height calibration artefact (Alicona IF-Calibration tool) were carried out in three scenarios: by using the on-machine sensor operated on the hybrid ultraprecision machine tool (in workshop), the on-machine sensor operated in a controlled laboratory (in laboratory) and an off-line FVM (Alicona Infinite Focus G5) in the controlled laboratory at 20 °C ± 0.5 °C. The step height artefact was calibrated at a DKD calibration laboratory, and its value was 0.9999 mm ± 0.0001 mm at k = 2. The measured areal data from both the sensor (on the hybrid machine tool and in the laboratory) and the off-line FVM were acquired with × 10 objective. The off-line FVM measurement results were used as a reference for comparisons with the on-machine sensor results.

The on-machine sensor (both in the laboratory and workshop) and off-line FVM measured the artefact three times. MountainsMap software was used for analysing the measured step height data. Figure 6 a shows the measured step height areal data that was obtained by the on-machine sensor operated both on the machine tool and in the laboratory. The bottom plane of the step height measurement was selected as a datum, and a least-squares method was used to fit two parallel planes. The depth is calculated as the distance of the two parallel planes. Figure 6 b shows the comparison of the profile of the step height from the on-machine sensor operated in the laboratory and on the machine tool and the off-line FVM. From Fig. 6b, the profiles measured from the on-machine sensor (in both scenarios) have significant curvature. Figure 7 shows the extracted flat area data measured by the on-machine sensor operated in the laboratory. From this measurement, a hemispherical shape is observed with a maximum peak-to-valley distance of approximately 16 μm caused by uncorrected lens distortion. This also accounts for the curved shape seen in the step height profile results (in Fig. 6b).

Fig. 6
figure 6

a Step height measurement measured by the on-machine FVM in the controlled laboratory and on the hybrid machine tool. b Step height profile comparison among the on-machine sensor operated in the laboratory (red) and on the machine tool (green) and the off-line FVM (blue)

Fig. 7
figure 7

Flat area measurement at the top plane of the step height calibrated artefact measured by the on-machine sensor

Table 1 shows the results of the step height measurements. The height difference between the off-line FVM and the calibrated step height is still within the error specification of the off-line FVM. The differences of the mean and the standard error of the mean of the step height measurements between the on-machine sensor operated in the laboratory and off-line FVM are approximately 0.2 μm and 0.06 μm, respectively. The differences of the mean and the standard error of the mean of the step height measurements between the on-machine sensor operated on the machine tool and off-line FVM are 5.8 μm and 0.89 μm, respectively. There are significant differences between the results from the sensor operated in the laboratory and on the machine tool, which is due to the different levels of environmental noise (see Section 6).

Table 1 Step height measurements

The measurement noise of the on-machine sensor, both operated in the laboratory and on the machine tool, and the off-line FVM were also computed. A flat area of (0.75 × 0.75) mm was extracted from the top plane of the three repeated step height measurement data. The subtraction method was applied to calculate the measurement noise [18]. Table 2 shows the measurement noise comparison. The mean results for the measurement noise of the on-machine sensor operated on the machine tool and in the controlled laboratory and FVM are 0.72 μm, 0.38 μm, and 0.15 μm, respectively. From Table 2, a significant difference in measurement noise between the on-machine sensor operated on the machine tool and in the laboratory can be observed. The measured areal data during the on-machine measurement is significantly affected by the environmental disturbances compared with the laboratory measurement [2] (see Section 6). Furthermore, there is a 0.23 μm mean difference between the noise from the measurement with the on-machine sensor in the laboratory and the off-line FVM, which is attributed to the low-cost imaging sensor and random motion errors.

Table 2 Measurement noise comparison

4 Experiment setup for on-machine measurement of micro-dimples and microchannels

The case study presents the developed on-machine sensor integrated into a hybrid ultraprecision machine tool in the Centre for Precision Manufacturing at the University of Strathclyde. The on-machine sensor was used to measure micro-patterned surfaces produced by a laser machining process. The hybrid machine tool is equipped with both a spindle milling tool and a nano-second pulsed laser system [19]. Figure 8 shows the integration of the sensor with the machine tool.

Fig. 8
figure 8

Sensor integrated into the machine tool

AISI 316L stainless steel was selected for the workpiece sample. Arrays of dimple and channel microscale features are machined on the top surface. The nominal diameter of the dimples is 1.2 mm and the nominal size of the channel is 1.2 mm × 1.2 mm. Both the dimple and channel arrays have 200 μm pitch (see Table 3). A plane milling operation was performed on the sample to ensure a flat top surface of the sample before the laser machining process was applied.

Table 3 Experiment details of the laser machining process

The laser machining operation was performed with a nanosecond pulsed fibre laser with a central emission wavelength of 1064 nm. The laser source has a repetition frequency up to 200 kHz and a mean output power of 20 W. In order to generate a spot size of approximately 15 μm, an achromatic doublet lens with a focal length of 26 mm was used to focus the laser pulse onto the sample surface that is mounted on a xy-c stage (two translations and one rotation).

On-machine measurements were performed approximately 5 s after the laser machining process had finished. As the sensor was positioned on the z stage (see Fig. 8), the workpiece sample on xy-c stage can be moved with respect to the sensor xy position with a predefined program, so that the machined micro-patterns can be positioned to be within the field of view of the sensor. The total time for a single measurement is less than 20 s, compared with 1 min for a typical off-line FVM measurement, excluding time required for part handling.

5 On-machine measurement results and their comparison with off-line measurements

On-machine measurements of the machined samples were performed by the on-machine sensor, and the results are compared with those obtained from the off-line FVM. In order to have a similar field of view for the samples, a 10 × objective magnification was used for both the on-machine and off-line measurements.

Surface topography datasets acquired by both the on-machine sensor and the off-line FVM were processed using MountainsMap. An area of (1.4 × 1.3) mm wide acquired by the off-line FVM was extracted and is used as reference data. For both sets of the measurement data, a levelling operator was applied to each surface using the least-squares fitting method. Areal matching is performed by overlaying the on-machine measurement data on the off-line measurement data and applying a cross-correlation operation to match similar features.

Figures 9 and 10 show the surface topography datasets of the channel and dimple patterns measured by the off-line FVM and on-machine sensor. Both figures are the results after the alignment procedure. As the optical system on the on-machine sensor is not corrected for distortion, a hemispherical shape is noticeable in the surface topography datasets (see Figs. 9 (right) and 10 (right)). This systematic effect could easily be removed, but we have left it to highlight the effect for this paper.

Fig. 9
figure 9

Areal topography of the channel pattern measured by the off-line (left) and on-machine FVM (right)

Fig. 10
figure 10

Areal topography of the dimple pattern measured by the off-line (left) and on-machine FVM (right)

For detailed comparison, cross-sectional profiles were extracted from each aligned surface topography dataset of the channel and dimple pattern and are shown in Figs 11 and  12. Six dominant valleys, that is, the microchannel features (Fig. 11), and three dominant valleys, that is, the micro-dimple features (Fig. 12), can be observed.

Fig. 11
figure 11

Profile comparison of the channel pattern with six dominant valleys

Fig. 12
figure 12

Profile comparison of the dimple pattern with three dominant valleys

From Figs 11 and  12, profile discrepancies, obtained from the on-line and off-line measurements, can be observed. To calculate the overall discrepancies of these profiles, a calculation method using confidence intervals (CIs) was used based on a method reported elsewhere [20]. The range of the CI for this case is based on the mean measurement noise of the off-line and on-machine sensors shown in Table 2. The discrepancy was computed as a percentage of the profile length where CI bands at each x position of the on-machine and off-line measured profiles do not overlap. The overall discrepancies for the channel and dimple profiles are 57% and 46%, respectively. The hemispherical shape, which is due to optical distortion, on the profile measured by the on-machine FVM greatly affects the surface profiles that are close to edge. The profiles around both ends of the sensor measurement data are approximately 25% steeper than for the off-line FVM measurement data and the profile around the centre of the on-machine sensor measurement data are approximately 30% higher compared with the off-line FVM measurement data. The profile discrepancy can be from environmental noise, such as vibration, and error related to optics, such as distortion and aberration, as the prototype optics used in the system is not yet fully calibrated.

Dimensional measurements of the depth of the dominant valleys of channel and dimple patterns for the off-line and on-machine sensors are shown in Table 4. From Table 4, the largest difference in depth between the off-line and on-line FVM is approximately 6 μm. From Table 4, by carrying statistical analysis of the mean and standard deviation comparisons (a t test) of the depth obtained from both off-line and on-line FVM, the differences of the measurements are not significant.

Table 4 Depth of dominant valleys of channel and dimple patterns

6 Discussion on uncontrolled environmental noise during on-machine measurements

Environmental noise will degrade the quality of on-machine measurement results. During the on-machine measurements, environmental factors, such as the ambient temperature and vibration inside the machining chamber, were monitored. Since there were no other production machines running during the experiments, the ambient temperature inside the machining chamber was only affected by the heat generated from electrical and mechanical components of the machine tool and the heat generated from the sensor ring light and image sensor. The recorded temperatures ranged from 22.6 to 23.0 °C for the ambient temperature and 21.7 to 22.0 °C for the fixture. The vibration inside the machining chamber was mostly caused by the xy-c and z motion stage when the machine axes are active (standby mode).

To investigate the vibration noise, a piezoelectric accelerometer, with operating bandwidth of 1 to 6000 Hz and sensitivity of 50 pC/g (g is acceleration due to gravity), was used to measure the vibration when the machine axes are in “off” and “on” conditions. The “off” condition is when machine axes are inactive, while the “on” condition is when the sensor performs the measurement and the machine axes are active (standby mode). The accelerometer was mounted on the fixture attached to xy-c motion stages for vibration measurement during “on” and “off” condition and mounted on the on-machine sensor attached to z motion stage for vibration measurement during the “on” condition. The measured vibration data is plotted in Fig. 13 for the “on” condition and in Fig. 14 for the “off” condition.

Fig. 13
figure 13

Vibration magnitude spectrum in z-direction, while the machine axes are active

Fig. 14
figure 14

Vibration magnitude spectrum in z-direction, while the machine axes are inactive

Figure 14 shows that in the “off” condition, vibration noise is negligible (compare the ordinate scales on the figures). In Fig. 13, the noise level for the measured vibration on xy-c motion stages is four times higher than on the z motion stage. This high noise level is because the xy-c motion stages are composed of two linear stages and one rotation stage and potentially contribute to the vibration detected by the accelerometer. In addition, as shown in Fig. 13, a relatively high magnitude of vibration can be observed at approximately 5 Hz both on xy-c motion stages and z motion stage. This phenomenon is presumably caused by a non-optimal control of the motion stages during the standby mode that cause the air supply continuously excites the motion stages to find a steady (equilibrium) static condition due to [21].

In order to quantitatively assess the effect of environmental disturbances (vibration and temperature variations), the variations of the detected z position at a single lateral location from three repeated measurements of the flat calibrated artefact are calculated and shown in Table 5. It can be seen that the mean of the height variation of the sensor operated on the machine tool is seven times higher compared with that from the off-line FVM. The large variation of measured height obtained from the on-machine sensor is presumably affected by the aforementioned vibration and temperature variation originated from the chamber of the machine tool.

Table 5 Height variation at a specific lateral location between the on-machine and off-line FVM

Figure 15 shows the workflow of the comparison experiments. In Fig. 15, the combined effects of the environmental factors such as thermal and vibration influence both the measured workpiece and the developed on-machine sensor. From Table 5, the contribution of the combined noise to the measured height of the single point is up to 0.1 μm. Since the measurement time is less than 20 s and the temperature gradient of the measured workpiece and the ambient are in the range of 1.1 °C and 0.3 °C, for 60 μm depth measurements, the effects of temperature variation to the measured height and the on-machine sensor performance are in few to sub-nanometre. This result suggests that the vibration noise has more significant effect on the measurements compared with the temperature variation; see Fig. 13 which shows that the machine axes are vibrating where the measured workpiece and the on-machine sensor are mounted. Some solutions to reduce vibration effects to the measurement results of the on-machine sensor could be implementing innovative design that can isolate vibration within specific frequency bandwidth, for example, using lattice structures [16, 17] and reducing the vibration effects on the measured workpiece through optimising the machine axes control during the standby mode.

Fig. 15
figure 15

Schematic of the comparison experiment

7 Conclusions

This paper presents the development of a compact on-machine FVM sensor that can perform on-machine full-field optical measurements inside the chamber of machine tools. The conceptual design of the sensor, the assembly and the integration onto a hybrid ultraprecision machine tool have been presented. To evaluate the feasibility of the sensor, measurements of a machined part and a reference artefact were performed. The compact size of sensor eases its integration onto any production machines. Additionally, one single field of view measurement requires less than 20 s. Therefore, the sensor could be a potential solution for general-purpose on-machine surface topography measurements.

For detailed surface topography comparisons, cross-sectional profiles were extracted from the measured surface topography of channel and dimple patterns measured by the on-machine sensor and off-line FVM. The overall discrepancy between these profiles was 57% for the channel pattern and 46% for the dimple pattern. These discrepancies are caused by environmental disturbances due to thermal expansion and vibration and a systematic error caused by uncorrected lens distortion of the optical system and non-optimal illumination. For dimensional measurement, in this case depth, the measurements between an off-line FVM and the on-machine sensor operated in a controlled laboratory are comparable. The on-machine sensor can achieve sub-micrometre accuracy for step height measurements.

Future work will be the development of compact electronics which included the Wi-Fi module and mini-computer, an enclosed feature that protects the on-machine sensor from any particle contaminants, the use of co-axial illumination and the calibration and adjustment of the prototype optical setup used by the on-machine sensor.