Introduction

Hypoeutectic Al–Si alloys are the most preferred alloy group in aluminum alloys because of their properties, such as high strength, high corrosion resistance and easy processability. Moreover, due to the superior properties of these alloys, their usage in the automotive and aerospace industries is increasing continuously.1,2 To the improvement of mechanical properties, the fine and equiaxed grain structure is usually desirable in the aluminum castings. However, recent works show that grain size increases to approximately 4000 µm with increasing silicon content in Al–Si alloys.3,4,5 In the formation of such a structure, grain refinement plays a crucial role in the cast and wrought aluminum alloys. Besides, a small amount of grain refiner in the melting affects not only mechanical properties but also the stability of alloys.

Moreover, grain refinement contributes to reducing hot tearing risk, better at eliminating porosity and improving the ability to achieve a uniform surface.6,7,8,9,10,11,12,13,14,15,16 Nowadays, grain refinement has mostly been achieved by the addition of the master alloys such as Al–B or Al–Ti–B in a waffle or rod form in the casting industry.17,18,19 At the same time, new generation grain refiners such as Al–Ti–B–C and Al–B–Nb are reported,20,21,22 yet they have limited usage in the industry. Also, in recent studies, it has been reported that rare earth elements such as La and Ce refine the grain.23,24,25 However, effective grain refinement is mostly not achieved due to several reasons. First, the mechanism of grain refinement is still contradictory.26 Secondly, the amount of grain refiner addition is significant for economic reasons, because excess amount of grain refiner addition will lead to high costs which need to be optimized. Thirdly, holding time has a crucial role because the grain refinement effect is disappeared over time.14,27 Also, the temperature of grain refiner addition affects the grain structure.28 As mentioned above, effective grain refinement can be achieved, considering the significant number of parameters.

Today, economic advantages can be achieved in many industries with various optimization methods. One of these methods is artificial neural networks. ANN models have been developed to predict and optimize several properties of materials. This technique is used to construct a mathematical model and to establish a relationship between dependent variables and independent variables in solving complex problems in which linear relationships cannot be determined.29,30 Hassan et al.31 have studied hardness, density and porosity in SiC-reinforced Al-Cu alloys depending on the reinforcement ratio. In another study, Liao et al.30 investigated the effects of the addition of Si, Cu, Mg and Mn to aluminum shrinkage with different algorithms. Patel et al.32 compared the modeling results obtained from ANN and statistical regression analysis with experimental results and found that the results obtained from ANN were more compatible with the experimental results. Undoubtedly, one of the areas where artificial neural networks can be used is foundries. The casting process involves many stages that can be optimized in terms of time, energy and cost. It will be a great advantage to obtain the desired quality cast parts in a shorter time and economically by optimizing the grain refining applications, especially in aluminum casting processes. However, there are still a limited number of studies on this subject in the literature. In this study, various grain refinement parameters such as casting temperature, holding time and addition level, which are the critical factors affecting the quality of aluminum casting parts, were modeled by using ANN.

Materials and Method

Casting

For the experimental study, an AlSi10Mg alloy, which was received from Eti Aluminyum A.Ş (Konya, Turkey), was used. The chemical composition of the starting material determined using the Oxford-Instrument Spectral Analysis device is shown in Table 1. According to the table, the titanium ratio of starting material was observed as 0.012 wt%.

Table 1 Spectral Analysis Results of A360 Alloy

The alloy was melted in an approximately 1.5-kg capacity SiC crucible by using an electric resistance furnace. The alloy was poured in an open sand mold that was prepared by 2.5 wt % resin cured with CO2. The mold and casting geometry were designed, as illustrated in Figure 1a. The model dimensions are bottom diameter Ø35 mm, top diameter Ø40 mm and height 60 mm. Samples were poured directly into the open mold, as shown in Figure 1b.

Figure 1
figure 1

(a) Dimensions of the model, (b) Schematic illustration of the sand mold

Altair Inspire Cast casting simulation was used to calculate the solidification time of the sample. According to the simulation study, the solidification module of the sample was calculated as approximately 0.6 cm (Figure 2a), and the solidification time was calculated approximately 200 s (Figure 2b).

Figure 2
figure 2

(a) Solidification modulus, (b) solidification time of the sample.

Extruded rod type of Al5Ti1B master alloy was added into the melt, according to parameters in Table 2. The given addition level in Table 2 is the targeted Ti values. For example, for the addition of 0.30 wt. Ti %, 90 grams of Al5Ti1B extruded rod-type master alloy has been added to 1.5 kg of liquid metal, adding 4.5 g of Ti and about 0.9 g of B. Before pouring, degassing was carried out with dry nitrogen for 3 min. This process was repeated for each experimental parameter given in Table 2.

Table 2 Grain Refinement Process Parameters and Their Respective Levels

Then, the samples were cut 25 mm height from the bottom side. For the microstructure analysis, the samples were grounded up to 2500 grid using SiC paper followed by polishing using 50-nm alumina suspension. The grain size measurement was taken by using an optical metal microscope (Nikon Eclipse L150) with a Clemex Vision image analysis software according to the linear intercept method ASTM E112 standard, at different regions of each sample as shown in Figure 3 schematically.

Figure 3
figure 3

Schematic illustration of the grain size measurement.

Modeling with ANN

Artificial neural networks have a highly interconnected structure similar to the brain cells of human neural networks and consist of many simple processing elements called neurons arranged in different layers in the network. Each network consists of an input layer, an output layer and one or more hidden layers. One of the most important known advantages of ANN is that it can learn from the sample set called the training set. Once the network architecture is defined, weights are calculated to provide the desired output during the learning process.31 ANN operations include the steps of multiplying the input neurons defined in the input layer by the weights of the connections, connecting these neurons in the hidden layer and then passing them through an activation function to produce the hidden layer. The output of the latent neurons is multiplied again by the weights of the connections, connecting the hidden neurons to the output neurons and summed to produce an output that will pass through another activation function. This process is called feedforward.33 The mathematical expression of feedforward operation is given in Eqn. 1.

$$ Y = f\left( {\vec{X}.\vec{w} + \vec{b}} \right) $$
(1)

where Y is the output neuron, X is the input neuron, w is the weight assigned to the connection between the input and the neuron, b is bias, and f is the activation function. As can be seen from the information given above, the activation function is to be selected, and the number of neurons in the hidden layer directly affects the performance of the model.

The procedure used for the learning process in an artificial neural network is called an optimization algorithm. There are many different optimization algorithms. Each has different features related to the expected performance and numerical precision. In this study, the quasi-Newton algorithm has been used as an optimization tool.

The application of the Newton’s method can be time-consuming since it requires many processes to evaluate the Hessian matrix and compute its inverse. New approaches, known as quasi-Newton or variable metric methods, have been developed to eliminate such disadvantages. These methods generate an approach to the inverted Hessian where each iteration, instead of directly calculating Hessian, the algorithm repeats and then evaluates the inverse. This approach is only computed with information about the first derivatives of the error function. The basic idea behind the quasi-Newton method is to approximate the inverse Hessian with another G matrix (τ) using only the first partial derivatives of the loss function. Then, the quasi-Newton formula can be expressed as:

$$ w^{{\left( {\tau + 1} \right)}} - w^{\left( \tau \right)} = G^{\left( \tau \right)} .g^{\left( \tau \right)} .\alpha^{\left( \tau \right)} $$
(2)

where τ = (0,1,2…) is the steps of the weight vector, g is gradient, and τ is training rate, which adjusted here at each epoch using line minimization.34

If there are huge differences between the mathematical values of the experimental parameters used in an ANN model, calculation accuracy may not occur precisely. In such cases, the data are normalized before modeling. In other words, all data are scaled to be distributed between [0, 1] and [− 1, 1].35,36 Equations 3 and 4 were used for the normalization of the data used in this study.

$$ X_{N} = 2\frac{{\left( {x - x_{\hbox{min} } } \right)}}{{\left( {x_{\hbox{max} } - x_{\hbox{min} } } \right)}} - 1 $$
(3)
$$ X_{N} = \frac{{\left( {x - x_{\text{mean}} } \right)}}{{\left( {\text{StdDev}} \right)}} $$
(4)

In order to determine the best ANN model, it was aimed to reach the minimum mean squared error (MSE) value by performing experiments from 1 neuron to 10 neurons in the hidden layer with tansig, logsig and linear activation functions. Obtaining the minimum MSE value enables the ANN model to produce the most realistic results.37 The mathematical representation of MSE is given below.

$$ {\text{MSE}} = \mathop \sum \limits_{i = 1}^{n} \frac{{(a_{i} - f_{i} )^{2} }}{n} $$
(5)

where ai is experimental results, fi is ANN model estimation, and n is the number of data points used. Figure 4 shows the different activation functions and the number of different neurons obtained according to the MSE graph.

Figure 4
figure 4

Effect of different activation functions and neuron numbers on MSE.

According to Figure 4, the lowest MSE value was obtained from 2.06E−5 hyperbolic tangent activation function with six neurons. The network architecture is constructed according to these values, and an ANN model is created.

In this study, ANN architecture created by Neural Designer software is shown in Figure 5. According to this figure, casting temperature, addition level and holding time are defined in the input layer. In the output layer, the particle size, which is our experimental target, is defined. The hidden layer is designed to be a single layer and with six neurons.

Figure 5
figure 5

ANN architecture.

Results and Discussion

The microstructure image of AlSi10Mg alloy with and without grain refining is given in Figure 5. It is seen that grain size changes with different grain refining parameters. The grain structure of commercially AlSi10Mg alloy is coarse and predominantly consists of elongated primary dendritic structure (Figure 6a). This sample had been poured at 720 °C without any addition grain refiner and holding time. According to the measurements carried out in different regions of the sample, the average grain size was found to be around 3200 µm. With the addition of a small amount of grain refiner, grain size is reduced, as shown in Figure 6b. In the sample, the grain size was found to be 1390.7 µm by using parameters of the addition of 0.05% Ti at 720 °C and 45-min holding time. The average grain size was measured as 1160.6 µm in the sample performed by adding 0.10% Ti at 700 °C and 45 min of holding time, shown in Figure 6c. The microstructure picture obtained as a result of the experiment performed with 0.20% Ti at 680 °C and 20-min holding time is given in Figure 6d. In the measurements taken from different points of this microstructure, the average grain size was measured as 603.7 µm. When we compare Figure 6a, b, it is seen that the addition of Ti even in small amounts at the same casting temperature positively affects the grain size. However, if it is necessary to make an evaluation between Figure 6b, c, it is seen that the grain size decreases as a result of increasing the casting temperature and additional Ti amount during the same holding period, whereas, according to the literature, it is emphasized that the grain size increases with the increase in the casting temperature.28,38 This case shows that grain size cannot be examined depending on a single parameter.

Figure 6
figure 6

Grain structure micrographs of (a) without grain refiner, (b) 30 min after %0.10 Ti addition at 740 °C, (c) 45 min. after %0.05 Ti addition at 720 °C and (d) 20 min. after  %0.20 Ti addition at 680 °C.

Table 3 shows all the experimental parameters and the average grain size measurements taken from the experiments performed with these parameters. According to the table, there is no linear relationship between the experimental grain sizes. It is seen that different grain sizes are obtained at different parameters. Previous studies reported that grain refiner must be added at a certain limit to reduce the grain size, but it does not cause a significant change in grain size by adding grain refiner over this limit.9,39 In studies conducted on holding time, it was observed that the grain refiner lost its effect over time in the stationary crucible, and the minimum grain size was generally obtained at 20–30 min.40 Besides, by mixing the molten metal before casting, a certain amount of grain size reduction occurs.28,41 However, mixing is not possible in industrial applications and especially in the hot chamber pressure casting process.

Table 3 Experimental Parameters and Grain Size Results

On the other hand, the casting temperature after the addition of grain refiner into the molten metal is another parameter affecting the grain size. Samuel et al. reported in their study that the grain size increased with increasing casting temperature.28 Besides, it was observed that grain size decreased with increasing casting temperature in the literature.38

Figure 7 is a summary of the change in grain size according to the parameters obtained from experimental studies. This graph is obtained when a triple diagram is analyzed between the inputs and the output. One of the results obtained from Figure 7 is that the grain size decreases as the amount of grain refiner increases. The general description is the presence of Al5Ti1B master alloy in the melt leading to the formation of intermetallic phases such as TiAl3 and/or TiB2. On the other hand, according to Al–Ti phase diagram, 0.15 wt% Ti is a critical limit to let primary TiAl3 precipitate and act as a nucleation substrate for alpha-Al. A large number of intermetallic phases formed behave as heterogeneous nucleation centers and contribute to the refinement of the grain size. For this reason, it is expected that the grain size will decrease with the increase in the amount of grain refiner added. However, it has been reported that it does not contribute to decreasing the grain size after the amount of grain refiner exceeds a certain rate. Similar studies in the literature have found similar results for this alloy.9,42 Another significant result is that the holding time has positive effects on grain size for a certain period, while it loses its effect over a certain period. Also, it was found that the casting temperature had no significant effects on grain size, particularly in sand castings. In the literature, Wang et al.27 carried out grain refining experiments by adding Al5TiB and Al3B master alloy to Al-7Si alloy and determined that the grain size decreases until a certain amount of addition; however, as the amount of addition increases, the grain size does not change. Hu et al.30 investigated the change in grain size by adding AlTi, AlB and AlTiB to the Al-8.15Si-2.4Cu alloy and observed similar results to Wang.27 As the amount of Si increases in Al–Si alloys, TiAl3 particles surfaces are covered with titanium silicon, which prevents heterogeneous nucleation of α-Al dendrites. Li et al.43 suggested that the Ti–Si covalent bond, which may occur in TiAl3 2DC, can disrupt the lattice, thereby reducing chemical interaction with a-Al and preventing epitaxial nucleation. However, it is reported in the literature that an increasing amount of Al–Ti-B grain refiner contributes to grain refining by overcoming the poisonous effect of silicon, depending on the ratio of Si and Mg in the alloy.44 Birol45 indicated that Si poisoning is a function of the solidification range. Riestra et al.4 and Bolzoni et al.5 have worked with hypoeutectic Al–Si alloys. They observed that grain size increased due to increasing solidification time in the same compositions. In the light of all these data, especially when we examine the green-colored region in Figure 7, which contains the average grain size distribution, it can be said that the grain refining process is not accurate enough to be explained by a single parameter. Thus, grain formation and growth are a dynamic process depending on many parameters. In other words, if one parameter decreases the grain size, the change in another parameter may cause an adverse effect, causing the refining effect to be lost, vice versa.

Figure 7
figure 7

The effects of the parameters on the grain size.

The grain sizes obtained from the experimental studies were defined as the input to the system, as shown in Figure 4. After the network architecture was established, the network was trained to complete the learning process (Figure 8). The learning process aims to bring training and test errors to as close to 0 as possible at the end of the training cycles. The closer the value is to 0, the better the network is trained. In this study, at the end of 241 iterations, training error was decreased to 3,06e-8 and test error to 1,41.

Figure 8
figure 8

Network training process.

The mathematical model obtained as a result of the training of the neural network is presented as follows

$$ y1 = { \tanh }\left[ {\begin{array}{*{20}l} {0.912694 + (N_{\text{CT}} *0.87977)} \hfill \\ {\quad + (N_{\text{AL}} *0.177889) + (N_{\text{HT}} *3.35946)} \hfill \\ \end{array} } \right] $$
(6)
$$ y2 = { \tanh }\left[ {\begin{array}{*{20}c} { - 12,5671 + (N_{CT} *11,4191)} \\ { + (N_{AL} *9,31175) + (N_{HT} *3,5692)} \\ \end{array} } \right] $$
(7)
$$ y3 = { \tanh }\left[ {\begin{array}{*{20}l} {1.97756 + (N_{\text{CT}} *\left( { - 8.2731} \right))} \hfill \\ {\quad + (N_{\text{AL}} *12.9977) + (N_{\text{HT}} *\left( { - 2.45239} \right))} \hfill \\ \end{array} } \right] $$
(8)
$$ y4 = { \tanh }\left[ {\begin{array}{*{20}l} { - 18.1659 + (N_{\text{CT}} *\left( { - 6.56964} \right))} \hfill \\ {\quad + (N_{\text{AL}} *4.06615) + (N_{\text{HT}} *\left( { - 22.0254} \right))} \hfill \\ \end{array} } \right] $$
(9)
$$ y5 = { \tanh }\left[ {\begin{array}{*{20}l} { - 2.94493 + (N_{\text{CT}} *\left( { - 0.130788} \right))} \hfill \\ {\quad + (N_{\text{AL}} *16.5083) + (N_{\text{HT}} *0.709597)} \hfill \\ \end{array} } \right] $$
(10)
$$ y6 = { \tanh }\left[ {\begin{array}{*{20}l} {2.41605 + (N_{\text{CT}} *\left( { - 1.28989} \right))} \hfill \\ {\quad + (N_{\text{AL}} *0.0320112) + (N_{\text{HT}} *2.09307)} \hfill \\ \end{array} } \right] $$
(11)
$$ N_{\text{GS}} = \tanh \left[ {\begin{array}{*{20}l} {1.15005 + \left( {y1*2.57891} \right) + \left( {y2*\left( { - 0.268882} \right)} \right)} \hfill \\ {\quad + \left( {y3*1.19364} \right) + \left( {y4*1.40368} \right)} \hfill \\ {\quad + \left( {y5*\left( { - 1.51884} \right)} \right) + \left( {y6*\left( { - 2.202} \right)} \right)} \hfill \\ \end{array} } \right] $$
(12)
$$ {\text{GS}} = \left[ {0.5*\left( {N_{\text{GS}} + 1} \right).\left( {1641.43 - 362.88} \right) + 362.88} \right] $$
(13)

where the values starting with y are the output functions of each neuron in the hidden layer. NCT, NAL, NHT and NGS values are normalized of casting temperature, addition level, holding time and grain size data, respectively. In order to test the model, after we normalize the CT and HT values measured in test sample 17 according to Eqn. 3 and the RA value according to Eqn. 4, we place them in the corresponding places in Eqns. 611; then, y1, y2, y3, y4, y5 and y6 values are calculated as − 0.99, − 1, − 0.98, 0.99, − 1 and 0.42, respectively. When we place these values in Eqn. 12, the normalized grain size value is found to be − 0.31. Then, the grain size value estimated by using Eqn. 13 was denormalized and 806.23 value was found. ANN model estimation values obtained from all input data and comparison with experimental results are given in Table 4.

Table 4 Comparison of Experimental and Model Results

Then, 5 more experiments were carried out and the accuracy of the ANN model created was tested. Process parameters used in the verification experiment, grain sizes and ANN model estimation results are given in Table 5.

Table 5 Experimental Validations and Model Results

It is seen that in Table 4, the mean absolute percent error (MAPE) values were compared with experimental results, min deviation was 0%, max deviation was 9.87%, and mean deviation was 1.04%. When the results of the verification experiment in Table 5 are examined, the minimum deviation between the experimental results and the estimation results was found to be 0% where the max deviation was 3.81% and the average deviation was 0.76%. Another result obtained in ANN studies is the sensitivity analysis. Sensitivity analysis is a method used to evaluate the effects of independent variables on dependent variables.30,31,46,47 The sensitivity analysis results obtained in this study are given in Figure 9. According to these results, the effect of Ti addition level on the grain size was found as 40.5%, the effect of holding time on grain size was 36.6%, and the effect of casting temperature on grain size was 22.8%. Results indicated that the most effective parameter on the grain size is the addition of Ti content, and the least effective parameter is the casting temperature. This situation is also compatible with the literature.

Figure 9
figure 9

Effect of process parameters on grain refining performance.

Besides, another parameter controlled in ANN studies is also regression curves. It is concluded that the relationship between output and inputs is significant as the value of R2 calculated in the curve approaches 1 and that there is a random relationship when it approaches 0. As illustrated in Figure 10, the R2 value obtained in this study was calculated as 0.992.

Figure 10
figure 10

Comparison of experimental grain size with grain size estimated by ANN model.

Conclusions

In this study, the effects of parameters such as casting temperature, grain refiner addition level and holding time on grain size and modeling with the ANN technique in AlSi10Mg aluminum alloys were investigated. The results obtained are as follows:

  • The best results were obtained at 680 °C casting temperature, 0.25 wt % Ti addition, 25-min holding time. Furthermore, after 25 min, grain size increase was observed. This is due to the sedimentation of TiB2 particles in the liquid over time, called the fading effect.

  • Experimental parameters used in grain refining give linear results in some instances, but in some cases seem to be meaningless. This case reveals that the grain refining process is a dynamic process that is dependent on multiple parameters that can vary at the same time.

  • As a result of the sensitivity analysis, it was determined that the amount of grain refiner is the most effective parameter in grain refining processes. However, it was determined that the parameter that has the least effect on grain refining is the casting temperature.

  • As a result of ANN, an average difference of 0.99% was found between experimental measurements and model estimation. The R2 value was calculated as 99.2%. This rate is quite good. This shows that the ANN approach can be used effectively in solving complex problems in which the effect of multiple parameters on the result will be examined.

  • Both the amount of grain refiner, addition temperature and holding time are critical for foundry operations. At this point, the use of ANN in today’s competitive industry is undoubtedly the fact that it will save time and economy for the enterprise.