## 2 Theoretical Analysis  
### Residual Shear and Normal and Stresses Calculation  
Figure 1a depicts the schematic diagram of non-uniform plastic deformation generation during the turning process. It is observed from Figure 1a that compressive, tensile, and shear plastic deformations were produced on the workpiece material ahead of the cutting tool during the turning process. On the other hand, a larger amount of heat was produced during machining which would lead to the compressive plastic deformation on the machined surface [1; 5]. The interaction of these non-uniform plastic deformations determined the final state of residual stress as shown in Figure 1b. It should be noted that the \(x\) and \(y\) axes in Figure 1b correspond to the longitudinal and transverse directions, respectively. The traditional X-ray diffraction based on the \(\sin^{2}\!\psi\) method was used to determine the residual stress according to [PERSON]'s law of an isotropic solid material [18]:  
\[\varepsilon_{\varphi\psi}=\frac{1+\
u}{E}\sigma_{\varphi}\sin^{2}\psi-\frac{\
u} {E}\Big{(}\sigma_{xx}+\sigma_{yy}\Big{)} \tag{1}\]  
\[\sigma_{\varphi}=\frac{E}{1+\
u}\frac{\partial\varepsilon_{\varphi\psi}}{ \partial\sin^{2}\psi} \tag{2}\]  
where \(\varepsilon_{\varphi\psi}\) is the strain at (\(\varphi\), \(\psi\)) direction, \(E\) and \(\
u\) are the [PERSON]'s modulus and [PERSON]'s ratio of material, and \(\sigma_{xx}\) and \(\sigma_{yy}\) are the stress components (normal stress). \(\sigma_{\varphi}\) is the normal stress in the \(\varphi\) direction. In the above two equations, it is noteworthy that only the residual normal stress \(\sigma_{\varphi}\) can be determined by using the \(\sin^{2}\!\psi\) method. In order to obtain the residual shear stress, the cos\(\alpha\) measurement technology proposed by [PERSON] et al. [19] and modified by [PERSON] et al. [20] was utilized. The relationship between the strain \(\varepsilon_{\alpha}\) and the stress components in \(x\)-\(y\)-\(z\) coordinates can be expressed by Equation (3):  
\[\varepsilon_{\alpha}=\frac{1+\
u}{E}\Big{(}\sigma_{x}n_{1}^{2}+\sigma_{y}n_{2 }^{2}+\sigma_{z}n_{3}^{2}+2\tau_{xy}n_{1}n_{2}+2\tau_{yz}n_{2}n_{3}+2\tau_{zx} n_{3}n_{1}\Big{)}-\frac{\
u}{E}\Big{(}\sigma_{x}+\sigma_{y}+\sigma_{z}\Big{)} \tag{3}\]  
where \(\tau_{xy}\), \(\tau_{yz}\), and \(\tau_{zx}\) represent the shear stresses. \(n_{1}\), \(n_{2}\), and \(n_{3}\) are the components of diffraction vector \(n\) as shown in Figure 2 and can be obtained by Equation (4) [20]:  
\[ \begin{array}{l}n_{1}=\cos\eta\sin\psi\cos\varphi-\sin\eta\cos\psi\cos \varphi\cos\alpha-\sin\eta\sin\psi\sin\alpha\\ n_{2}=\cos\eta\sin\psi\sin\varphi-\sin\eta\cos\psi\sin\varphi\cos\alpha+\sin \eta\cos\psi\sin\alpha\\ n_{3}=\cos\eta\cos\psi+\sin\eta\sin\psi\cos\alpha\end{array}  \tag{4}\]  
where \(\alpha\) is a central angle that can vary from 0 to \(90^{\circ}\) in order to cover the whole ring, \(\psi\) is the tilt angle between the incident beam and axial \(z\), \(2\eta\) is a complementary angle of diffraction angle, and \(\varphi\) is the rotation angle in the \(x\)-\(y\) plane as shown in Figure 2.  
Figure 1: (**a**) Residual stress generation during machining, (**b**) space stress state, and (**c**) plane stress state. According to the Equation (3), a set of four strains \(\varepsilon_{\alpha}\), \(\varepsilon_{\pi+\alpha}\), \(\varepsilon_{-\alpha}\), and \(\varepsilon_{\pi-\alpha}\) can be obtained which are used to calculate the following two strains: \(\varepsilon_{\alpha 1}\) and \(\varepsilon_{\alpha 2}\). \[\varepsilon_{\alpha 1}=[(\varepsilon_{\alpha}-\varepsilon_{\pi+\alpha})+( \varepsilon_{-\alpha}-\varepsilon_{\pi-\alpha})]/2 \tag{5}\]  
\[\varepsilon_{\alpha 2}=[(\varepsilon_{\alpha}-\varepsilon_{\pi+\alpha})-( \varepsilon_{-\alpha}-\varepsilon_{\pi-\alpha})]/2 \tag{6}\]  
The X-ray diffraction measurements should be carried out at four rotation angles \(\varphi\) (0, 90, 180, and 270\({}^{\circ}\) as illustrated in Figure 2) to determine the normal stress and shear stress.