1 Introduction

For applications such as automotive and aerospace engineering, polymer gears have unique advantages over metal gears: low cost and weight, high efficiency, quietness of operation, functioning without external lubrication, etc. The performance of 3D printed gear has been investigated previously. According to Ye et al. [1], 5 different 3D printing nylon materials have been compared; result shows Nylon 618 has outstanding performance compared with other nylon materials, including 23% carbon fibre reinforced nylon filament. There are many investigations into the characteristics of wear and thermal behaviour of injection-moulded gears. Mao et al. [2] carried out an analysis of the friction and wear behaviour of acetal and nylon gears including characterising the failure mechanism and thermal analysis. The results showed the operational time of polymer spur gears under different circumstances. Hu and Mao [3] investigated the effects of different misalignments on the fatigue of polymer gears during use. Hooke et al. [4] proved that increases in the surface temperature can dramatically increase the wear rate of the gear tooth. Moreover, Gauvin et al. [5] carried out an investigation into the maximum surface temperature experienced by polymer gears without lubrication. Mao et al. [6] introduced a new method to predict the surface temperature of acetal gears and found the correlation between fatigue life and tooth size. Additive manufacturing (AM) and 3D printing processes have become increasingly popular; the applications of 3D printing are usually suitable for relatively low production volumes, small size parts and complex designs. It is generally understood that 3D printing is cost effective if production volumes are below 1000 units in comparison with plastic injection moulding [7]. The technology has been applied in wide range of industries, including the automotive industry, aerospace, medical and architectural [8]. There was limited research on dynamic performance of 3D printed polymer parts; however, there are several investigations regarding the parameters which affect the mechanical and thermal properties. Chacon et al. [9] has investigated the effect of process parameters on mechanical performance of PLA in terms of on-edge orientation, layer thickness and feed rate. It has been shown that higher printing speeds can increase the mechanical performance of printed parts. Giovanni [10] carried out Taguchi’s experimental design for fatigue analysis of PLA and claimed that infill percentage had the most influence on fatigue life. Kuznetsov et al. [11] claimed that printing temperature and printing speed could dramatically dominate the mechanical properties of the 3D printed part. Moreover, the thermal conductivity of 3D printing filaments can also affect the properties of the object [12], increasing or decreasing the bonding quality between each layer during fused deposition modelling [13, 14]. In order to understand the complicated interplay between these different process parameters and to select the most appropriate parameter set for the production of 3D printed gears, a multiple regression process is required.

There was very limited research regarding of machine learning associated with predicting performance of gears and only some on its application to 3D printing processes. Fracture behaviour of 3D printed material has shown dramatically different compared with other materials [15]. Deng et al. [16] introduced optimisation methods to the multi-factor printing of a ceramic slurry by using artificial neural networks. Koeppe et al. [17] used neural networks to analyse load distribution in 3D printed lattice cell structures. Delli and Chang [18] used supervised machine learning to do real time monitoring of 3D printing to eliminate printing time and waste. Those research reports have provided valuable results in terms of static force analysis and monitoring of the 3D printing; however, dynamic analysis of 3D printed parts require further investigations. Li et al. [19] has introduced a method using support vector machine to predict dynamic contact characteristics for helical gears. Sun et al. [20] used neural networks to optimise and predict a gear hobbing process to improve the efficiency and reduce the cost. Sun et al. [21] used artificial neural networks and support vector machines with genetic algorithms to monitor the faults in gears. To find the correlation of 3D printing process parameters and dynamic performance of polymer gears would be a significant benefit to researchers both in the fields of 3D printing and gear manufacture to increase the efficiency of the 3D printing process and quality of the resultant 3D printed spur gears.

Performing multi-parameter regression has many challenges, for example missing data and data noise, as well as high dimensionality which impacts the ability to identify the relations between parameters [22]. Through ordinary mathematical solutions, it is computationally complex to solve multi-target modelling, and targets often may not correlate. However, by using some baseline methods, such as Gaussian processes, neural networks or support vector machines, the complexity of the problem can be much reduced [23].

2 Methods and experiments

All 3D printing parameters were set as default and printed with manufacturer-recommended printing temperature (250 °C), bed temperature (30 °C) and speed (45 mm/s) apart from infill percentage, which was set to 60% for both printer systems. Under initial setting which printing temperature was 245°C, printing speed was 45°C, infill percentage was 60% and bed temperature was 45°C gear running under 10 Nm torque and last around 16 h. There are several stages required in order to complete dynamic performance optimisation of 3D printed gears. First of all, the use of a Sobol sequence was employed to generate Sobol random parameters with multiple data points per parameter. The Sobol sequence is a low discrepancy quasi-random sequence. Using this method, a set of test data comprising of 50 points was generated, including a printing temperature range (230–275 °C), printing speed range (20–75 mm/s), infill percentage (20–80%) and bed temperature range (30–70 °C). Bed temperature refers to the temperature of printing surface which will affect the first few layers during printing. Infill percentage represents how ‘hollow’ the gear is, with the aim of reducing the infill percentage and hence reducing the weight and inertia during operation. Each parameter was increased by factor of one, for example printing temperature was increased from 230 to 275 °C and the Sobol sequence covers the entire range, hence there was a total of 45 data points for printing temperature. Figure 1 shows the specification of gears.

Fig. 1
figure 1

a 3D printed nylon gear cross section in simplified 3D. b Specifications of gears

Furthermore, by applying a similar range for each parameter, a small number of experiments could potentially provide insights into the complex combination of each test data category, roughly reducing a total of 45 × 45 × 40 × 60 = 5,940,000 possible combinations of 3D printing settings to a sample set of 50 chosen by the Sobol sequence. Gears were produced using an Ultimaker 3 extended fused deposition modelling (FDM) system. Gears were printed on a tufnol print surface due to superior adhesion between the nylon and tufnol, eliminating the peel off during the 3D printing process. A total of 100 gears were printed (50 matched pairs) with an average printing time of around 6 h per gear (depending on the setting of the parameters). After printing, gears were mounted on a gear wear test rig subject to the gear performance life cycle with 10 Nm torque. The tests included the recording of the wear occurring at the gear tooth and showed the different stages of gear operation until gear failure. The time from commencing the test run on the test rig until the gear failure was considered as the fatigue time. After acquiring the test data for the printed gears, the 3D printing parameters were used as input, and the corresponding gear life cycle data from test rig was used as an output to create a neural network model of correlations between input and output. The Gaussian process was also employed to perform multi-parameter regression to find out the approximate likelihood of output accuracy. By using the model generated by the artificial neural network (ANN) and GP, a subsequent sensitivity analysis was carried out to investigate the relations of each multi-parameter. The process was shown in Fig. 1. Table 1 shows the result of the tests via the different Sobol sequence settings.

Table 1 Input parameters generated by the Sobol sequence and output from test rig

2.1 Sobol sequence

The Sobol sequence is a method to sample data in a quasi-random sequence, in which data was selected in a uniformly random form. The Sobol sequence was first introduced by Russian mathematician I.M Sobol [24]. According to Savine, Sobol’s sequence could provide better evenness and higher speed to fill the space within a hyper cube [25]. Sobol’s sequence had over past 20 years of improvement of the algorithm to capable applied to high dimension. Hence, Sobol’s sequence became a best practice in different applications. Sobol’s sequence was generated with Sobol’s generator fitted in MATLAB; experiment data of each parameter was generated based on the algorithm of Sobol’s sequence. This code below creates 50 vectors (4 components in each vector), according to a 4-variate uniform distribution implemented (approximately) using the Sobol sequence. Each component in each vector is a number between 0 and 1. The command above produces a matrix ‘X’ that lines up each of the vectors as a column in the matrix X. There are therefore 50 columns and 4 rows.

$$ \mathrm{Temperature}=225+X\left(1,:\right)\ast 50 $$

This takes the first component of each of the 50 vectors and rescales it to get a temperature input value (between 225 and 275 K). Basically, use the first row X(1,:) of X.

$$ \mathrm{Speed}=20+X\left(2,:\right)\ast 50 $$

Same as above but use the 2nd row X(2,:) of X to get the printing speed values (between 20 and 70 rpm).

$$ \mathrm{BedT}=10+X\left(3,:\right)\ast 50 $$

3rd row X(3,:) of X to get the bed temperature values

$$ \mathrm{Infill}=20+X\left(4,:\right)\ast 50 $$

4th row X(4,:) of X to get the infill values

$$ \mathrm{Input}\left(:,1\right)=\mathrm{Temperature}^{\prime } $$

Create a matrix called ‘Input’ and make the first column as the 50 temperature values by typing the above (you need to transpose the vector of temperature values by using a prime, i.e. ′).

$$ \mathrm{Input}\left(:,2\right)=\mathrm{Speed}^{\prime } $$

Second column of input is the speed value.

$$ \mathrm{Input}\left(:,3\right)=\mathrm{BedT}^{\prime } $$

Third column of input is the bed temperature values.

$$ \mathrm{Input}\left(:,4\right)=\mathrm{sInfill}\hbox{'} $$

Fourth column of input is the infill values.

2.2 Test rig

The test rig was designed to test the gear wear whilst the gears were meshed and running. Details of the test rig employed have been discussed in previous paper [1, 2]. 3D printed gears can be tested in much the same way as metal gears, using a back to back test configuration where the gears are loaded by winding in the torque to a prescribed level [2]. A torque of 10 Nm was added to the gears, with each test gear operated until failure. A motor was used to drive gears with an externally applied torque, with the reaction force between gear teeth were equivalent to the bearing block and loading arm (Fig. 2). This loading method permits large amounts of wear without significantly affecting the applied torque (Fig. 3).

Fig. 2
figure 2

Schematic of 3D printing optimising process

Fig. 3
figure 3

Schematic of wear test rig

2.3 Artificial neural networks

Artificial neural networks simulate the physiological structure and mechanism of the human brains in order to solve complex problems. It is a machine learning process which is distinctly different from common methods such as signal reasoning and logical thinking approaches [26]. ANN is an appropriate method for solving incomplete associative memory, defect characteristic pattern recognition and automatic learning [27]. There are three main reasons that ANN was selected for this research; first of all, the calculation speed of the ANN is significantly computationally cheaper than other methods [28]. Secondly, ANN has strong fault-tolerant ability to minimise the uncertainty during the experiments. Thirdly, ANN is adept in addressing problems with multi-parameter regression, which is hard to solve with purely numerical methods [29]. Back-propagation (BP) training algorithm is the most frequently used ANN training method [30].

2.3.1 Back-propagation networks

The principles of the back-propagation networks

The detailed stages of BP training method are the following: (1) The sample data for training are input to the network. (2) Data moves forward from input stage to each hidden layer until the output stage, then the output data is generated. (3) The difference between input data and output data is compared, and if the differences are larger than expected, they will be transferred back to the hidden layer. (4) The weight of each neuron is adjusted based on the deviation via the steepest descent method that means calculating the minimum value (maximum value) of the loss function along the gradient descent (ascent) direction and the deviation transited to the input layer. (5) The value proceeds forward again and after repeated iteration; the error constantly diminishes. (6) The training process is over when the gap between the input value and output value is smaller than the expected value.

Figure 4 shows the structure of the ANN model. The ANN model in this paper was carried out based on MATLAB neural network toolbox. Moreover, there is a loop fitted in the model aimed to select optimised hidden number of neural from 1 to 20. Result shows 5 hidden sizes providing less error. The ANN model in this paper is composed of 4 input layer nodes, 5 hidden layer nodes and 1 output layer nodes. The initial parameters of ANN, such as the connection weights between input layer, hidden layer and output layer, and threshold value of hidden layer and output layer have large influence on the predictive performance. Due to the small number of training data, best validation performance could occur at epoch 1 as shown in Fig. 5.

Fig. 4
figure 4

Schematic structure of ANN model

Fig. 5
figure 5

Performance validation of ANN

2.4 Genetic algorithm

For the traditional ANN predictive models, without combining optimization algorithms, the initial parameters are determined randomly, which is inefficient or prone to converging to local optima, slow convergence speed, overtraining, subjectivity in the determining of model parameters and often pose a convergence problem [31]. The optimised algorithm GA is able to optimise the initial parameters of machine learning models to increase the estimating accuracy and accelerate the convergence speed of the ANN models [32, 33].

Genetic algorithm (GA) is a parallel random search optimisation algorithm to simulate the genetic mechanism of natural GA, and biological evolution GA can conduct efficient heuristic search and parallel computing [34]. It introduces the biological evolutionary principle of ‘survival of the fittest’ in the coded tandem population formed by optimisation parameters and chooses individuals according to the fitness function of the individuals and the operations of selection, cross and mutation to make the individuals with high fitness value be retained; the individuals with low fitness be eliminated [35]. The new generation would inherit the information of the previous generation and be superior to the previous generation. This iteration is repeated until the predetermined expired criterion is met [36].

The basic operations of the GA are divided into:

2.4.1 Select operation

The selection operation refers to the selection of individuals from the old generation to the new generation [37]. The probability that the individual is selected from the old generation to the new generation is related to the fitness value of the individual. The better the individual fitness value, the higher the probability of being selected [38].

2.4.2 Cross operation

The cross operation refers to the selection of two individuals from the old generation to produce new individuals by randomly exchanging and combination of the chromosomal locations of the two old individuals [39].

2.4.3 Mutation operation

The mutation operation refers to the selection of an individual from the old generation and choosing a point in the chromosome of the individual to mutate to produce a new individual. The basic process of GA is shown in Fig. 6.

Fig. 6
figure 6

Schematic of GA process

The detailed method of applying GA in improving the performance of ANN is following: the GA is used to optimise the initial parameters of ANN. Each particle in GA contains all information of the initial parameters of the ANN model. According to the fitness function of the individuals and the operations of selection, cross and mutation to make the individuals with high fitness value be retained, the individuals with low fitness are eliminated. This iteration is repeated until the predetermined expired criterion is met. The initial parameters of the particle with the highest fitness are assigned to the ANN model. The objective function (fitness function) is the R-squared. The crossover coefficient of the GA algorithm is 0.2, the mutation coefficient is 0.2, the size of population is 100 and the maximum iteration number is 100.

2.5 Leave-one-out cross validation

Leave-one-out cross validation is a method which evaluates the performance of a machine learning algorithm, which in this case is an ANN. As a technique, it can increase the prediction accuracy by increasing the training data point to and decrease the test data point to 1. Hence, leave-one-out cross validation could eliminate the randomness of dividing instances into for training and testing. By changing the ratio of training and testing of AAN, it could maximised the training algorithm to provide a better understanding of model and clearer pattern of the Sobol sequence [40]. Due to the small amount of data, it is workable to maximise the number of the training data.

2.6 Garson’s algorithm

Based on the established machine learning models, the sensitivity analysis of the input parameters is conducted by adopting Garson’s algorithm. In 1991, Garson proposed Garson’s algorithm [41, 42], later modified by Goh, for determining the relative importance of the input parameters to the output parameter [39, 41, 43], the equation of Garson’s algorithm is shown in Eq. 1; the results of the sensitivity analysis by using Garson’s algorithm is shown in Fig. 9.

$$ {R}_{\mathrm{ij}}=\frac{\sum \limits_{j=1}^L\left(\left|{W}_{ij}{W}_{jk}\right|/\sum \limits_{r=1}^N\left|{W}_{rj}\right|\right)}{\sum \limits_{i=1}^N\sum \limits_{j=1}^L\left(\left|{W}_{ij}{W}_{jk}\right|/\sum \limits_{r=1}^N\left|{W}_{rj}\right|\right)} $$

where Rijis the relative importance of input parameters, Wij,Wjkare the connection weights of the input layer hidden layer and the hidden-output layer, i = 1,2….N, k = 1,2….M (N and M are the numbers of the input parameters and output parameters).

3 Result and discussion

Figure 7 shows the performance of each model fitting with original test data. Figure 7a shows the linear fitting between the ANN model and test data given a Pearson product-moment correlation coefficient of 0.85326 and R square of 0.728. It shows high correlation related to the original test data [44, 45]. However, to optimise the performance, it is possible to increase the accuracy of the prediction model. Hence, the GA-based ANN (Fig. 7b) has been applied to the model which yields closer agreements between the measured and predicted values of gear fatigue time. R2 increases from 0.728 to 0.8 when the GA is applied; moreover, Pearson’s r increased by nearly 5%. This result could be explained by the fact that the proposed ANN-based predictive model accuracy in this case was increased with GA optimisation. Furthermore, the initial target was to achieve an R-squared value greater than 0.9; hence, the GA-based ANN can provide a relatively satisfactory result. However, optimisation and prediction accuracy can be further increased by applying leave-one cross validation.

Fig. 7
figure 7

Performance result fitted with test data

Figure 4c shows the model applied with both GA and leave-one cross validation, Pearson’s r and R2 dramatically increase from 0.83 to 0.97 and 0.728 to 0.956, respectively. Hence, a model with applied leave-one cross validation was selected as the final model to carry out further analysis.

Figure 5 shows the result of optimisation performed by GA, which is used to optimise the ratio between ω and δ in order to improve the accuracy of the ANN. The solid plot represents the average error corresponding to the real test data. In the GA optimisation process, 200 iterations were selected due to the decrease in computational time and convergence towards an optimised solution. Each iteration has a population of 50. The plot on the solid line represents the average error corresponding to the test data, and the dotted line represents the best fit corresponding to the test data from the wear test rig. It is shown that average error was decreased from around 23 to 10%; moreover, best fit was improved from 10 to less than 5%, respectively. Hence, it can be shown that applying GA can increase the efficiency and accuracy of the ANN regression model (Fig. 8).

Fig. 8
figure 8

Optimisation process of GA on weight ratio of ANN

Figure 9 shows the comparison of the prediction of each model and test performed by wear test rig. Compared with evaluation methods such as Pearson’s r and R-squared, it is shown that leave-one cross validation applied to the GA-based ANN model provides better accuracy compared with a conventional ANN model and the GA-based ANN model. Hence, as a result, leave-one cross validation applied to the GA-based ANN model can provide an efficiently and relatively accurate model to carry out the prediction of performance of 3D printed nylon spur gears with different manufacturing parameters.

Fig. 9
figure 9

Performance of different models compared with test result

The model reveals (Fig. 10) that printing temperature contributes to the performance of a printed gear by around 22% in terms of weighting. Printing speed has around a 23% influence on the performance. Bed temperature contributes an 8.6% influence on the final result, showing a reduced importance compared with the rest of the parameters. Hence, by using Garson’s algorithm, it is possible to identify the most influential parameter regarding gear performance is infill percentage. Conceptually, this result makes sense as it is possible that by increasing infill percentage, the rigidity of gear under loads is increased.

Fig. 10
figure 10

Sensitivity response contributes to result

In order to explore the power of the model in predicting optimal gear performance and outputting the 3D printer parameters required, a simulation was carried out. Figure 8 shows the simulation of 14,256 combinations of different parameters. In this simulation, printing temperature is increased from 230 to 275 °C by 5 °C each step. Hence, there are 10 data points created for printing temperature instead of 50. Printing speed was increased from 20 to 75 mm/s by 5 mm/s each step. Hence, there are 12 data points generated. Bed temperature is increased from 30 to 70 °C with 5 °C each time, with 9 data points required for the analysis. Infill percentage was increased from 20 to 80%, with 12 data points. As mentioned earlier, there are more than 5 million combinations that could be used in generating test input data; however, errors in the 3D printing process and errors in the test rig could counter the tolerance of the setting, hence a gap between parameters by factor of 5 could provide relatively accurate results. Simulation was carried out by leave-one cross validation–applied GA-based ANN model. Simulation number 7532 showed 52.07 h of potential gear performance with 3D printer settings of a printing temperature of 250 °C, printing speed of 70 mm/s, bed temperature of 25 °C and infill percentage of 80% as shown in Fig. 11.

Fig. 11
figure 11

3D printing process optimisation by ANN simulation

Validation of this model result was performed by producing a 3D printed gear using the same settings suggested by the ANN optimisation. A total of 5 pairs of gears were printed and tested on the wear test rig, with the results shown in Fig. 12. The results showed that the 5 tests yielded an average performance of 51.46 h, which was very close to the ANN simulation value of 52.07 h. Hence, optimisation simulation could be considered as a valid simulation.

Fig. 12
figure 12

5 tests using optimisation setting for 3D printed gears

Previous paper has carried out the analysis of 5 different nylon 3D printing materials. There are 5 different materials that have been printed and tested including Nylon 618, Nylon 645, alloy 910 onyx and Markforged nylon filaments. Nylon 618 3D printed gear provided best wear performance among 5 different 3D printing filament materials. Research shows that the different mechanical performance between nylon filaments was caused by differences in crystallinity and uniqueness of the FDM process. Another outstanding behaviour of Nylon 618 was shown in SEM (scanning electron microscopy); result shows dramatically different wear behaviour for the 3D printed gears when compared with the literature reports of injection-moulded gears. Furthermore, Nylon 618 material has outstanding thermal performance of gears during wear tests and together with SEM, which was used to analyse gear failure mechanisms. The performance results showed that gears 3D printed using Nylon 618 actually performed better than injection-moulded Nylon 66 gears when low to medium torque was applied. Associating with the result of optimal 3D printer setting, it is believed that by improving the manufacturing procedure, the performance of Nylon 618 was further enhanced. By applying machine learning method to manufacturing 3D printed gears could dramatically increase the mechanical behaviour of 3D printed part in a highly dynamic criterion.

4 Conclusion

In this paper, a set of experimental data has been designed by the Sobol sequence, providing relatively higher tolerance and covering a much larger range of input data with minimal test data being required. Four 3D printing parameters were selected via specific requirements of polymer gears which require rigidity and light weight. A prediction model of 3D printed gears has been carried out with three models including an ANN model, a GA-based ANN model and a leave-one cross validation–applied GA-based ANN model. The results show that all models provide relatively accurate predictions and provide satisfactory fitting to the test data. A leave-one cross validation–applied model provides the strongest correlation with test results, with Pearson’s r equal to 0.97 and R2 equal to 0.956, respectively. Moreover, by simulating an experiment, the printing parameters have been optimised to increase the performance of the 3D printed polymer gears. The results suggest an optimised setting of the 3D printer as follows: printing temperature is equal to 250 °C, a printing speed of 70 mm/s, a bed temperature of 25 °C and the infill percentage is 80%. The operational time of the resultant 3D printed polymer gear was increased more than 3 times compared with the gears produced using the default print settings. Sensitivity analysis performed by Garson’s algorithm indicated that infill percentage has the most influence on the performance of a 3D printed gear, and bed temperature has the least influence on the test result.

5 Limitations and future scope

Due to the unique characteristic of the ANN process, true correlation between each parameter was not fully studied. Moreover, more data points added to the model could increase the accuracy of the simulation. There are several possible directions based on this research. Firstly, to carry out the study of the polymer molecular structure to explain the influence of different parameter settings. Secondly, to investigate several other 3D printed materials in order to understand the correlation between different materials and creating model to predict the performance of gears produced by using different materials and elicit the required print parameters.