1 Introduction

Finite element method (FEM) is used to improve accuracy and productivity in machine tools by analyzing machining operations and structures. Errors in machining operations can be studied and minimized to improve part accuracy. Analyzing the stress and deformations of machine tool parts under actual loads improves performance and operational life cycle. Kiew et al. [1] discussed the relationship between the vibration of the machine spindle and its surface finish. In the machining process, the difference in spindle speed caused different degrees of mechanical vibration, which had a considerable impact on the surface finish of the workpiece. Using the fractal dimension in fractal analysis as an indicator of the complexity of the time series, the depth of cut, spindle speed, and feed rate were added to the parameter settings. Consequently, the relationship between the vibration signal and the machined surface becomes more complicated. According to Kim et al. [2], the chatter generated during the machining process can have adverse effects on the tool, workpiece, and machine. Therefore, choosing a suitable rotational speed can prevent chatter vibration. However, the existing flutter detection methods can only detect flutter after the vibration becomes unstable. Therefore, Kim et al. proposed an operating modal analysis to analyze the turning process using a discrete-time-domain finite-set dimension system. The regenerative vibration in the model was modeled, and the change in the damping ratio of the main pole was used as a monitoring parameter to reduce the stable vibration signal before it became unstable. To estimate the dynamic modal parameters accurately, Zaghbani et al. [3] conducted spectrum analysis and modal tapping experiments on a machine. The parameters obtained during the testing and analysis were compared and used to predict the dynamic characteristics during machining. Fujishima et al. [4] analyzed the thermal sensitivity of a machine based on the thermal deformation caused by heat transfer between the surrounding environment and the machine structure and the resulting temperature changes inside the machine structure. The geometric shape of the thermal plane rendered the machine structure more resistant to thermal displacement. In addition, a neural network and thermal displacement compensation method for deep learning of temperature sensors have been proposed. Ericson et al. [5] used a modal analysis technique to analyze the dynamic characteristics of the two spur planetary gear planes. The natural frequencies and mode shapes of the planetary gears were obtained through modal experiments and compared with those obtained from a linear element modal analysis. Two different frequency ranges and mode shapes were identified from the experimental results and were verified using a lumped parameter model. The number and types of modes at low and high frequencies depend on the degrees of freedom of the core and planetary gear. The prediction accuracy of the natural frequency improved when the gears were in the same direction as the curve and radial directions of the shaft. Yang et al. [6] established a three-dimensional finite element analysis model for the diamond turning of spherical surfaces, and the tool motion path during processing was controlled using self-developed software. The tool head radius, cutting depth, and feed speed were used as the experimental parameters to determine the influence of the three parameters on the surface roughness. The coordinates of the nodes on the machined surface were collected experimentally to evaluate the surface roughness. The experimental results showed that the radius of the cutter head had the greatest influence on surface roughness, and the analysis results were consistent with the experimental results. Yin et al. [7] proposed multiple iterative error compensation technologies to improve the milling accuracy of automatic milling machines by increasing their efficiency, diversification, and flexibility. A model was established for the flexible connecting rod in a robotic arm. The relationship between the cutting force and cutting depth was determined based on a milling force prediction model, and the machining error and milling depth of the workpiece were predicted. The corresponding error compensation system was established using a multiple-iteration method. The experimental results show that the relative error of the post-frequency average was less than 3%, which verifies the reliability of the compensation method. Gao et al. [8] reported that the thermal error significantly affects the machining accuracy, and compensation technology is important for improving machining accuracy. A long short-term memory neural network and particle swarm optimization were used to calculate the thermal error. First, the model was established to measure the thermal error of the ball screw. The prediction was followed by thermal error experiments using the step and random speeds as the parameters. The results showed that the model had better accuracy and stability than previously reported models. Wu et al. [9] discussed the positioning error of a double ball bar caused by the geometric error of the translation axis in a multi-axis machine tool and established a multi-body system positioning error model using a homogeneous transformation matrix and the theory of multi-body systems. They also established 18 iterative compensation methods for position-related geometric errors and corrected the NC code generated by the conventional compensation method. The compensation value of the iterative compensation method was smaller than that of the conventional method. The iterative compensation method avoids geometric errors caused by the effect of translation on rotation. Li et al. [10] discussed the factors affecting the dimensional accuracy of the micro-axis in the turning process, including workpiece deformation, cutting force, and tool setting errors. The constant-force cutting method was used to propose a compensation method for the tool path planning error, and finite element analysis was used to predict the workpiece deformation during the turning process. The amount of deformation was experimentally determined to evaluate the accuracy of the compensation value and the factors that affect the cutting force. Zhao et al. [11] discussed a drilling and riveting system for aircraft assembly, which is composed of two five-axis machine tools that cooperate with each other. They also discussed the relative positioning accuracy of the two machine tools through static error analysis. Based on the relative positioning accuracy, an error prediction model and error compensation strategy were established. Based on the position of the driving device, the program code is modified to compensate for the motion path. Finally, the experimental measurement data proved that the proposed compensation strategy was feasible. Li et al. [12] discussed the thermal error of a spindle in a horizontal center-processing machine, and the principal component analysis (PCA) method was used to establish an axial thermal error model for the temperature change in the spindle within a time interval. The thermal error data were then compared with the original temperature to examine the model and its predictions to obtain a precise value. To explore the performance of engineering structures at unstable frequencies, the machine learning input used in the past was typically the structural response, such as the strain and frequency; however, this machine learning method is easily affected by noise, which reduces its damage identification ability. Therefore, Zhang et al. [13] proposed a displacement PCA. This method is used as the input for machine learning because using displacements instead of strain or frequency to verify the input after feature comparison yields more accurate results. Yuqing et al. [14] discussed machine tool damage identification using a vibration signal and extracted the principal component feature map using the characteristic parameters of time–frequency statistics and probabilistic principal component analysis. Liu et al. [15] proposed that the milling process and chatter due to cutting affect productivity and quality. To monitor the occurrence of chatter effectively, the variational mode decomposition method was used to break down the vibration signal into several signals, and the PCA method was used to reduce the viewing dimension. The feature size and calculation amount were used to classify the state of the machine tool using these features and to monitor the cutting chatter of different machining methods. Hong et al. [16] used a Solidworks simulation to perform static analysis on the primary axis, secondary axis, and bed of a CNC machine to examine the stress and displacement of the CNC machine tool. The ideal stress value of the original machine to resist external loads without being damaged was compared with that of a lighter machine. The maximum stress of the machine tool was less than the yield strength, and the stress value satisfied the condition for safe operation. Jun et al. [17] presented a study on the mechatronics modeling of a five-DOF hybrid machine tool. Du et al. [18] proposed quality monitoring and prediction to ensure high-quality or zero-defect production. Guo et al. [19] proposed a surface topography model based on the dynamic characteristics of the processing system and the properties of the cutting process. Dongju Chen et al. [20] investigated that the eccentricity ratio affects the spindle system film thickness, stiffness, and deformation; static and dynamic modeling was used. First, a static model is utilized to study spindle deformation due to parameter change. The second phase analyzes eccentricity-induced vibration with a dynamic model. The dynamic findings are used to calculate the imbalance-induced force in two directions to examine the influence of imbalanced vibration on machining precision in the third stage. Zhaoshun Liang et al. [21] developed a system-oriented DT framework that uses weak machine components as digital threads to model dynamic processes with multiple models. They correlate position and cutting excitation variables using structural dynamics theory, employing frequency response function (FRF) for online process performance characterization and synchronization [22]. The proposed machine failure detection approach is limited, not covering all machine tool models, lacking research on additional properties, and unable to predict when there is no response. Transport vehicle health is unexamined, which can disrupt scheduling. Future studies will address these issues. Chao Zhang et al. [23] studied integrates digital twin with multi-access edge computing (MEC) and proposes a novel framework for building a knowledge-sharing intelligent machine tool swarm with ultra-low latency that supports secure knowledge sharing across authorized machine tools. Next, digital twin machine tool swarm construction, knowledge-based cloud brain learning, and MEC-enhanced system deployment are introduced as framework enabling approaches. Finally, application examples and evaluation studies show that the proposed approach works with a prototype system. The performance, accuracy, and longevity of these intricate machining systems are crucially dependent upon structural health monitoring in precision turning-milling machines. For sectors where the need for high-quality components is paramount, like aerospace manufacturing and automotive, precision in turning and milling processes is essential. With structural health monitoring, potential malfunctions can be avoided and consistent precision is ensured by early detection of any deviations or weaknesses in the machine’s structural integrity. Operators can maintain accuracy in the production of complex and valuable components by proactively addressing issues, implementing preventive maintenance procedures, and optimizing machining parameters through continuous machine health monitoring. By lowering downtime and the possibility of expensive repairs, this not only improves operational efficiency but also helps save money. In industries where precise turning and milling machines must meet strict quality and efficiency standards, structural health monitoring plays a critical role in preserving their dependability and performance. In precision turning and milling machines, structural health monitoring (SHM) is essential because it can give real-time data on the machine’s condition, allowing for timely maintenance and minimizing downtime [24]. A crucial component of SHM, vibration monitoring is crucial for machine tool structures as it can be used to anticipate mechanical wear and failure [25]. It has been demonstrated that novel approaches to SHM, like the application of active magnetic bearings, are successful in identifying structural damage in rotating machinery [26]. The feasibility and accessibility of these monitoring techniques are further improved by the development of low-cost, non-contact SHM systems for rotating machinery [27].

The application of machine learning to improve CNC machining accuracy has been the subject of numerous studies. Artificial neural networks were used by [28] Shashidhara and Suneel to predict and correct machining errors, improving part accuracy. Yemelyanov [29] concentrated on CNC machine design and employed cutting-edge techniques to lower resonance zones and relative motion, improving accuracy. In order to optimize cutting parameters, Abbas [30] used an artificial neural network and the Edgeworth-Pareto method. This led to an improvement in surface roughness and minimal material removal rates. Taken as a whole, these studies show how machine learning can improve CNC machining accuracy.

In recent years, the machine tool industry has developed turning and milling compound processing technology, and the tendency is currently progressing toward high-precision, high-speed, and compound development. Because machine tools are mostly small to medium-sized, they are mainly used to process automobile, motorcycle parts, home appliances, and hardware. To avoid competition due to low product prices, a large turning and milling machine was selected as the subject. It mainly focuses on the processing of large components, such as large offshore fans. Because the weight of the processing material exceeds 40 tons and there are certain requirements for processing quality and efficiency, the structural strength requirements of the machine tool are particularly important. To rectify this industrial barrier in this study, static and modal analyses of the machine tool were performed using FEA code to understand the static and dynamic characteristics of the machine tool. At the same time, there are plans to add the concept of intelligent machinery to machine tools. Through intelligent pre-diagnosis and PCA, the vibration signal of the machine can be converted into a feature distribution map, and the health of the machine tool spindle can be determined. Machine health status monitoring technology integrates the elements of intelligent technology such that the machine tool has intelligent functions, including fault prediction, spatial accuracy compensation, and the real-time monitoring of health status. The flowchart of the study is shown in Fig. 1.

Fig. 1
figure 1

Research flow chart

2 Methodology

2.1 Mathematical model and software

When performing a linear static structural analysis, a general matrix equation of a mathematical model is used to solve for stress and displacement results in the computer program without taking into account inertial force, damping force, impact force, or the nonlinear state of the contact surface.

$$\left[m\right]\left\{u\right\}=\left\{f\right\}$$
(1)

where \(\left[m\right]\) is the material stiffness matrix, \(\left\{u\right\}\) is the displacement vector, and \(\{f\}\) is the external load vector.

The formulation of the dynamic equation for structures in modal coordinates can be expressed as:

$${\phi }^{{\text{T}}}M\phi \ddot{q}+{\phi }^{{\text{T}}}C\phi \dot{q}+{\phi }^{{\text{T}}}K\phi q={\phi }^{{\text{T}}}F$$
(2)

In the given equation, \(\phi\) represents the normalized mode shape, \(F\) is the input force vector, and \(q\) represents the modal displacement vector. The process of transforming the dynamic equation in modal coordinates into a state-space model can be mathematically represented as stated in [31].

$$\left[\begin{array}{c}{\dot{q}}_{1}\\ {\ddot{q}}_{1}\\ {\dot{q}}_{2}\\ {\ddot{q}}_{2}\\ \vdots \\ {\dot{q}}_{n}\\ {\ddot{q}}_{n}\end{array}\right]=\left[\begin{array}{ccccccc}0& 1& 0& \cdots & \cdots & \cdots & 0\\ -{\omega }_{1}^{2}& -{\Gamma }_{1}& 0& \cdots & \cdots & \cdots & 0\\ 0& \cdots & 0& 1& 0& \cdots & 0\\ 0& 0& -{\omega }_{2}^{2}& -{\Gamma }_{2}& 0& \cdots & 0\\ \cdots & \cdots & \cdots & \cdots & \ddots & \cdots & \cdots \\ 0& \cdots & \cdots & \cdots & \cdots & 0& 1\\ 0& \cdots & \cdots & \cdots & 0& -{\omega }_{n}^{2}& -{\Gamma }_{n}\end{array}\right]\left[\begin{array}{c}{q}_{1}\\ {\dot{q}}_{1}\\ {q}_{2}\\ {\dot{q}}_{2}\\ \vdots \\ {q}_{n}\\ {\dot{q}}_{n}\end{array}\right]+\left[\begin{array}{ccc}0& \cdots & 0\\ {\phi }_{\mathrm{1,1}}& \cdots & {\phi }_{n,1}\\ 0& \cdots & 0\\ {\phi }_{\mathrm{1,2}}& \cdots & {\phi }_{n,2}\\ \vdots & \vdots & \vdots \\ 0& \cdots & 0\\ {\phi }_{1,n}& \cdots & {\phi }_{n,n}\end{array}\right]F$$
(3)

to the \(n-the\) degree of freedom in response.

The excitation force can be mathematically represented as \(F=f{e}^{j\omega t}\). The modal displacement for the \(r\) mode can be expressed as \({q}_{r}={Q}_{r}{e}^{j\omega t}\). By substituting the excitation and modal displacement into Eq. (3), we obtain the dynamic equation of the mode following modal decoupling.

$$\left(-{\omega }^{2}+j\omega {c}_{r}+{\omega }_{r}^{2}\right){Q}_{r}{e}^{j\omega t}={\phi }^{{\text{T}}}f{e}^{j\omega t}$$
(4)

The symbol \(f\) represents the amplitude of the excitation force signal, whereas ω denotes the frequency of the excitation force signal. The symbol \({Q}_{{\text{r}}}\) represents the amplitude of the response, which signifies the influence of the \(r-the\) mode on the structural vibration response at a specific frequency.\({\omega }_{{\text{r}}}\) is the natural frequency of the system.

The Kalman filter algorithm has the capability to estimate the necessary system information based on the measured signals. The input of this algorithm is the observed value of a system, while the output is the estimated state of the system. The modal parameters of a structure can be identified from the vibration signal to determine the vibration response of the structure. These modal parameters represent the state variable, and the contribution \({Q}_{{\text{r}}}\) can be calculated accordingly. The determination of the mode of vibration is achieved through the evaluation and comparison of the quality factor, denoted as \({Q}_{{\text{r}}}\).

The experimental hardware equipment used in this study included a turning-milling machine tool, impact hammer (PCB Model 086D20), three-axis accelerometer (Endevco Model 65–100), spectrum analyzer, smart machine box, and single-axis accelerometer (1801B). The software includes the Workbench, a platform for passing data between the ANSYS software packages and is not finite element analysis software. However, ANSYS Mechanical is the applicable finite element analysis software package. Novian spectral analysis, and MEscope modal experiment post-processing software. The main research process includes setting the structural material parameters and boundary conditions, solving for the static and dynamic characteristics analysis results, testing the dynamic characteristics, collecting vibration signals, and comparing the vibration characteristics. Modal used in this study is a turning-milling compound machine. CAD was used to construct the three-dimensional (3D) solid model. As shown in Fig. 2, the main structure is divided into six parts: the base, spindle box, milling structure, turning structure, tailstock, and secondary track. The material for the base, secondary track, turning structure, and milling structure is GB300; and FC350 was used for some components of the tailstock, and spindle box properties are listed in Table 1.

Fig. 2
figure 2

a CAD model of turning and milling compound tool machine and b real machine model

Table 1 Material properties

2.2 Mesh generation and mesh independence study

The mesh-independent analysis is one method for overcoming the challenges related to generating a conforming mesh to approximate the geometry for finite element analysis. Despite the fact that several meshless methods have been thoroughly and extensively investigated over the past two decades, many recent methods have demonstrated the possibility and benefits of representing geometry without the use of meshes. Investigation on the mesh convergence tests was conducted in order to enhance the precision of the finite element analysis as per [32,33,34]. The investigation focused on analyzing the variations in elastic deformations, total deformations, and maximum shear stresses across different element numbers, as part of the conducted mesh convergence experiments.

For the mesh, the element type is “tetrahedral,” the mesh size of the bed table and auxiliary rail is 80 mm, and the mesh size of the turning structure, milling structure, headstock, and tailstock is 50 mm. The total number of nodes was 1,845,075, and the number of elements was 1,024,708 (Table 2). At this configuration of mesh specification, the error discrepancy came out to be less than 1% which became the reason for its consideration.

Table 2 Mesh detail

The CAD models were exported to ANSYS Workbench in order to construct finite element models. The meshing process was the initial phase of the first stage. The efficacy of finite element analysis is significantly influenced by the mesh generation procedure. The accuracy of the computation is contingent upon the dimensions of the mesh employed. Greater credibility can be attributed to the outcomes when employing a smaller mesh size; however, this advantage is counterbalanced by a notable increase in computational time. Initially, a preliminary mesh creation is conducted in order to achieve an optimal trade-off between mesh quality and computational efficiency. During the process of analysis, the mesh of the model is partitioned into numerous elements (Fig. 3).

Fig. 3
figure 3

a Mesh model and b grid independence

3 Results and discussions

3.1 Modal analysis

The vibration dynamics of the structure are explained by the modal analysis performed on the machine with fixed boundary conditions at the feet. To identify possible weak points, it is important to consider the associated modal shapes and identified natural frequencies. The initial mode, which has a frequency of 51.4 Hz, shows a noticeable Z-swing, indicating a large vertical structural response. A noticeable swing in the X direction is depicted in the second mode at 57.3 Hz, which sheds light on possible lateral vibrations. The dynamic behavior of the system is better understood in relation to the third-order mode at 62.6 Hz. The results of this research are crucial for precision machining because they indicate which rotational speeds to avoid in order to minimize chatter-induced errors. It is critical to match operational parameters to the findings of the modal analysis in order to maximize machining efficiency and guarantee high precision by reducing resonance-related issues (Fig. 4).

Fig. 4
figure 4

Modal analysis results

3.2 Experimental validation of modal analysis

A modal experiment was conducted to verify the accuracy of the modal analysis. The modal experiment was conducted using a spectrum analyzer, impact hammer, and triaxle acceleration gauge. First, the tapping and measurement points of the accelerometer must be designated on the model. The main measurement points for the accelerometer were located on the headstock, milling structure, and tailstock, as shown in Fig. 5.

Fig. 5
figure 5

Experimental apparatus

An impact hammer was used to strike the headstock to excite the structure, which was accelerated through triaxle acceleration, and the vibration signals were collected using a gauge. The impact hammer used in the tapping experiment of this study is the PCB model 086D20. The function of the impact hammer is to measure the frequency response caused by tapping on the structure, thereby understanding the motion characteristics of the structure and verifying the accuracy of modal analysis. The specifications of the impact hammer are shown in Table 3.

Table 3 Impact hammer PCB model 086D20 specifications

The spectrum analyzer used in this experiment is a dynamic measurement and analysis instrument. It is primarily paired with the Novian spectrum analysis software to perform fast Fourier transform (FFT) on the vibration signals, thereby transforming the time-domain signals into frequency-domain signals. Finally, the results are displayed on the spectrum analysis software, making it convenient for users to read information such as structural frequency response, correlations, and tapping force magnitude. In this experiment, the triaxle accelerometer installed on the spectrum analyzer is the Endevco model 65–100 triaxle accelerometer. This accelerometer is of the piezoelectric type and primarily converts the potential energy changes of structural vibrations into changes in charge, in order to measure the vibration frequencies of the structure. The specifications of the Endevco model 65–100 triaxle accelerometer are presented in Table 4.

Table 4 Triaxle accelerometer specifications

The data were input into the Novian spectrum analysis software to perform Fourier transformation of the vibration (Fig. 6). Curve fitting was performed with MEscope software to obtain the parameters of the structural mode shape and confirm the modal and spectrum analysis results. The experimental results show that the first-, second-, and third-order modes are 51.5 Hz, 60 Hz, and 63.5 Hz, respectively.

Fig. 6
figure 6

Measurement points for the modal experiment

Compared with the modal analysis, the error percentage for the first-order mode was 0.2%. The second- and third-order modes were 4.5% and 1.4%, respectively (Figs. 7 and 8). The error between the simulation and experimental results was less than 4.5%. The results showed that the boundary conditions in the analysis model were consistent with those of the actual machine.

Fig. 7
figure 7

Experiment modal analysis result

Fig. 8
figure 8

Numerical validation of modal analysis

4 Spatial precision

During the machining process, the machine tool is not set in a fixed position. It performs a reciprocating processing cycle in the space. Therefore, this study mainly focuses on the changes in the accuracy of the machine at different positions in space during machining, observing the changes in the static and dynamic characteristics of the machine, discussing the relative deformation of the spindle and tool during the machining process, and evaluating the geometric error of the machine tool. The components of the moving path generate component errors with other moving points. The compensation value can be calculated using the arithmetic mean to correct the errors generated during movement and improve the positioning accuracy of the machine. In addition to the overall relative deformation, the model changes at different positions in space are discussed. To avoid resonance in the mechanical structure, we can use an analysis to predict the machining position in different coordinate systems during processing. By determining these natural frequencies, they can be avoided during processing, and the surface accuracy of the work piece can be improved. First, we located the origin of the machine as a reference point, and then, we designed a position table based on the mechanical characteristics to plan the processing space. It is divided into three planes, as listed in Table 3. The height of plane B was 0 mm, and planes C and A were spaced 240 mm above and below, respectively, as shown in Fig. 9.

Fig. 9
figure 9

Spatial location diagrams

Each plane in the space was then divided into 12 points, and each point was identified using a code. The three planes have a total of 36 points, as shown in Fig. 9 and Table 5.

Table 5 Space location planning table

4.1 Static rigidity analysis of the spatial position

The static rigidity self-weight analysis of the machine was conducted by setting the gravity of each point in space and observing the relative deformation relationship between the cumulative error of the tool owing to the stacking of the different linear axes and the spindle. From the self-gravity static analysis results, the relative deformation ranges between the spindle and the tool for planes A, B, and C are 0.3–11.3 µm, 1.5–11.2 µm, and 0.2–9.1 µm, respectively. For the structural deformation caused by the influence of gravity on the machine tool structure, the spatial points with the largest relative deformation are located at positions 3, 6, 9, and 12, determined through the analysis of the line graph results at each point, as shown in Fig. 10.

Fig. 10
figure 10

Three-plane gravity relative deformation

For the relative deformation of the three planes, the arithmetic mean was calculated by adding points 1 to 12, dividing by 12, and subtracting the outcome from the relative deformation of each point. For the compensation value in space, the average gravity deformations were 8.4 µm for plane A, 7.4 µm for plane B, and 5.9 µm for plane C, as shown in Table 6, 7, and 8, respectively. After the error value was calculated, the tool nose error compensation was performed in the controller.

Table 6 Error compensation between the spindle and tool in plane A—gravity (µm)
Table 7 Error compensation between the spindle and tool in plane B—gravity (µm)
Table 8 Error compensation between the spindle and tool in plane C—gravity (µm)

Subsequentlyntly, a force of 2000 N was applied to the tool handle to simulate the cutting of the workpiece. The self-weight was also set to perform a static analysis of each point in space and observe the relative deformation between the spindle and tool. From the analysis results, the relative deformation range between the spindle and the tool was 1.9–9.6 µm, 0.8–10.2 µm, and 4.3–19.8 µm, for planes A, B, and C, respectively. For the structural deformation of the tool handle owing to the influence of the cutting force, by analyzing the line graph at each point, the spatial points with the largest relative deformation were points 3, 6, 9, and 12, as shown in Fig. 11.

Fig. 11
figure 11

Three-plane force relative deformation

For the relative deformation of the three planes, the arithmetic mean was calculated by adding points 1 to 12, dividing by 12, and subtracting the outcome from the relative deformation of each point. For the compensation value in space, the average self-weight deformations were 5.9 µm, 3.6 µm, and 10.5 µm for planes A, B, and C, as shown in Table 9, 10, and 11, respectively. After the error value was calculated, the tool nose error compensation was performed in the controller.

Table 9 Error compensation between spindle and tool in plane A—force (µm)
Table 10 Error compensation between spindle and tool in plane B—force (µm)
Table 11 Error compensation between spindle and tool in plane C—force (µm)

4.2 Analysis of dynamic characteristics of the spatial position

When the main shaft moves in space, the structure and shape are different owing to the change in position at any time. Structures with different geometric shapes exhibit different natural frequencies. Therefore, in this study, the analysis points in each plane have different natural frequencies. Regarding the structure, lower frequencies are observed. The purpose was to ensure the excitation frequency of the external force corresponding to the spindle speed is different from the natural frequency of the structure itself, to reduce the generation of resonance. The frequency and mode shape of each point in planes A, B, and C were observed using a modal analysis. The first- and second-order mode shapes of the milling structure swung in the Z- and X-directions, respectively, and the third-order mode shape of the spindle box swung in the X-direction (in reference to the global coordinate axis), as shown in Fig. 12.

Fig. 12
figure 12

Mode shapes of first three modes

The data for the first three modes of planes A, B, and C were merged, as shown in Figs. 13, 14, and 15. From the modal analysis results, although the mode shapes of each order were the same, the frequencies were different, indicating that the natural frequency of each position of the machine changed as it moved. The point with the lowest frequency in the first- and second-order modes was located at a distance of 240 mm on the Y-axis, and the point with the highest frequency at a distance of − 240 mm on the Y-axis. The third-order mode is a secondary-structural modal vibration. Therefore, there was no tendency in the frequency comparison, and the difference was not comprehensive.

Fig. 13
figure 13

First mode of each plane

Fig. 14
figure 14

Second mode of each plane

Fig. 15
figure 15

Third mode of each plane

4.3 Static and dynamic characteristics of machine tools in space

The monitoring and prediction of tool wear are crucial aspects in the management of machine tool health. The process by which tools undergo wear can be attributed to alterations in cutting temperature and cutting force, resulting in modifications to material hardness and friction at the cutting surface. Consequently, these changes contribute to the occurrence of tool wear. The extent of tool wear is impacted by various elements, such as the composition and configuration of the tool, the conditions in which it is used, including the cooling technique employed, and the specific cutting parameters, namely cutting speed, feed rate, and the properties of the materials being processed. Additionally, tool wear encompasses other forms, such as abrasive wear, adhesion wear, diffusive wear, fatigue wear, and chemical wear. Currently, there are two primary approaches for acquiring proficiency in the states of machine tools, namely direct methods and indirect methods [35]. The direct approach involves the utilization of measurement equipment or machine vision systems to quantify tool wear. In a study conducted by Lins et al. [36], a machine vision system was implemented for the purpose of wear measurement. This system facilitated the monitoring of cutting tool wear by employing a decentralized design. Digital image processing techniques were employed by Bagga et al. [37] to enable real-time monitoring of tool wear. Using threshold segmentation and edge detection on the raw images, we were able to calculate the wear values. The suggested technique for measuring wear also demonstrated excellent detection accuracy. The growing popularity of machine vision technology has prompted an increasing number of scholars to engage in research endeavors in this field [38,39,40].

The turning-milling compound tool machine exhibits dynamic behavior during the entire cutting process. Parameters, such as the cutting position and cutting force, feed driving torque change with time, which has a significant impact on the behavior of the machine. This can easily cause positional deviation or vibration of the structure. The static force causes static deformation of the mechanical structure, causing positioning errors and affecting the dimensional accuracy of the workpiece. The dynamic force causes dynamic errors in the machining path and affects the contour accuracy. If the processing frequency is the same as the natural frequency of the structural parts, the vibration of the processing is amplified, and in severe cases, the surface roughness of the workpiece is poor.

From the results of the spatial precision static analysis, it is known that the deformation of the three-plane structure is reproducible in the state of self-weight, and the maximum relative deformation is 11.3 µm under the influence of gravity; The deformation of the three-plane structure is reproducible when the maximum cutting force of 2000 N is applied, and the maximum relative deformation is 19.8 µm. The maximum deformation positions are all located at points 3, 6, 9, and 12, and the arithmetic mean is used to calculate the average error of each plane to reduce machining errors and improve machining accuracy. The dynamic characteristics of different machining positions are discussed using spatial precision modal analysis. For the same model and boundary conditions, but different positions of the milling structure, the frequency of the natural vibration of the structure and the variation of the vibration mode under these variables are determined. From the results of the modal analysis, it can be seen that the frequency will be different owing to the change in the structural shape, but the mode shape remains the same. When the milling structure is closer to the headstock, the frequency increases so that the relative speed of the spindle can be calculated by the frequency change value, to reduce the probability of resonance and improve the surface roughness of the workpiece.

5 Prediction diagnosis performance system

In this study, an accelerometer was used to measure the vibration signals of the machine tool spindle under no-load conditions. When collecting the vibration signals, both healthy and unhealthy signals were collected, and these signals were compared via a feature extraction using the PCA method to determine the health status of the spindle. Through these abnormal alarm signals, the user can immediately determine the status of the machining equipment and take corresponding actions and measures, such as preventive maintenance or immediate control of the machine. The prediction diagnosis performance system for spindle vibration monitoring in this study utilizes accelerometers to measure the vibration signals of the machine tool spindle under both healthy and unhealthy (abnormal) conditions during no-load operations. The system aims to provide a reliable means of assessing the health status of the spindle in real-time. The process involves collecting vibration signals from the spindle and conducting a feature extraction analysis using the principal component analysis (PCA) method. PCA is a statistical technique that transforms the original set of correlated variables (vibration features in this case) into a new set of uncorrelated variables known as principal components. By comparing the features extracted from healthy and unhealthy signals, the system can effectively identify patterns or anomalies associated with spindle health. An abnormal alarm signal is generated when deviations from normal behavior are detected. This enables users to promptly assess the status of the machining equipment and take appropriate actions, such as initiating preventive maintenance or implementing immediate control measures to avoid potential machine failures or damage. The predictive diagnosis system provides a valuable tool for condition monitoring, allowing for timely intervention and optimization of machine performance.

5.1 Principal component analysis and Gaussian mixture model

The utilization of feature extraction software was employed to extract the distinctive characteristics of every vibration signal. The feature attributes can be categorized into many domains, including time-domain attributes, edge frequency, fast Fourier transform (FFT) frequency domain attributes, envelope spectrum (HT) characteristics, power spectral density (PSD) characteristics, energy amplitude, and shape statistics which are shown in Fig. 16.

Fig. 16
figure 16

Schematic illustration

PCA is a dimensionality reduction method that is used to reduce the complexity of data. The original high-dimensional data were reconstituted into low-dimensional data using a linear combination. In this study, all the vibration signals of the machine tool spindle were captured, feature extraction and dimensionality reduction of the vibration signals were carried out by principal component analysis, and a Gaussian mixture model clustering algorithm was used to cluster the features to realize vibration signal classification.

PCA attempts to collect most of the information in a dataset by identifying the principal components that increase the variance of the observations as much as possible. A covariance matrix is a symmetric matrix with the number of rows and columns equal to the number of dimensions in the data. The offset of the eigenvalue or variable is determined by calculating the mean of the two sets of data. Then, computes the eigenvectors, which are linearly independent vectors that do not change direction when a matrix transformation is applied. The eigenvalues are scalars that represent the sizes of the eigenvectors. The eigenvectors of the covariance matrix point in the direction of the maximum variance. The larger the eigenvalue, the larger the eigenvector corresponding to the first principal component. In this experiment, a turning-milling compound machine tool was used as an example. The signal measurement equipment includes a prediction diagnosis performance system, single-axis accelerometer, and soft hammer, as shown in Fig. 17.

Fig. 17
figure 17

Experimental devices

5.2 Data planning and collection

The spindle used in this experiment was divided into two parts: the spindle of the spindle box and the spindle of the milling structure. The experimental speed of the spindle of the spindle box was divided into three speeds: 20 rpm, 40 rpm, and 220 rpm. The healthy signal of the rotational speed was obtained under the spindle idling condition, and the abnormal X-direction vibration signal was obtained by hitting the spindle with a soft hammer to simulate a turning machine collision condition. The experimental speed of the spindle of the milling structure was divided into four rotation speeds: 6000 rpm, 7000 rpm, 8000 rpm, and 90,000 rpm. The accelerometer measured the healthy and abnormal Z-direction vibration signals of the four speeds. The healthy and abnormal vibration signals were obtained in a similar manner, as shown in Fig. 18.

Fig. 18
figure 18

Installed accelerometer

5.3 PCA data analysis

This experiment measured the vibration signal of the spindle of a milling structure and spindle box. The experimental speeds of the milling spindle were adjusted to 6000 rpm, 7000 rpm, 8000 rpm, and 9000 rpm. The direction of the measurement was along the Z-axis. Healthy and unhealthy vibration signals are shown in Fig. 19a and b, respectively. The X-axis and Y-axis units of the graphs obtained using PCA are expressed in dimensionless quantities. The change in distribution in the graph represents the difference in the dynamic characteristics of the machine. To measure an unhealthy vibration signal, a soft hammer was used to strike the structure and simulate a machine collision. The vibration signal converges in a block under undisturbed normal operating conditions. In contrast, when the spindle is abnormally operated under the influence of an external force, it diverges, and the characteristics at each speed are different. At any position, the machine features the same rotation speed, and the respective readings are gathered in the same block, as shown in Fig. 19c and d.

Fig. 19
figure 19

PCA data analysis results

The coordinate values of the feature distribution map are all dimensionless because the feature vector is dimensionless. As the variables that make up a dataset often have different units and methods, this could lead to confusion in the system. Therefore, in data mining, eigenvalues are directly used to describe the amount of information contained in the direction of the corresponding eigenvectors. In other words, the eigenvalues of the matrix are computed to obtain the corresponding eigenvectors. We can determine the correct coordinate axis after the rotation. A vector image generally does not have the basic unit of this term; usually, the graphic element of a vector image is an object, and an object contains attributes such as color, shape, outline, size, and screen position. In addition to the two properties of color and outline, style, shape, size, and screen position are determined by points and vectors.

6 Conclusions

To improve the surface accuracy during the machining of a workpiece using a turning-milling compound machine, finite element analysis software and experimental tests were used to analyze the static and dynamic characteristics of the machine. Static and modal analyses were performed to understand the machine performance, and modal experimental tests were used to compare the experimental and analytical results. In addition, the flaws in the machine and natural frequency of the structure were assessed, which is convenient for future structural improvements and processing performance.

A static and dynamic analysis of the spatial accuracy of the turning-milling compound machine was conducted. From the analysis results, the machine structure moved under a space-generated force. At points 3, 6, 9, and 12, the arithmetic mean was used to calculate the compensation value of the spatial error and improve the positioning accuracy of the machine in space. In addition, the modal analysis results showed that the natural frequency of the machine changed with the shape of the structure. Although the modal shapes of each order were the same, different frequencies were observed.

Finally, the vibration signal of the main shaft was collected using an intelligent prediction and diagnosis system, and the PCA method was used to extract and compare the characteristics of the vibration signal. Moreover, when the spindle was affected by external forces and did not operate normally, it diverged, and the signal features were scattered in different areas, like points on a map, with features of the same speed gathered together. The characteristic distribution map of these signals enables the evaluation of the health of the spindle, which can help users plan maintenance schedules.