1 Introduction

Machining processes are paramount to the manufacturing industries worldwide and play a pivotal role in shaping and finishing components to achieve precise specifications. Turning is one of the most widely utilized techniques among these processes, owing to its versatility and efficiency [1]. However, the quality and performance of machined components are significantly influenced by the induced residual stresses during the machining process [2, 3].

Residual stress adversely affects carbon steel’s fatigue strength, dimensional stability, and durability [4]. Understanding the factors influencing residual stress generation and effective mitigation strategies is crucial for optimizing the machining process and enhancing the reliability of steel components for engineering applications. Various factors contribute to residual stress formation, including tool geometry, cutting parameters, material properties, and cooling conditions [5, 6].

During turning, the cutting tool applies forces and heat to remove material from the workpiece, leading to localized plastic deformation and thermal expansion, which induces residual stress near the machined surface or beneath. The intensity and distribution of induced stresses depend on tool and workpiece material properties and turning parameters when machining carbon steels [7, 8].

A part of enhancing the quality of machined engineering parts is the development of cost-effective computer-based models to predict residual stresses that are likely to be induced based on the input parameters. Many researchers have proposed the finite element (FE) method as a potential solution for machining residual stresses because of its ability to model material properties and optimize cutting parameters [9, 10]. X-ray diffraction and hole drilling are some of the experimental approaches most used in measuring residual stresses; however, they are expensive and time-consuming. The FEM method is an alternative, cost-effective method that researchers are working on to enhance material analysis and machinability. Through finite element modelling, residual stresses can be analyzed with the help of adaptive meshing of the model using software such as ANSYS, Simulia, and Deform. The Johnson–Cook model is widely applied in the simulation process for material modelling.

Many researchers have modelled residual strategies and optimization approaches using 2D and 3D finite element models to improve the quality of machined products. For instance, Attanasio and Ceretti [11] researched the 3D FEM of the residual stresses on the external surface of AISI 1045 steel. The effects of the workpiece material’s feed rate and tool nose radius on the induced residual stresses were analyzed. Despite numerical errors, the simulation outcomes were utilized to establish analytical models and devise two nomograms for pinpointing process parameters that generate the anticipated external residual stress.

Jiang and Wang [12] conducted a finite element analysis to examine the impact of various wiper tool edge geometries on the hard turning of AISI 4340 steel. Their study explored how different tool geometries influenced the turning process, including cutting forces and surface integrity, providing insights into optimizing tool design for improved performance in hard-turning operations.

Most studies on the machining of steels have focused on the cutting parameters, tool material, and geometry, and the nature of the work material affects the development of tensile or compressive residual stresses [11, 12]. Nevertheless, there are still opportunities for advancing finite element models employing the updated Lagrangian formulation model and adaptive mesh approaches to improve the accuracy of the simulation results [13, 14].

Mondelin et al. [15] examined the residual stresses created by a longitudinal turning operation in 15-5PH martensitic stainless steel. The model was able to show the degree to which residual stresses were affected by the cutting speed, feed, tool geometry, and tool flank wear as process parameters. The tool shape and flank wear significantly impacted the residual stresses compared to the cutting speed and feed rate. A comparative analysis between the experimental and simulation results was not performed to validate the models.

Mohammadpour et al. [16] performed a numerical investigation to analyze the effects of turning parameters on residual stresses in orthogonal cutting. The study employed simulations to examine how different cutting parameters influence residual stress development. The simulation results aligned with experimental tests.

Outeiro et al. [17] conducted numerical modelling of residual stresses using the Finite element method to simulate the cutting process and predict the residual stress distribution in AISI 316L steel. The results of the experiments revealed that the cutting conditions significantly influenced the magnitude and distribution of residual stresses. Higher cutting speeds and feed rates increased compressive residual stresses near the cutting zone.

Ramesh and Melkote [18] conducted a study in which they utilized ABAQUS to simulate residual stresses in AISI 52100 steel machining using CBN tools. They researched using Johnson–Cook’s material model and Zorev’s friction model. The results of their study revealed that incorporating white layer formation in the simulation increased the accuracy of predicted residual stresses. The study emphasized the significance of considering material behaviour and surface effects for precise predictions.

Bouacha et al. [19] investigated the relationship between cutting forces and surface roughness in AISI 52100 steel hard turning. Using response surface optimization (RSM), they found that feed rate and cutting speed primarily affected surface roughness, while the depth of cut mainly influenced cutting forces.

Mabrouki et al. [20] explored machining simulations involving A2024-T351 and tungsten carbide. They employed the Johnson–Cook material model to capture material behaviour under high strain rates and temperatures typical of metal-cutting processes. Additionally, a Coulomb friction model simulated the interactions between the tool and workpiece, while the Johnson–Cook damage criterion accounted for material damage and failure prediction.

Dhengre et al. [21] studied WO-CO turning tool using the finite element method to predict tool life. They developed a simulation model using ANSYS software to assess von Mises stresses and residual stresses generated during machining. The study revealed the significance of cutting depth in machining and the effect of induced stresses on carbide tools.

The Taguchi method, response surface methodology (RSM), artificial neural network (ANN), and regression analysis are modelling techniques that can be used to determine the optimal machining parameters. RSM is the most widely used among these modelling techniques because it can yield reliable data with relatively few experiments. Using RSM, Bagaber [22] optimized the machining parameters to reduce surface roughness, power consumption, and tool wear. They performed this study on stainless steel 316 with an uncoated carbide tool under dry conditions. They found that cutting speed was the most influential factor for power consumption, with a 37.43% contribution. They also found that feed rate had the highest impact on surface roughness, with a 53.8% contribution.

Yingfei et al. [23] investigated the effects of cutting parameters and tool wear on the induced residual stress distribution in the axial and radial directions on the surface and subsurface of the workpiece during turning operations. Their findings underscore these factors’ significant impact on the alloy’s surface integrity and highlight the importance of carefully controlling cutting conditions to maintain optimal surface performance. In the same context, Brusch et al. [24] assessed how variations in process parameters influenced machinability characteristics, including tool wear and surface finish. They observed higher microhardness values for all cutting tests to characterize affected surface layers. Li et al. [25] conducted a finite element modelling and simulation study to examine the turning process while considering the cutting-induced hardening of workpiece materials. Their research focused on incorporating material hardening effects into the simulation to improve the accuracy of modelling the turning process, clarifying the effects of cutting-induced material property changes on machining performance for steel alloys.

The literature review reveals conflicting results for optimizing the cutting parameters. Many researchers have reported that the feed rate significantly affects residual stress [16,17,18,19]. Some authors have suggested that cutting speed is the most critical parameter for minimizing residual stress [20, 21]. Several studies have highlighted variations in residual stress values across different materials, machines, and cutting conditions using 2D models, indicating the need for further research in this area using 3D FEM models [26,27,28]. Using a finite element model, this research optimised the turning parameters during the longitudinal turning process for annealed AISI 1040 steel. The study was validated through experimental testing.

2 Materials and methods

A finite element 3D model of the workpiece material of diameter 40 mm and length 110 mm was simulated using Analysis systems (ANSYS 2018). The 3D models designed by Inventor Software 2018 were then converted into STEP Files for compatibility. The files were imported to the ANSYS (Explicit Dynamics) design modeller as STEP files, and the stepwise process illustrated in Fig. 1 was applied.

Fig. 1
figure 1

Finite element simulation flow process for ANSYS

Optical emission spectroscopy (OES) was used to measure the chemical composition of AISI 1040 steel presented in Table 1 to ensure the material conforms to standard specifications.

Table 1 Chemical Composition (Weight %) of AISI 1040 Steel Alloy

The mechanical and thermo-physical properties of the standard cutting tool (T1) are presented in Table 23. The properties of the T1 cutting tool were included in the modelling analysis of the work material in explicit dynamics in ANSYS 2018 to enable the accuracy of residual stress analysis.

Table 2 Mechanical properties of work material for modelling for AISI 1040 Material [32]
Table 3 Thermal and Mechanical Properties of high-speed steel (HSS) tool T1 [22]

Materials often exhibit changes in mechanical properties with temperature, such as variations in yield strength and thermal expansion coefficients. These changes influence stress distributions and deformation behaviour [34, 35]. Thermal effects can also induce or alter residual stresses due to differential expansion or contraction, impacting structural integrity. Modelling analysis must incorporate these temperature dependencies to predict real-world performance accurately and ensure reliable simulation results.

2.1 Boundary conditions and meshing

A finite element model for longitudinal turning of AISI 1040 steel alloy was developed using ANSYS software (2018). The model was meshed with approximately 40,000 quadrilateral elements, featuring four-node bilinear displacement and temperature characteristics. The tool was applied with a cutting speed in the circumferential direction of the workpiece. The mesh density varied based on the regions of the geometric model. A highly refined mesh (1-micron) was implemented along the contact area between the tool and workpiece and at the top of the machined material, but far from the interaction zone. The tool loadings minimally affected the workpiece, allowing for a coarser mesh at the bottom. Using the paving boundary approach, a 1-micron element size was chosen based on a detailed analysis of high-gradient regions, such as the tool-workpiece contact area. This involved defining the boundary’s edge length and setting a fine mesh to accurately capture geometric details and physical phenomena like stress and thermal gradients. A mesh convergence study was conducted, refining the mesh until key results stabilized at 1 micron, ensuring the accuracy of the FEM.

The 3D longitudinal cutting model was set to rotate about the centre axis, as shown in Fig. 2, while the cutting tool was modelled as a rigid body because it is stiffer than the workpiece. When the set-up was done, as shown in Fig. 3a, the workpiece model turned 360º, as illustrated in Fig. 3b.

Fig. 2
figure 2

Boundary conditions for 3D finite element model

Fig. 3
figure 3

a Model set-up, b actual cutting process

The tool was assigned a reference point to capture the forces generated, and the conditions were set at room temperature (23 °C) and normal atmospheric pressure. The governing finite element equations to be solved are as expressed in Eq. 1:

$$ MU + \ddot{U} + F(\ddot{U},time) = R(time) $$
(1)

where M is the mass matrix, C is the damping matrix, U is the vector of nodal displacements (including rotations), F denotes the vector of nodal forces equivalent to the element’s internal stresses, R is the vector of externally applied nodal loads, and an overdot denotes a time derivative. The force matrix (F) depends on the displacements and time, whereas the mass (M) and damping (C) matrices are assumed to be constant.

The mechanical modelling equations used in finite element methods are based on the balance of each element’s forces, moments, energy, and momentum and the constitutive relations that describe the material behaviour [36,37,38,39]. Depending on the type of problem and element. The equilibrium equation was applied to determine the sum of the internal and external forces acting on an element, as shown in Eq. 2.

$$ \nabla .\sigma + f = 0 $$
(2)

where σ is the stress tensor and f is the body force vector.

The compatibility equation is used to establish the displacement field of an element, whether it is continuous or compatible with the geometry and boundary conditions, as shown in Eq. 3 [29, 30].

$$ \varepsilon = \frac{1}{2}\left( {\nabla_{u} + \nabla_{u}^{T} } \right) $$
(3)

Where ε is the strain tensor, and u is the displacement vector.

The constitutive equation was applied to ensure that the stress and strain in an element are related by material law, as shown in Eq. 4 [29,30,31,32,33].

$$ \sigma = C\varepsilon $$
(4)

Where C is the elasticity tensor.

The principle of virtual work was applied to determine that the work done by internal and external forces on an element is equal to any virtual displacement field and satisfies the boundary conditions in Eq. 5 [40,41,42].

$$ \smallint_{\Omega } \sigma :\delta \varepsilon d\Omega - \smallint_{\Omega } f.\delta ud\Omega - \smallint _{\partial \Omega } t. \delta udS = 0 $$
(5)

Where δu is the virtual displacement vector, δε is the virtual strain tensor, t is the traction vector, Ω is the element domain, and ∂Ω is the element boundary. The process allows the workpiece to rotate while the cutting tool remains rigid, as shown in Fig. 4. The tool was fixed in the z-axis, ensuring no displacement to depict the actual turning process in the real world.

Fig. 4
figure 4

a Workpiece Coordinate System, b remote

2.2 Modelling constitutive equations

The work materials were modelled on an explicit dynamics platform using commercial Analysis Simulation Systems (ANSYS) software. Using the model equations to assess the flow stresses and convergence of the residual stress results during the simulation is crucial. The Johnson–Cook model is used because of its robustness, fit, and good strain-hardening behaviour, Eq. 6 [43].

$$ \overline{\sigma } = \left( {A + B(\overline{\varepsilon }_{p} )^{n} } \right)\left( {1 + C\ln \left( {\frac{{\overline{{\dot{\varepsilon }}}_{p} }}{{\overline{{\overline{{\dot{\varepsilon }}} }}_{o} }}} \right)} \right)\left( {1 - \left( {\frac{{T - T_{o} }}{{T_{m} - T_{o} }}} \right)^{m} } \right) $$
(6)

Where \(\overline{\sigma },\overline{\varepsilon }_{p} ,\overline{{\dot{\varepsilon }}}_{p} ,\overline{{\overline{{\dot{\varepsilon }}} }}_{o} ,\) T, Tm and To are equivalent flow stress, equivalent plastic strain, The Johnson–Cook model is used because of its robustness, fit, and good strain-hardening behavioequivalent plastic strain rate, reference strain rate, temperature, melting temperature, and ambient temperature, respectively. A is the yield strength of the material, B is the strain hardening constant, n is the strain hardening coefficient, C is the strengthening coefficient of strain rate, and m is the thermal softening coefficient.

The Johnson–Cook damage criterion was implemented in the finite element code to simulate the chip formation. The criterion is expressed as a cumulative damage law \(\left({D}_{m}\right)\) using Eq. 7 [43].

$$ D_{m} \sum \frac{{\overline{{\Delta_{{\varepsilon_{p} }} }} }}{{\overline{{\varepsilon_{ef}^{p} }} }} $$
(7)

Where \(\overline{{\Delta }_{{\varepsilon }_{p}}}\) is the equivalent plastic strain and \(\overline{{\varepsilon }_{f}}\) is the equivalent strain at failure. When \({D}_{m}\hspace{0.17em}\)= 1, equality is achieved; hence, the corresponding elements are deleted, allowing the separation of the chip from the workpiece during the finite element simulation. Therefore, an expression for calculating the equivalent strain failure during chip separation is required, Eq. 8 [43].

$$ \varepsilon_{ef}^{p} = \left[ {D_{1} + D_{2} e^{{\eta D_{3} }} } \right]\left[ {1 + D_{4} \ln \left( {\frac{{\overline{{\dot{\varepsilon }_{p} }} }}{{\overline{{\dot{\varepsilon }_{o} }} }}} \right)} \right]*\left[ {1 - D_{5} \left( {\frac{T - 23}{{T_{m} - 23}}} \right)^{m} } \right] $$
(8)

Where: \(D_{1} - D_{5}\) is failure damage parameters, \(\varepsilon_{ef}^{p}\) is the strain rate reference, and ƞ is the mean hydrostatic stress to the equivalent stress. The Johnson–Cook and damage parameters for this particular are listed in Table 4.

Table 4 Johnson–Cook parameters for AISI 1040 [44]

2.2.1 Friction modelling

The interaction between the tool-workpiece is defined between the outer surface of the tool and the workpiece’s nodes. Zorev’s friction model is applied in modelling the mechanical contact between the tool and workpiece interface in ANSYS explicit dynamics using Eq. 9 [45].

$$ \tau = \left\{ {\begin{array}{*{20}c} {\tau_{y} , \mu \sigma_{n} \ge \tau_{y} } \\ {\mu \sigma_{n} , \mu \sigma_{n} < \tau_{y} } \\ \end{array} } \right. $$
(9)

where: τ is the shear stress, τy is the shear yield strength, μ is the Coulomb friction coefficient, and \({\sigma }_{n}\) is the normal stress on the tool rake face. Sliding and sticking friction are two distinct behaviours under which Zorev’s model is applied. μ and \({\sigma }_{n}\) are calibrated numerically as 0.40 and 350 MPa [46].

2.2.2 Design of experiment (DoE)

This study focused on optimizing the longitudinal turning process parameters using the face-centred central composite design approach in the response surface methodology (RSM). Central Composite design (CCD) is based on 2-level factorial designs augmented with centre and axial points to fit quadratic models [47]. The regular CCDs had five levels for each factor. They were modified by choosing an axial distance 1.0, creating a Face-Centered CCD with only three levels per factor. The centre points were replicated to provide prediction capability near the centre of the factor space. The factors are simultaneously varied over planned tests and then connected via a mathematical model equation based on RSM. This model is then used for interpretation and predictions. Three factors were considered in this investigation: cutting speed (v), feed rate (f), and Depth of Cut (d). The minimum and maximum levels were obtained from the experimental design performed on the AISI 1040 simulations, as presented in Table 5.

Table 5 Design factors levels for simulation

2.3 Residual stress measurement

The residual stresses were measured based on the X-ray diffraction method using a Proto-LXRD 1200 X-ray stress analyzer machine (Proto Manufacturing, USA) fitted with a Modular Stress Mapping system and Proto Software for analyzing the residual stress using the Sin2Ψ method. The circumferential direction was considered in the measurement of the residual stresses. Proto–LXRD 1200 has nine β angles with a maximum of 30. X-ray diffraction constants and parameters used for induced residual measurement are obtained from ASTM E915-2019 [48], Table 6.

Table 6 Induced residual stress measurement parameters and constants [48]

Two susceptible detectors capture the diffracted beams on both sides of the diffracted cone at various X-ray incidence angles. The X-ray machine then calculates residual stresses for AISI 1040 using the Sin2Ψ method, as seen in Fig. 5.

Fig. 5
figure 5

Proto-LXRD 1200 machine set up for residual stress measurement

The material removal process involved in-depth residual-stress measurements using a prototype electropolishing machine. This method removes a layer of material without mechanical stress using direct current. The anode was connected to the positive (+) terminal and the cathode to the negative (−) terminal. A metal workpiece served as the cathode. A 45 kV voltage was applied for different durations depending on the desired removal depth, as shown in Fig. 6.

Fig. 6
figure 6

Electropolishing depth residual stress analysis

The profilometer measured the pocket depth using a Mitutoyo SJ-400. The average results of two data points were recorded for the in-depth residual stress. The cylindrical shaft of AISI 1040 had in-depth induced residual stress at 0, 20, 40, and 60 microns from the surface.

2.4 Optimization using response surface methodology (RSM)

The numerical optimization of factors was performed using Design Expert 13 software and response surface methodology (RSM). The three factors were set in the range, while the response (induced surface residual stress) was set to be minimized. The optimization module searched for a combination of factor levels that satisfied each response and factor criteria. Including a response in the optimization, the criteria had to have a model fit through the analyzed data during the simulation. The input variables were automatically included “in range.” The designs constructed a polynomial approximation of the response based on the results obtained using the DoE method. In this case, a nonlinear (quadratic) response surface with three variables was applied, Eq. 10 [49].

$$ Y = b_{o} + \mathop \sum \limits_{i = 1}^{K} a_{i} y_{i} + \mathop \sum \limits_{i = 1}^{K} a_{ii} y_{i}^{2} \mathop \sum \limits_{ij}^{K} a_{ij} Y_{i} Y_{ij} $$
(10)

Where yi is the input parameters, and the coefficients b0, bi, bii, and bij are the accessible terms of the regression equation, the linear effect of yi, the quadratic effect of yi2, and the linear by linear interaction between Yi and Yj, respectively.

The experimental design explored the connection between the input parameters and the desired response (induced residual stress). Three factors (speed, feed rate, and depth of cut) at three levels were used for the 27 randomized designs, as shown in Table 7.

Table 7 Simulation and Experiment superficial residual stress

2.5 Desirability function

Desirability analysis was used for the optimization analysis. The objective function, desirability, is based on the numerical optimization of Design Expert software. The overall desirability (D) is the geometric (multiplicative) mean of all individual desirabilities (di) from 0 (lowest) to 1 (highest), as shown in Eq. 11 [50].

$$ D = \left( {d_{1} xd_{2 } x \ldots xd_{n} } \right)^{\frac{1}{n}} = \left( {\mathop \prod \limits_{i = 1}^{n} d_{i} } \right)^{\frac{1}{n}} $$
(11)

Each parameter required a minimum and a maximum level. Weight could change the shape of the desirability function for each goal. The “importance” of each goal could vary. The default was equally crucial for all goals at the three pluses (+ + +). The desirability function at each optimum was explored in the factor space using contours, 3D surfaces, and perturbation plots. Additionally, any individual response could be plotted to determine the optimum point.

3 Results and discussions

This section presents the simulation results and contrasts them with experimental findings. Regression analysis was used to create the main effect plots. Simulations were run on all datasets according to the design of the experiment, and the resulting residual stresses are displayed in Table 7 as response 1. Similarly, Table 7 Response 2 displays the outcomes of the experimental residual stress measurements using X-ray diffraction following turning operations for 27 samples.

3.1 Surface-induced residual stresses

The simulated and experimentally induced residual stresses were compared for various combinations of cutting parameters for AISI 1040 steel, and the results are presented in Table 7. A negative (-) value indicates a compressive surface-induced residual stress. The residual surface stress results were compressive in the simulation and experimental tests. The percentage error between the simulated and experimental data was deficient, ranging from 0.43% to 2.21%, which confirmed the accuracy and reliability of the finite element model for predicting the induced residual stress in AISI 1040 steel.

Superficial residual stresses were measured in the circumferential direction for the simulation and experimental experiments. The average superficial stress for 27 simulation and experiment trials was -330.1 MPa and -326.4 MPa, respectively. The superficial induced residual stress distributions and magnitudes were closely related. Figure 7 shows a plot of the residual surface stress versus the number of trials with minimal margin errors between the simulation model and the experimental tests except for run number 7 (240 m/min, 0.6 mm/rev, and 0.6 mm), which had high compressive residual stresses; experiment (− 650.2 MPa) and simulation (− 645.5 MPa). The high stresses can be attributed to excessive heat during chip removal and massive cutting forces. When the machined material undergoes phase transformations at a very high temperature during cutting, it changes its volume and creates compressive residual stresses [51]. The thermomechanical affected zone also has a lot of compressive residual stresses because of the combined effect of the thermal expansion from the heat transfer from the stir zone and the mechanical compression by the tool [52].

Fig. 7
figure 7

Comparison between Experiment and Simulation surface residual stress

A detailed investigation revealed that minor variations in tool wear or slight environmental changes during the experimental runs could account for the marginally higher residual stress in run orders 7 and 2 despite the three factors being the same. This was cross-verified with repeated simulations under controlled conditions, showing consistent results.

3.2 Induced residual stress beneath surface

The induced residual stress beneath the surface was measured experimentally at different depths, as shown in Table 8. The results showed that the percentage error between the simulation and experiment was less than 5.47%. After each measurement, a new layer was obtained by removing the superficial layer via electropolishing. The results validated the accuracy of the 3D finite element model, confirming its suitability for modelling residual stresses for AISI 1040.

Table 8 Residual stress beneath the surface of the specimen

The graphical comparison of induced residual stress versus the beneath depth shows close agreement between experiment and simulation values, Fig. 8. The residual stress profiles exhibited a general pattern of decreasing compressive stresses with increasing depth. This trend aligns with the widely accepted understanding that surface machining generates compressive stresses due to thermal and mechanical effects, which diminish with depth. The initial compressive stress at the surface (0 µm) is likely a consequence of rapid cooling and material contraction, while the reduction in stress magnitude at deeper levels can be ascribed to the diminishing influence of the surface machining processes [53].

Fig. 8
figure 8

Induced residual stress on varying depths from the surface

3.3 RSM Model-Analysis of variance (ANOVA) for surface-induced residual stress

In both models, as shown in Table 910, cutting speed (A) and its interactions, along with quadratic terms A2 and B2, were significant, whereas feed rate (B), depth of cut (C), and most interactions showed no significant impact.

Table 9 Analysis of Variance of the Model (Experiment)
Table 10 Analysis of variance for model (Simulation)

The regression model equation is statistically significant. The coefficient correlation (R2) for the finite element simulation was 94.92%, while that of experimental tests was 94.85%. Therefore, both equations help identify the relative impact of the factors (speed, feed rate, and depth of cut) on the response by comparing the coefficient factors from the analysis of variance.

The objective equations were derived using regression analysis, identifying the relationship between the induced residual stress (dependent variable) and the parameters A, B, and C (independent variables). By analyzing the data from simulations and experiments, the analysis calculated coefficients for each term, representing the contributions of the variables to the model.

These coefficients were used to formulate equations that best fit the data, providing a mathematical representation of the relationship between the factors and the induced residual stress as expressed in Eqs. 1213.

$${{\varvec{\sigma}}}_{\boldsymbol{ }({\varvec{s}}{\varvec{i}}{\varvec{m}}{\varvec{u}}{\varvec{l}}{\varvec{a}}{\varvec{t}}{\varvec{i}}{\varvec{o}}{\varvec{n}})}[{\varvec{M}}{\varvec{p}}{\varvec{a}}]= 303.04+104.09*A-80.58*B-21.49*C+12.53*AB+9.10*AC+18.95*BC+113.69*{A}^{2}-94.10*{B}^{2}+10.65*{C}^{2}+12.40*ABC+136.24*{A}^{2}B+77.74*{A}^{2}C+0.0414*{AB}^{2}$$
(12)
$${{\varvec{\sigma}}}_{ ({\varvec{E}}{\varvec{x}}{\varvec{p}}{\varvec{e}}{\varvec{r}}{\varvec{i}}{\varvec{m}}{\varvec{e}}{\varvec{n}}{\varvec{t}})}[{\varvec{M}}{\varvec{p}}{\varvec{a}}]= 299.10+104.51*A-80.90*B-20.44*C+12.63*AB+9.49*AC+19.05*BC+113.62*{A}^{2}-93.79*{B}^{2}+10.78*{C}^{2}+12.05*ABC+136.33*{A}^{2}B+76.69*{A}^{2}C-1.42*{AB}^{2}$$
(13)

Interaction plots can help to visualize and analyze how one factor influences the response variable depending on the level of another factor in the machining processes [54]. The interaction plots for the three factors revealed that residual stress was more influenced by cutting speed at higher feed rates and lower depths of cut, where rapid heat build-up amplifies stress sensitivity, and by feed rate at lower cutting speeds and higher depths of cut, where the material removal and heat generation were substantial [55]. This suggests that at high feed rates and shallow cuts (near the surface), the cutting speed significantly affects the residual stress, whereas at low speeds and deep cuts, the feed rate plays a crucial role, as shown in Fig. 9.

Fig. 9
figure 9

Interaction plots showing the effect of turning parameters on residual stress simulation

In the context of high cutting speeds and feed rates, the increase in frictional heat exacerbates thermal gradients, resulting in greater residual stresses due to rapid heating and uneven cooling [56, 57]. On the other hand, at lower cutting speeds with higher depths of cut, extended frictional forces lead to significant heat accumulation and heightened residual stresses, particularly when feed rates are increased [58].

3.4 Effect of cutting parameters on induced residual stress

The effect of the cutting parameters on inducing residual stress during the longitudinal turning of AISI 1040 steel is an important aspect to consider in the machining process. Understanding the influence of cutting parameters on residual stress can help optimize machining operations and improve the performance and integrity of machined components. Cutting speed was ranked higher in causing residual stress, followed by feed rate and depth of cut. Thermal gradients and material deformation increased residual stress at higher cutting speeds: deeper cuts induced increased plastic deformation, material loss, and residual stress. Higher input rates caused plastic deformation and chip formation, increasing residual stress, Fig. 10.

Fig. 10
figure 10

Main effects plot for turning parameters

A contour plot of cutting speed versus depth of cut confirmed that cutting speed dominated the residual stress formation, whereas the depth of cut had a minor effect. When cutting speed (240 m/min.) was considered along with feed rate, the residual stress increased sharply to a maximum value of -600 to 650 MPa for simulation, indicating that cutting speed had a more significant impact on residual stress induction than depth of cut and feed rate. as depicted in Fig. 11 a-b.

Fig. 11
figure 11

Effects of speed and feed rate on residual stress for AISI 1040 a Simulation, b experiment

Increasing the cutting speed tends to increase the residual stress in the circumferential direction and decrease the residual stress’s penetration depth. Higher speeds generate more heat and thermal gradients on the machined surface. Increasing the feed rate tended to enhance the penetration depth of the residual stress.

A higher feed rate causes more plastic deformation and strain hardening in the subsurface layer in the circumferential direction. This is because a higher feed rate results in a greater material removal rate per unit time, increasing the heat and mechanical load on the workpiece [59]. Therefore, the subsurface layer experiences elevated temperatures and stresses, which enhance plastic deformation and strain hardening [60]. This effect can improve hardness and induce residual stresses in the subsurface layer.

The contour plots in Fig. 12 depict the correlation between the cutting speed and feed rate and the resulting residual stress. In both plots, the residual stress escalates as the cutting speed and feed rate increase. In Fig. 12 (a), the stress ranges from 350 to 550, with higher values portrayed by warmer colours (yellow/orange), while Fig. 12 (b) shows a range from 200 to 300, represented by blue to green colours. The uniform trend evident in both plots suggests that elevated cutting speeds and feed rates lead to an increase in residual stresses. This can be attributed to the augmented thermal and mechanical stresses during the machining process, resulting in a more pronounced residual stress within the material [61,62,63,64].

Fig. 12
figure 12

Contour plots showing the effects of speed and feed rate in the circumferential direction a Simulation, b experiment

To compare the effects of feed rate and depth of cut, 3D surface plots were constructed. They showed that the residual stress increased steadily with higher feed rate and depth of cut, as seen in Fig. 13 a-b. The graphs show similar residual stress trends in cases (a) and (b). Both graphs indicate that the residual stress increased with increasing feed rate and depth of cut. However, simulation (b) generally predicts lower residual stress values than the experimental results (a) across the same range of feed rates and depths of cut. This difference is due to minor material property variations on the surface and tool wear [65]. An increased depth of cut was found to elevate the mechanical and thermal stresses owing to a greater material removal volume. Similarly, a higher feed rate resulted in a larger chip thickness and increased cutting forces, further increasing mechanical and thermal stresses. Consequently, these intensified conditions have been reported to have elevated residual stresses in the workpiece [52,53,54].

Fig. 13
figure 13

Effects of parameters on residual stress a Experiment, b simulation

3.5 Optimization and confirmation tests

Using Design Expert software, numerical optimization was performed to investigate the design space using regression RSM models to identify the factor settings that meet the specified objectives. The objectives are delineated in Table 11. Specifically, the objective for cutting conditions is “In Range,” which denotes an acceptable range of results between the upper and lower limits. The goal for residual stress is to “Minimise,” with the lower limit signifying the intended optimal result and the upper limit representing the highest permissible outcome.

Table 11 Goals and limits for optimization of cutting conditions

The best combination of cutting parameters was selected based on the highest desirability value for the three best solutions, considering minimal residual stress and optimal surface finish. Sensitivity analysis confirmed the robustness of these parameters. Each solution offers specific combinations of speed, feed rate, and depth of cut, resulting in a relatively close alignment between the simulated and experimental residual stress values. Solution 1 demonstrated the highest desirability with a simulated stress of -136.23 MPa and an experimental stress of -131.89 MPa, while solutions 2 and 3 also provided promising results with desirabilities of 0.995 and 0.990, respectively, as illustrated in Table 12.

Table 12 Optimum cutting condition for minimum residual stress

The highest desirability value is 1, which shows that the minimum residual stress (-136.23 MPa) can be realized when turning the AISI 1040 steel at a cutting speed of 138.94 m/min, feed rate of 0.588 mm/rev and at a depth of cut of 0.282 mm for solution 1.

A confirmation test was conducted for the top three solutions in Table 12 under the optimized cutting conditions for AISI 1040. Table 1315 compare predicted mean and median simulated residual stresses (σ) against experimental results for three solutions. In solution 1, simulated stresses closely match experimental values.

Table 13 Confirmation test for desirability 1.000
Table 14 Confirmation test for desirability 0.995
Table 15 Confirmation test for desirability 0.990

Similarly, for solutions 2 and 3, simulated stresses align well with experimental results. The standard deviation and standard error of the mean remain consistent across solutions. These results indicate the simulation model’s ability to accurately predict induced residual stresses, validating its efficacy and application.

The nature of induced superficial residual stress was compressive. Compressive residual stresses can enhance certain material properties, such as increasing fatigue resistance and inhibiting crack propagation. However, minimizing these stresses is essential in carbon steels to prevent dimensional inaccuracies, warping, and unintended deformations, which can compromise the fit and function of precision components [66, 67]. Excessive compressive stresses may also lead to unexpected stress relaxation or redistribution under operational conditions, potentially undermining the structural integrity and performance of the material [68]. Therefore, managing and minimizing compressive residual stresses is crucial for ensuring the reliability and precision of critical components.

Based on the accuracy of confirmation test results, the developed FEM model can, therefore, be applied in the machining industry for optimizing cutting parameters and managing residual stresses in manufacturing, aerospace and automotive components, and medical device fabrication. Control of the residual stresses during machining enhances component quality, prolongs tool life, and ensures the integrity of high-precision parts by predicting and minimizing detrimental stress effects.

3.6 Novelty of the work

The novelty of this study lies in the sophisticated integration of finite element modelling (FEM) with response surface methodology (RSM) to optimize machining parameters and minimize residual stresses in annealed AISI 1040 carbon steel. In this study, a comprehensive 3D FEM was developed to accurately predict induced residual stresses, which were rigorously validated through experimental measurements using an X-ray diffractometer. The minimal percentage errors between the simulated and experimental datasets highlighted the precision of the model. Furthermore, applying the Johnson–Cook model to simulate material behaviour, friction, and flow stresses enhances the robustness of the FE model, making it highly applicable for practical industrial use in the machining sector. This research is unique because it precisely determines the optimal cutting parameters (cutting speed, feed rate, and depth of cut) that minimize residual stress, significantly reducing to -136.23 MPa. This result not only underscores the effectiveness of combining FEM and RSM but also provides critical, empirically validated insights for industry professionals seeking to improve part quality and reduce defects in post-machining processes. The FEM model represents a reliable and validated approach for predicting and controlling induced residual stresses in machining operations and contributing to enhanced product performance and longevity.

4 Conclusion

This study investigated the application of finite element analysis to predict the machining parameters and induced residual stresses in AISI 1040 steel, focusing on model accuracy, parameter optimization, and impact assessment. The finite element model demonstrated high accuracy, with simulated and experimental superficial residual stresses averaging -330.1 MPa and -326.4 MPa, respectively. The optimal machining conditions were determined to be a cutting speed of 138.94 m/min, feed rate of 0.588 mm/rev, and depth of cut of 0.282 mm, which resulted in a compressive residual stress of − 136.23 MPa. The FE model validation showed a percentage error ranging from 0.43–2.21%, confirming its reliability. Sensitivity analysis revealed that cutting speed significantly affects residual stress, whereas feed rate and depth of cut have less influence on residual stress induction. This study underscores the model’s application in optimizing machining parameters to effectively control residual stresses, providing a valuable tool for improving manufacturing processes and material performance.