Introduction

Cold spray (CS) has attracted significant attention and has been widely employed in industrial applications. It is a materials deposition technology that preheats and leads a high-pressure gas jet into a converging–diverging de Laval-type nozzle. Here, gas and powder particles are accelerated to supersonic velocities (500-1000 m/s) and cooled down to temperatures that are typically around room temperature or even lower (Ref 1). This process enables a solid-state deposition by the kinetic energy of the particles without melting. It fabricates coatings with unique properties that are difficult to achieve by conventional thermal spray technologies (Ref 2). The characterizations of cold-sprayed coatings, such as homogeneous structure, high density and purity, notable cohesive strength, and high deposition rate, provide the ability to manufacture large components (Ref 3). This permits CS technology to be a novel additive manufacturing technology, i.e., cold spray additive manufacturing (CSAM).

However, from the perspective of industrial applications, the CSAM technology has not yet become a mature commercial technology by considering several fundamental and practical problems. Precise profile control is one of the practical challenges. It facilitates the construction of near-net-shape components and reduces property variation caused by component profile, for instance, residual stress (Ref 4). Mathematic formulae, especially the Gaussian model, have frequently been used to simulate surface profiles in CS technology. A symmetric Gaussian distribution model was employed in modeling a single-track profile of cold-sprayed coating under different stand-off distances by Cai et al. (Ref 5). Thirty points were picked up from each coating profile to fit a Gaussian curve with a constant coefficient. The simulation result can only respond to different stand-off distances, which is inadequate to study the CS process comprehensively. Y. Zhang et al. employed Gaussian distribution to fit the coating profile on spheres with different scanning azimuthal angles to predict the coating thickness of a single-track profile (Ref 6). Nevertheless, these works mainly focus on single-track modeling, which supposes that the deposited surface is flat and ignores the interaction between layers. The study by Benenati et al. which used Tsui and Clyne’s progressive coating deposition model to predict the profile of the residual stresses through the thickness of the deposition proves that the interaction between layers should be considered (Ref 4). The layer-by-layer build-up process of the CSAM component is not a numerical superposition of layers. The state of the previous profile will influence the deposition process of the later track.

Apart from mathematic fitness, numerical simulation has also been used frequently to investigate the coating build-up process in CS. C. Chen et al. developed a 3D finite element analysis (FEA) model to simulate the transient coating build-up process and the heat transfer under the influence of robot trajectory and different operating parameters in CS (Ref 7). A numerical model based on Gaussian distribution was constructed by Wu et al. to evolve a 3D geometric profile in real time to predict and evaluate the influence of the ‘shadow effect’ in CS (Ref 8). A Gaussian distribution model was also embedded in offline programming software to simulate coating thickness based on kinematic data by Chen et al. (Ref 9). Tzinava et al. developed a simulator based on MATLAB, which can deal with arbitrary geometry through triangle meshing and predict the coating thickness by calculating thickness value with each elementary triangle in the form of interpolated lookup tables (Ref 10). Although numerical simulation provides a model to predict as-sprayed coating thickness in CS, it fails to study the layer-by-layer deposition process and the interaction between layers. Therefore, a deposition model with a new approach to predict multi-layer profiles with acceptable accuracy is necessary.

With the rapid development and broad application of artificial intelligence in various fields, one of its categories, artificial neural networks (ANN), has emerged in thermal spray technologies. An ANN model is a computing model that can self-regulate and fit various nonlinearities in a data series through training and learning, which results in obtaining high-quality and efficient optimal conditions for manufacturing processes (Ref 11). The ANN model has been widely employed to predict coating properties and optimize the spray process in air plasma spray (Ref 12,13,14), high velocity oxygen-fuel spray (Ref 15, 16), and arc spray (Ref 17). Meanwhile, less attention has been focused on researching CS or profile control via the ANN model. D. Ikeuchi et al. presented an ANN model to predict both symmetric and asymmetric single-track profiles, which provided fundamental research to improve geometric control for CSAM (Ref 2). However, to develop CS as a mature commercial AM technology, the study of multi-layer profiles is of great importance. A comprehensive prediction of multi-layer profiles will benefit the fabrication of complex components with less post-machining and promote the application of CSAM in industrial applications.

In summary, this paper is dedicated to introducing an ANN model to describe and predict the complete track of the multi-layer profile of cold-sprayed deposits on different substrate morphologies. The remainder of this paper is organized as follows: “Experimental Procedure” section introduces the experimental procedure; “Development of ANN Model” section illustrates the data processing and the implementation of the ANN model; “Discussion” section presents and discusses the results of the experiment and predictions of the ANN model; and “Conclusions” section draws the conclusions for this study and gives perspectives on future work.

Experimental Procedure

Pure copper powder with near-spherical morphology and an average size of 26 μm was selected as feedstock in this study, the details of which are referenced by Wu (Ref 3). A grit-blasted aluminum plate was used as substrate. A homemade CSAM system, consisting of power sources, a high-pressure compressed gas source, a powder feeder, and a spray gun, was employed to carry out the CS experiments. An axisymmetric de Laval nozzle with an expansion ratio of 8.3 was applied in the system, as introduced in the reference (Ref 3). A six-axis industrial robot (ABB IRB2400, Sweden) was applied to realize the spray trajectory. A 3D profiler (LJ-V7060, Keyence, Japan) was used to scan the coating profile online and in real time. The 3D profiler was fixed at a distance of 60 mm from the measured surface. A laser line with a total length of 16 mm (intervals of 0.02 mm) was used to scan and obtain the profile data. The surface profile was measured five times, and the average was calculated as the final profile data.

With the above-mentioned experimental setup, fifty sets of CS experiments were conducted with different stand-off distances, gun traverse speeds, and numbers of deposition cycles. The stand-off distance varied from 20 to 40 mm, and the gun traverse speed from 20 to 100 mm/s. The number of deposition cycles was set from 1 to 10. The CS process parameters are listed in Table 1.

Table 1 CS process parameters

Development of ANN Model

An ANN model was developed to descript and predict the multi-layer profile of cold-sprayed coatings on different substrate morphologies. In this ANN model, the stand-off distance, gun traverse speed, number of deposition cycles, and substrate profile data were selected as inputs, while the coating profile data served as targets.

Data Processing

The first step in modeling is to collect and pre-process data for follow-up learning and training. A robust and sufficiently large database is essential for constructing a model that generalizes well (Ref 18). Based on the CS experiment, the coatings were deposited, and the profiles were obtained in real time by the 3D profiler. Every layer of coating was scanned during a deposition for measuring the profile on different substrate morphologies. The surface with i tracks serves as the substrate for the (i+k)th deposit profile (k is the number of the deposition cycle), as illustrated in Fig. 1. The initial profiles need to be trimmed to keep length identical (412 points, interval of 0.02 mm) as the number of effective points in each profile is different. On the premise of ensuring the ANN model’s accuracy, reasonable simplification is beneficial in reducing database scale, thereby reducing the ANN model’s scale. Hereafter, the average value of every two adjacent points in one profile was calculated, and a new profile was formed with simplified data. This treatment provides concise and efficient data for ANN training. As a result, 330 sets of profile data, each containing 206 points, have been collected and used for ANN modeling.

Fig. 1
figure 1

Schematic diagram of coating deposition process

The data required a linear transformation before being used for modeling. In this work, the data were normalized according to Eq 1 to fall into the range [− 1, 1] to avoid the calculation error related to different parameter magnitudes and ensure equal treatment from the ANN model during training and learning (Ref 18).

$$X_{{{\text{NORM}}}} = 2\left( {X - X_{{{\text{MIN}}}} } \right)/\left( {X_{{{\text{MAX}}}} - X_{{{\text{MIN}}}} } \right) - 1$$
(1)

where \(X_{{{\text{NORM}}}}\) is the normalized value; \(X\) is the real value; \(X_{{{\text{MAX}}}}\) is the maximum of the real value, \(X_{{{\text{MIN}}}}\) is the minimum of the real value.

Configuring the ANN Model

For the ANN model, the stand-off distance, gun traverse speed, number of deposition cycles (k), and 206 points of substrate profile were selected as inputs. The 206 points of coating profile served as targets. After normalization, the data were randomly divided according to the data division function of “dividerand.” It was then divided into three sets: a training set, a testing set, and a validation set, with the ratio of 70% (230 samples), 15% (50 samples), and 15% (50 samples), respectively.

The root mean square error (RMSE), which is defined by Eq 2, has been chosen as an indicator to evaluate the performance of models. It is for sure that the smaller the RMSE, the better the prediction performance.

$${\text{RMSE}} = \sqrt {\left( {{1 \mathord{\left/ {\vphantom {1 N}} \right. \kern-\nulldelimiterspace} N}} \right)\sum\limits_{i = 1}^{N} {\left( {e_{i} } \right)^{2} } } = \sqrt {\left( {{1 \mathord{\left/ {\vphantom {1 N}} \right. \kern-\nulldelimiterspace} N}} \right)\sum\limits_{i = 1}^{N} {\left( {t_{i} - a_{i} } \right)^{2} } }$$
(2)

where ti is the experimental result; ai is the predicted result; ei is the difference between the experimental result and the predicted result; N is the number of the data sets.

Indicator R indicates the relationship between the predicted result and the actual result, which has been selected to evaluate the regression performance of the model, as depicted in Eq 3. Usually, the higher the correct evaluation value R, the better the fitting result of the ANN model.

$$R^{2} = 1 - {{\sum\limits_{i = 1}^{N} {\left( {t_{i} - a_{i} } \right)^{2} } } \mathord{\left/ {\vphantom {{\sum\limits_{i = 1}^{N} {\left( {t_{i} - a_{i} } \right)^{2} } } {\sum\limits_{i = 1}^{N} {\left( {t_{i} - \overline{t}_{i} } \right)^{2} } }}} \right. \kern-\nulldelimiterspace} {\sum\limits_{i = 1}^{N} {\left( {t_{i} - \overline{t}_{i} } \right)^{2} } }}$$
(3)

where ti is the experimental result, ai is the predicted result, \(\overline{t}_{i}\) is the average of the experimental result, and N is the number of datasets.

Once the data have been allocated, the next step is to configure the network and conduct the training of the network. The number of neurons in the input and output layers was set as 209 and 206 neurons, according to the input and target numbers. However, there is no general rule to precise the number of neurons in the hidden layers. An ANN model with two-hidden layers was chosen in this paper, and the number of neurons in hidden layers was optimized and analyzed in “Discussion” section.

The training of the ANN model in this work was conducted in a supervised manner, using the backpropagation method in MATLAB (MathWorks, Natick, MA, the USA). The transfer functions, including the function from the input layer to the first hidden layer, the function between hidden layers, and the function from the second hidden layer to the output layer, were set as tansig, logsig, and purelin. Scaled conjugate gradient backpropagation (trainscg) was selected as the training function.

Discussion

Optimization of Neuron Numbers in Hidden Layers

In the ANN model’s structure, the neuron numbers in both the input and output layers are determined by the number of the network’s input and output variables. However, there is no general rule for determining the number of hidden layers and number of neurons in the hidden layers. Generally speaking, the number of hidden layers and the neuron number in the hidden layer are specified by considering the accuracy of the trained model and the complexity of the network structure. Higher accuracy with fewer hidden layers and fewer neurons in the hidden layer is expected. Several researchers have suggested that some formulae relate the neuron number in the hidden layer with the database size (Ref 19, 20). For instance, Guessasma (Ref 21) suggests that Eq 4 provided in reference (Ref 20) better describes the case with less of the database, which is estimated as explained in the following paragraph.

$$N_{{\text{H}}} \in \left[ {\frac{{N_{P} N_{{\text{S}}} }}{{N_{{\text{I}}} + N_{{\text{S}}} }}, \frac{{2N_{P} N_{{\text{S}}} }}{{N_{{\text{I}}} + N_{{\text{S}}} }}} \right]$$
(4)

where \(N_{{\text{H}}}\) is the total neuron number in the hidden layers, \(N_{p}\) is the database size, \(N_{{\text{I}}}\) and \(N_{{\text{S}}}\) are the input and output neuron size.

In the ANN model, the suitable neuron number in the hidden layers was estimated to be between 163 and 326. Therefore, 100×100 sets of training models, with 1–100 neurons (with an interval of one neuron) in the first hidden layer and 1–100 in the second hidden layer, were trained to optimize the architecture of the ANN model as shown in Fig. 2. It illustrates that the two-hidden-layer models with fewer neurons in the first or second hidden layer perform worse, particularly when the second hidden layer has fewer neurons. The simulation results indicate that a combination of 86 neurons in the first and 54 neurons in the second hidden layer, respectively, produces a relatively low RMSE value of 0.02209 in the ANN model. Due to the model’s relatively high accuracy and the reduced complexity of the network structure, the number of hidden layers and the number of neurons in the hidden layer for the models were selected to be 86 neurons in the first and 54 neurons in the second hidden layers. The number of neurons used in the ANN model (140 neurons in total) is less than the number estimated, which may contribute to the regular tendency of the coating profile.

Fig. 2
figure 2

Comparing the performance of the ANN model with different structures

The ANN model was trained, and the network generating the minimum error within the validation set was saved. An R of 0.9957 for the ANN model to predict the coating profile from the process parameters and substrate morphology was obtained. The training results demonstrating the comparison between the targets (T, experimental values) and outputs (Y, predicted values) of the ANN model is shown in Fig. 3. The line Y = T represents that the predicted outputs exactly match the targets. It is clear that all the data that stand for the coating profiles are dispersed around the line Y = T, which indicates that the trained results rightly fit with the targets.

Fig. 3
figure 3

The comparison between the output and the target of ANN model

Analysis of the Predicted Result on a Flat Substrate

Figure 4 shows the experimental and predicted results of coating profiles on a flat substrate. Figure 4(a1), (b1), (c1), (d1), and (e1) displays the experimental results. In practice, the general characteristic of CS deposits is that as the number of deposition cycles increases, the thickness of the coating gradually increases and becomes a typical triangular profile. The reasons have been described in previous reports (Ref 3, 8). Figure 4(a1), (c1), and (e1) shows that stand-off distance (SOD) impacts the height of coatings. The final coating height is 0.730 mm with a SOD of 20mm, 0.751mm with a SOD of 30mm, and 0.591mm with a SOD of 40mm. This phenomenon can be explained by the behavior of particle acceleration under different SODs. Many published studies have proved that SOD significantly affects critical particle velocity, which is one of the most important factors in coating formation (Ref 3, 8, 22, 23). This effect is directly reflected in the deposition efficiency and its thickness. Also, Fig. 4(b1), (c1), and (d1) shows that changing the gun traverse speed greatly influences the coating height. It can be seen that the height of the coating decreased from 1.291 mm to 0.591 mm as the gun traverse speed increased from 20 m/s to 40 m/s. Typically, gun traverse speed has no influence on deposition efficiency but the amount of material deposited per unit of time. The lower gun traverse speed means that the amount of material deposited per unit of time will increase, resulting in a higher coating height.

Fig. 4
figure 4figure 4

The experimental result (a1–e1) and predicted results (a2–e2) of coating profiles deposited on a flat substrate at (SOD = 20 mm, v = 50 m/s) (a1, a2), (SOD = 30 mm, v = 20 m/s) (b1, b2), (SOD = 30 mm, v = 50 m/s) (c1, c2), (SOD = 30 mm, v = 100 m/s) (d1, d2), and (SOD = 40 mm, v = 50 m/s) (e1, e2)

Figure 4(a2), (b2), (c2), (d2), and (e2) illustrates the ANN model’s predicted results, which show that the ANN model can give a precise prediction for forecasting coating profiles at different stand-off distances, gun traverse speeds, and numbers of deposition cycles. The coating profile’s formation tendency is exactly the same as the corresponding experimental result for the different process parameters. However, the predicted result is more symmetrical and demonstrates a more obvious layer-by-layer formation process as compared to the experimental result. It is notable that in some experimental cases, the substrate profile may be higher than the coating profile, which may attribute to two points. On the one hand, the substrate may be destroyed by the high-speed impact of particles. On the other hands, the measurement accuracy of the 3D profiler and the installation accuracy of the fixture may influence the profile data. The ANN model’s prediction eliminates this effect and shows an ideal coating formation process, which may be slightly different from the actual situation but will give a clear and simplified deposition process.

Analysis of the Predicted Result for a Curved Substrate

The deposition of the 10th cycle (deposit) on the 9th track (substrate), i.e., i = 9, k = 1, was selected as an example to analyze the ANN model’s prediction for a curved substrate with a single deposit. Figure 5 demonstrates the experimental and predicted results of coating profiles deposited on a curved substrate at different stand-off distances and gun traverse speeds. As shown in Fig. 5(b), the predicted profile rightly covers the experimental profile, producing an average relative error of 5.91%. It indicates the predicted accuracy of the ANN model is higher when the substrate is smoother. Figure 5(a) also displays a smooth substrate surface, but the measurement error, which occurred in the range of 0 mm < x < 1.12 mm, results in an average relative error of 9.66%. Although the substrate is rough, the ANN model is still accurate with a small average relative error of 4.89% when the deposit is regular, as proved in Fig. 5(e). It is interesting to see that the ANN model can offset the measurement errors in the experimental results. This is shown in Fig. 5(c), where the blue line (predicted result) is more likely to be the coating for the substrate than the red line (experimental result). It can be concluded that the detailed profiles predicted by the ANN model are in good qualitative agreement with the experimental profiles. Therefore, the ANN model succeeds in giving a prediction that can rightly reflect the ideal coating profile on curved substrates with a single deposit.

Fig. 5
figure 5

The experimental and predicted results of coating profiles deposited by one cycle on a curved substrate (i = 9, k = 1) at (SOD = 20 mm, v = 50 m/s) (a), (SOD = 30 mm, v = 20 m/s) (b), (SOD = 30 mm, v = 50 m/s) (c), (SOD = 30 mm, v = 100 m/s) (d), and (SOD = 40 mm, v = 50 m/s) (e)

Another example (i = 2, k = 4) was employed to examine the predicted result of the deposition of multi-cycles on a curved substrate, as illustrated in Fig. 6. It can be seen that the smoother the experimental curve, the better the predicted result, as shown in Fig. 6(c), where the average relative error is the smallest (5.18%). Similar to Fig. 5(c), the ANN model’s ability to offset the deviation of the experimental result caused by measurement error can be observed in Fig. 6(b). In addition, the predicted result appears to be the same curve after smoothing the experimental result, as displayed in Fig. 6(a), (c), and (d). Generally speaking, the ANN model yields an accurate prediction under different process parameters since the predicted curve fits well with the experimental result. Consequently, it can be summarized that the ANN model precisely depicts the deposition of multi-cycles on the curved substrate.

Fig. 6
figure 6

The experimental and predicted results of coating profiles deposited by multi-cycle on a curved substrate (i = 2, k = 4) at (SOD = 20 mm, v = 50 m/s) (a), (SOD = 30 mm, v = 20 m/s) (b), (SOD = 30 mm, v = 50 m/s) (c), (SOD = 30 mm, v = 100 m/s) (d), and (SOD = 40 mm, v = 50 m/s) (e)

Conclusions

An accurate prediction for depositing layer-by-layer coating is of importance for forming complex 3D shapes in CSAM. This study focused on data-driven ANN modeling to predict a multi-layer profile on flat and curved substrates. Instead of focusing on key features, as in previous studies, this paper employed a large amount of profile data to research the deposition process directly. The real-time measurement of coating profiles contributes to the construction of a large training dataset, enhancing the robustness of the ANN model. The number of neurons in hidden layers was optimized to yield the most suitable ANN model. Analysis of the optimized ANN model shows that the profiles predicted by the ANN model are in good agreement with the experimental one. The comparison between the experimental and predicted results proves that the ANN model enabled an accurate description of profiles on different substrate morphologies that will undoubtedly occur in CSAM. In conclusion, the proposed ANN model can predict multi-layer profiles with acceptable accuracy. Therefore, it can guide and improve profile control during CSAM to promote its application as a commercial technology.