Main shaft cutting force prediction method and device based on multi-channel deep learning model and electronic equipment
By combining multi-channel signal acquisition with a deep learning model, along with a multi-scale convolutional neural network and a bidirectional long short-term memory network, the high hardware cost and poor robustness of existing cutting force monitoring schemes are solved, achieving high-precision, real-time cutting force prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2026-03-10
AI Technical Summary
Existing cutting force monitoring solutions rely on expensive hardware that is prone to damage and difficult to adapt to complex machining environments. Furthermore, existing data-driven solutions have low signal utilization, poor robustness, and large prediction errors.
By collecting the three-dimensional vibration signal of the machine tool spindle and the three-phase current signal of the spindle motor, feature extraction and temporal modeling are performed using a multi-scale convolutional neural network and a bidirectional long short-term memory network, and prediction is performed by combining a multi-head attention mechanism and a composite loss function.
It achieves high-precision, real-time spindle cutting force prediction, reduces hardware costs, improves model adaptability and prediction accuracy, and is suitable for various machining scenarios.
Smart Images

Figure CN121637376A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of intelligent monitoring of numerical control machine tools, and relates to a spindle cutting force prediction method, device and electronic equipment based on a multi-channel deep learning model, which realizes high-precision and real-time spindle cutting force three-dimensional component prediction by jointly modeling a multi-scale convolutional neural network and a time series deep learning network using spindle vibration signals and spindle motor current signals. BACKGROUND
[0002] The spindle system and the feed system of a numerical control machine tool are key components for realizing machining precision, efficiency and workpiece surface quality. Cutting force, as the direct force between the tool and the workpiece, has a significant impact on the servo system and the machining process of the machine tool. Cutting force not only reflects changes in the machining state, but also provides important references for process stability and tool wear. Therefore, high-precision and real-time monitoring of cutting force is of great significance for improving the machining performance of numerical control machine tools.
[0003] Currently, the mainstream cutting force monitoring solution in the industry still relies on direct force measuring devices, such as desktop piezoelectric force platforms and rotary force measuring tool holders. Although such solutions can achieve high measurement accuracy in laboratory environments, they have significant limitations: first, the hardware cost is high, and the installation requires modification of the spindle structure of the machine tool, affecting the original stiffness of the machine tool; second, the force measuring device directly bears the cutting impact and is easily damaged due to overload, resulting in high maintenance costs; third, the device is large in size and occupies the working space of the machine tool, making it unsuitable for small numerical control milling machines or complex workpiece machining scenarios, and difficult to be applied on a large scale in industry.
[0004] During the machining process, cutting force acts directly on the spindle and motor system of the machine tool as external load, and its dynamic changes will cause changes in motor current and spindle vibration signals. By collecting and analyzing these signals, indirect monitoring and prediction of cutting force can be achieved using the existing spindle current signals and vibration signals of the numerical control system. Compared with the traditional force sensor method, this solution does not require additional hardware installation, does not affect the structure of the machine tool, and the acquisition device does not directly bear the cutting impact, thus having better long-term stability and practicality.
[0005] Traditional cutting force monitoring is mostly based on physical models, relying on spindle dynamics equations or motor torque balance equations, etc. The modeling process is complex, and the adaptability to processing conditions is poor, which is difficult to meet the real-time monitoring demand in complex processing environment. With the development of artificial intelligence technology, especially the application of deep learning method, the data-driven cutting force prediction model shows excellent modeling ability and generalization performance, which can learn the nonlinear relationship between cutting force and machine tool state directly from the actual monitoring signals. However, the existing data-driven scheme still has the following key defects: single signal source, low information utilization, most schemes only use single signal modeling, which leads to poor model robustness and large prediction error; the time series modeling ability is insufficient, the traditional model can only extract local signal features, or the fitting accuracy of signal mutation segment is low. The loss function design is single, and the engineering practicability is poor. The existing model mostly uses mean square error as the only loss function, which only optimizes the overall fitting error, which easily leads to the prediction curve jumping without physical meaning, or the prediction deviation of cutting force peak segment is large. Therefore, it is of important engineering application value to develop a cutting force prediction method which fuses the advantages of multi-channel signals, strengthens the time series modeling ability and optimizes the loss function design, reduces the hardware cost and improves the prediction accuracy. SUMMARY
[0006] The purpose of the present application is to overcome the defects of the prior art, provide a spindle cutting force prediction method, device and electronic equipment based on a multi-channel deep learning model, acquire three-direction vibration signals of a machine tool spindle and three-phase current signals of a spindle motor, extract features of each channel signal by using a multi-scale convolutional neural network, model the time series features extracted by a bidirectional long short-term memory network, realize deep fusion of multi-channel signals, and finally predict component values of cutting force in three directions by a multi-output sub-network, so as to realize high-precision and real-time spindle cutting force prediction.
[0007] To achieve the above purpose, the following technical solutions are adopted in the present application:
[0008] The spindle cutting force prediction method based on the multi-channel deep learning model comprises the following steps:
[0009] S1, acquisition and preprocessing of multi-channel monitoring signals: three-direction vibration signals of a spindle and three-phase current signals of a spindle motor are acquired by sensors and a servo system respectively, after time stamp alignment and data completion, sliding window segmentation and normalization processing are performed to form standardized samples meeting the input requirements of the model; wherein the sliding window ensures the time series continuity, and the normalization eliminates the dimension difference, laying a foundation for subsequent feature extraction;
[0010] S2, multi-scale convolutional neural network parallel feature extraction: the pre-processed multi-channel signal is divided into current signal channel and vibration signal channel according to physical characteristics, each channel is connected to a multi-scale convolutional neural network, different receptive fields of the multi-scale convolutional neural network are configured, local features are extracted through convolution operation of different receptive fields, and multi-scale fusion features of the two types of signals are obtained through channel dimension feature splicing and ; wherein the multi-scale convolutional neural network ensures covering short-term fluctuations, medium-term changes and long-term trends of the signal, and provides high-quality local features for time series modeling;
[0011] S3, time series modeling based on bidirectional long short-term memory network: the multi-scale fusion features and are respectively input into independent bidirectional long short-term memory networks, the forward and backward time series dependence of the signal is captured through bidirectional time series calculation and gate mechanism processing, and the time series features of the two types of signals are obtained through feature splicing and ; wherein the 3-layer stacked structure and the Dropout layer ensure the depth and generalization ability of the time series modeling, and the bidirectional design solves the problem of missing single-direction time series information;
[0012] S4, multi-head attention feature fusion: the and are respectively processed by multi-head attention mechanism, the attention calculation of the two types of signal channels is independently completed, the multi-channel fusion features are obtained by cross-channel dimension splicing after obtaining the attention features of each other, the attention to key time period is strengthened, and the feature correlation is improved;
[0013] S5, three-axis cutting force prediction and model training: by designing a full connection network, the is input into 3 independent full connection networks, and the X, Y and Z three-direction cutting force prediction values are respectively output; a composite loss function is constructed, the model training strategy of Adam optimizer and early stopping is combined, and the model precision and generalization ability are ensured through performance verification;
[0014] The specific process of the step S1 comprises:
[0015] S1.1 Multi-channel signal acquisition: Taking a numerical control milling experiment as the application scenario, two types of core acquisition signals are identified: one is the three-direction vibration signal of the spindle, which is collected by a three-direction acceleration sensor installed near the spindle shell to avoid the tool movement trajectory and ensure accurate capture of the dynamic changes of the spindle in the X, Y, and Z directions during processing; the other is the three-phase current signal of the spindle motor, which is directly read from the servo drive system of the numerical control machine tool without the need for additional external acquisition devices, making full use of the machine tool's own monitoring resources and reducing hardware deployment costs; During the acquisition process, the system synchronously records the processing condition parameters, including spindle speed, feed speed, and cutting depth, ensuring that the signals correspond to the working conditions one by one and providing data support for subsequent multi-condition model training;
[0016] S1.2 Signal timestamp alignment and data completion: A unified timestamp is added to the two types of signals through the clock synchronization function of the numerical control system, achieving time sequence alignment of the 6-channel data and avoiding feature correlation failure due to time misalignment; If a small amount of signal is missing due to transient contact failure of the sensor or data transmission delay during acquisition, linear interpolation is used to complete the missing data points, and finally each channel data is uniformly processed into a fixed-length original signal sequence containing 50,000 data points, ensuring consistent data format for all channels and facilitating subsequent batch preprocessing;
[0017] S1.3 Sliding window segmentation and normalization processing:
[0018] Sliding window segmentation: The original signal is a continuous long time sequence, directly inputting it into the neural network will result in a sharp increase in calculation and difficulty in capturing local time sequence features, therefore sliding window method is used for segmentation; The window length is set to 200 sampling points, which has been verified by experiments to balance the time sequence continuity and local feature integrity, and the long sequence is cut into multiple fixed-length time sequence samples through this fixed window length, ensuring that each sample can reflect the dynamic changes of the signal in a certain time period, such as cutting instantaneous impact and load fluctuation, avoiding feature dilution caused by too long signal;
[0019] Normalization processing: The dimension of current signal and vibration signal is significantly different, directly inputting the model will lead to overfitting of signals with large numerical range, therefore Min-Max normalization is performed on each window signal, the formula is:
[0020]
[0021] Where, is the single sampling value of the original signal, is the minimum value of the original signal in the window, is the maximum value of the original signal in the window, is the normalized signal value;
[0022] The signal is mapped to the interval [0, 1] by normalization processing, the dimensional difference is eliminated, the characteristics in the window are ensured not to be interfered by the amplitude, and the adaptability of the model to different working conditions is improved.
[0023] Specifically, in step S2, the signal channel division, multi-scale convolutional neural network configuration, convolution operation and feature splicing process includes:
[0024] S2.1 Signal channel division and multi-scale convolutional neural network configuration: the preprocessed signal is explicitly divided into two independent channels: the current signal channel input IU, IV, IW, reflecting the load change of the main shaft motor, directly related to the energy transmission of cutting force; the vibration signal channel input Vx, Vy, Vz, reflecting the mechanical vibration state of the main shaft, embodying the dynamic impact of cutting force on the main shaft;
[0025] The multi-scale convolutional neural network structure of each channel is consistent, and each contains 3 parallel convolution branches, the convolution kernel size is 3x1, 5x1, 7x1, and the output channel number is 32; different size convolution kernels correspond to different receptive fields: 3x1 captures short-term fluctuations, reflecting instantaneous impact of cutting; 5x1 extracts medium-term changes, reflecting load fluctuations; 7x1 captures long-term trends, reflecting overall signal changes in stable working conditions, ensuring multi-scale coverage of signal characteristics;
[0026] S2.2 Convolution operation and feature splicing: using a linear rectifier function as an activation function to alleviate the gradient vanishing problem, and the convolution formula is:
[0027]
[0028] wherein, is the feature value of the i-th output channel and the j-th convolution branch, is a linear rectifier function as an activation function, is the i-th convolution weight of the i-th output channel and the j-th branch, is the bias term of the i-th output channel and the j-th branch, is the i-th sampling point of the normalized time series;
[0029] No pooling layer is set in the convolution operation to avoid loss of time series information and ensure that the output feature time series length is consistent with the input;
[0030] The output features of the three convolution branches of the same channel are spliced in the channel dimension, and the current signal channel obtains multi-scale fusion features The vibration signal channel obtains multi-scale fusion features Different receptive field features are integrated to form a comprehensive local representation.
[0031] Specifically, in step S3, the bidirectional long short-term memory network is configured, bidirectional time series calculation, gating mechanism and feature splicing, the process includes:
[0032] S3.1 bidirectional long short-term memory network structure configuration: input and into two independent bidirectional long short-term memory networks with the same structure respectively, each network adopts a 3-layer stacked structure; the number of hidden units in each layer is 256, a Dropout layer with a dropout probability of 0.2 is set between adjacent layers to randomly discard part of the neurons, inhibit overfitting, and improve the model generalization ability;
[0033] S3.2 bidirectional time series calculation and gating mechanism, including: bidirectional time series calculation: the forward long short-term memory network processes the features according to the original time sequence, and outputs the forward hidden state , reflecting the forward time sequence dependence; the reverse long short-term memory network processes the features in reverse order according to the time sequence, and outputs the reverse hidden state , reflecting the backward time sequence dependence;
[0034] Gating mechanism operation: through the forget gate, input gate, cell state, and output gate to realize selective transmission of time sequence information, wherein:
[0035] Forget gate: , discard the redundant information in the cell state at the previous moment;
[0036] Input gate: , , update the new information of the current cell state;
[0037] Cell state: , stable transmission of long time sequence information;
[0038] Output gate: , , filter key information to hidden state;
[0039] wherein, is the forget gate weight matrix, is the input gate weight matrix, is the candidate cell state weight matrix, is the output gate weight matrix, is the forget gate bias vector, is the input gate bias vector, bias vector for the candidate cell state, bias vector for the output gate, previous time hidden state, current time hidden state, current time input feature, element-wise multiplication, previous time cell state, current time cell state, current time candidate cell state;
[0040] will be and concatenated in the channel dimension, the current signal channel obtains the time sequence feature , and the vibration signal channel obtains the time sequence feature , which fully captures the time sequence correlation and provides a time sequence feature basis for subsequent multi-head attention processing.
[0041] Specifically, in step S4, the double-channel multi-head attention calculation and feature fusion and cross-channel attention feature splicing are performed, and the specific process includes:
[0042] S4.1 Double-channel multi-head attention calculation and feature fusion: for the current signal time sequence feature and the vibration signal time sequence feature , an independent multi-head attention mechanism is configured respectively, wherein the number of attention heads is 4, and feature fusion is achieved by cross-channel splicing:
[0043] Current signal channel attention calculation:
[0044] 4 attention heads are calculated in parallel, each head generates an attention score through , and the weight is obtained through the Softmax function , and the context output of the first head is generated through ;
[0045] Feature splicing: the context output of the first head is spliced to obtain the context vector of the first head ; the context vectors of the 4 attention heads are further spliced to obtain the multi-channel fusion feature ;
[0046] wherein, , , are respectively trainable query matrix, key matrix and value matrix; , are respectively the first , The output vector of BiLSTM at each time step; The dimension of the key vector; The timing length; Number the attention head. ;
[0047] Vibration signal channel attention calculation:
[0048] Using the same calculation process as the current path, through independent parameter matrices , , deal with Generate vibration channel attention features The focus is on capturing the temporal correlation of impact characteristics in vibration signals;
[0049] S4.2 Cross-channel attention feature stitching: and By splicing along the channel dimension, multi-channel fused features are obtained. By integrating the load timing characteristics of current signals and the impact timing characteristics of vibration signals, multi-source information complementarity is achieved, providing comprehensive feature support for prediction.
[0050] Specifically, in step S5, the fully connected network design, composite loss function construction, model training strategy, and performance verification processes include:
[0051] S5.1 Fully Connected Network Design: Three independent fully connected networks correspond to the prediction in the X, Y, and Z directions, respectively. Each fully connected network contains one hidden layer with 128 neurons, using a linear rectified function as the activation function; one output layer contains one neuron and does not use an activation function; the hidden layer enhances the nonlinear fitting capability to adapt to the complex coupling relationship between cutting force and features, and the output layer directly outputs the predicted cutting force value without additional transformation;
[0052] Prediction process: The inputs are processed through three fully connected networks. After forward propagation, the fused features are first activated by a linear transformation and a linear rectified function in the hidden layer to filter key features. Then, the output layer undergoes a linear transformation to obtain the predicted cutting forces in the X, Y, and Z directions. To achieve synchronous prediction of three-axis cutting forces;
[0053] S5.2 Construction of Composite Loss Function: To address the shortcomings of traditional single loss functions, which only optimize the overall error, are prone to abrupt changes in the prediction curve, and have low accuracy in the peak segment, a weighted composite loss function is designed. The three types of losses are optimized in a coordinated manner, taking into account overall accuracy, curve smoothness, and peak accuracy:
[0054] Mean Squared Error: As the basic loss term, the overall fitting error of the optimized model is optimized to ensure the global consistency of the predicted value and the true value, and the formula is:
[0055]
[0056] Smooth Loss: Suppresses the physically meaningless jump of the predicted curve, ensures the time series trend of the predicted value consistent with the true value, and meets the physical law of cutting force change, and the formula is:
[0057]
[0058] Peak Weighted Loss: Improve the prediction accuracy of the peak section of cutting force; The cutting force in the peak section has the greatest impact on tool wear and machine structure impact, so it is optimized, and the formula is:
[0059]
[0060] Where, is the total number of samples, is the number of cutting force peak samples, is the true cutting force of the th sample, is the predicted cutting force of the th sample, is the peak sample index set; Set the weight coefficient = 0.6, = 0.2, = 0.2; While ensuring the basic prediction accuracy of the model, balance the overall accuracy and curve stability, and avoid model output from noise interference;
[0061] The weighted composite loss function satisfies , to ensure the synergistic effect of the three types of loss;
[0062] S5.3 Model Training Strategy: To ensure efficient convergence of the model and suppress overfitting, design the training process by combining data division, optimizer selection and early stopping strategy:
[0063] Data division: The model training data comes from the multi-condition data collected in the numerical control milling experiment, covering different spindle speeds, feed rates, and cutting depths of numerical control milling data. A total of 500 sets of cutting process data are selected as the data set, which is divided into training set, validation set and test set according to the ratio of 70% / 15% / 15%. Training set: 350 groups of data are used for model parameter learning, including convolution weight, long short-term memory network gate parameter and attention matrix parameter. The parameters are updated through batch iteration to minimize the composite loss function. Validation set: 75 groups of data are used for hyperparameter tuning and early stopping judgment to avoid data leakage between training set and validation set and ensure the objectivity of evaluation. Test set: 75 groups of data are used for final model performance verification. The test set data does not participate in any training process, so it can truly reflect the generalization ability of the model.
[0064] Optimizer selection and parameter setting: Adam optimizer is used for model parameter update, which combines momentum gradient descent. It is suitable for complex deep learning model training. Initial learning rate: set to 0.001. Learning rate decay: when the validation set loss does not decrease for 5 consecutive rounds, the learning rate is decayed to 1 / 10 of the original. By dynamically adjusting the learning rate, the model can be ensured to converge to the optimal solution in the later training period. Batch size and training rounds: the batch size is set to 32 and the maximum training rounds are set to 200 to ensure that the model has sufficient iteration times to learn the data pattern.
[0065] Early stopping strategy: Early stopping strategy is introduced to prevent model overfitting. When the validation set loss does not decrease for 30 consecutive rounds, the training is immediately terminated and the current optimal model parameters are saved, i.e. the parameters at the time when the validation set loss is the smallest.
[0066] S5.4 Model performance verification: The model performance is verified by quantitative indicators and visual results to ensure that the precision and stability meet the requirements of engineering applications:
[0067] Quantitative index evaluation: Mean absolute error, relative root mean square error and determination coefficient are used as core evaluation indicators:
[0068] Mean absolute error: It measures the average absolute deviation between predicted value and true value. The smaller the value, the higher the precision.
[0069] Relative root mean square error: It amplifies the influence of large errors and reflects the prediction ability of the model for extreme values.
[0070] Determination coefficient: It measures the explanatory power of the model for data pattern. The closer to 1, the better the fitting effect.
[0071] Wherein, N represents the number of samples in the data set, Indicates the first The true cutting force components of each sample Indicates the first Predicted cutting force components for each sample The mean of the true values The mean of the predicted values.
[0072] The present invention provides a spindle cutting force prediction device based on a multi-channel deep learning model, comprising:
[0073] The acquisition and preprocessing module is used for the acquisition and preprocessing of multi-channel monitoring signals. It acquires the three-dimensional vibration signal of the spindle and the three-phase current signal of the spindle motor through sensors and servo system, respectively. After the data format is unified by timestamp alignment, sliding window segmentation and normalization are used to form standardized samples that meet the model input requirements. The sliding window ensures the continuity of time sequence, and normalization eliminates the difference in dimensions, laying the foundation for subsequent feature extraction.
[0074] The feature extraction module is used for parallel feature extraction via multi-scale convolutional neural networks. It divides the preprocessed multi-channel signal into current signal channels and vibration signal channels based on their physical characteristics. Each channel is connected to a multi-scale convolutional neural network, and local features are extracted through convolutional branches with different receptive fields. The features are then concatenated along the channel dimensions to obtain the multi-scale fused features of the two types of signals. and Among them, multi-scale convolutional neural networks ensure coverage of short-term fluctuations, medium-term changes and long-term trends of signals, providing high-quality local features for time series modeling;
[0075] The temporal modeling module is used for temporal modeling based on bidirectional long short-term memory networks: it fuses features across multiple scales. and Separate bidirectional long short-term memory networks are input into each signal. The forward and backward temporal dependencies of the signals are captured through parallel processing of the forward and backward long short-term memory networks. The temporal features of the two types of signals are then obtained by feature concatenation. and The three-layer stacked structure and Dropout layer ensure the depth and generalization ability of timing modeling, while the bidirectional design solves the problem of missing timing information in one direction.
[0076] Feature fusion module for multi-head attention feature fusion: and A multi-head attention mechanism is used for processing, with each signal channel independently performing attention calculations. The resulting attention features are then concatenated along the channel dimension to form a multi-channel fused feature. Strengthen the focus on key time segments and improve feature correlation;
[0077] A prediction and training module for three-axis cutting force prediction and model training: inputting three independent fully connected sub-networks, respectively outputting X, Y, Z three-direction cutting force prediction values; adopting a weighted composite loss function to optimize the model, combining the Adam optimizer and early stopping strategy for training, and ensuring the model accuracy and generalization ability through data division and performance verification; Input 3 independent fully connected sub-networks, respectively output X, Y, Z three-direction cutting force prediction value; adopt weighted composite loss function to optimize model, combine Adam optimizer and early stopping strategy training, through data division and performance verification to ensure model precision and generalization ability;
[0078] The acquisition and preprocessing module, wherein:
[0079] Multi-channel signal acquisition: Taking numerical control milling machining experiment as the application scene, two types of core acquisition signals are determined: one is the three-direction vibration signal of the spindle, which is collected by a three-direction acceleration sensor installed near the spindle shell, avoiding the tool movement trajectory, ensuring that the dynamic changes of the spindle in X, Y, Z three directions during machining can be accurately captured, and signal distortion caused by installation position deviation is avoided; the second is the three-phase current signal of the spindle motor, which is directly read from the servo drive system of the numerical control machine tool without additional external acquisition device, fully utilizing the machine tool's own monitoring resources, reducing the hardware deployment cost; the system synchronously records the machining condition parameters including spindle speed, feed speed, cutting depth during the acquisition process, ensuring that the signals and working conditions correspond one by one, providing data support for subsequent multi-condition model training;
[0080] Signal timestamp alignment and data completion: Due to the different collection paths of vibration signals and current signals, time deviation may exist; therefore, a unified timestamp is added to the two types of signals through the clock synchronization function of the numerical control system, realizing the time sequence alignment of 6 channels of data, avoiding the feature correlation failure caused by time misalignment; if a small amount of signal loss occurs due to sensor instantaneous poor contact and data transmission delay during the acquisition process, linear interpolation method is used to complete the missing data points, finally the data of each channel is uniformly processed into a fixed-length original signal sequence containing 50,000 data points, ensuring that all channel data formats are consistent, facilitating subsequent batch preprocessing;
[0081] Sliding window segmentation and normalization processing:
[0082] Sliding window segmentation: The original signal is a continuous long time sequence, directly inputting into the neural network will cause a sharp increase in calculation and difficulty in capturing local time sequence features, therefore sliding window method is adopted for segmentation; the window length is set to 200 sampling points, which has been verified by experiments to balance the time sequence continuity and local feature integrity, the long sequence is cut into multiple fixed-length time sequence samples through this fixed window length, ensuring that each sample can reflect the dynamic changes of the signal in a certain time period, such as cutting instantaneous impact and load fluctuation, avoiding feature dilution caused by too long signal;
[0083] Normalization processing: the dimensional difference between the current signal and the vibration signal is significant, and directly inputting the model will cause overfitting of signals with a large numerical range, so the Min-Max normalization is performed on the signals in each window, and the formula is:
[0084]
[0085] wherein, is a single sampling value of the original signal, is the minimum value of the original signal in the window, is the maximum value of the original signal in the window, is the normalized signal value;
[0086] The signal is mapped to the [0, 1] interval through normalization processing, the dimensional difference is eliminated, the features in the window are not interfered by the amplitude, and the adaptability of the model to different working conditions is improved.
[0087] An electronic device of the present application comprises a memory, a processor and a computer program stored on the memory and executable on the processor, and the processor executes the computer program to realize the main shaft cutting force prediction method based on the multi-channel deep learning model as described above.
[0088] A non-transitory computer readable storage medium of the present application has a computer program stored thereon, and the computer program is executed by a processor to realize the main shaft cutting force prediction method based on the multi-channel deep learning model as described above.
[0089] Compared with the prior art, the present application has the following advantages and beneficial effects:
[0090] 1. Without additional deployment of force measuring devices, the spindle vibration signal and spindle motor current signal of the built-in sensor in the machine tool system are fully utilized as input variables, avoiding the problem of relying on expensive and easily disturbed external force measuring devices or special measurement environment in traditional methods, significantly reducing the system deployment cost; without modifying the machine tool structure, it can adapt to various machining scenes such as numerical control milling and drilling, improving the adaptability range and scalability of the system.
[0091] 2. The present application is based on multi-channel signal design, and the monitoring signals from different physical sources are introduced into independent feature extraction channels, which can fully exploit the complementary characteristics between different signals, realize multi-dimensional modeling of the cutting force time sequence dynamics, and improve the perception ability of the model to the mechanical behavior under complex working conditions.
[0092] 3. By introducing a joint modeling method of multi-scale convolutional neural network and bidirectional long short-term memory network in each signal channel, the application can simultaneously capture local fluctuation patterns and long-term dependencies, significantly outperforming existing prediction methods based only on statistical features or single model structures, and enhancing the time robustness and generalization ability of the model.
[0093] 4. The application introduces a composite loss function combining mean square error, time series smoothing constraint and peak weighting in the training process, so that the model not only optimizes the overall error, but also shows stronger response accuracy in the mutation section, while avoiding the jumping or oscillation of the output curve, and improving the usability of the prediction results in actual engineering. BRIEF DESCRIPTION OF DRAWINGS
[0094] Figure 1 is a flowchart of a main shaft cutting force prediction method based on a multi-channel deep learning model of the application.
[0095] Figure 2 is a multi-channel deep learning model architecture diagram of an embodiment of the application.
[0096] Figure 3 is an application architecture diagram in the main shaft cutting force prediction of an embodiment of the application.
[0097] Figure 4 is a comparison diagram of three-direction cutting force component prediction values and actual values of an embodiment of the application.
[0098] Figure 5 is a local magnification diagram of the comparison of cutting force prediction values and actual values of an embodiment of the application, taking 0-1000 sampling points.
[0099] Figure 6 is a local magnification diagram of the comparison of cutting force prediction values and actual values of an embodiment of the application, taking 3000-4000 sampling points. DETAILED DESCRIPTION
[0100] The application discloses a main shaft cutting force prediction method and device based on a multi-channel deep learning model and electronic equipment, which fuses multi-source monitoring signals of a machine tool spindle in a machining process, including three-phase current signals of a spindle motor and three-direction vibration signals of a spindle, i.e., six-channel signals, to improve the accuracy and real-time performance of cutting force prediction. First, in the machining process of a numerical control machine tool, the spindle motor and the spindle vibration sensor are high-frequency synchronously sampled, and all channel signals are collected and aligned under a unified time reference. The six-channel original signal sequence obtained after normalization processing is constructed into training samples according to a fixed length sliding window, so as to have a standardized input format and meet the requirements of neural network modeling.
[0101] In view of the different physical properties of the six-channel signals and the differences in the influence characteristics of the cutting force, in order to realize targeted feature extraction, the vibration signal and the current signal are respectively input into independently designed multi-scale convolutional neural networks, and local dynamic features are extracted through multiple convolution kernels with different receptive fields. Each multi-scale convolutional neural network includes multiple parallel convolution branches for capturing the change characteristics of the signal at different time scales, and the convolution output is spliced in the channel dimension as the local representation of the signal. Then, the features extracted by the multi-scale convolutional neural network modules of the vibration and current signals are respectively input into a bidirectional long short-term memory network for forward and backward dependent modeling of the signal sequence in the time dimension. After the bidirectional long short-term memory network, a multi-head attention mechanism is introduced to enhance the model's attention ability to key time segments and to realize weighted modeling of the importance of different time steps, thereby improving the response ability to peak loads and sudden changes in non-stationary signals. After the feature modeling is completed, the model fuses the time sequence features extracted from the two types of signals and inputs them into three independent regression branch sub-networks, respectively corresponding to the predicted values of the Fx, Fy and Fz three-axis cutting forces. Each sub-network is composed of multiple layers of fully connected neural networks to output the corresponding values in a regression manner. The overall model architecture is as shown in Figure 2
[0102] Secondly, in order to further improve the model's prediction ability for complex working conditions such as peak load and dynamic response, the present application adopts a three-way output structure to predict the three-axis cutting forces, and designs a composite loss function containing mean square error, sequence smoothness constraint and peak value weighted penalty, effectively balancing the prediction accuracy and stability. Early stopping strategy is introduced in the model training process to prevent overfitting, and the overall model performance is improved through hyperparameter optimization method.
[0103] The present application makes full use of existing machine tool monitoring channel resources without the need to introduce additional complex sensor systems, and has good industrial practicability. Through the combination of structure design and loss function optimization, the present method shows good prediction accuracy and real-time response ability when dealing with complex dynamic working conditions, and is suitable for online cutting state monitoring and tool wear prediction in numerical control machining process and other application scenarios, and has high engineering application value and promotion prospect.
[0104] The application will be further described in detail below with reference to specific embodiments. It should be understood that the following embodiments are only used to illustrate the application, but not to limit the application.
[0105] As shown in Figure 1 The present application provides a spindle cutting force prediction method based on a multi-channel deep learning model, including the following steps:
[0106] S1, acquisition and preprocessing of multi-channel monitoring signals: the three-axis vibration signals and three-phase current signals of the main shaft motor are collected through sensors and servo systems respectively, after time stamp alignment and data completion, sliding window segmentation and normalization processing are adopted to form standardized samples that meet the input requirements of the model; the sliding window ensures the continuity of the time sequence, and the normalization eliminates the dimensional differences, laying a foundation for subsequent feature extraction.
[0107] S2, parallel feature extraction of multi-scale convolutional neural network: the preprocessed multi-channel signals are divided into current signal channels and vibration signal channels according to physical characteristics, each channel is connected to a multi-scale convolutional neural network, different receptive fields of the multi-scale convolutional neural network are configured, local features are extracted through convolution operation of different receptive fields, and multi-scale fusion features of the two types of signals are obtained through channel dimension splicing and ; wherein the multi-scale convolutional neural network ensures to cover short-term fluctuations, medium-term changes and long-term trends of the signal, and provides high-quality local features for time series modeling.
[0108] S3, time series modeling based on bidirectional long short-term memory network: the multi-scale fusion features and are respectively input into independent bidirectional long short-term memory networks, the forward and backward long short-term memory networks are processed in parallel to capture the forward and backward time series dependence of the signal, and the time series features of the two types of signals and are obtained through feature splicing; wherein the 3-layer stacked structure and the Dropout layer ensure the depth and generalization ability of the time series modeling, and the bidirectional design solves the problem of missing single-direction time series information.
[0109] S4, multi-head attention feature fusion: the and are respectively processed by multi-head attention mechanism, each signal channel independently completes attention calculation, and the multi-channel fusion features are obtained after cross-channel dimension splicing, which strengthens the attention to key time segments and improves the feature correlation.
[0110] S5, three-axis cutting force prediction and model training: by designing a full connection network, input into 3 independent full connection sub-networks, respectively output X, Y, Z three direction cutting force prediction value; construct a composite loss function, combined with Adam optimizer and early stopping model training strategy, through performance verification to ensure the model precision and generalization ability, meet the engineering application requirements.
[0111] Specifically, in step S1, the multi-channel signal acquisition, signal timestamp alignment and data completion, sliding window segmentation and normalization processing, the process includes:
[0112] S1.1 Multi-channel signal acquisition: Taking numerical control milling experiment as the application scenario, two types of core acquisition signals are defined: one is the spindle three-direction vibration signal, which is collected by a three-direction acceleration sensor installed near the spindle shell to avoid the tool movement trajectory and ensure accurate capture of the dynamic changes of the spindle in the X, Y and Z directions during processing, avoiding signal distortion caused by installation position deviation; the other is the spindle motor three-phase current signal, which is directly read from the servo drive system of the numerical control machine tool without additional external acquisition device, fully utilizing the machine tool's own monitoring resources to reduce hardware deployment cost. During the acquisition process, the system synchronously records the processing condition parameters, including spindle speed, feed speed, cutting depth, etc., to ensure one-to-one correspondence between the signals and the conditions and provide data support for subsequent multi-condition model training.
[0113] S1.2 Signal timestamp alignment and data completion: Due to the different collection paths of vibration signals and current signals, time deviation is easy to occur. Therefore, the clock synchronization function of the numerical control system is used to add a unified timestamp to the two types of signals, realize the time sequence alignment of the 6-channel data, and avoid the feature correlation failure caused by time misalignment. If a small amount of signal is missing due to sensor instantaneous poor contact, data transmission delay, etc. during the acquisition process, linear interpolation method is used to complete the missing data points, and finally each channel data is uniformly processed into a fixed-length original signal sequence containing 50,000 data points, ensuring that all channel data formats are consistent and facilitating subsequent batch preprocessing.
[0114] S1.3 Sliding window segmentation and normalization processing:
[0115] Sliding window segmentation: The original signal is a continuous long time sequence, and directly inputting it into the neural network will cause a sharp increase in calculation and make it difficult to capture local time sequence features, therefore sliding window method is used for segmentation. The window length is set to 200 sampling points, which has been verified by experiments to balance the time sequence continuity and local feature integrity, and the long sequence is cut into multiple fixed-length time sequence samples through this fixed window length, ensuring that each sample can reflect the dynamic changes of the signal in a certain time period, such as cutting instantaneous impact and load fluctuation, avoiding feature dilution caused by too long signal.
[0116] Normalization processing: the dimension of current signal and vibration signal is significantly different, and directly inputting into the model will cause excessive fitting of signals with large numerical range, therefore Min-Max normalization is performed on the signals in each window, the formula is:
[0117]
[0118] wherein, For a single sample value of the original signal, This represents the minimum value of the original signal within that window. This represents the maximum value of the original signal within the window. This is the normalized signal value.
[0119] By normalizing the signal to the [0,1] interval, the difference in dimensions is eliminated, ensuring that the features within the window are not affected by the amplitude, and improving the model's adaptability to different working conditions.
[0120] Specifically, in step S2, the signal channel segmentation, multi-scale convolutional neural network configuration, convolution operation, and feature concatenation process includes:
[0121] S2.1 Signal Channel Division and Multi-Scale Convolutional Neural Network Configuration: The preprocessed signal is clearly divided into two independent channels: the current signal channel with inputs IU, IV, and IW, reflects the changes in the spindle motor load and is directly related to the energy transfer of cutting force; the vibration signal channel with inputs Vx, Vy, and Vz reflects the mechanical vibration state of the spindle and embodies the dynamic impact of the cutting force on the spindle. Independent channel processing allows for targeted mining of the characteristic patterns of different signals and avoids interference between signals.
[0122] Each channel has a consistent multi-scale convolutional neural network structure, containing three parallel convolutional branches with kernel sizes of 3×1, 5×1, and 7×1, and 32 output channels. Different kernel sizes correspond to different receptive fields: 3×1 captures short-term fluctuations, such as instantaneous impact during cutting; 5×1 extracts medium-term changes, such as stable load fluctuations; and 7×1 captures long-term trends, such as overall signal changes under stable operating conditions, ensuring multi-scale coverage of signal features.
[0123] S2.2 Convolution Operation and Feature Concatenation: Using a linear rectified function as the activation function To alleviate the vanishing gradient problem, the convolution formula is:
[0124]
[0125] in, For the first The output channel, the first The feature values of each convolutional branch Using a linear rectified function as the activation function, For the first The output channel, the first The branch road Each convolution weight, For the first The output channel, the first The bias term of each branch, The first normalized time-series signal one sampling point;
[0126] No pooling layer is set in the convolution operation to avoid the loss of time sequence information and ensure that the output feature time sequence length is consistent with the input.
[0127] The output features of the three convolution branches of the same channel are spliced in the channel dimension, and the current signal channel obtains multi-scale fusion features , and the vibration signal channel obtains multi-scale fusion features , integrates different receptive field features, and forms a comprehensive local representation.
[0128] Specifically, in step S3, the bidirectional long short-term memory network configuration, bidirectional time sequence calculation, gating mechanism and feature splicing, the process includes:
[0129] S3.1 Bidirectional long short-term memory network structure configuration: input and into two independent bidirectional long short-term memory networks with the same structure respectively, each network adopts a 3-layer stacked structure, which can fully capture long time sequence dependence and avoid the increase of training difficulty caused by too deep model; the number of hidden units in each layer is 256, balancing feature expression and computing efficiency; a Dropout layer with a dropout probability of 0.2 is set between adjacent layers to randomly discard part of the neurons, inhibit overfitting, and improve the generalization ability of the model.
[0130] S3.2 Bidirectional time sequence calculation and gating mechanism: bidirectional time sequence calculation: the forward long short-term memory network processes the features according to the original time sequence, and outputs the forward hidden state , reflecting the forward time sequence dependence; the reverse long short-term memory network processes the features in reverse order according to the time sequence, and outputs the reverse hidden state , reflecting the backward time sequence dependence.
[0131] Gating mechanism operation: through the forget gate, input gate, cell state, and output gate to realize selective transmission of time sequence information:
[0132] 1. Forget gate: , discard the redundant information in the cell state at the previous moment;
[0133] 2. Input gate: , , update the current cell state new information;
[0134] 3. Cell state: , stable transmission of long time sequence information;
[0135] 4. Output gate: , , filter key information to hidden state.
[0136] wherein, Here is the forget gate weight matrix. The weight matrix of the input gate, This is the weight matrix for the candidate cell states. This is the output gate weight matrix. Let be the bias vector of the forget gate. The bias vector of the input gate, This is the bias vector for the candidate cell state. This is the bias vector for the output gate. The state was hidden in the previous moment. Hide the current state. Input features for the current time step. For element-wise multiplication, This represents the cell state at the previous moment. This represents the current state of the cell. This represents the current state of the candidate cells.
[0137] Will and By concatenating along the channel dimension, the current signal channels obtain timing characteristics. The vibration signal channel obtains time-series characteristics. It fully captures temporal correlations, providing a temporal feature foundation for subsequent multi-head attention processing.
[0138] In step S4, the dual-channel multi-head attention calculation and feature fusion, and cross-channel attention feature concatenation, specifically include the following processes:
[0139] S4.1 Dual-channel multi-head attention calculation and feature fusion: targeting the timing characteristics of current signals With vibration signal timing characteristics Each is configured with an independent multi-head attention mechanism, with 4 attention heads in each case, and feature fusion is achieved through cross-channel stitching:
[0140] Current signal channel attention calculation:
[0141] Four attention heads compute in parallel, each head through Attention scores are generated, and weights are obtained through the Softmax function. Then through Generate the first The context output of the head;
[0142] Feature splicing: splicing the first The context output of the first head is obtained. The context vector of the head The context vectors of the four attention heads are further concatenated to obtain the multi-channel fused features. .
[0143] wherein, , , are trainable query matrix, key matrix, value matrix respectively; , are BiLSTM output vectors of the , th time step respectively; is the dimension of key vector; is the length of time sequence; is the attention head number, ;
[0144] Vibration signal channel attention calculation:
[0145] Using the same calculation process as the current channel, the vibration channel attention feature , , is generated by processing , which focuses on capturing the impact feature time sequence in the vibration signal.
[0146] S4.2 Cross-channel attention feature splicing: concatenate and in the channel dimension to obtain multi-channel fusion feature , which integrates the load time sequence features of the current signal and the impact time sequence features of the vibration signal, and realizes the complementarity of multi-source information to provide comprehensive feature support for prediction.
[0147] In step S5, the full connection network design, the composite loss function construction, the model training strategy and the performance verification, the specific process includes:
[0148] S5.1 Full connection network design: The full connection network design: 3 independent full connection networks correspond to X, Y, Z direction prediction respectively, each full connection network contains 1 hidden layer, the hidden layer contains 128 neurons, and the linear rectifier function is used as the activation function; 1 output layer contains 1 neuron, and no activation function is used; The hidden layer enhances the nonlinear fitting ability to adapt to the complex coupling relationship between cutting force and features, and the output layer directly outputs the cutting force prediction value without additional conversion.
[0149] Prediction process: Input 3 full connection networks respectively, and after forward propagation: the fusion features are first linearly transformed by the hidden layer and activated by the linear rectifier function to filter key features; Then linearly transform the output layer to get X, Y, Z three direction cutting force prediction value , realize the synchronous prediction of three-axis cutting force.
[0150] S5.2 Composite loss function construction: In view of the defects of traditional single loss function, such as optimizing only the overall error, the predicted curve is easy to jump, and the accuracy of the peak segment is low, a weighted composite loss function is designed , three types of loss are optimized cooperatively, considering overall accuracy, curve smoothness and peak accuracy:
[0151] Mean squared error: As the basic loss term, it optimizes the overall fitting error of the model, ensuring the global consistency of the predicted value and the true value, and the formula is:
[0152]
[0153] Smooth loss: It suppresses the physically meaningless jump of the predicted curve, ensures the time series trend of the predicted value consistent with the true value, and conforms to the physical law of cutting force change, and the formula is:
[0154]
[0155] Peak weighted loss: It improves the prediction accuracy of the peak segment of cutting force-the peak segment cutting force has the greatest impact on tool wear and machine structure impact, and needs to be optimized, and the formula is:
[0156]
[0157] wherein, is the total number of samples, is the number of cutting force peak samples, is the true cutting force of the th sample, is the predicted cutting force of the th sample, is the peak sample index set. Set the weight coefficient =0.6, =0.2, =0.2. While ensuring the basic prediction accuracy of the model, balance the overall accuracy and curve stability, and avoid the model output from appearing shock due to noise interference.
[0158] The weighted composite loss function satisfies , ensuring the cooperative effect of the three types of loss, and improving the prediction effect comprehensively.
[0159] S5.3 Model training strategy: In order to ensure efficient convergence of the model and suppress overfitting, the training process is designed by combining data division, optimizer selection and early stopping strategy:
[0160] Data division: The model training data comes from the multi-condition data collected in the numerical control milling experiment, covering different spindle speeds, feed rates, and cutting depths. A total of 500 sets of cutting process data are selected as the data set, which is divided into training set, validation set, and test set according to the ratio of 70% / 15% / 15%. Training set: 350 groups of data are used for model parameter learning, including convolution weight, long short-term memory network gate parameter, attention matrix parameter, etc. The parameters are updated through batch iteration to minimize the composite loss function. Validation set: 75 groups of data are used for hyperparameter tuning and early stopping judgment to avoid data leakage between training set and validation set, ensuring objective evaluation. Test set: 75 groups of data are used for final model performance verification. The test set data does not participate in any training process, so it can truly reflect the generalization ability of the model.
[0161] Optimizer selection and parameter setting: Adam optimizer is used for model parameter update. Adam optimizer combines the advantages of momentum gradient descent and adaptive learning rate, which can accelerate convergence and avoid local optimal solution. It is suitable for complex deep learning model training: initial learning rate: set to 0.001, which is verified by experiment to ensure that the loss value decreases rapidly in the early stage of training and avoids parameter oscillation caused by excessive learning rate in the later stage; learning rate decay: when the validation set loss does not decrease for 5 consecutive rounds, the learning rate is decayed to 1 / 10 of the original value. By dynamically adjusting the learning rate, the model can be ensured to converge to the optimal solution stably in the later training stage; batch size and training rounds: the batch size is set to 32 and the maximum training rounds is set to 200, ensuring that the model has sufficient iteration times to learn the data pattern.
[0162] Early stopping strategy: early stopping strategy is introduced to prevent model overfitting. When the validation set loss does not decrease for 30 consecutive rounds, the training is immediately terminated and the current optimal model parameters are saved, i.e. the parameters at the time when the validation set loss is minimum. This strategy can effectively avoid the overfitting of the model to the noise in the training set in the later training stage, ensuring that the model still maintains high prediction accuracy on the test set and improves the generalization ability.
[0163] S5.4 Model performance verification: the model performance is verified by quantitative indicators and visual results to ensure that the accuracy and stability meet the requirements of engineering application:
[0164] Quantitative index evaluation: mean absolute error, relative root mean square error, and determination coefficient are used as core evaluation indicators:
[0165] : mean absolute error, which measures the average absolute deviation between predicted value and true value. The smaller the value, the higher the accuracy;
[0166] Compared to the root mean square error, it amplifies the impact of larger errors and reflects the model's ability to predict extreme values.
[0167] The coefficient of determination measures a model's ability to explain patterns in the data; the closer it is to 1, the better the fit.
[0168] in, This represents the number of samples in the dataset. Indicates the first The true cutting force components of each sample Indicates the first Predicted cutting force components for each sample The mean of the true values The mean of the predicted values.
[0169] Figure 3 This paper details the application architecture of the spindle cutting force prediction method based on a multi-channel deep learning model proposed in this invention. The schematic diagram clearly presents the entire process from multi-source signal acquisition, model construction and training to prediction result output, demonstrating the systematic nature and completeness of this method. Based on this technical process, to comprehensively evaluate the performance of the proposed model in the cutting force prediction task, it is compared and analyzed in depth with a series of deep learning methods, as shown in Tables 1, 2, and 3.
[0170] Table 1 Comparison of Prediction Results - X Component
[0171] Table 2 Comparison of Prediction Results - Y Component
[0172] Table 3 Comparison of Prediction Results - Z Component
[0173] The comparison results show that the proposed model performs best in predicting cutting forces across all three components, and significantly reduces errors in mean absolute error and relative root mean square error. Furthermore, the coefficient of determination remains consistently high, indicating that the model not only accurately predicts the magnitude of the cutting force but also effectively captures its changing trends. To further demonstrate the effectiveness of the cutting force prediction, Figure 4 , Figure 5 , Figure 6 The complete results of the three components of the cutting force prediction on the validation set, as well as the magnified results of some sampling points, are presented respectively. The prediction results show that the model's overall performance in triaxial cutting force prediction is relatively stable, and the predicted curves are basically consistent with the waveform trends of the actual cutting forces, accurately depicting the dynamic changes in the cutting process.
[0174] The application provides a spindle cutting force prediction method and device based on a multi-channel deep learning model and electronic equipment, which fuses two types of monitoring information with different sources but complement each other, i.e., spindle current and vibration signals, to construct a time series prediction model with high precision and high responsiveness. Compared with a traditional cutting force estimation method relying on a single channel or an empirical model, the application has been improved in aspects such as signal modeling, network structure design and loss function construction, so that the adaptability and generalization ability of the model to complex cutting conditions are significantly improved.
Claims
1. A main spindle cutting force prediction method based on a multi-channel deep learning model, characterized by, Comprising the following steps: S1, multi-channel monitoring signal acquisition and preprocessing: through the sensor and servo system, respectively, collecting the spindle three-direction vibration signal and the spindle motor three-phase current signal, after time stamp alignment and data completion, using sliding window segmentation and normalization processing, forming standardized samples meeting the model input requirements; wherein the sliding window ensures the time sequence continuity, and the normalization eliminates the dimension difference, laying the foundation for subsequent feature extraction; S2, multi-scale convolutional neural network parallel feature extraction: the pre-processed multi-channel signal is divided into current signal channel and vibration signal channel according to physical characteristics, each channel is connected to a multi-scale convolutional neural network, different receptive fields of the multi-scale convolutional neural network are configured, local features are extracted through convolution operation of different receptive fields, and multi-scale fusion features of the two types of signals are obtained through channel dimension feature splicing and ; wherein the multi-scale convolutional neural network ensures covering short-term fluctuations, medium-term changes and long-term trends of the signal, and provides high-quality local features for time series modeling; S3, time series modeling based on bidirectional long short-term memory network: by configuring bidirectional long short-term memory network, multi-scale fusion features and are input into independent bidirectional long short-term memory networks respectively, and the forward and backward time series dependence of the signals is captured through bidirectional time series calculation and gate mechanism processing, and then the time series features of the two types of signals are obtained through feature splicing and ; wherein the 3-layer stacking structure and the Dropout layer ensure the depth and generalization ability of the time series modeling, and the bidirectional design solves the problem of missing single-direction time series information; S4, multi-head attention feature fusion: on and respectively using multi-head attention mechanism, two signal channels independently complete attention calculation, get the attention features of each other cross channel dimension splicing to form multi-channel fusion features , strengthen the attention to key timing paragraphs, improve feature relevance; S5. Three-axis cutting force prediction and model training: By designing a fully connected network, Input three independent fully connected networks and output the predicted cutting force values in the X, Y, and Z directions respectively; construct a composite loss function, combine the Adam optimizer and the early stopping model training strategy, and ensure the model accuracy and generalization ability through performance verification; The specific process of step S1 includes: S1.1 Multi-channel signal acquisition: taking numerical control milling processing experiment as the application scene, two types of core acquisition signals are determined: one is the spindle three-direction vibration signal, which is collected by a three-direction acceleration sensor installed near the spindle shell to avoid the tool movement trajectory, ensuring that the dynamic changes of the spindle in X, Y and Z directions during processing can be accurately captured, avoiding signal distortion caused by installation position deviation; the second is the spindle motor three-phase current signal, which is directly read from the servo drive system of the numerical control machine tool without additional external acquisition device, fully utilizing the machine tool itself monitoring resources, reducing the hardware deployment cost; during the acquisition process, the system synchronously records the processing condition parameters, including spindle speed, feed speed and cutting depth, ensuring that the signal corresponds to the working condition one by one, providing data support for subsequent multi-condition model training; S1.2 Signal time stamp alignment and data completion: through the clock synchronization function of the numerical control system, a unified time stamp is added to the two types of signals, realizing the time sequence alignment of the 6-channel data, avoiding the feature correlation failure caused by time misalignment; if a small amount of signal is missing due to sensor instantaneous contact failure or data transmission delay during the acquisition process, linear interpolation method is used to complete the missing data points, finally the data of each channel is uniformly processed into a fixed-length original signal sequence containing 50,000 data points, ensuring that all channel data formats are consistent, facilitating subsequent batch preprocessing; S1.3 Sliding window segmentation and normalization processing: Sliding window segmentation: the original signal is a continuous long time sequence, directly inputting into the neural network will cause the calculation amount to increase sharply and it is difficult to capture local time sequence features, therefore, sliding window method is used for segmentation; the window length is set to 200 sampling points, which has been verified by experiments to balance the time sequence continuity and local feature integrity, the long sequence is cut into multiple fixed-length time sequence samples through the fixed window length, ensuring that each sample can reflect the dynamic changes of the signal in a certain time period, such as cutting instantaneous impact and load fluctuation, avoiding the feature dilution caused by too long signal; Normalization processing: the dimension difference of current signal and vibration signal is significant, directly inputting into the model will cause excessive fitting of signals with large numerical range, therefore, Min-Max normalization is performed on the signals in each window, the formula is: ; wherein, is a single sample value of the original signal, is a minimum value of the original signal within the window, is a maximum value of the original signal within the window, is a normalized signal value; Through normalization processing, the signal is mapped to the interval [0, 1], eliminating the dimension difference, ensuring that the window features are not disturbed by the amplitude, and improving the adaptability of the model to different conditions.
2. The spindle cutting force prediction method based on a multi-channel deep learning model according to claim 1, characterized in that, In step S2, the signal channel division, multi-scale convolutional neural network configuration, convolution operation and feature splicing process includes: S2.1 Signal channel division and multi-scale convolutional neural network configuration: The preprocessed signal is explicitly divided into two independent channels: the current signal channel input is IU, IV, IW, which reflects the spindle load change and is directly related to the energy transmission of cutting force; the vibration signal channel input is Vx, Vy, Vz, which reflects the spindle mechanical vibration state and embodies the dynamic impact of cutting force on the spindle; The multi-scale convolutional neural network structure of each channel is consistent, and each contains 3 parallel convolution branches with kernel sizes of 3x1, 5x1, and 7x1, and the output channel number is 32; different size convolution kernels correspond to different receptive fields: 3x1 captures short-term fluctuations, reflecting instantaneous cutting impact; 5x1 extracts medium-term changes, reflecting load fluctuations; 7x1 captures long-term trends, reflecting overall signal changes in stable conditions, ensuring multi-scale coverage of signal features; S2.2 convolution operation and feature splicing: adopt linear rectifier function as activation function , to alleviate the problem of gradient disappearance, the convolution formula is: ; in, For the first The output channel, the first The feature values of each convolutional branch Using a linear rectified function as the activation function, For the first The output channel, the first The branch road Each convolution weight, For the first The output channel, the first The bias term of each branch, The first normalized time-series signal One sampling point; No pooling layer is set in the convolution operation to avoid loss of time series information and ensure that the output feature time series length is consistent with the input; The output features of the three convolution branches of the same channel are spliced in the channel dimension, and the current signal channel obtains multi-scale fusion features , and the vibration signal channel obtains multi-scale fusion features , integrates different receptive field features, and forms a comprehensive local representation. 3.The spindle cutting force prediction method based on a multi-channel deep learning model according to claim 1, characterized in that, In step S3, the bidirectional long short-term memory network configuration, bidirectional time series calculation, gating mechanism, and feature splicing process include: S3.1 Bidirectional Long Short-Term Memory Network Structure Configuration: [The following text appears to be a separate, unrelated section and is not translated: "will..."] and Two independent bidirectional long short-term memory networks with identical structures are input respectively. Each network adopts a 3-layer stacked structure. Each layer has 256 hidden units. A dropout layer with a dropout probability of 0.2 is set between adjacent layers to randomly drop some neurons, suppress overfitting, and improve the model's generalization ability. S3.2 Bidirectional temporal computation and gating mechanism, comprising: bidirectional temporal computation: a forward long short-term memory network processes features in original temporal order, outputs forward hidden states, reflecting forward temporal dependency ; a backward long short-term memory network processes features in reverse temporal order, outputs backward hidden states, reflecting backward temporal dependency Gating mechanism operation: Time series information is selectively transmitted through the forget gate, input gate, cell state, and output gate, where: forget gate: to discard redundant information in the cell state from the previous time step; Input gate: , , update the current cell state with new information; Cell state: , stable delivery of long temporal information; Output gate: , , filter key information to hidden state; wherein, is a forget gate weight matrix, is an input gate weight matrix, is a candidate cell state weight matrix, is an output gate weight matrix, is a forget gate bias vector, is an input gate bias vector, is a candidate cell state bias vector, is an output gate bias vector, is a previous time hidden state, is a current time hidden state, is a current time input feature, is an element-wise multiplication, is a previous time cell state, is a current time cell state, is a current time candidate cell state; Will With In the channel dimension splicing, the current signal channel gets the timing characteristics , the vibration signal channel gets the timing characteristics , the timing correlation is captured completely, and the timing feature basis is provided for subsequent multi-head attention processing.
4. The spindle cutting force prediction method based on a multi-channel deep learning model according to claim 1, characterized in that, In step S4, the double-channel multi-head attention calculation and feature fusion, and cross-channel attention feature splicing process include: S4.1 Dual-channel multi-head attention calculation and feature fusion: for current signal time sequence features and vibration signal time sequence features , respectively configure independent multi-head attention mechanisms, where the number of attention heads is 4, and feature fusion is achieved through cross-channel splicing: Current signal channel attention calculation: 4 attention heads are computed in parallel, each head by generating attention scores, which are weighted by a Softmax function and then by generating the context output for the th head; Feature concatenation: concatenate the context outputs of the first head to obtain the context vector of the first head ; further concatenate the context vectors of the four attention heads to obtain the multi-channel fusion feature ; wherein, , , are trainable query matrix, key matrix, value matrix, respectively; , are BiLSTM output vectors at the , time step, respectively; is the key vector dimension; is the time length; is the attention head number, ; Vibration signal channel attention calculation: Adopting the same calculation process as the current channel, through independent parameter matrix 、 、 Processing , generate vibration channel attention features , focus on capturing the timing correlation of impact features in the vibration signal; S4.2 Cross-channel attention feature splicing: the With In the channel dimension splicing, the multi-channel fusion features , integrating the load timing characteristics of the current signal and the impact timing characteristics of the vibration signal, realizing the complement of multi-source information and providing comprehensive feature support for prediction.
5. The spindle cutting force prediction method based on a multi-channel deep learning model according to claim 1, characterized in that, In step S5, the full connection network design, composite loss function construction, model training strategy, and performance verification process include: S5.1 Full connection network design: 3 independent full connection networks correspond to X, Y, Z direction prediction respectively, each full connection network contains 1 hidden layer, the hidden layer contains 128 neurons, and the linear rectifier function is used as the activation function; 1 output layer contains 1 neuron, and no activation function is used; the hidden layer enhances the nonlinear fitting ability to adapt to the complex coupling relationship between cutting force and features, and the output layer directly outputs the cutting force prediction value without additional conversion; Prediction process: The inputs are processed through three fully connected networks. After forward propagation, the fused features are first activated by a linear transformation and a linear rectified function in the hidden layer to filter key features. Then, the output layer undergoes a linear transformation to obtain the predicted cutting forces in the X, Y, and Z directions. To achieve synchronous prediction of three-axis cutting forces; S5.2 Composite loss function construction: In view of the defects that the traditional single loss function only optimizes the overall error, the predicted curve is easy to jump, and the accuracy of the peak section is low, a weighted composite loss function is designed , three types of loss are optimized cooperatively, and the overall accuracy, curve smoothness and peak accuracy are considered. Mean square error: as a basic loss term, it optimizes the overall fitting error of the model to ensure the global consistency of the predicted value and the true value, and the formula is: ; Smooth loss: suppresses the physically meaningless jumps in the predicted curve to ensure that the time series change trend of the predicted value is consistent with the true value and conforms to the physical law of cutting force change, the formula is: ; Peak weighted loss: improves the prediction accuracy of the peak segment of cutting force; the peak segment cutting force has the greatest impact on tool wear and machine structure impact, so it is optimized, the formula is: ; wherein, is the total number of samples, is the number of peak cutting force samples, is the true cutting force of the th sample, is the predicted cutting force of the th sample, is the set of peak sample indices; the weight coefficients are set as = 0.6, = 0.2, = 0.2; while ensuring the accuracy of the base prediction of the model, the overall accuracy and curve stability are balanced to avoid oscillation of the model output due to noise interference; The weighted compound loss function satisfies , ensuring the synergistic effect of the three types of losses; S5.3 Model training strategy: to ensure efficient convergence of the model and suppress overfitting, the training process is designed by combining data division, optimizer selection, and early stopping strategy: Data division: The model training data comes from the multi-condition data collected in the numerical control milling experiment, covering numerical control milling data of different spindle speeds, feed rates, and cutting depths. A total of 500 sets of cutting process data are selected as the data set, which is divided into training set, validation set, and test set according to the ratio of 70% / 15% / 15%. The training set: 350 groups of data are used for model parameter learning, including convolution weight, long short-term memory network gate parameter, and attention matrix parameter. The parameters are updated through batch iteration to minimize the composite loss function. The validation set: 75 groups of data are used for hyperparameter tuning and early stopping judgment to avoid data leakage between the training set and the validation set, ensuring the objectivity of the evaluation. The test set: 75 groups of data are used for final model performance verification. The test set data does not participate in any training process, so it can truly reflect the generalization ability of the model. Optimizer selection and parameter setting: Adam optimizer is used for model parameter update, which combines momentum gradient descent. It is suitable for complex deep learning model training. Initial learning rate: set to 0.
001. Learning rate decay: when the validation set loss does not decrease for 5 consecutive rounds, the learning rate is decayed to 1 / 10 of the original. By dynamically adjusting the learning rate, the model can be ensured to converge to the optimal solution in the later training period. Batch size and training rounds: the batch size is set to 32, and the maximum training rounds is set to 200, ensuring that the model has sufficient iteration times to learn the data pattern. Early stopping strategy: Early stopping strategy is introduced to prevent model overfitting. When the validation set loss does not decrease for 30 consecutive rounds, the training is immediately terminated, and the current optimal model parameters are saved, i.e., the parameters at the time when the validation set loss is minimum. S5.4 Model performance verification: The model performance is verified by quantitative indicators and visual results to ensure that it meets the precision and stability requirements of engineering applications: Quantitative index evaluation: Mean absolute error, relative root mean square error, and determination coefficient are used as core evaluation indicators: : mean absolute error, a measure of the average absolute deviation of predicted values from true values, the smaller the value the higher the accuracy; : Relative root mean square error, amplifying the effect of larger errors, reflecting the model's ability to predict extreme values; : coefficient of determination, measures the explanatory power of the model to the data regularity, the closer to 1 indicates the better fitting effect; wherein, represents the number of samples in the data set, represents the true cutting force component of the sample, represents the predicted cutting force component of the sample, the mean of the true values, the mean of the predicted values.
6. A spindle cutting force prediction device based on a multi-channel deep learning model, characterized by, Including: The acquisition and preprocessing module is used for the acquisition and preprocessing of multi-channel monitoring signals. The spindle three-direction vibration signals and the spindle motor three-phase current signals are collected through sensors and servo systems, respectively. After time stamp alignment and unified data format, sliding window segmentation and normalization processing are performed to form standardized samples that meet the model input requirements. The sliding window ensures the time sequence continuity, and the normalization eliminates the dimension difference, laying a foundation for subsequent feature extraction. The feature extraction module is used for parallel feature extraction of the multi-scale convolutional neural network: the preprocessed multi-channel signal is divided into a current signal channel and a vibration signal channel according to physical characteristics, each channel is connected to the multi-scale convolutional neural network respectively, local features are extracted through different receptive field convolution branches, and then multi-scale fusion features of the two types of signals are obtained through channel dimension splicing and ; wherein the multi-scale convolutional neural network ensures covering short-term fluctuations, medium-term changes and long-term trends of the signal, and provides high-quality local features for time series modeling; The temporal modeling module is used for temporal modeling based on bidirectional long short-term memory networks: it fuses features across multiple scales. and Separate bidirectional long short-term memory networks are input into each signal. The forward and backward temporal dependencies of the signals are captured through parallel processing of the forward and backward long short-term memory networks. The temporal features of the two types of signals are then obtained by feature concatenation. and The three-layer stacked structure and Dropout layer ensure the depth and generalization ability of timing modeling, while the bidirectional design solves the problem of missing timing information in one direction. The feature fusion module is configured to perform multi-head attention feature fusion on the feature sequence of each signal channel. and Each signal channel is independently subjected to attention calculation by using a multi-head attention mechanism respectively, and the attention features obtained by each signal channel are spliced in the channel dimension. The multi-channel fusion features formed by splicing in the channel dimension strengthen the attention on key time intervals and improve the feature correlation. The prediction and training module is used for triaxial cutting force prediction and model training: Three independent fully connected subnetworks are input, and the predicted cutting force values in the X, Y and Z directions are output respectively. The model is optimized by a weighted composite loss function, and trained by combining the Adam optimizer and the early stopping strategy. Data partitioning and performance verification are used to ensure the model's accuracy and generalization ability. The acquisition and preprocessing module, wherein: Multi-channel signal acquisition: Taking a numerical control milling experiment as an application scenario, two types of core acquisition signals are clearly defined: one is the three-direction vibration signal of the spindle, which is collected by a three-direction acceleration sensor installed near the spindle shell to avoid the tool movement trajectory and ensure accurate capture of the dynamic changes of the spindle in the X, Y and Z directions during processing, avoiding signal distortion caused by installation position deviation; the other is the three-phase current signal of the spindle motor, which is directly read from the servo drive system of the numerical control machine tool without the need for additional external acquisition devices, making full use of the machine tool's own monitoring resources and reducing hardware deployment costs; During the acquisition process, the system synchronously records the processing condition parameters, including spindle speed, feed speed and cutting depth, ensuring that the signals correspond to the working conditions one by one and providing data support for subsequent multi-condition model training; Signal timestamp alignment and data completion: Due to the different collection paths of vibration signals and current signals, time deviation is prone to occur; therefore, a unified timestamp is added to the two types of signals through the clock synchronization function of the numerical control system to achieve time sequence alignment of the 6-channel data and avoid feature correlation failure caused by time misalignment; if a small amount of signal is missing due to transient contact failure of the sensor or data transmission delay during the acquisition process, linear interpolation is used to complete the missing data points, and finally each channel data is uniformly processed into a fixed-length original signal sequence containing 50,000 data points, ensuring that all channel data formats are consistent and facilitating subsequent batch preprocessing; Sliding window segmentation and normalization processing: Sliding window segmentation: The original signal is a continuous long time sequence, and direct input into the neural network will cause a sharp increase in calculation and make it difficult to capture local time sequence features, therefore, sliding window method is used for segmentation; the window length is set to 200 sampling points, which has been verified by experiments to balance the time sequence continuity and local feature integrity, and the long sequence is cut into multiple fixed-length time sequence samples through this fixed window length, ensuring that each sample can reflect the dynamic changes of the signal in a certain time period, such as cutting instantaneous impact and load fluctuation, avoiding feature dilution caused by too long signal; Normalization processing: The dimension of current signal and vibration signal is significantly different, and direct input into the model will cause overfitting of signals with large numerical range, therefore, Min-Max normalization is performed on the signal in each window, the formula is: ; wherein, is a single sample value of the original signal, is a minimum value of the original signal within the window, is a maximum value of the original signal within the window, is a normalized signal value; Through normalization processing, the signal is mapped to the [0, 1] interval, eliminating the dimension difference and ensuring that the window features are not disturbed by the amplitude, improving the adaptability of the model to different conditions.
7. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to realize the spindle cutting force prediction method based on the multi-channel deep learning model as claimed in any one of claims 1 to 5.
8. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the spindle cutting force prediction method based on the multi-channel deep learning model as claimed in any one of claims 1 to 5.
Citation Information
Cited By
Ultra-precision turning profile error prediction method and system with serial attention mechanism
CN122164928A
Process performance prediction method and system for quality management
CN122175466A