## 5 Spot Shift Compensation Model  
The possibility to manipulate the spot position of the measuring system alone is not sufficient to achieve synchronous operation of both systems involved in a production environment. To dynamically adjust the spot position of the measuring system so that overlaying between the process laser and the measuring beam occurs, it is necessary to know the tilting angle of the scanner mirrors required for correction. The optical system was recreated as a Zemax OpticStudio simulation and simulated for the outermost point in the image area of the lens, like shown in Figure 8. If both mirrors of the processing scanner (HS1, HS2 in Figure 7) are deflected to the maximum possible angle of [6.0\({}^{\circ}\),6.0\({}^{\circ}\)] for the lens-scanner combination, the result is a sport offset of 171.8 \(\upmu\)m. Now the mirrors (MS1 and MS2) are varied in 0.001\({}^{\circ}\) steps until the optimum is found. As a result, the spot offset in the simulation could be corrected to 1.8 \(\upmu\)m or by 98.9%. Thus, a correction on this basis is possible. Figure 8: Beam path of the measuring beam with the two main-galvanometer mirrors and the two secondary-galvanometer mirrors. Figure 7: System comparison with and without beam manipulation. Left: the coupling of both beam paths without the adjustment of the measuring beam and the resulting lateral offset on the processing plane; right: an additional pair of galvanometer mirrors (MS1 and MS2). However, manual correction is very labor- and time-intensive. It is difficult to determine all possible combinations of angles and resolutions in advance. A simulation algorithm was developed to obtain correction data for arbitrary discretization, hereby, the density of the generated data point on the surface or the amount of data can be influenced. From the simulation of the light beam path, it is known that the measuring spot is smaller in the focus plane than the processing spot. This is sufficient as a boundary condition for the termination condition of the simulation that the spots cover each other and not that the centers must match. The aim of the data obtained from the simulation model is to generate a correction table or lookup table in which the angles to be set are dependent on the position of the main scanner. At the same time, the amount of data should be as small as possible. On the one hand, this saves time when generating the data, and on the other hand, it reduces the amount of memory required. For this purpose, the scan field is first assumed to be symmetrical, i.e., the values of one quadrant are transferable to the others, thus reducing the data requirement by 75%. The remaining scan field is now discretized in x- and y-direction, whereby the simulation model enables a flexible and independent discretization of the two directions. The actual calculation of the correction values is now carried out on the points created in this way. In the process, the above-mentioned Zemax OpticStudio simulation was extended so that it can run automatically. Several cycles of the simulation are run through. With each cycle, the step size of the angular iteration is reduced until it reaches the mechanical resolution of the galvanometer used. This procedure is illustrated in Figure 9.  
With the data generated in this way, compensation can take place, but due to the discretization, the grid has gaps. These gaps can be closed by interpolating the data. The laser processing system informs the measuring system of the current position of the main scanner and thus the position at which the measurement is to be made. Scanning systems do not usually work directly with the applied angles, unlike our simulation data. Therefore, the first step here is homogenization. Subsequently, the next interpolation points that are located at the adjacent position are identified and the required values are interpolated.