Main shaft state monitoring method and system based on Transform neural network fusion physical constraint
By using a Transformer neural network-based method, combined with finite element simulation and data dimensionality reduction, the overall deformation of the spindle is predicted using load parameters. This solves the problems of limited measurement points and high cost in spindle deformation monitoring methods, and achieves efficient and real-time visualization of the full-field deformation of the spindle.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-03-27
AI Technical Summary
Existing spindle deformation monitoring methods have limited measurement points, high costs, and difficulty in achieving real-time visualization of deformation across the entire field. Traditional methods cannot accurately reflect the overall deformation state of the spindle.
A method based on Transformer neural network and physical constraints is adopted, which combines finite element simulation, data dimensionality reduction and machine learning interpolation. The overall deformation of the main shaft is predicted by load parameters. By using the K nearest neighbor interpolation method and Transformer neural network surrogate model, a physical constraint loss function is introduced to achieve efficient prediction and visualization of the full-field deformation of the main shaft.
It enables rapid and accurate prediction of full-field spindle deformation with limited computing resources, reducing the need for and deployment costs of physical sensors, and achieving real-time mapping and visualization of spindle performance evaluation and condition monitoring.
Smart Images

Figure CN121744779A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of mechanical structure state monitoring and digital twin technology, and particularly relates to a main shaft state monitoring method and system based on a Transformer neural network and fusing physical constraints. BACKGROUND
[0002] As a core component of precision equipment such as machine tools, the structural deformation of the main shaft directly affects the machining precision and equipment performance. Traditional deformation monitoring methods mainly rely on physical sensors such as strain gauges and displacement sensors to directly measure the deformation of specific points. However, arranging a large number of sensors on the main shaft has problems such as installation difficulty, high cost, and potential impact on the dynamic balance and performance of the main shaft. In addition, it is difficult to accurately reflect the overall deformation state of the main shaft with limited measurement data.
[0003] Digital twin technology creates a virtual mapping of physical objects, enabling real-time monitoring and prediction of physical states. The current technical challenge is how to efficiently and accurately predict the full-field deformation of the main shaft and achieve intuitive visualization using limited computing resources and measurement data.
[0004] The existing patent with publication number CN114676524A provides a main shaft stiffness testing method based on dynamic load. The method uses a single variable method to obtain main shaft structure parameters that significantly affect the static and dynamic stiffness of the main shaft, and then comprehensively considers the static and dynamic stiffness of the main shaft. A neural network is used to establish a main shaft performance mapping model. The BP neural network model is improved by combining a genetic algorithm, and the relationship between the main shaft structure parameters and performance indicators is obtained. Finally, a main shaft structure optimization mathematical model is established to optimize the structure of the machine tool main shaft. The main shaft stiffness testing method is not accurate and not practical, and there is a lack of efficient and unified dynamic and static stiffness optimization means in the optimization design of the main shaft, which limits the machining precision and efficiency of the machine tool. However, the core of this method is how to accurately evaluate and optimize the inherent stiffness performance of the main shaft, focusing on performance evaluation and optimization during the design phase of the main shaft, aiming to improve the inherent stiffness properties of the main shaft, and not focusing on the full-field deformation of the main shaft under any load. SUMMARY
[0005] To solve the problem of limited measurement points, high cost, and difficulty in realizing real-time visualization of full-field deformation in existing main shaft deformation monitoring methods, the present application proposes a main shaft state monitoring method based on a Transformer neural network and fusing physical constraints. This method combines finite element simulation, data dimensionality reduction, machine learning interpolation, and neural network prediction to efficiently predict the overall deformation of the main shaft with only load parameters.
[0006] In order to achieve the above object, the first aspect, the application provides a main shaft state monitoring method based on a Transformer neural network and fusing physical constraints, comprising the following steps: The K nearest neighbor interpolation method is adopted, the dynamic deformation data of each node of the main shaft three-dimensional finite element model under different working conditions and the index mapping relationship between the simplified nodes and the original nodes are utilized, and the deformation values of the simplified model nodes under different loads are calculated; A neural network proxy model based on the Transformer is constructed, the stiffness parameter k is taken as an input vector, and the deformation values of the simplified model nodes under different loads are taken as outputs; a physical constraint loss function conforming to the finite element dynamics law of the main shaft is introduced in the training process of the neural network proxy model based on the Transformer; The simulated or real-time monitored stiffness parameter k is taken as the input vector of the neural network proxy model based on the Transformer, real-time prediction is performed, forward calculation is executed, and the deformation values of each node of the simplified model under the stiffness support corresponding to the stiffness parameter k are obtained.
[0007] Further, the dynamic deformation data of each node of the main shaft three-dimensional finite element model under different working conditions and the index mapping relationship between the simplified nodes and the original nodes comprise: A main shaft three-dimensional finite element model is established based on a physical entity, spring support units are adopted to simulate the bearing support conditions of the front and rear bearings of the main shaft, modal analysis is performed on the main shaft three-dimensional finite element model, and deformation data under different support conditions are obtained; The dynamic response of the main shaft under the action of different boundary stiffnesses and loads is simulated by changing the stiffness parameter k of the spring support unit, finite element calculation is performed, and the dynamic deformation data of each node of the main shaft three-dimensional finite element model under different working conditions are obtained; The dynamic deformation data of each node of the main shaft three-dimensional finite element model are processed, an STL format simplified model file with reduced node quantity is generated by re-meshing, the repeated nodes in the simplified model file are eliminated, and the index mapping relationship between the simplified nodes and the original nodes is established.
[0008] Further, in the K nearest neighbor interpolation method, the calculation form of the interpolation function is:
[0009] wherein, is the interpolation deformation value of the jth node in the simplified model, is the three-dimensional coordinates of the jth node in the simplified model, is the three-dimensional coordinates of the ith node in the original finite element model, is the deformation value of the ith node in the original finite element model, is the number of nearest neighbor nodes participating in the interpolation calculation, is the distance weight index, is the Euclidean distance operator; this step realizes the accurate mapping from the high-density finite element node data to the low-dimensional simplified model, providing data support for neural network training.
[0010] Further, the support stiffness parameter k represents the equivalent stiffness values of the front and rear bearings.
[0011] Further, a neural network proxy model based on Transformer is constructed and trained, taking the stiffness parameter k as the input vector and the simplified model node deformation value as the output. A physical constraint loss function consistent with the main shaft finite element dynamics is introduced in the training process. The main shaft dynamics equation is:
[0012] where, is the mass matrix of the main shaft system, is the damping matrix, is the stiffness matrix, is the external load vector, is the node displacement vector, is the node velocity vector, is the node acceleration vector.
[0013] Further, in the training process of the neural network proxy model based on Transformer, the loss function is:
[0014] where, is the data error term, is the physical loss term formed by the above dynamics equation constraint, is the regularization term, is the physical constraint term weighting parameter, is the regularization term weighting parameter.
[0015] Further, it also includes a visualization step: Import the main shaft three-dimensional finite element model into Unity3D software, save the main shaft model built by SolidWorks as STL format, convert the exported STL format file to FBX format recognized by Unity3D in Blender software, and then import it into Unity3D software to complete the visualization of the main shaft model. The prediction results are encapsulated and formatted, and returned to the Unity system through the TCP channel to realize real-time output of the prediction results. In the Unity engine, according to the received node deformation value, the virtual main shaft model is driven to perform corresponding dynamic deformation, so that the real-time visualization of the deformation of the main shaft under the change of load is realized.
[0016] In a second aspect, the application provides a main shaft state monitoring system based on a Transformer neural network and fusing physical constraints, comprising a simplified data acquisition module, a model construction module and a prediction module. The simplified data acquisition module is used to calculate the deformation values of the simplified model nodes under different loads by using the dynamic deformation data of each node of the main shaft three-dimensional finite element model under different working conditions and the index mapping relationship between the simplified nodes and the original nodes by using the K nearest neighbor interpolation method. The model construction module is used to construct a Transformer-based neural network proxy model, taking the stiffness parameter k as an input vector and the deformation values of the simplified model nodes under different loads as an output. The prediction module is used to take the simulated or real-time monitored stiffness parameter k as an input vector of the Transformer-based neural network proxy model, perform real-time prediction, execute forward calculation, and obtain the deformation values of each node of the simplified model under the stiffness support corresponding to the stiffness parameter k.
[0017] In a third aspect, the application further provides a computer device comprising a processor and a memory, the memory being used to store computer executable programs, the processor reading part or all of the computer executable programs from the memory and executing, and the processor executing part or all of the computer executable programs can realize the above-mentioned main shaft state monitoring method based on the Transformer neural network and fusing physical constraints.
[0018] Meanwhile, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by the processor to realize the above-mentioned main shaft state monitoring method based on the Transformer neural network and fusing physical constraints.
[0019] Compared with the prior art, the application has the following beneficial effects: The application utilizes finite element simulation to generate training data, combines KNN interpolation processing to reduce dimension data, and establishes a nonlinear mapping relationship between load and deformation through a multi-modal Transformer algorithm, which can quickly predict the full-field deformation of the spindle under any load with a small amount of computing resources; realizes real-time mapping of the physical spindle state (load) to its virtual model (deformation), and provides an effective digital twin platform for spindle performance evaluation, state monitoring, and predictive maintenance. Compared with traditional methods that require a large number of sensors, the application mainly relies on simulation and calculation prediction, significantly reducing the demand and deployment cost of physical sensors.
[0020] Further, the Unity engine's powerful three-dimensional rendering capability is used to drive the virtual spindle model in real time with the predicted deformation data, to intuitively and dynamically display the deformation state of the spindle under different loads. BRIEF DESCRIPTION OF DRAWINGS
[0021] Figure 1 is the overall flowchart of the method of the application, showing the overall technical route from finite element modeling, node dimensionality reduction and interpolation, neural network prediction to digital twin visualization.
[0022] Figure 2 is a structure diagram of the finite element modeling of the spindle, showing the three-dimensional model of the spindle and the support position of the front and rear ends using spring elements.
[0023] Figure 3 is a finite element meshing diagram of the spindle, showing the unit structure after fine meshing.
[0024] Figure 4 is a spindle deformation cloud chart.
[0025] Figure 5 is a K-nearest neighbor interpolation mapping diagram from the original node to the simplified node, used to illustrate the mapping process of displacement data from high-density grid to simplified grid.
[0026] Figure 6 is a structure block diagram of a Transformer neural network proxy model, including input stiffness parameter k, feature mapping, Transformer encoder, and displacement output layer.
[0027] Figure 7 is a Unity digital twin visualization effect diagram, showing the dynamic deformation display result of the spindle. DETAILED DESCRIPTION
[0028] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of the present application.
[0029] Reference Figure 1 A spindle state monitoring method based on a Transformer neural network fusing physical constraints, step 1, a three-dimensional finite element model of the spindle is established based on a physical entity, spring support elements are used to simulate the support conditions of the front and rear bearings of the spindle, modal analysis is performed on the spindle model, and deformation data under different support conditions are obtained.
[0030] Step 2, by changing the stiffness parameter k of the spring support element, the dynamic response of the spindle under the action of different boundary stiffness and load is simulated, finite element calculation is performed, and the dynamic deformation data of each node of the spindle model under different working conditions are derived.
[0031] Wherein, k represents the support stiffness, and the equivalent stiffness values of the front and rear bearings can be taken.
[0032] Step 3, the dense node data derived from the finite element model is processed, a STL format simplified model file with significantly reduced node number is generated by re-meshing. The STL model is preprocessed, duplicate nodes are eliminated, and an index mapping relationship between the simplified nodes and the original nodes is established.
[0033] Step 4, the K-nearest neighbor interpolation method is used to calculate the dynamic deformation values of the simplified model nodes under different load conditions by using the original finite element node deformation data and the simplified model node information.
[0034] The calculation form of the interpolation function is:
[0035] Wherein, is the interpolation deformation value of the jth node in the simplified model, is the three-dimensional coordinates of the jth node in the simplified model, is the three-dimensional coordinates of the ith node in the original finite element model, is the deformation of the ith node in the original finite element model, is the number of nearest neighbor nodes participating in interpolation calculation, is the distance weight index (usually =2), is the Euclidean distance operator; accurate mapping from high-density finite element node data to low-dimensional simplified model is realized, and data support is provided for neural network training.
[0036] Step 5, build a Transformer-based neural network surrogate model, take the stiffness parameter k as the input vector, and the simplified model node deformation value obtained in step 4 as the output. During the training of the Transformer-based neural network surrogate model, a physical constraint loss function consistent with the principal axis finite element dynamics law is introduced, so that the network prediction result not only meets the training data, but also meets the physical law.
[0037] The principal axis dynamics equation is:
[0038] where, is the mass matrix of the principal axis system, is the damping matrix, is the stiffness matrix, is the external load vector, is the node displacement vector, is the node velocity vector, is the node acceleration vector.
[0039] In the training process, the loss function constructed is:
[0040] where, is the data error term, is the physical loss term formed by the above dynamics equation constraint, is the regularization term, is the physical constraint term weighting parameter, is the regularization term weighting parameter.
[0041] Step 6, develop a digital twin main program for receiving real-time or preset load parameters.
[0042] The main program uses the TCP communication mechanism to establish a server port and continuously listens to the request messages from the Unity engine. Unity encapsulates the current support stiffness parameter k as a JSON format message during running and sends it to the main program; the main program parses the parameter and inputs it into the surrogate model to complete real-time prediction.
[0043] Step 7, call the neural network surrogate model trained in step 5 to perform real-time prediction on the stiffness parameter k received in step 6. After receiving the load from Unity, the main program converts it into the model input format, performs forward calculation, and obtains the deformation value of each node of the simplified model under the support of the stiffness.
[0044] Step 8: Import the spindle 3D finite element model into Unity3D software. Save the spindle 3D finite element model built by SolidWorks as an STL file. Convert the exported STL file into an FBX file that Unity3D can recognize in Blender software, and then import it into Unity3D software to complete the visualization of the spindle model.
[0045] Step 9: The main program encapsulates and formats the prediction results and returns them to the Unity system via the TCP channel, enabling real-time output of the prediction results.
[0046] Step 10: In the Unity engine, based on the received node deformation values, drive the virtual spindle model to perform corresponding dynamic deformation, thereby realizing real-time visualization of spindle deformation under load changes.
[0047] like Figure 1 As shown, the present invention will be further described in detail with reference to the embodiments and accompanying drawings.
[0048] In the ANSYS Workbench environment, a 3D geometric model of the spindle is created by importing it into SolidWorks. The model must fully include the key features of the spindle body, and its geometric accuracy should meet the requirements of finite element analysis. The spindle material is defined as structural steel, with an elastic modulus E of 206 GPa, Poisson's ratio μ of 0.3, and density ρ of 7850 kg / m³. To simulate the support conditions of the front and rear bearings of the spindle, a spring support structure is created using Body-Groud elements. The spring stiffness coefficient k is set to multiple discrete values, each corresponding to a different support stiffness state. The far end of the spring support is set to a "Fixed Support" boundary condition. Figure 2 As shown.
[0049] The spindle uses tetrahedral elements for meshing, with Solid187 as the element type and a mesh size of 5mm. Figure 3 As shown. After verifying mesh independence, the first-order deformation of the principal shaft was solved for different spring stiffnesses, including the displacement results of each node in the X, Y, and Z directions, as follows. Figure 4 As shown. After the calculation is completed, the displacement results of each node are exported as a CSV file. The file fields include node number, displacement in the X direction, displacement in the Y direction, and displacement in the Z direction. At the same time, the first six natural frequencies and corresponding mode shapes of the principal axis are extracted for subsequent dynamic analysis.
[0050] To reduce the input dimensionality of the neural network, dimensionality reduction and spatial interpolation were performed on the original high-density node data. In ANSYS Workbench, a coarse mesh was re-generated with an element size of 15mm, generating a simplified principal axis model with a significantly reduced number of nodes, which was then exported as an STL file. A Python script was used to read the STL files of the original and simplified models, and a spatial coordinate matching algorithm was used to establish a one-to-one mapping relationship between the simplified and original nodes, generating a "mapping table" file.
[0051] For any node P in the simplified model, extract its 15 nearest neighbor nodes from the original model, calculate the distance between the nodes based on Euclidean distance, and perform interpolation using an inverse distance weighting method, such as... Figure 5 As shown. The displacement of node P can be expressed as:
[0052] in, To simplify the interpolated deformation value of the j-th node in the model, To simplify the 3D coordinates of the j-th node in the model, Let be the three-dimensional coordinates of the i-th node in the original finite element model. Let be the deformation of the i-th node in the original finite element model. The number of nearest neighbor nodes participating in the interpolation calculation. Distance weighting index (take) =2), This is the Euclidean distance operator.
[0053] Using the above method, the displacement data of the original high-density grid can be smoothly mapped to the simplified model nodes, realizing full-field displacement reconstruction at the coarse grid level, and providing high-quality input data after dimensionality reduction for subsequent neural network model training.
[0054] A neural network proxy model based on the Transformer architecture is constructed to establish a nonlinear mapping relationship between load parameters and simplified model node deformation, such as... Figure 6 As shown. The model input consists of normalized load parameters, where the spring stiffness k is normalized to a range of 0 to 1. The Fourier feature mapping method is used to extend the single load parameter into a multi-frequency feature sequence, enabling the Transformer to capture nonlinear relationships between different frequency components.
[0055] The model output is a simplified total displacement vector of all nodes, normalized to a value range of -1 to 1, used to characterize the overall deformation state of the principal shaft under different load conditions. The model structure consists of a multi-layer Transformer encoder and a linear mapping layer. A self-attention mechanism is used to establish a global dependency between input parameters and node responses, achieving high-precision prediction of high-dimensional multi-node displacement fields.
[0056] During model training, a physical constraint loss function conforming to the dynamic laws of principal axis finite elements is introduced to ensure that the prediction results both match the training samples and satisfy basic mechanical consistency. According to quasi-static linear elasticity theory, the load F and displacement x should satisfy the approximate relationship F≈k·x.
[0057] Therefore, a physical constraint term is added to the total loss function to minimize the deviation between the model's predicted equivalent displacement and the theoretically calculated value F / k. The total loss function consists of two parts: the data fitting error (MSE) and the physical constraint error. Weighting coefficients are introduced to balance the contributions of these two errors. The model is trained using the Adam optimization algorithm with a learning rate of 0.001 and a maximum of 1000 iterations. The training process is terminated early when the mean squared error of the validation set is below 0.001, corresponding to a prediction error of no more than 0.1 mm.
[0058] The digital twin system consists of a main program module and a Unity visualization module. The main program is written in Python and uses TCP / IP communication to achieve real-time data interaction. The main program establishes a communication interface on port 8080, which can receive load parameter data encapsulated in JSON format, such as "{k:1.2e6}". The program loads the trained neural network proxy model, and after inputting the load parameters, outputs the predicted displacement results of each node in the simplified model in real time. The output data is encapsulated and transmitted to the Unity client via the TCP / IP communication channel, realizing real-time data linkage between the physical axis and the virtual model.
[0059] In the Unity visualization module, a simplified spindle model is imported into the scene, and the STL format model is converted to an FBX file that Unity can recognize. The model is set as a MeshFilter component and given a metallic material. A network connection with the main program is established via C# script, setting the server address to 127.0.0.1 and the port number to 8080, to receive displacement data packets in real time and parse them into nodal displacement arrays. By dynamically modifying the model's vertex coordinates, the real-time deformation visualization effect of the spindle under different loads is achieved, such as... Figure 7 As shown, this forms a complete digital twin interactive system. By dynamically modifying the vertex coordinates of the model, the real-time deformation visualization effect of the main axis under different loads is achieved, thus forming a complete digital twin interactive system.
[0060] System operation and verification. During the offline verification phase, the main program input is set to a typical load condition from the finite element simulation, for example, the spring stiffness k is set to 3 × 10⁻⁶. 6 The displacement was compared with the original simulated displacement using N / m to verify the prediction accuracy. In the real-time verification phase, the system's latency from data reception to Unity rendering was tested. The results showed that the average system latency did not exceed 50 milliseconds, meeting the real-time display requirements.
[0061] This invention provides a spindle state monitoring system based on Transformer neural network and physical constraints, including a simplified data acquisition module, a model building module, and a prediction module; The simplified data acquisition module is used to calculate the deformation values of the simplified model nodes under different loads by using the K nearest neighbor interpolation method, utilizing the dynamic deformation data of each node of the three-dimensional finite element model of the main shaft under different working conditions and the index mapping relationship between the simplified nodes and the original nodes. The model building module is used to build a Transformer-based neural network surrogate model. The stiffness parameter k is used as the input vector, and the deformation values of the model nodes under different loads are simplified as the output. During the training process of the Transformer-based neural network surrogate model, a physical constraint loss function that conforms to the dynamic laws of principal axis finite element is introduced. The prediction module is used to take the stiffness parameter k obtained from simulation or real-time monitoring as the input vector of the Transformer-based neural network surrogate model, perform real-time prediction, execute forward calculation, and obtain the deformation value of each node of the simplified model under the stiffness support corresponding to the stiffness parameter k.
[0062] You can also configure the Unity visualization module. This module imports the 3D finite element model of the spindle into Unity3D software. It saves the spindle model built in SolidWorks as an STL file, converts the exported STL file to FBX format (which Unity3D can recognize) in Blender, and then imports it back into Unity3D to visualize the spindle model. It also encapsulates and formats the prediction results and returns them to the Unity system via a TCP channel, achieving real-time output of the prediction results. In the Unity engine, based on the received node deformation values, it drives the virtual spindle model to perform corresponding dynamic deformations, achieving real-time visualization of spindle deformation under changing loads. (See reference...) Figure 7 .
[0063] On the other hand, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the implementation of the spindle state monitoring method based on Transformer neural network fused with physical constraints as described in the present invention.
[0064] The present invention can also provide a computer device, including a processor and a memory, wherein the memory is used to store a computer executable program, the processor reads the computer executable program from the memory and executes it, and the processor can implement the spindle state monitoring method based on Transformer neural network fused with physical constraints described in the present invention when executing the computer executable program.
[0065] The computer device may be a laptop, a desktop computer, or a workstation.
[0066] The processor can be a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), or an off-the-shelf programmable gate array (FPGA).
[0067] The memory described in this invention can be an internal storage unit of a laptop, desktop computer, or workstation, such as memory or hard disk; or it can be an external storage unit, such as a portable hard disk or flash memory card.
[0068] Computer-readable storage media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer-readable storage media can include: read-only memory (ROM), random access memory (RAM), solid-state drives (SSDs), or optical discs, etc. Random access memory can include resistive random access memory (ReRAM) and dynamic random access memory (DRAM).
[0069] This invention provides a spindle state monitoring method based on Transformer neural network and physical constraints. First, a three-dimensional finite element model of the spindle is established. Spring support elements are used to simulate the front and rear bearing support conditions. By changing the spring stiffness and cutting force load parameters, the dynamic response of the spindle under different boundary stiffnesses and loads is simulated, and deformation data of each node is obtained. The high-density node data is re-meshed and K-nearest neighbor interpolation is performed to obtain the dimensionality-reduced simplified model deformation results, realizing the mapping from high-dimensional finite element data to a low-dimensional model. Based on this, a Transformer neural network surrogate model is constructed with the stiffness parameter k as input, and a physical constraint loss function based on the spindle dynamics equation is introduced to achieve high-precision deformation prediction of the spindle under different support stiffnesses. After training, the model is embedded in a digital twin main program, receiving real-time load parameters via TCP communication, predicting and outputting node deformation data. The Unity engine drives the virtual spindle model based on the prediction results, realizing real-time visualization of the deformation. This invention integrates finite element simulation, KNN interpolation dimensionality reduction, neural network prediction, and three-dimensional visualization technologies, enabling rapid spindle deformation prediction and dynamic display with relatively few computing resources. It has advantages such as high prediction accuracy, strong real-time performance, and intuitive visualization effects.
[0070] The above content is only for illustrating the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solution based on the technical concept proposed in this invention shall fall within the scope of protection of the claims of this invention.
Claims
1. A method for monitoring the principal axis state based on Transformer neural network and physical constraints, characterized in that, Includes the following steps: The K-nearest neighbor interpolation method is used to calculate the deformation values of the simplified model nodes under different loads by utilizing the dynamic deformation data of each node of the three-dimensional finite element model of the main shaft under different working conditions and the index mapping relationship between the simplified nodes and the original nodes. A neural network proxy model based on Transformer is constructed, with the stiffness parameter k as the input vector, and the deformation values of the model nodes under different loads as the output. During the training of the Transformer-based neural network surrogate model, a physical constraint loss function that conforms to the dynamic laws of the principal axis finite element is introduced. The stiffness parameter k obtained from simulation or actual monitoring is used as the input vector of the Transformer-based neural network surrogate model to perform real-time prediction and forward calculation, thereby obtaining the deformation value of each node of the simplified model under the stiffness support corresponding to the stiffness parameter k.
2. The method for monitoring the principal axis state based on Transformer neural network and physical constraints according to claim 1, characterized in that, The process of obtaining dynamic deformation data of each node in the 3D finite element model of the spindle under different working conditions and simplifying the index mapping relationship between nodes and original nodes includes: A three-dimensional finite element model of the spindle is established based on the physical entity. Spring support elements are used to simulate the support conditions of the front and rear bearings of the spindle. Modal analysis is performed on the three-dimensional finite element model of the spindle to obtain deformation data under different support conditions. By changing the stiffness parameter k of the spring support unit, the dynamic response of the spindle under different boundary stiffness and load is simulated, and finite element calculation is performed to obtain the dynamic deformation data of each node of the three-dimensional finite element model of the spindle under different working conditions. The dynamic deformation data of each node of the main axis three-dimensional finite element model are processed, and a simplified model file with fewer nodes is generated by re-meshing. Duplicate nodes in the simplified model file are eliminated, and an index mapping relationship between the simplified nodes and the original nodes is established.
3. The method for monitoring the principal axis state based on Transformer neural network and physical constraints according to claim 1, characterized in that, In the K-nearest neighbor interpolation method, the interpolation function is calculated as follows: in, To simplify the interpolated deformation value of the j-th node in the model, To simplify the 3D coordinates of the j-th node in the model, Let be the three-dimensional coordinates of the i-th node in the original finite element model. Let be the deformation of the i-th node in the original finite element model. The number of nearest neighbor nodes participating in the interpolation calculation. The distance-weighted index, This is the Euclidean distance operator; this step achieves accurate mapping from high-density finite element node data to a low-dimensional simplified model, providing data support for neural network training.
4. The method for monitoring the principal axis state based on Transformer neural network and physical constraints according to claim 1, characterized in that, The bearing stiffness parameter k is taken as the equivalent stiffness value of the front and rear bearings.
5. The method for monitoring the principal axis state based on Transformer neural network and physical constraints according to claim 1, characterized in that, A Transformer-based neural network surrogate model is constructed and trained, with stiffness parameter k as the input vector and simplified model node deformation values as the output. During the training process, a physical constraint loss function that conforms to the principal axis finite element dynamics is introduced. The principal shaft dynamic equation is: in, The mass matrix of the main spindle system, Here is the damping matrix. Here is the stiffness matrix. For external load vector, Let be the nodal displacement vector. For the node velocity vector, This is the nodal acceleration vector.
6. The method for monitoring the principal axis state based on Transformer neural network and physical constraints according to claim 1, characterized in that, During the training of the Transformer-based neural network proxy model, the loss function is: in, For data error terms, The physical loss term is formed by the constraints of the above dynamic equations. For regularization terms, For the physical constraint term trade-off parameters, This is the parameter for the regularization term.
7. The method for monitoring the principal axis state based on Transformer neural network and physical constraints according to claim 1, characterized in that, It also includes a visualization step: Import the 3D finite element model of the spindle into Unity3D software, save the spindle model built in SolidWorks as an STL file, convert the exported STL file to FBX format that Unity3D can recognize in Blender software, and then import it into Unity3D software to complete the visualization of the spindle model. The prediction results are encapsulated and formatted, and then returned to the Unity system via a TCP channel to achieve real-time output of the prediction results; In the Unity engine, based on the received node deformation values, the virtual spindle model is driven to perform corresponding dynamic deformation, realizing real-time visualization of spindle deformation under load changes.
8. A spindle state monitoring system based on Transformer neural network and physical constraints, characterized in that, It includes a simplified data acquisition module, a model building module, and a prediction module; The simplified data acquisition module is used to calculate the deformation values of the simplified model nodes under different loads by using the K nearest neighbor interpolation method, utilizing the dynamic deformation data of each node of the three-dimensional finite element model of the main shaft under different working conditions and the index mapping relationship between the simplified nodes and the original nodes. The model building module is used to build a Transformer-based neural network proxy model, taking the stiffness parameter k as the input vector and simplifying the deformation values of the model nodes under different loads as the output. During the training of the Transformer-based neural network surrogate model, a physical constraint loss function that conforms to the dynamic laws of the principal axis finite element is introduced. The prediction module is used to take the stiffness parameter k obtained from simulation or actual monitoring as the input vector of the Transformer-based neural network surrogate model, perform real-time prediction, execute forward calculation, and obtain the deformation value of each node of the simplified model under the stiffness support corresponding to the stiffness parameter k.
9. A computer device, characterized in that, It includes a processor and a memory, the memory being used to store a computer-executable program, the processor reading part or all of the computer-executable program from the memory and executing it, and when the processor executes part or all of the computer-executable program, it can implement the spindle state monitoring method based on Transformer neural network fused with physical constraints as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, A computer-readable storage medium stores a computer program that, when executed by a processor, enables the implementation of the spindle state monitoring method based on Transformer neural network fused with physical constraints as described in any one of claims 1-7.
Citation Information
Patent Citations
Main shaft rigidity testing method based on dynamic load
CN114676524A