*4.2.2. D\* Lite with reset algorithm*

Unlike AD\*, D\* Lite with Reset (D\*LR) [16] partially solves the problem D\* Lite while still maintaining path optimality. The idea of D\*LR is simple; it decides flushing previous search data and starts searching from scratch when the replanning process is expensive.

D\*LR is a variant of D\* Lite; it inherits all the properties of D\* Lite. The main contribution of D\*LR is that it proposes two criteria to decide whether to incrementally replan path or calculate a fresh path using A\* at the position the robot detects changes. Let total traversed cell is *NT*; total cell of path that exists between consecutive detection incidents is *NP*, and the remaining path count is *NR* = *NP* − *NT*; the criteria are:

• **Ratio of traversed length:** The criteria measure how many percentages of the path the robot has moved between two consecutive positions that the robot detects environment changes. The ratio \_\_\_ *NT NP* is then compared with a threshold:

$$\frac{N\_r}{N\_p} < \infty \,. \tag{8}$$

If the ratio is greater than **threshold** ∝ when the robot perceives changes, it triggers the reset routine and starts searching from scratch. Intuitively, the position that robot detects changes is nearer the goal, the more likely replanning process is expensive.

• **Linear heuristic distance:** The criteria measure the complexity of the remaining path count *NR* between consecutive detection incidents. The method to measure the complexity is to use inflated heuristic function:

$$N\_{\mathbb{R}} \ge \varepsilon \* h \langle s\_{\gamma} \mid s\_{goal} \rangle \tag{9}$$

where *s* is the current position of the robot. If *NR* ≤ *ε* ∗ *h*(*s*,  *sgoal*), then the remaining path is simple enough; there is a chance that the new path is much more complex. Hence, the algorithm must plan over from scratch.

As can be seen, these criteria use only path information between consecutive detection incidents in order to estimate the amount of computation of replanning process comparing with planning over from scratch. The reason is that it is hard to predict propagation behaviour of OPEN list, because the state space is only partially known. Moreover, these criteria only work in high cluttered and complex environment, where environment changes usually block initial path and the new path is likely to be much longer than initial path. The pseudo code of D\*LR is presented in **Figure 11**.

The proposed criteria of D\*LR are not robust due to extensively replying on environmental assumptions. However, the algorithm can be improved if criteria that can robustly estimate computation of replanning process in any kind of environment are applied. If criteria are robust, D\*LR performance of each iteration is bounded by the complexity of A\*:

$$O(|V|) = O(|E|) = O(b^4) \tag{10}$$

#### **4.3. Optimality improvements: Field D\* algorithm**

At first, we set the suboptimal bound *ε* to be large enough in order to generate solution quickly (**Figure 10**, line 42). Unless environment changes are detected, AD\* iteratively decrease suboptimal bound *ε* to improve the solution as time allowed (**Figure 10**, lines 55–60); this phase

When changes are perceived, the suboptimal bound of solution is no longer guaranteed, especially the under-consistent cells, due to the fact that there could have shorter paths exist. Therefore, these under-consistent cells are placed in OPEN list with uninflated heuristic to ensure these cells propagate their inconsistences to neighbours first when ComputeOrImprovePath() function is called (**Figure 10**, lines 5 and 45–50). However, because of this effect, many under-consistent cells quickly rise to the top of OPEN list; they usually do not contribute to calculate new path in practice (e.g. objects cause under-consistent changes like human movement, etc.). Hence, AD\* tends to slow down when the path is near optimal.

When "significant cell changes are detected" (**Figure 10**, line 53), there is a high chance that the problem of D\* Lite occurs and the search tree may be corrupted heavily; the replanning process now is expensive; we can increase suboptimal bound *ε* to speed up the correction effort or start a new search from scratch. The problem is how to estimate "significant cell changes". This algorithm does not solve the mentioned problem of D\* Lite completely; it is just a trade-off between performance and path optimality. However, AD\* performs quickly in large-scaled map compared to other algorithms, in which the robot has significant time to

Unlike AD\*, D\* Lite with Reset (D\*LR) [16] partially solves the problem D\* Lite while still maintaining path optimality. The idea of D\*LR is simple; it decides flushing previous search

D\*LR is a variant of D\* Lite; it inherits all the properties of D\* Lite. The main contribution of D\*LR is that it proposes two criteria to decide whether to incrementally replan path or calculate a fresh path using A\* at the position the robot detects changes. Let total traversed cell is *NT*; total cell of path that exists between consecutive detection incidents is *NP*, and the remaining path

• **Ratio of traversed length:** The criteria measure how many percentages of the path the robot has moved between two consecutive positions that the robot detects environment

If the ratio is greater than **threshold** ∝ when the robot perceives changes, it triggers the reset routine and starts searching from scratch. Intuitively, the position that robot detects changes

< ∝ . (8)

is then compared with a threshold:

is nearer the goal, the more likely replanning process is expensive.

\_\_\_ *NT NP*

data and starts searching from scratch when the replanning process is expensive.

is exactly the same with ARA\*.

78 Advanced Path Planning for Mobile Entities

*4.2.2. D\* Lite with reset algorithm*

count is *NR* = *NP* − *NT*; the criteria are:

*NT NP*

changes. The ratio \_\_\_

Theorems of AD\* are described in detail in [12].

iteratively repair its path, and thus overall path is near optimal.

Although cell decomposition approximation is widely used to discretize C-space for searchbased algorithms due to its robustness (no prior environmental assumptions), this approximation intrinsically prevents search-based algorithm to produce optimal path. The search-based algorithms just allow to transition between cell centres, thus restricting robot traverse directions to increment of *π*\_\_ 4 . Moreover, the produced path involves many sharp turns and jerky segments in large map that makes robot difficult to move.

There were many approaches to cope with this problem. For instance, post-processing method that finds the furthest point P along the solution path for which a straight line path from P to robot position is collision-free and replaces the original path to P with this straight line. However, this method sometimes does not work and increases the path cost. Another approach is fast marching method [22]; this method incorporates interpolation step in planning step to produce low-cost interpolated path. Nonetheless, this method assumes that transition cost between grid cells is constant and does not have heuristic property like A\*; hence it is not applicable to outdoor environment, which requires fast path generating and non-uniform cost grid.

To incorporate incremental heuristic property of D\* Lite, the authors of Field D\* [3] embed linear interpolation method to the replanning process to generate "any-angle" optimal path

In this case, the edge, which resides on the boundary of two cells, has the edge cost equal to the minimum of cost of the two cells. Field D\* use linear interpolation to compute approxi-

**Figure 12.** Remapping state space graph vertices from cell centres to cell corners (a) Center Vertices, (b) Corner Vertices

*g*(*sy*) = *yg*(*s*2) + (1 − *y*)*g*(*s*1), (11)

\_\_\_\_\_\_\_\_\_

where *x* is the distance travel along the bottom edge from *s* before cutting through the centre

The interpretation from formulas (4) into ComputeCost() function is described in detail in [3]. This optimization approach can be plugged in any dynamic planner by replacing standard cost function between cell centres by function ComputeCost(). In addition, due to remapping

a distance *y* from *s*1

as

by using the path cost (cost from the node to

(**Figure 13**). Given the centre cell cost *c* and bottom cell cost

Search-Based Planning and Replanning in Robotics and Autonomous Systems

http://dx.doi.org/10.5772/intechopen.71663

81

(1 − *x*) 2 + *y*2 + *g*(*s*2)*y* + *g*(*s*1)(1 − *y*)) (12)

. (see **Figure 13**).

 *s*2

) > g(2

) (c) Case g(1

. The subfigures illustrate possible

) and (d) Case path costs that

on the edge ⟶*s*1 *s*2

to *sy*

**Figure 13.** Linear interpolation process to compute path cost of s using edge ⟶ *s*1

*, s*2 (b) Case g(1

) < g(2

 *s*2 .

*b*, we can compute the path cost of *s* using edge ⟶*s*1 *s*2

*g*(*s*) = min*x*,*y* (*bx* + *c* √

cell to reach the right edge at the point *sy*

optimal path cost (a) Calculate g(*s*) based on *s*1

pass arbitrary point.

mately the cost of any point *sy*

and (c) Optimal Path intersected ⟶*s*1

where *y* is the distance from *s*1

goal) *g*(*s*1) and *g*(*s*2):

**Figure 11.** Pseudo code of D\*LR. Other functions such as Key(), UpdateVertex() and ComputePath() are the same with D\* Lite and thus are not presented.

that overcomes grid limitation in dynamic environment. The root cause of restriction of path optimality is the rule to transition between cell centres; the idea of Field D\* to solve this problem is to remap state space graph vertices to the corner of each cell (see **Figure 12**). The nodes *s* can be considered as sample points of continuous cost field, where the optimal path must pass one of the edges { ⟶*s*1 *s*2 , ⟶*s*2 *s*3 , ⟶*s*3 *s*4 , ⟶*s*4 *s*5 , ⟶*s*5 *s*6 , ⟶*s*6 *s*7 , ⟶*s*7 *s*8 , ⟶*s*8 *s*1} that connects consecutive neighbours of *s*; the edge is ⟶*s*1 *s*2 in the picture's case.

Search-Based Planning and Replanning in Robotics and Autonomous Systems http://dx.doi.org/10.5772/intechopen.71663 81

**Figure 12.** Remapping state space graph vertices from cell centres to cell corners (a) Center Vertices, (b) Corner Vertices and (c) Optimal Path intersected ⟶*s*1  *s*2 .

In this case, the edge, which resides on the boundary of two cells, has the edge cost equal to the minimum of cost of the two cells. Field D\* use linear interpolation to compute approximately the cost of any point *sy* on the edge ⟶*s*1 *s*2 by using the path cost (cost from the node to goal) *g*(*s*1) and *g*(*s*2):

$$\mathcal{S}(\mathbf{s}\_y) = \mathcal{Y}\mathcal{S}\{\mathbf{s}\_2\} + (1 - \mathbf{y})\mathcal{S}\{\mathbf{s}\_1\} \tag{11}$$

where *y* is the distance from *s*1 to *sy* (**Figure 13**). Given the centre cell cost *c* and bottom cell cost *b*, we can compute the path cost of *s* using edge ⟶*s*1 *s*2 as

$$\mathbf{g(s)} = \min\_{\mathbf{x}, \mathbf{y}} \left( b\mathbf{x} + c\sqrt{(1-\mathbf{x})^2 + y^2} + \mathbf{g(s\_2)}\mathbf{y} + \mathbf{g(s\_1)(1-y)} \right) \tag{12}$$

where *x* is the distance travel along the bottom edge from *s* before cutting through the centre cell to reach the right edge at the point *sy* a distance *y* from *s*1 . (see **Figure 13**).

The interpretation from formulas (4) into ComputeCost() function is described in detail in [3]. This optimization approach can be plugged in any dynamic planner by replacing standard cost function between cell centres by function ComputeCost(). In addition, due to remapping

that overcomes grid limitation in dynamic environment. The root cause of restriction of path optimality is the rule to transition between cell centres; the idea of Field D\* to solve this problem is to remap state space graph vertices to the corner of each cell (see **Figure 12**). The nodes *s* can be considered as sample points of continuous cost field, where the optimal path must pass

**Figure 11.** Pseudo code of D\*LR. Other functions such as Key(), UpdateVertex() and ComputePath() are the same with

⟶*s*8 *s*1} that connects consecutive neighbours

one of the edges { ⟶*s*1 *s*2

D\* Lite and thus are not presented.

80 Advanced Path Planning for Mobile Entities

of *s*; the edge is ⟶*s*1 *s*2

, ⟶*s*2 *s*3 , ⟶*s*3 *s*4 , ⟶*s*4 *s*5 , ⟶*s*5 *s*6 , ⟶*s*6 *s*7 , ⟶*s*7 *s*8 ,

in the picture's case.

**Figure 13.** Linear interpolation process to compute path cost of s using edge ⟶ *s*1  *s*2 . The subfigures illustrate possible optimal path cost (a) Calculate g(*s*) based on *s*1 *, s*2 (b) Case g(1 ) < g(2 ) (c) Case g(1 ) > g(2 ) and (d) Case path costs that pass arbitrary point.

graph vertices into cell corners, we also need to change finding cell centre neighbours to a pair of corner nodes as illustrated in **Figure 13**. Once the path costs of necessary nodes are computed, the path is generated by starting from the initial node and iteratively finds, using linear interpolation, the optimal node on the neighbor cell boundary to move next. The pseudo code of Field D\* and modifications in red colour are shown in **Figure 14**. Note that the differences between D\* Lite and Field D\* are highlighted in red. The function Key(), ComputePath() are the same as D\* Lite and thus is not presented. This pseudo code is a basic version of Field D\*;

Search-Based Planning and Replanning in Robotics and Autonomous Systems

http://dx.doi.org/10.5772/intechopen.71663

83

Field D\* inherits all properties of D\* Lite; it combines linear interpolation method to compute path from any point inside cell, not just corners or cell edges. This feature is crucial for robot to get back on track if the actuator execution is faulty. Moreover, Field D\* is not subjected to

In this section, using our path planning framework, we demonstrate the evaluation comparison between algorithms in search-based family in terms of performance and path

To visualise the evolution in computation of search-based algorithms, we compare the replanning computation of D\* Lite, Anytime Dynamic A\* and D\* Lite with Reset. The purpose of the comparison is to demonstrate the performance improvements of D\* Lite variants in order to apply on robot that operates in complex and dynamic environment. However, since the planning time depends on the implementation and machine configuration, we therefore choose the amount of cell expansion in each replanning iteration of search-based algorithm to be standard performance measurement of the mentioned algorithms. This method is independent on machine specifics and actual implementation and therefore firmly accurately shows the enhancement of this evaluation. The path solution ratio between AD\* with different *ε* suboptimal bound and optimal path of other algorithms is also measured to visualise the

The experiments are conducted on our 2D simulation engine. The state space is a 2D grid cell with uniform resolution [23]. The conceptual robot in this simulation has two-cell-unit range and its own known grid map to detect environment changes (unblocked cell to blocked cell

We evaluate the performance and path solution of search-based algorithms in two scenarios: partially known and unknown 2D grid environment with uniform resolution. The total expanded cells are averaged based on total replanning processes on each simulation instance, with 95% confident. The path solution of each algorithm is counted as the total cells that the robot has traversed from corner to corner of the map. We decrease the suboptimal bound of AD\* for 0.1 per step the robot travels until the suboptimal bound reaches 1.0

direction restriction; hence, it produces much shorter and smoother path.

optimised versions are presented in [3].

**5. Experimentation**

**5.1. Evaluation method**

**5.2. Evaluation results**

(optimal path).

trade-off between optimality and computation.

and vice versa) as it moves along the initial path (see **Figure 15**).

optimality.

**Figure 14.** Pseudo code of Field D\*.

between D\* Lite and Field D\* are highlighted in red. The function Key(), ComputePath() are the same as D\* Lite and thus is not presented. This pseudo code is a basic version of Field D\*; optimised versions are presented in [3].

Field D\* inherits all properties of D\* Lite; it combines linear interpolation method to compute path from any point inside cell, not just corners or cell edges. This feature is crucial for robot to get back on track if the actuator execution is faulty. Moreover, Field D\* is not subjected to direction restriction; hence, it produces much shorter and smoother path.


**2. Building Blocks of an Automated Disassembly Station**

An automated disassembly station for EVBs can be reduced to two building blocks: (1) a mechanical system that directly interacts with the EoL products, and (2) a disassembly planner that adaptively calculates and updates the disassembly strategies (see Figure 2). The subcomponents are described in the following sections to show the big picture of our work. Thereby, publications in the context of battery disassembly are assigned to the respective subcomponent.

#### *2.1. Mechanical System*

#### 2.1.1. Manipulators

Manipulators are responsible for moving several components during the disassembly process. These components can either be part of the battery or the disassembly station, such as tools and sensors. Robot arms are typical manipulators. The disassembly process can be carried out using a single manipulator resulting in a sequential disassembly, in which the parts are removed one by one. However, multiple manipulators have a great potential to reduce the disassembly time if parallel disassembly activities are possible. This is known as corporative disassembly. The disassembly sequence planning is more complicated if more than one manipulator is used [15].

**Figure 2.** Building blocks of disassembly stations.

## 2.1.2. Disassembly Tools

EVBs are complex products whose disassembly is associated with multiple difficulties. Screw connections are frequently found in batteries. This allows the application of non-destructive disassembly. However, different screw types are often used, which are not accessible from the same direction [16]. This means that disassembly involves frequent tool and direction changes, which have to be considered while planning the disassembly process. Furthermore, many non-detachable connections are used in EVBs, such as welded joints. This is especially the case at the module level when connecting the cells [17], where welding processes have become established because they increase the electrical performance and improve the joints' thermal properties and long-term stability [18]. However, these joints are difficult to disassemble, especially when alternative circular economy strategies are targeted.

Moreover, various other joining techniques are used in the battery, such as adhesive bonding and riveting. In addition, there are several connector systems and flexible components that have to be disconnected or cut. That is why an automated disassembly of EVBs can only be achieved with a wide range of disassembly tools. In the literature, various tools have been presented that can be used in automating individual steps of battery disassembly. Tan et al. [9] presented a pneumatically actuated separation tool suitable for removing covers and stack holders and an unscrewing device with integrated torque sensors. Kay et al. [19] proposed a cost-effective cutting instrument based on a high-speed rotary cut-off wheel, which can be integrated into a disassembly station for battery modules. However, according to their evaluation, laser cutting is more suitable to achieve lower heat

generation and vibration amplitudes and higher cutting accuracy. Li et al. [20] proposed an automated disassembly system for Z-folded pouch cells consisting of three modules for the pouch trimming, housing removal, and electrode sorting. Thereby, they presented a pouch trimming module consisting of a trimming blade set, a trimming base set, and a conveyor roller set. In this context, the main challenge in designing disassembly tools will be to develop universal tools that are, first, suitable for different battery variants and, second, capable of performing more than one disassembly task to reduce the number of tool changes during disassembly.


**Author details**

Juvenal Rocha Dias and Eliane Aparecida Faria Amaral Fadigas\* Department of Electrical Automation and Energy Engineering, São Paulo University, São Paulo, Brazil

\*Address all correspondence to<EMAIL_ADDRESS><EMAIL_ADDRESS>
© 2020 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/ by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

**77**

*A Reverse Osmosis and Electrodialysis System Simultaneously Powered by Gravitational…*

*DOI: http://dx.doi.org/10.5772/intechopen.91135*

[1] Dias JR. Osmose Reversa com Energia Eolica e Energia da Gravidade. Germany: Novas Edições Acadêmicas;

[2] Dias JR. Dessalinização de água por osmose reversa usando energia potencial gravitacional e energia eólica [Dissertação de Mestrado]. Brasil: Defendida na Universidade de São

[3] Fadigas EAFA, Dias JR. Desalination of water by reverse osmosis using gravitational potential energy and wind energy. Desalination. 2009;**237**:140-146. Available from: www.sciencedirect.com

[4] Isentropic Desalination (At Minimal Energy Cost) of Seawater. Available from: http://mshades.free. fr/isentropiques/desalination.html

[Accessed: 15 March 2004]

[5] Manwell JF, McGowan JG, Rogers AL. Wind Energy Explained. Amherst, USA: John Wiley & Sons Ltd., University of Massachusetts; 2002

[6] Fadigas EAFA, Dias JR. A

nonconventional reverse osmosis plant powered by storage of wind energy as gravitational potential energy. In: Desalination: Methods, Costs and Technology. New York: Nova Science Publishers. Inc.; 2010. pp. 229-245

**References**

Paulo; 2004. p. 212

2017

*A Reverse Osmosis and Electrodialysis System Simultaneously Powered by Gravitational… DOI: http://dx.doi.org/10.5772/intechopen.91135*


*3.2. Signal Analysis*

Table 3 shows the color-coded images, which helps to visualize a 3D image of the spectrum intensity (Figure 4) in a 2D form of the spectrum during 0.2 s (0.4–0.6 s). In the color-coded image, the horizontal and vertical axes represent the time and wavelength, respectively, and the intensity is mapped in color. The used color scale was the same used by Viridis [28], and the minimum and maximum values of the color scale were set as 0 and 65535, respectively. It was seen that higher intensities were observed, mainly in the wavelength range of 350–650 nm. In general, when the laser power was kept constant, a higher welding speed increases the intensity. In terms of the size of weld bead, i.e., the penetration and width, this signifies that smaller the weld bead, more was the light, reflected into the spectrometer. Similarly, in case of constant welding speeds, the higher the welding power, the larger was the intensity. However, in this case, even if the size of the weld bead increased, the intensity increased, as the laser power increased. This means that the intensity is influenced more by the laser power, than the weld bead size. These trends were quite clearly observed, in the range of 1000–2500 W of the laser power. However, these trends were rarely observed in all values of laser power more than 3000 W, and rather, all color-coded images in these conditions were almost identical. Additionally, in these conditions, the size of the weld beads, at each welding speed, was almost identical, regardless of the laser power. The growth of the weld bead seems to saturate at a laser power above 3000 W. It is thought that two experimental results, observed when the laser power was more than 3000 W, are related to each other. Table 4 presents the color-coded images of spectrum at all conditions, at a gap of 0.8 mm, and the other configurations except the gap setting are same as those of Table 3. In this case, the pattern of the spectrum intensity was irregular, and the intensity level was smaller, compared to those of Table 3. This result indicates that the irregular geometry of the welding area, caused by the gap, caused a higher irregular reflection of the visible light and laser light. The 3D images (Figure 4) and color-coded images (Tables 3 and 4) may be difficult to be interpret, and their color and form can also change quite drastically, when compared to a referenced color scale and other configurations. Therefore, in this study, we used the color space created by the International Commission on Illumination in 1931 (CIE 1931 color space), to convert the measured spectrum data to a standard form. The measured spectrum data were converted into CIE 1931 XYZ values, and then these values were further converted into CIE 1931 RGB values by Colour, an open-source Python package, providing algorithms and datasets for color science [29]. The RGB format is effective for showing the features of data measured by the spectrometer and it consists of much smaller data converted using the spectrum data, which allows to estimate models and handle data, with less computation time. Additionally, the maximum value of wavelength for each sample was searched and added.

**Table 3.** Color-coded images of spectrum, according to the laser power and welding speed; in each image, the horizontal axis is time (s), the vertical axis is wavelength (nm), and intensity is mapped in color (color scale: Viridis, date from [28]).

**Table 4.** Color-coded images of spectrum at a gap of 0.8 mm according to the laser power and welding speed: in each image, the horizontal axis is time (s), the vertical axis is wavelength (nm), and intensity is mapped in color (color scale: Viridis, data from [28]).

To investigate the effect of the weld penetration on the spectrum intensity, the maximum wavelength and RGB values, at a laser power of 2000 W and different welding speeds, are shown in Figure 7. It is seen that the welding heat input (expressed in kJ/mm) increases, as the welding speed decreases, when the laser power was kept constant. Likewise, the weld penetration increased with increasing heat input, as the welding speed decreased (Table 2). The RGB value, which is converted from the intensity data, decreased when the penetration was increased, which is similar to the results shown in Table 3. It might be inferred that the amount of light reflected from the welding area decreases, as the penetration depth increases, when the laser power is limited to 3000 W, as used in this study. The maximum values of the wavelength were found to be distributed in the range of 500–540 nm, and these values in the case of welding speed 1.5 m/min were slightly lower, when a different welding speed was used. Figure 8 shows the maximum wavelength and RGB values wavelength, at a welding speed of 2.5 m/min, according to different laser powers. The RGB values increased, as the laser power increased, even though the size of weld bead increased due to the high laser power. In addition, the RGB values were almost same, in the conditions of the laser power more than 3000 W. These results were found to be in good agreement, with those of Table 3. The maximum values of wavelength were distributed in the range of 530–540 nm. Figure 9 shows the RGB values and maximum wavelength at a gap of 0.8 mm, and a 3000 W laser power, according to the welding speed. In this case, the maximum wavelength and RGB values were almost same as those shown in Figure 8c, which had conditions of a 3000 W laser power and a 2.5 m/min welding speed. However, overall waveforms of the RGB curves were found to be uneven and irregularly-shaped, and the variations of the RGB and maximum wavelength values were relatively small, as compared to those of the cases when the laser power was above 3000 W. For this reason, the green curve is clearly separated from the red and blue curves, as seen in Figure 9.

**Figure 7.** RGB values and maximum wavelength at laser power of 2000 W: welding speed of (**a**) 1.5 m/min; (**b**) 2.0 m/min; (**c**) 2.5 m/min.

**Figure 8.** RGB values and maximum wavelength at welding speed of 2.5 m/min: laser power of (**a**) 1000 W; (**b**) 2000 W; (**c**) 3000 W; (**d**) 4000 W.

**Figure 9.** RGB values and maximum wavelength, at 0.8 mm gap and 3000 W laser power: welding speed of (**a**) 1.5 m/min; (**b**) 2.0 m/min; (**c**) 2.5 m/min.

### *3.3. Weld Quality Prediction Model*

To predict the weld quality, a DNN model was used as the prediction model. As shown in Figure 10, we modeled a neural architecture, as a seven-hidden-layer DNN, and assigned 256 neurons to each of the hidden layer. The neurons of every preceding layer were fully connected, to those of the succeeding layer. The eight values, which were the average and standard deviation of the RGB values and the maximum wavelength, were used as the inputs to the network (see Nomenclature). Especially, considering the weld size and speed of welding, the model was designed to predict the weld quality, per 0.5 mm of the weld length. The outputs are the four joint types, described in Section 2.3: unwelded (*Y*1), incomplete penetration (*Y*2), full penetration (*Y*3), and unwelded by a gap (*Y*4). The other specifications of the DNN implementation model is summarized in Table 5. All the hidden layers utilized rectified linear unit (ReLU) functions, to calculate their respective intermediate outputs. The output layer had four nodes, and the output layer with the Softmax activation function computed and returned the type probability with respect to each of the output types. The prediction of the weld quality, by the model, was determined based on the type probability. A total of 5400 data sets (4320 training sets and 1080 test sets) were used to generate the DNN model. Each dataset contained the given eight input variables, and four output variables. The backpropagation algorithms were carried out with a batch size of 50, with 500 epochs. Figure 11 shows the training results, including the cost, training accuracy, and test accuracy. After training, the cost value was calculated as 0.2806, the training accuracy was 0.8993, and the test accuracy was 0.9083.

**Figure 10.** Structure of the deep neural network (DNN) model to classify the weld quality.

**Table 5.** Summary of DNN model implementation.

To test the developed model, we produced 100 test datasets, for each class, by carrying out an additional welding experiment. Figure 12 shows the result of testing the developed DNN model using 400 test datasets, the confusion matrix and prediction result according to weld seam length. In Figure 12, the vertical and horizontal axes represent the predicted value of the DNN model and the data sequence, respectively. The four symbols, green, gray, red, and blue, represent the class to which each dataset belongs. It is seen that most of the errors occurred owing to the false prediction of *Y*2 as *Y*1. That is, 22 of the 100 datasets of class 2 (*Y*2) made false predictions, and among them, the 21 datasets were predicted as class 1 (*Y*1). Although *Y*1 and *Y*2 are divided into unwelded and incomplete penetration, respectively, in this study, *Y*1 and *Y*2 can be the same case, which is not full penetration. In particular, in the lap joint configuration of the two same metal sheets, if the penetration depth is less than 50% of the sum of the thickness of the two sheets, the weld quality is classified *Y*1. If the penetration depth

is more than 50% but less than the sum of thickness of the two sheets, the weld quality is classified *Y*2. It is considered that this relationship between *Y*1 and *Y*2 causes this error. In addition, most errors occurred at the beginning of welding, which could be due to the relatively unstable spectral signal at the beginning of welding. In the case of *Y*4, 9 of the 100 datasets made false predictions. The errors, which occur, by predicting *Y*4 as the other classes, might be due to excessively irregular signal of *Y*4. In the case of *Y*3, there is no error in predicting the weld quality because its signal was stable and had a distinct distribution in the RGB space. In summary, the biggest prediction error was seen to have occurred in predicting *Y*2. This error could be explained by the relatively small amount of available training data needed to increase the prediction accuracy of *Y*2. That is, it is assumed that there were insufficient training data that otherwise could have made the quality prediction model more accurate in classifying *Y*2 and *Y*1. As presented in Tables 3 and 4, the range of the welding conditions in which the data for *Y*2 can be obtained is smaller than that of other classes, and these welding conditions exist in the range of laser power of 1500–2000 W. If sufficient training data is obtained through more detailed experiments in the same range of laser power, the obtained data can reduce the prediction errors by more clearly learning a prediction model the boundary of *Y*2 and *Y*1.

**Figure 12.** Verification results: (**a**) confusion matrix; (**b**) prediction result according to data sequence.