Photometric stereo-based high-speed inline battery electrode inspection

: Battery technology is a key component in cur-rent electric vehicle applications and an important building block for upcoming smart grid technologies. The performance of batteries depends largely on quality control during their production process. Defects introduced in the production of electrodes can lead to degraded performance and, more importantly, to short circuits in final cells, which is highly safety-critical. In this paper, we propose an inspection system architecture that can detect defects, such as missing coating, agglomerates, and pinholes on coated electrodes. Our system is able to acquire valuable production quality control metrics, like surface roughness.Byemployingphotometricstereotechniques,a shape from shading algorithm, our system surmounts dif-ficulties that arise while optically inspecting the black to dark gray battery coating materials. We present in detail the acquisition concept of the proposed system architecture, and analyze its acquisition-, as well as, its surface reconstruction performance in experiments. We carry these out utilizing two different implementations that can oper-ate at a production speed of up to 2000 mm / s at a resolution of 50 µm per pixel. In this work we aim to provide a system architecture that can provide a reliable contribution to ensuring optimal performance of produced battery cells. die wir mit einer Geschwindigkeit von 2000 mm / s bei einer Auflösung 50 µm pro Pixel testen. Weiters zeigen wir qualitative Resultate von Defekten, die in der Elektroden-produktion üblicherweise auftreten. Wir sind überzeugt, dass die vorgeschlagene Inspektionssystemarchitektur ei-nen wertvollen Beitrag zur Produktion von hochwertigen Batterien leisten kann. Schlagwörter: OptischeInspektion,InlineInspektionssys-teme, Elektrode, Photometrisches Stereo, Zerstörungsfreie Materialprüfung.


Introduction
Battery technology is an integral part in the development of upcoming sustainable energy storage, energy distribution and electric mobility [1]. Electrode material is produced in the so-called coating process, in which electrochemically active material is applied onto a metal substrate foil. A material commonly chosen for cathodes, is nickel manganese cobalt (NMC) on aluminium substrate. Such cathodes exhibit a deep black texture, as shown in   For the coating process, illustrated in Fig. 2, a socalled "slurry", a mixture of active material, binder material, conductive additives, and solvents, is prepared and placed into the application funnel. The slurry is applied onto the substrate with defined thickness. Following the doctor blade method [2], a blade mounted over the substrate lets slurry pass up to a well defined thickness. Next, the coated electrodes are dried and stored for the subsequent calandering process, where they are mechanically compressed. The goal of calandering is to improve electrode characteristics. Compression leads to more active material per volume, it homogenizes pore sizes, and re-duces coating inhomogeneities. Finally, the calandered electrodes can be cut out and stacked on top of each other, interleaved with insulating separator layers. The result can then be packaged into final battery cells, for example in form of pouch-or prismatic cells.
An important factor influencing the electrical characteristics, and the safety of battery cells is the quality of the applied coating [3]. Ideally, the coating is finely grained and fully covers the substrate area evenly. However, especially when new kinds of coating mixes are developed, coating surfaces can deviate from these ideal conditions. A typical type of defect occurs, when the doctor blade gets clogged with agglomerates that are present within the slurry mix. Such circumstances lead to missing or unevenly applied coating behind the blade. The use of such defective electrodes in final cells degrades electrical capabilities, and, moreover, can lead to highly undesirable exothermic reactions, which can potentially cause harm to users [3].
In this work, we present an optical inspection system that can facilitate quality assurance in the coating process of anode and cathode foils that serve as building blocks for battery cells at production speeds of up to 2000 mm/s at an optical resolution of 50 µm/px by means of photometric stereo surface reconstruction. This paper is structured as follows. Section 2 provides an overview of existing systems for the inspection of battery foils. In Section 3 the proposed inspection system architecture, its components and operation principles are described in detail. Two variants with different hardware configuration are described, a "high-accuracy" configuration with four lights, and a "high-speed" one with only two lights. In Section 4 the proposed photometric stereo algorithms are described. Section 5 presents exemplary qualitative results of defects acquired with our two system variants. In Section 6 we discuss the advantages and limitations of our approach. Finally, Section 7 summarizes the content of this work and provides concluding remarks.

Related work
In the recent past, several optical battery foil inspection systems employing various sensing modalities have been proposed. Just et al. [4] measure the mid-wavelength infrared response of electrodes that are excited using electromagnetic radiation in order to detect applied silver particles. In contrast, our proposed system acquires material response in the visible frequency bands. Frommknecht et al. [5] combine a camera with ring-shaped illumination with a laser profilometer for defect detection. While the use of a laser profilometer allows for measuring absolute depth, its speed is limited to 500 Hz by the detectability of the laser line. Further, depth is measured only on a fraction of the foil area by the profilometer. Gruber et al. [6] employ hyper-spectral imaging and spectral ellipsometry to measure foil layer thickness while at the same time overcome specular reflections of the foil substrate. Our system, in contrast, reconstructs surfaces using a shape from shading approach.

Inline inspection using photometric stereo
In this section we describe the proposed battery foil inspection system and its components in detail. Broadly, we can discern two subsystems, the sensor head ("Sensing & Acquisition") and the processing subsystem ("Processing & Control"), as schematically illustrated in Fig. 3. The sensor head is located within a coating machine and performs data acquisition and material illumination, while acquired data is processed on a computer (Controlling PC) situated in a back compartment of the machine outside of the, potentially toxic, atmosphere of the coating compartment. This is due to easier accessibility for maintenance. The sensing subsystem comprises (a) four line light sources illuminating the material from four directions, and (b) a high-speed industrial camera, viewing at the material from top. The processing subsystem comprises (c) an FPGA-based trigger hardware synchronizing the strobing of the four line lights with the camera acquisition, as well as, (d) a PC that coordinates image data acquisition and computes the foil surface representation.

Acquisition and control
For a deeper understanding of the inline image acquisition process, the generation of the trigger signals for the light sources and the camera are described in detail. For sake of clarity, our "high-accuracy" hardware configuration is described first, and the changes necessary to achieve higher scanning speeds are described later in the text.
According to the blockdiagram in Fig. 3, an FPGAbased controller ("Trigger Hardware"), developed in our group, synchronizes control of lights and camera acquisition with material motion. Firstly, the trigger hardware decimates the pulses from an optical encoder with 5 µm increments to frame trigger pulses with 50 µm increments, Figure 3: Schematic illustration of the system components. The sensing subsystem consists of a camera, viewing the electrode material from top, while it is illuminated in turn by four xposure:flash [7] light sources for each increment, measured by an optical encoder. A computer, shown in the right area, initiates acquisition and processes the resulting image data, whereas acquisition timing is controlled by an FPGA-based trigger hardware.
thus defining the resolution in transport direction as 50 µm per pixel. Secondly, for each frame trigger pulse, i. e. each 50 µm of transport movement, the controller switches on a different light of the four lights, while the other lights are off, and triggers an image acquisition by the camera. Figure 4 shows the timing for switching the lights and triggering the camera for the high-accuracy hardware configuration at maximum speed, with a frame trigger rate of 10 kHz, corresponding to a material speed of 0.5 m/s. The frame period is the inverse of the frame trigger rate and equals to 100 µs, corresponding to a material progress of 50 µm. The exposure time of the camera is set to 80 µs.
To be able to acquire each object point under four different illumination conditions, four rows of the camera's pixel matrix are read out per frame trigger. The spatiotemporal sampling of the moving object is illustrated in Fig. 5, showing that each object point (A, B, C, . . .) is acquired four times.
As illumination, four AIT xposure:flash 1 [7] line light sources are located in a 4-orthogonal-configuration around the camera's field of view. Each light source contains a linear array of white high-power LED's that allow fast strobing, and a cylinder Fresnel lens for collimating the radiated light.
The detailed, geometric relations between the directions of the four illuminations, the camera view, the object transport and the orientation of the object's surface, with respect to a Cartesian coordinate system, are schematically shown in Fig. 6. Viewing from the top, the light sources are mounted at ϕ = 45°rotation with respect to the transport direction, so to deliver high quality control data for defects that often occur in transport direction. They are mounted with a polar angle of approx. θ = 54.7°. This four-light constellation is optimal from algebraic considerations [8] and has been experimentally validated for the electrode material by acquiring an electrode using a 32 light source dome fixture and selecting the four-light tuple that provided the best results in terms of mean angular error of reconstructed surface normals compared to the full 32 light surface reconstruction. The viewing direction of the camera is perpendicular to the plane of object's surface (battery foil). Per frame, the camera acquires only a small fraction of the object's surface indicated by which we refer to as the field of view (FOV). The line lights 1 to 4 are mounted at the indicated four points and are oriented to illuminate the FOV area. The distance between light emitting area and FOV is 239 mm. The fan of relevant light rays emerging from line light 3 is symbolized by the dashed lines from line light 3 to the two ends of the FOV. From this consideration it becomes clear that due to the slanted mounting of line light 3 over the FOV, one end of the FOV is nearer to the line light 3 than the other one. This leads to a gradient of the illuminance along the FOV. The same holds for the other light sources in a similar manner.
Note that regarding the light sources as concentrated spots is a simplification. In reality, the light emitting area of the line lights is a longish rectangle (approx. 150 x 15 mm). Nevertheless, within the limits of accuracy of the photometric stereo algorithms presented here, the effect of this idealization can be neglected.
The directions of the light sources are described by the direction vectors (length scaled with arbitrary factor) from the center of the FOV to the centers of the light-emitting areas of the four line light sources. They are defined by We use four light sources for their increased surface reconstruction stability compared to the three lights that are the minimum requirement for determining three dimensional surface normal vectors [8]. In order to have enough light for a proper signal, the light sources are strobed at a frequency of 10 kHz, which is only a small fraction of their maximum strobing frequency of 600 kHz. The illuminance in the object plane, generated by a single line light, is approximately 500.000 lx.
The camera, a Mikrotron EoSens 4CXP area-scan camera with 2336(H) × 1728(V) pixels, 7 µm pitch, monochrome Figure 4: Timing of illumination and camera triggering. Material motion, as registered by an encoder, causes a camera exposure, while light sources from each direction are activated in turn. In highaccuracy configuration, the frame period is 100 µs. In high-speed configuration, the frame period is 25 µs.
version, is equipped with a Schneider-Kreuznach Xenoplan 2.0/28 lens with 29.29 mm focal length, mounted with 226 mm working distance (WD) for a magnification of 0.14 to realize an optical resolution of 50 µm/px, which is equal to the resolution in transport direction. Using this configuration we achieve a FOV of approximately 116 mm perpendicular to transport direction, and 200 µm in transport direction. The FOV corresponds to a region of interest of 2336 × 4 pixels configured in the camera. For sake of clarity, FOV, WD, and the transport direction are shown in Fig. 6.
The FOV together with the resolution of 50 µm/px were design requirements to be able to acquire the whole width of the material as well as the transition from substrate to the material at a resolution suitable for the expected defects' size.
We have constructed and successfully tested a system prototype in our laboratory. Figure 7 shows a photograph of the prototype system, including a motorized roll simulation that allows us to thoroughly test system performance under various operating speeds.
Up to here, the high-accuracy configuration of the acquisition and control system was described. For faster scanning, we have developed a high-speed system. The differences between the two system variants shall be described now.
In order to speed up the acquisition, a faster camera, the AIT xposure:camera, monochrome version, is used and the number of xposure:flash light sources is reduced from four to two. The timing of Figure 4 reduces to toggling of two lights at a frame period of 25 µs. The direction vectors of Fig. 6, are then defined as l 1 = (1, 0, 1) T and l 2 = (−1, 0, 1) T .
The xposure:camera is based on a high-speed sensor with 2016(H) x 60(V) light-sensitive pixels, 9 µm pitch, allowing single-line readout of up to 600.000 frames per sec-   ond (fps). Corresponding to the two light directions, two of the 60 lines of the pixel matrix are read out. A Schneider-Kreuznach Apo-Componon 2.8/40 lens with 41.52 mm focal length, mounted at a WD of 255 mm, is used to achieve a magnification of 0.18 for realizing again a resolution of 50 µm/px. Due to light limitation, in order to have a good signal, the test images described later are acquired at 40 kHz frame trigger rate, with exposure time of 24 µs, corresponding to a scanning speed of 2 m/s.

Data processing
An industrial-grade computer with Microsoft Windows 10 operating system is used for configuration of the acquisition subsystem and processing of acquired image data. Image data from the Mikrotron camera is acquired via an Active Silicon FireBird CoaXPress Frame Grabber (Quad CXP-6). Image data from the xposure:camera is acquired via an Intel Ethernet-Converged-Network-Adapter X520-SR2 (2x10 Gigabit Ethernet). Photometric stereo results are processed, and stored to hard disk for further analysis. A graphical user interface is provided in order to enable an operator to review the results in real-time. As the PC is located within the machine, its user interface is remotely accessible via Ethernet-based networking.

System calibration
In order to achieve optimal performance in terms of image quality, we perform a flat field correction (FFC) calibration step prior to scanning.
FFC serves two purposes. The first is to mitigate dark signal non-uniformity and photo response non-uniformity of the camera sensor. Secondly, it compensates the previously described gradient of illuminance along the FOV, caused by the slant of the respective light source relative to the object's surface. By application of the FFC to the acquired raw image data, we approximate an assumption needed for the photometric stereo (PS) algorithm [9], namely that light sources appear infinitely far away from the observed surface. Therefore it is obvious that we have to perform FFC individually for each of the available light sources, i. e. manage four sets of FFC coefficients.
To calculate the FFC coefficients (offset and gain parameters per pixel and per light source), we acquire 1000 camera frames with all lights turned off and 1000 camera frames per light source (all but one light source turned off). The average over all dark acquisitions is denoted as black frame B ∈ ℝ V×H . In a second step, we turn on a single light k, while all others are turned off, and acquire 1000 camera frames per light source, with a white, flat, quasi-Lamertian object in its field of view, average the data pixelwise and denote the results as white frames W k ∈ ℝ V×H for light source k with 1 ≤ k ≤ n.
Using dark-and white-frames, we derive gain values G k = 2 m W k −B for each light source k. Here, matrix operations to be done element-wise, and m is number of bits of the output image, in our case m = 16 bit. The process up to here is the FFC calibration, which has to be done in regular intervals of days or weeks or if relevant things have changed. In regular operation, the calibration parameters are applied to the acquired raw frames. From raw frames R k with light k turned on, corrected frames, C k , are calculated, using C k = (R k − B)G k , multiplications to be done element-wise.

Photometric stereo processing
The dark texture of the battery material, black for NMC coated cathodes to dark gray for anode foils, impedes direct optical intensity analysis. Either large amounts of light are required for illumination, increasing costs, or long camera exposure times need to be used, which limits the speed of the coating line. Due to the fact that coated electrodes of high quality have a diffuse, anisotrope surface, the material lends itself to surface reconstruction using photometric stereo [9], a shape-from-shading algorithm. Instead observing intensities from the image sensor directly, we use the derived surface normals as signal for defect detection. The availability of surface normals allows us to further derive the surface's curvature and to generate a corresponding depth map by means of normal integration. In subsequent data processing we prevalently use curvature, while we use depth maps predominantly for visualization purposes.
PS employs the Lambertian assumption of perfect diffuse material illuminated by infinitely distant, parallel light rays, and reconstructs surfaces based on observed light intensities of light reflected from surface points illuminated under several illumination angles. We compute surface normals and albedo from acquired image data that correspond to the four illumination directions using our PS algorithm [10]. In the following, we concisely summarize the method for the reader's convenience.
We consider Lambertian reflectance under known light directions. A surface is acquired from a fixed view point from n ≥ 3 known illumination directions (l 1 , . . . , l n ) T = L ∈ ℝ n×3 , where each acquisition has a size of p×q pixels with row indices 1 ≤ i ≤ p and column indices 1 ≤ j ≤ q. Observed intensities are denoted by o i,j ∈ ℝ n , where each observation k ∈ ℕ with 1 ≤ k ≤ n corresponds to the acquisition obtained with light source l k . From these known quantities we want to determine surface normals n i,j ∈ ℝ 3 and albedo ρ i,j ∈ ℝ. Lambertian reflectance models image formation as a linear relationship [9]: By inverting L we can obtain m i,j ∈ ℝ 3 the vector field of normals scaled by albedo, where L + ∈ ℝ 3×n denotes the Moore-Penrose pseudo inverse of L. From Eq. (2) we obtain surface normals n i,j and albedo ρ i,j by scaling m i,j to unit length, where ||.|| 2 denotes the L 2 norm. For n ≥ 3 light sources, we use a regularized PS model that is less prone to large scale surface perturbations. Its details have been previously described in [10]. From the known light directions L defined by their components {x, y, z} for x, y, z ∈ ℝ n , we construct a polynomial P = [P 2 , P 1 , P 0 ] ∈ ℝ n×10 with: y ⊙ y, z ⊙ z, x ⊙ y, x ⊙ z, y ⊙ z], where ⊙ represents the Hadamard product, P 2 ∈ ℝ n×6 denotes 2nd order basis functions, P 1 ∈ ℝ n×3 denotes surface normal vectors, and P 0 = 1 n is a one-valued vector modelling ambient illumination.
In order to cope with the additional parameters in P, we extend m i,j to a 10 dimensional vector m ext i,j ∈ ℝ 10 whose elements 7 to 9 correspond to the coefficients of m i,j and formulate the following optimization problem: where Γ = diag(1, 1, 1, 1, 1, 1, 0, 0, 0, 1) ∈ ℝ 10×10 denotes the Tikhonov regularization term. Regularization allows to orient the model between Lambertian reflectance (P 1 ) and non-Lambertian reflectance (P 2 , P 0 ) using the regularization strength parameter λ ∈ ℝ. In our experiments we use λ = 0.4.
By solving Eq. (5) for m ext i,j , we retrieve surface normals and albedo using Eq. (3) and Eq. (4), respectively. Note that when using less than ten light sources, i. e. the number of terms in P, we rely on regularization to solve the model.
Often, we are not interested in the normal map n i,j directly, but rather in its derived gradient image that is defined as: Given a normal map n i,j , we can generate a depth map by means of normal integration. To that end, we used the method of Frankot and Chellappa [11].

Experimental results
In this section, we present the qualitative results obtained from acquisitions of deliberately defective anode and cathode foils provided by researchers from our on-premises coating pilot line facility. The samples have been specifically selected to provide a good overview of real-world defects that can occur in foil coating, such as missing coating, coating inhomogeneities, pinholes, agglomerations, cavities and cracks. We present results from two setups. The first, a high-accuracy setup uses four light sources, as described in Section 3. The second setup is designed with high-speed operation in mind and uses only two light sources.

High-accuracy, four light setup
Our dataset comprises two black colored nickel manganese cobalt (NMC) cathodes and two graphite anodes of dark gray texture. Coating was applied with a width of 100 mm onto substrates of approximately 130 mm width. The substrate's thickness is 20 µm, whereas, the applied coating thickness ranges from 30 to 450 µm. The samples were acquired at a speed of 500 mm/s. The results were obtained using the processing pipeline described in Section 4.
The most obvious type of defect is missing coating, as illustrated in Fig. 8 (a,b). In the present samples it is caused by agglomerates clogging the doctor blade and preventing new slurry to pass the blade in those regions. Sometimes these pollutions break free after a while, as can be seen in Fig. 8 (a). Electrodes with missing coating are unfit for use in cells. Large scale missing coating is obviously visible in raw image data, small blade obliterations, however, may not reach down to the substrate material.
Such defects can be called coating inhomogeneities. An example can be seen in Fig. 8 (c). Coating inhomogeneities can cause, among others, degraded cell capacity [3], and can be mitigated to some extent by subsequent calandering. Inhomogeneities are hard to detect optically, especially on the black NMC material. They are, however, visible in surface normals and the derived depth map.
Pinholes are small diameter pores, depicted in Fig. 8 (c), are caused by small air bubbles bursting in the drying process and can reach down to the substrate. Pinholes can be caused by inadequate slurry mix, or drying parameters [3]. They are best visible in depth maps and invisible in raw image data. Note that the shown sample additionally exhibits small dark spots that can, but don't always coincide with pinholes. Slurry containing large air bubbles can leave cavities or void areas, as shown in Fig. 8 (d). This sample further contains cracks in the coating area.
While all the previously discussed defects are variations of missing active material, agglomerates constitute of excess material, as shown in Fig. 8 (d). Agglomerates can be caused by an incomplete slurry mix [3] and can potentially damage the calandering roll, or if not crushed there, pierce the separator foil in final cells.
Another observable coating property is the coating's surface roughness. Rough coating can damage the mechanical press in the calandering process following the coating step. Examples for low roughness is shown in Fig. 8 (a,b), while a sample of high roughness can be seen in Fig. 8 (c).

High-speed, two light setup
In this section we present a qualitative comparison to results of an implementation of the proposed inspection system architecture that is designed towards even higher operational speeds. Here, we choose an acquisition speed of 2000 mm/s. The setup, illustrated in Fig. 9, maintains the same acquisition control mechanism as presented in Section 3 with two notable differences. First, here we employ a high-speed multi-line-scan camera, an AIT xposure:camera [12]. The camera's sensor delivers 60 lines of 2048 pixels width and can be clocked at frequencies of up to 600 kHz in grayscale operation. The optics are chosen for a 100 mm field of view at a resolution of 50 µm per pixel. At a speed of 2000 mm/s the system trigger rate is 40 kHz with a camera exposure of slightly below 25 µs. Secondly, this setup uses only two line light sources which are mounted vertically in line with the camera axis and tilted ±45°relative to the transport direction. Correspondingly, two of the 60 available sensor lines are used to acquire data. Using two light sources, prevents full, two dimensional, surface reconstruction, as that would require at least three light sources. Hence, we use the standard PS algorithm for processing. We acquire the same electrode sample as presented in Fig. 8 (c), perform one dimensional PS according to Eq. (2) and albedo, and present resulting normals in terms of a gradient image that is generated by applying Eq. (7).
As shown in Fig. 10, surface features -such as the vertical coating inhomogenity marked on the right hand side of each plot -are still clearly distinguishable despite the increased speed and lower number of lights used for surface reconstruction. Turning the attention to the crack in the electrode surface on the left side of the plot, we can see the vertical section of the crack vanishing on the shown gradient in y-direction. The gradient in x-direction is not reconstructed due to using only two lights.

Discussion
Here we focus on electrodes, however, the system can be flexibly repurposed for defect detection for other materials, for example for defects of steel surfaces.
The output of our processing pipeline, albedo and surface normals, provides strong cues about the object's surface. Using these results can help to reduce the complexity of a learning-based defect classifier in terms of model complexity compared to an classifier that operates solely and directly on input data. The comparison of the results of a two light source and a four light source setup suggests that, while two light sources can still make defects visible, four lights allow for better visualization of surface defects in general pose. Extending the high-speed setup with a third light source would allow for processing of full-two dimensional surface normals that allow detection of defects in general pose, without increasing the acquisition time substantially.
A notable limitation of the inspection system, as proposed here, is that depth reconstruction from surface normals by means of normal integration is up to relative reference. Therefore the proposed reconstruction method does not fit for 3D metrology tasks, such as 3D surface profile measurement.

Conclusions
In this paper we have presented a combined hardware/software system architecture for the inline inspection of battery electrodes that utilizes state of the art photometric stereo algorithms to provide surface structure information at speed of up to 2000 mm/s with a resolution of 50 µm/px. We achieve this performance using tight coupling of transport movement, interleaved strobing of four line lights and image acquisition using an FPGA-based controller. The use of photometric stereo for surface reconstruction, enables our system to provide highly detailed information of the surface structure of battery electrodes. We have presented detailed information on the proposed system architecture in terms of used components, acquisition schema and the processing of the final results. In experiments using two different implementations of the proposed system architecture, we have obtained results that show that common defects occurring in the coating process of battery electrodes can be visualized clearly, as can be seen in the presented qualitative data on a data set of defective electrodes.
We are confident that the proposed system can make a valuable contribution to ensuring optimal quality in the coating process of battery electrodes.