Counterweight balance adjusting method and system for machine tool spindle box
By fusing camera and sensor data and combining them with a neural network model, the machine tool spindle box counterweight can be precisely adjusted, solving the problems of difficulty in positioning unbalanced positions and environmental interference in existing technologies, and improving adjustment efficiency and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING PROSPER PRECISION MACHINE TOOL CO LTD
- Filing Date
- 2026-02-06
- Publication Date
- 2026-05-12
AI Technical Summary
Existing methods for adjusting the counterweight balance of machine tool spindle boxes rely on a single sensor to collect vibration data. This makes it difficult to locate the imbalance position, and the methods are easily affected by environmental interference, resulting in low efficiency and an inability to meet the real-time adjustment requirements of high-speed machining scenarios.
Sensor data and image data from the machine tool spindle box are collected by cameras and sensors, fused, and input into a pre-trained neural network model to determine the location and amount of imbalance. Combined with closed-loop control, the counterweight device is adjusted to achieve precise adjustment.
It improves the accuracy of unbalanced position positioning and the accuracy of unbalance calculation, reduces the risk of secondary vibration caused by adjustment deviation, improves adjustment efficiency and reduces manual intervention costs, and ensures the operational stability of the machine tool spindle box.
Smart Images

Figure CN122016159A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machining technology, and in particular to a method and system for adjusting the counterweight balance of a machine tool spindle box. Background Technology
[0002] During rotation, the machine tool spindle box is prone to uneven mass distribution and unbalanced vibration due to factors such as manufacturing errors of parts, assembly deviations, long-term wear and tear, and load variations. The machine tool is equipped with a control device to balance the spindle box counterweight. This control device consists of a mechanical structure that drives the spindle box counterweight balancing and a counterweight balancing adjustment method that controls the mechanical structure. Existing counterweight balancing adjustment methods mostly rely on a single sensor to collect vibration data, which can only estimate the amount of imbalance but is difficult to locate the imbalance position and is easily affected by environmental interference. Methods that partially rely on manual inspection are inefficient and cannot meet the real-time adjustment requirements of high-speed machining scenarios.
[0003] Therefore, there is an urgent need for a method and system for adjusting the counterweight balance of machine tool spindle boxes. Summary of the Invention
[0004] To address the aforementioned technical problems, this application provides a method and system for adjusting the counterweight balance of a machine tool spindle box.
[0005] A first aspect of this application provides a method for adjusting the counterweight balance of a machine tool spindle box, comprising: Sensor data and image data on the operating status of the machine tool spindle box are collected using cameras and sensors; The first imbalance position is determined based on the image data, and the first imbalance amount is determined based on the sensor data; The sensor data and the image data are fused to obtain fused data; The fused data is input into a pre-trained neural network model to obtain the second imbalance position and the second imbalance amount; The position where the first imbalance position coincides with the second imbalance position is taken as the target imbalance position; Calculate the difference between the first imbalance amount and the second imbalance amount corresponding to the target imbalance position to obtain the imbalance amount difference; The average of the first imbalance and the second imbalance, where the difference in the imbalance is less than a preset first threshold, is taken as the target imbalance. The counterweight adjustment device is driven to adjust based on the target imbalance amount and the target imbalance position; sensor data and image data after adjustment are collected to verify the adjustment effect.
[0006] A second aspect of this application provides a machine tool spindle box counterweight balance adjustment system, comprising: The data acquisition module is used to acquire sensor data and image data of the machine tool spindle box operating status through cameras and sensors; The preliminary analysis module is used to determine the first imbalance position based on the image data and to determine the first imbalance amount based on the sensor data; The data fusion module is used to fuse the sensor data and the image data to obtain fused data; The intelligent recognition module is used to input the fused data into a pre-trained neural network model to obtain the second imbalance position and the second imbalance amount; The position determination module is used to take the position where the first unbalanced position and the second unbalanced position coincide as the target unbalanced position; The difference calculation module is used to calculate the difference between the first imbalance amount and the second imbalance amount corresponding to the target imbalance position, and obtain the imbalance amount difference. The imbalance quantity determination module is used to take the average of the first imbalance quantity and the second imbalance quantity, which are corresponding to an imbalance quantity difference that is less than a preset first threshold, as the target imbalance quantity. The control execution module is used to drive the counterweight adjustment device to adjust based on the target imbalance amount and the target imbalance position; The effect verification module is used to collect adjusted sensor data and image data to verify the adjustment effect.
[0007] A third aspect of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the above-described machine tool spindle box counterweight balance adjustment method.
[0008] In a fourth aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described machine tool spindle box counterweight balance adjustment method.
[0009] The beneficial effects of the machine tool spindle box counterweight balance adjustment method and system provided in this application are as follows: This application uses dual-path detection of image data and sensor data to first locate the unbalanced position and quantify the unbalance amount, and then uses data fusion and neural network secondary verification. This avoids the limitations of single data acquisition and locks the target unbalanced position through dual verification, improving the accuracy of position positioning and effectively solving the problems of fuzzy positioning and susceptibility to interference in traditional methods. By calculating the difference in unbalance amount and determining the target unbalance amount by the average value, it takes into account the basic advantages of single data quantification and the optimization characteristics of fused data, ensuring the accuracy of unbalance amount calculation and providing a basis for precise adjustment, reducing the risk of secondary vibration caused by adjustment deviation. In addition, after adjustment, the effect is verified by collecting multi-source data again, forming a closed-loop process of detection-adjustment-verification. This not only improves the efficiency of counterweight balance adjustment and reduces the cost of manual intervention, but also continuously ensures the operational stability of the machine tool spindle box. Attached Figure Description
[0010] Figure 1 A schematic flowchart illustrating a machine tool spindle box counterweight balance adjustment method provided in an embodiment of this application; Figure 2 This is a structural block diagram of a machine tool spindle box counterweight balance adjustment system provided in an embodiment of this application; Figure 3 This is a schematic block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0011] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0012] To make the purpose, technical solution, and advantages of this application clearer, the following will be described in conjunction with the appendix. Figure 1-3 The following is an explanation using specific examples.
[0013] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a machine tool spindle box counterweight balance adjustment method according to an embodiment of this application. The method includes: S101: Collects sensor data and image data on the operating status of the machine tool spindle box through cameras and sensors.
[0014] In this embodiment, an industrial camera is selected, with a lens focal length adapted to the observation distance of the spindle box. It is mounted on a stable bracket on the side or top of the spindle box, so that the shooting range includes the spindle end of the spindle box, the counterweight installation area, and key transmission components, and the camera frame rate is greater than or equal to 120fps. The sensors adopt a multi-dimensional combination configuration, including a triaxial vibration sensor, a non-contact speed sensor, and a laser displacement sensor, and the sampling frequency of all sensors is synchronously matched with the camera frame rate.
[0015] During data acquisition, data transmission between the camera and sensor is achieved via an industrial bus. Timestamp synchronization technology is used to associate and bind each frame of image data with the corresponding sensor data at that moment. Simultaneously, before data acquisition, the camera lens must be cleaned and the sensor zero-point calibrated. During acquisition, the data transmission status is monitored in real time, and if any anomalies such as data loss or signal interference occur, a re-acquisition mechanism is immediately triggered.
[0016] After obtaining sensor data and image data, preliminary preprocessing is required. Specifically, image data undergoes grayscale correction, Gaussian filtering for noise reduction, and distortion correction to eliminate interference from ambient light and lens errors; sensor data undergoes outlier removal and normalization to convert physical quantities from different sensors into a standardized data format.
[0017] Specifically, sensor data includes quantitative data collected by various sensors that reflect the operating status of the spindle box, including vibration acceleration and rotational speed values; image data consists of continuous frame images of spindle box components (counterweight, spindle end cover, transmission gear) taken by industrial cameras, including visual information such as component position, shape, and relative offset.
[0018] S102: Determine the first imbalance position based on image data, and determine the first imbalance amount based on sensor data.
[0019] In this embodiment, the first imbalance position refers to the specific physical location where the machine tool spindle box has a mass imbalance during operation, determined solely by visual analysis and feature extraction based on image data collected by an industrial camera; the first imbalance amount refers to the quantified value characterizing the degree of imbalance of the spindle box, obtained solely by quantified data collected by sensors according to a preset imbalance amount mapping model.
[0020] Specifically, when determining the first imbalance position based on image data, time-series analysis is performed on the image data to extract the image displacement of the machine tool spindle head relative to the stationary reference frame at multiple characteristic operating moments. Based on the image displacement at multiple characteristic operating moments, the swing trajectory of the machine tool spindle head in three-dimensional space is fitted and generated. Based on the amplitude and phase information of the swing trajectory, the first imbalance position is calculated. Spectral analysis and amplitude calculation are performed on the sensor data, and based on a preset imbalance mapping model, the first imbalance amount corresponding to the first imbalance position is calculated and determined.
[0021] When determining the first imbalance based on sensor data, a preset model needs to be established according to the dynamic characteristics of the spindle box. For example, the preset model uses the real-time rotational speed collected by the speed sensor as the basic parameter, and the resonant frequency and vibration amplitude detected by the vibration sensor. The imbalance range is initially estimated through the linear mapping relationship between the imbalance and the vibration amplitude (which needs to be calibrated in advance according to the spindle box model). Then, the preliminary estimate is corrected based on the maximum radial displacement data of the spindle collected by the displacement sensor to eliminate the error caused by the speed fluctuation, and finally the first imbalance is output. If there is abnormal fluctuation in the sensor data (greater than 15% of the normal range), re-acquisition is triggered.
[0022] S103: Fuse sensor data with image data to obtain fused data.
[0023] In this embodiment, before fusing sensor data and image data, preprocessing is required for both. Specifically, feature filtering is performed on the sensor data, retaining features strongly correlated with the imbalance state and removing irrelevant data such as temperature drift and electromagnetic interference. The feature vectors of the image data are standardized, converting visual features such as position coordinates and offsets into numerical forms of the same order of magnitude as the sensor data. Simultaneously, temporal alignment is performed on the sensor data and image data.
[0024] The data fusion process employs a feature-level fusion algorithm. Specifically, based on the spindle box's operating conditions (speed, load), dynamic weights are first assigned to the dynamic characteristics of the sensor data and the spatial characteristics of the image data. Then, matrix operations are performed on the standardized features of the two types of data to generate preliminary fusion features. Subsequently, the preliminary fusion result is optimized using a Kalman filter algorithm to filter out data conflicts and redundant information, and to enhance effective features related to imbalance states, ultimately obtaining the fused data. The output of the data fusion is a high-dimensional dataset (such as feature vector groups and fusion matrices) that includes quantitative indicators of the spindle box's operating status, spatial location features, and temporal correlation information, which can be directly input into a neural network model.
[0025] In this embodiment, the validity of the fused data is verified after the data fusion is completed. For example, if the characteristic variance of the fused data is greater than a preset range, it is determined that the fusion has failed, and the data preprocessing stage is returned to re-execute the fusion process. The preset range is set after statistical analysis of historical fused data collected multiple times under typical normal operating conditions of the spindle box to determine its normal fluctuation range, and is used to distinguish between valid fused data and invalid fused data caused by sensor anomalies, data conflicts, or environmental interference.
[0026] S104: Input the fused data into the pre-trained neural network model to obtain the second imbalance position and the second imbalance quantity.
[0027] In this embodiment, the second imbalance position refers to the imbalance position output by the model inference after the fused data is input into the pre-trained neural network model, which has been verified by deep fusion of multi-source features; the second imbalance quantity refers to the quantized value that characterizes the degree of imbalance of the spindle box, calculated by the neural network model based on the quantized features and spatial features in the fused data through nonlinear mapping.
[0028] The pre-trained neural network model adopts a CNN-LSTM hybrid network architecture. The input layer receives fused data (dynamic features and spatial features) and divides it into two input channels according to the feature type. In the dual-branch module, the CNN branch consists of three convolutional layers (with kernel sizes of 3×3, 5×5, and 3×3, and output channels of 64, 128, and 256 respectively), two pooling layers (max pooling with a stride of 2), and one fully connected layer (128 neurons), which is responsible for extracting deep associations of spatial features. The LSTM branch includes two bidirectional LSTM layers (256 neurons in the hidden layer) and one dropout layer (dropout rate of 0.3), which focuses on capturing the changing patterns of temporal dynamic features. The cross-dimensional fusion layer integrates the output features of the two branches through weighted summation (CNN branch weight 0.45, LSTM branch weight 0.55), and finally outputs the second imbalance position (3D coordinates) and the second imbalance amount (quantization value) through the output layer (two regression sub-layers).
[0029] The key parameters for the neural network model training phase need to be adapted to the spindle box imbalance detection scenario: the dataset is divided into training, validation, and test sets in a 7:2:1 ratio, with a total sample size of 5000 or more, including more than 20 spindle box models and 10 typical imbalance conditions; the optimizer is Adam, with an initial learning rate of 0.001 and a learning rate decay strategy, which decays to 0.9 every 10 epochs; the loss function uses a hybrid loss (MSE loss + L1 loss, with a weight ratio of 6:4), taking into account the regression accuracy of position coordinates and quantized values; the training batch size is set to 32, the number of epochs is 50, and the early stopping strategy threshold is set to 5; regularization uses a combination of L2 regularization and dropout layers.
[0030] S105: The position where the first imbalance position coincides with the second imbalance position is taken as the target imbalance position.
[0031] In this embodiment, a unified coordinate reference system is established. Specifically, a three-dimensional rectangular coordinate system is constructed with the spindle axis of the spindle box as the origin (the X-axis is along the spindle axis, and the Y-axis and Z-axis form a radial plane). The original coordinates of the first and second unbalanced positions are uniformly transformed to this coordinate system. Subsequently, a position coincidence threshold is set, which is adjusted according to the machining accuracy level of the spindle box (set to less than or equal to 0.3mm for precision machine tools and less than or equal to 0.5mm for ordinary machine tools). By calculating the distance deviation between the two types of positions in the YZ radial plane, it is determined whether the coincidence condition is met.
[0032] If the deviation between a single first imbalance position and its corresponding second imbalance position is less than the position overlap threshold, then that position is determined to be the target imbalance position. If there are multiple overlapping areas between the first and second imbalance positions, then all of them are considered target imbalance positions. The target imbalance position is the final imbalance position selected by verifying the overlap between the first and second imbalance positions, ensuring consistency between the two positioning results. The position overlap threshold is determined comprehensively based on the machining accuracy of the machine tool spindle box, the pixel equivalent of the vision inspection system, the sensor measurement error, and the mechanical positioning accuracy of the counterweight adjustment device. It is used to determine whether the first and second imbalance positions have sufficient consistency, thereby selecting the target imbalance position.
[0033] S106: Calculate the difference between the first and second imbalance amounts corresponding to the target imbalance position to obtain the imbalance amount difference.
[0034] In this embodiment, the imbalance difference refers to a quantitative index obtained by calculating the absolute difference between the first imbalance and the second imbalance corresponding to the target imbalance position.
[0035] Specifically, the imbalance difference is calculated using the absolute difference formula: Imbalance Difference = |First Imbalance - Second Imbalance|. If the target imbalance position corresponds to multiple first or second imbalances (multiple sets of overlapping position data exist), the difference for each corresponding quantity is calculated first, and then the average of all differences is taken as the final imbalance difference. After obtaining the imbalance difference, the original data of the two sets of imbalances and the coordinates of the target imbalance position are recorded simultaneously. An anomaly marking mechanism is also established. If the imbalance difference is greater than a reasonable range (50% of the average of the two types of imbalances), the correspondence between the position and the quantized value is verified to eliminate data association errors. The reasonable range is set based on the differences in the calculation principles of the first and second imbalances, the comprehensive measurement error of the sensor and vision inspection system, and the statistical analysis results of a large amount of historical debugging data.
[0036] S107: The average of the first imbalance and the second imbalance, where the difference in imbalance is less than a preset first threshold, is taken as the target imbalance.
[0037] In this embodiment, during the threshold judgment stage, if the calculated difference in imbalance is less than a preset first threshold, it indicates good consistency between the two types of imbalance. In this case, the arithmetic mean of the two is taken as the target imbalance. This arithmetic mean combines the dynamic quantification advantage of the first imbalance based on sensor data with the intelligent optimization characteristics of the second imbalance based on multi-source fusion data, effectively reducing random errors in single-data calculations. If the difference in imbalance is greater than or equal to the preset first threshold, a secondary verification mechanism is triggered. Specifically, the accuracy of the target imbalance location, the calculation logic of the two types of imbalance, and the data integrity are first reviewed. If the data is confirmed to be normal, the range of the first threshold can be appropriately expanded (maximum equal to 1.2 times the initial first threshold) and re-judged. If the requirements are still not met, the process returns to the data fusion stage to regenerate the fused data and the second imbalance, or multiple sets of data from the target location are collected to recalculate the first imbalance.
[0038] After calculating the mean and determining the target imbalance, the parameters of the first imbalance, the second imbalance, the imbalance difference, and the first threshold are recorded simultaneously. The first threshold is set based on the historical debugging data of the spindle box, the comprehensive measurement accuracy of the sensor and vision inspection system, and the actual allowable imbalance deviation range, through statistical analysis and engineering experience. It is used to determine whether the first imbalance and the second imbalance have sufficient consistency.
[0039] S108: Adjustment is performed by driving the counterweight adjustment device based on the target imbalance amount and the target imbalance position.
[0040] In this embodiment, the mapping relationship between target parameters and adjustment actions is first established. For example, based on the structural design of the spindle box (counterweight installation trajectory, adjustment stroke range), the three-dimensional coordinates of the target imbalance position are converted into the execution coordinates of the counterweight adjustment device, and the required counterweight compensation amount is calculated based on the target imbalance.
[0041] During the adjustment process, closed-loop control logic is employed to ensure accuracy. Specifically, after receiving the target imbalance amount and target imbalance position signals, the PLC controller sends drive commands to the servo motor of the counterweight adjustment device. This drives the counterweight block to move to the designated position via a transmission mechanism such as a ball screw, or adjusts the weight of the counterweight block via an electromagnetic adsorption module. The position detection unit collects the actual position and weight data of the counterweight block in real time and compares it with the target parameters. If the deviation exceeds the allowable range, for example, position deviation ≤ 0.1mm or weight deviation ≤ 0.2g, the drive command is dynamically corrected using a PID algorithm until the counterweight state meets the compensation requirements. The allowable range is determined comprehensively based on the dynamic balance accuracy requirements of the machine tool spindle box, the mechanical transmission accuracy of the counterweight adjustment device, and the minimum adjustment step size of the counterweight block.
[0042] For scenarios with multiple unbalanced positions or large unbalance amounts, a step-by-step adjustment strategy is adopted. Specifically, the target unbalanced position with the largest deviation is addressed first, and initial adjustment is performed based on 60%-80% of the target unbalance amount. After the spindle box stabilizes, fine compensation is then performed based on the remaining unbalance amount. During the adjustment process, drive parameters, adjustment time, and real-time unbalance status data are recorded simultaneously.
[0043] Among them, the PID algorithm is a classic closed-loop control algorithm. Through the coordinated calculation of three links, namely proportional (P), integral (I), and derivative (D), it dynamically corrects the drive command of the counterweight adjustment device to ensure the adjustment accuracy. Specifically, based on the deviation value between the actual position and weight data of the counterweight block collected by the position detection unit (grating ruler) and the target parameters (execution coordinates, counterweight compensation amount), it quickly responds to the deviation through the proportional link, eliminates static errors through the integral link, and predicts the trend of deviation changes through the derivative link, and adjusts the drive signal of the servo motor in real time.
[0044] S109: Collect the adjusted sensor data and image data to verify the adjustment effect.
[0045] In this embodiment, after the counterweight adjustment device is activated and the machine tool spindle box has run at least one complete cycle, verification sensor data and verification image data are acquired. The residual imbalance and residual vibration energy are then calculated based on these data. If the residual imbalance is less than a second threshold and the peak value of the residual vibration energy is less than a preset safety threshold, the adjustment effect is deemed satisfactory. Otherwise, the residual imbalance and its corresponding position are used as new inputs, and the adjustment steps of a machine tool spindle box counterweight balance adjustment method are iteratively executed until the satisfactory adjustment effect condition is met or the maximum number of iterations is reached.
[0046] As can be seen from the above, this application employs dual-path detection using both image data and sensor data. First, it locates the imbalance position and quantifies the imbalance amount separately. Then, through data fusion and secondary verification using a neural network, it avoids the limitations of single data acquisition and locks the target imbalance position through dual verification, improving the accuracy of position positioning and effectively solving the problems of fuzzy positioning and susceptibility to interference in traditional methods. Furthermore, by calculating the imbalance difference and determining the target imbalance amount using the average, it combines the fundamental advantages of single data quantization with the optimization characteristics of fused data, ensuring the accuracy of imbalance calculation and providing a basis for precise adjustment, reducing the risk of secondary vibration caused by adjustment deviations. In addition, after adjustment, the effect is verified by collecting multi-source data again, forming a closed-loop process of detection-adjustment-verification. This not only improves the efficiency of counterweight balance adjustment and reduces manual intervention costs but also continuously ensures the operational stability of the machine tool spindle box.
[0047] In one embodiment of this application, determining a first imbalance position based on image data and determining a first imbalance amount based on sensor data includes: Perform time-series analysis on image data to extract the image displacement of the machine tool spindle box relative to the stationary reference frame at multiple characteristic operating moments; Based on the image displacement at multiple characteristic running moments, the swing trajectory of the machine tool spindle box in three-dimensional space is fitted and generated; The first unbalance position is calculated based on the amplitude and phase information of the oscillation trajectory; Spectral analysis and amplitude calculation are performed on the sensor data. Based on a preset imbalance mapping model, the first imbalance quantity corresponding to the first imbalance position is calculated and determined.
[0048] In this embodiment, when determining the first imbalance position based on image data, the time-series analysis employs a combination of inter-frame difference and optical flow methods. Specifically, grayscale correction and noise filtering are first performed on consecutive image frames to eliminate interference from lighting changes and equipment vibration. Then, using a stationary reference frame, the component contour feature points of the machine tool spindle box at each characteristic running moment are extracted. The pixel displacement of the feature points is calculated using the optical flow method, and converted into image displacement in physical space based on camera calibration parameters. When fitting the three-dimensional swing trajectory, a polynomial fitting algorithm is used to perform three-dimensional modeling of multiple sets of image displacements based on the spindle rotation direction (clockwise / counterclockwise), the time interval of the characteristic running moment, and the spindle speed, generating trajectory curves including X, Y, and Z dimensions. The first imbalance position is calculated based on amplitude and phase information. The spatial coordinates corresponding to the maximum amplitude of the swing trajectory are used as the basis, and the angular distribution of this position on the spindle circumference is determined according to the phase information (with a reference point on the spindle end face as 0°, the circumferential angle of the imbalance position is marked). Finally, the first imbalance position in three-dimensional coordinate form with the spindle axis as the origin is output.
[0049] In this embodiment, spectral analysis of sensor data requires first setting a characteristic frequency range (fundamental frequency ± 5Hz corresponding to the rated spindle speed). Signal components within this range are filtered using bandpass filtering to eliminate irrelevant frequencies such as motor interference and environmental vibration. Then, a peak detection algorithm is used to extract the signal amplitude corresponding to the characteristic frequency. Amplitude is calculated based on the sensor's range and accuracy level to obtain a standardized quantized amplitude. According to the spindle box model, current speed, and load status, matching model parameters are selected (mapping relationships differ under different operating conditions). The calculated amplitude data is input into a preset unbalance mapping model. The first unbalance, corresponding to the first unbalance position, is calculated using the built-in calibration formula: unbalance = k × amplitude (k is the operating condition coefficient). If the calculated result exceeds the effective range of the preset unbalance mapping model, or if the amplitude data exhibits abnormal fluctuations, such as exceeding the normal range by 20%, the sensor data is re-acquired. Among them, the unbalance mapping model is a mathematical model established based on the dynamic characteristics of the spindle box and a large amount of experimental data. The correspondence between the sensor signal amplitude and the unbalance has been pre-calibrated, and the corresponding unbalance can be directly output by inputting amplitude data. The static reference frame is a pre-set standardized rectangular frame or contour frame with reference to the components (spindle end cover, counterweight mounting reference surface) when the spindle box is stationary. It serves as a reference coordinate system for measuring the positional offset of the components during operation.
[0050] As can be seen from the above, this embodiment performs time-series analysis and swing trajectory fitting on image data, locates the first imbalance position based on amplitude and phase information, performs spectrum analysis and amplitude calculation on sensor data, and quantizes the first imbalance quantity corresponding to the position according to a preset mapping model. This not only achieves spatial locking of the imbalance position through visual time-series feature capture, but also ensures the quantification accuracy of the imbalance quantity by means of frequency domain analysis and model mapping of sensor signals, effectively avoiding the limitations of single data type detection.
[0051] In one embodiment of this application, the swing trajectory of the machine tool spindle box in three-dimensional space is fitted and generated based on the image displacement at multiple characteristic running moments, including: Acquire vibration sensor data corresponding to multiple characteristic running times; The image displacement at each characteristic running time is correlated with the vibration sensor amplitude at the corresponding characteristic running time to obtain the correlated image displacement. Based on preset calibration coefficients, the associated image displacement is converted into a three-dimensional spatial displacement. Based on the three-dimensional spatial displacement and phase information from vibration sensor data, a spatial curve interpolation algorithm is used to generate the oscillation trajectory in three-dimensional space.
[0052] In this embodiment, firstly, when acquiring vibration sensor data corresponding to multiple characteristic operating moments, the corresponding vibration amplitude and phase information are matched for each image displacement. For example, the image displacement (2.3 pixels in the Y-axis direction and 1.8 pixels in the Z-axis direction) at a certain characteristic moment (the spindle rotates to a 0° reference angle) needs to be bound one-to-one with the vibration amplitude (0.05 mm) and phase information (30°) at that moment. During the association process, if vibration data or image data is missing at a certain characteristic moment, the discrete points at that moment are discarded, and only the complete associated data set is retained.
[0053] Secondly, based on preset calibration coefficients, the associated image displacement is converted into a three-dimensional spatial displacement. Specifically, the pixel values of the image displacement are first converted into radial (Y / Z axis) relative displacement using camera calibration coefficients (pixel equivalent k = 0.01 mm / pixel); then, based on the distance coefficient between the sensor installation position and the spindle axis, and the axial (X axis) displacement correction coefficient, the relative displacement is converted into a three-dimensional absolute spatial displacement. The calibration coefficients need to be individually calibrated for different machine tool models and reviewed every six months. For example, if the associated image displacement is 3.5 pixels on the Y axis and 2.7 pixels on the Z axis, corresponding to a vibration amplitude of 0.04 mm, and the calibration coefficient k = 0.015 mm / pixel, then the converted three-dimensional spatial displacement is 0.0525 mm on the Y axis and 0.0405 mm on the Z axis. The X-axis displacement is further calculated based on the axial sensor data and the calibration coefficients.
[0054] Finally, based on the three-dimensional spatial displacement and phase information from the vibration sensor data, a spatial curve interpolation algorithm is used to generate the oscillation trajectory in three-dimensional space. The three-dimensional spatial displacement is the absolute displacement data (unit: mm) in a three-dimensional Cartesian coordinate system (X-axis axial, Y-axis / Z-axis radial) with the spindle axis as the origin. This data includes displacement components in the X, Y, and Z dimensions, fully characterizing the spatial positional offset of key components of the spindle box.
[0055] From the above, it can be concluded that this embodiment, through deep correlation and fusion of image displacement and vibration sensor data, and based on calibration coefficient conversion and spatial curve interpolation algorithms, constructs the swing trajectory of the machine tool spindle box in three-dimensional space. This not only leverages the amplitude and phase information of the vibration sensor data to compensate for the deficiencies of single image data in quantization accuracy and dynamic characteristic capture, but also achieves complementary advantages between the two types of data through correlation processing. Furthermore, calibration coefficients ensure the accuracy of displacement conversion. Simultaneously, the spatial curve interpolation algorithm ensures the continuity and completeness of trajectory generation.
[0056] In one embodiment of this application, a three-dimensional oscillation trajectory is generated using a spatial curve interpolation algorithm based on the three-dimensional spatial displacement and phase information from vibration sensor data, including: Based on the phase information in the vibration sensor data, determine the temporal distribution of multiple characteristic operating moments within the spindle rotation cycle; Based on the temporal distribution, a non-uniform rational B-spline curve interpolation algorithm is used to fit the three-dimensional spatial displacement, wherein the weight of the curve control points is adjusted according to the vibration energy at the corresponding time. In the interpolation process of the non-uniform rational B-spline curve interpolation algorithm, the curvature continuity of the fitted trajectory curve is constrained and optimized based on the known geometric structure and kinematic constraints of the machine tool spindle box as optimization conditions, thereby generating an oscillating trajectory.
[0057] In this embodiment, the generation of the three-dimensional oscillation trajectory achieves a unified approach of temporal alignment, trajectory fitting, and physical adaptation through a non-uniform rational B-spline curve interpolation algorithm. First, the temporal distribution calibration of the characteristic moments needs to be completed. For example, based on the phase information of the vibration sensor (with the spindle keyway as the 0° reference and the phase angle corresponding to the vibration peak), each characteristic running moment is mapped to the specific phase position of the spindle rotation cycle, forming a two-dimensional time-phase distribution table. For instance, if the spindle rotation cycle is 0.02s (3000 r / min), and the phase of a certain characteristic moment is 60°, then its temporal position within the cycle is 0.02 × (60 / 360) = 0.0033s. If phase drift exists (the phase difference between adjacent characteristic moments exceeds the theoretical value ±5%), then the temporal distribution is corrected through linear interpolation.
[0058] When fitting curves using the non-uniform rational B-spline interpolation algorithm, a node vector is set based on the distribution density of displacement in three-dimensional space (non-uniform node vector, with smaller node spacing in densely populated data areas). Then, the three-dimensional displacement points corresponding to the characteristic moments are selected as initial control points. The weight adjustment of the curve control points is based on vibration energy: the vibration energy is calculated using the formula: Vibration Energy = Vibration Amplitude² × Vibration Frequency. The energy value is normalized and used as the weight of the corresponding control point. Higher vibration energy results in a larger weight. For example, if the vibration energy at a certain characteristic moment is 0.8 (after normalization), the corresponding control point weight is set to 0.8, making the influence of this point on the curve shape more significant. Conversely, at moments with lower vibration energy, i.e., 0.2 after normalization, the weight is set to 0.2, reducing the interference of secondary data on the trajectory and increasing the prominence of features related to unbalanced positions.
[0059] This embodiment transforms the known geometric structure and kinematic constraints into algorithm optimization conditions. Geometrically, with the spindle axis as a fixed reference, the radial displacement of the trajectory curve is constrained to not exceed the physical contour range of the key components of the spindle box (not exceeding the maximum allowable radial clearance of the bearing), while simultaneously ensuring that the axial (X-axis) displacement of the trajectory meets the design limit of the spindle extension / retraction. Kinematically, an upper limit is set for the rate of curvature change of the trajectory curve (less than or equal to 0.05). ).
[0060] In the interpolation process of the non-uniform rational B-spline curve interpolation algorithm, these constraints are incorporated into the objective function using the Lagrange multiplier method to iteratively optimize the curvature continuity of the trajectory curve. If the curvature continuity of a certain segment of the curve does not meet the G2 standard, the positions and weights of adjacent control points are adjusted until the trajectory curve both fits the three-dimensional spatial displacement data and satisfies geometric and kinematic constraints. The G2 standard (Geometric Continuity) is a grade index of the smoothness of curves or surfaces at splicing points, determining whether there are visual or physical abrupt changes during the transition. The final generated oscillating trajectory possesses three main characteristics: precise synchronization of temporal sequence and principal axis rotation period, higher fitting accuracy in areas of severe vibration, and a smooth trajectory without physical contradictions.
[0061] In this algorithm, curve control points are key reference points used to define the curve shape. By adjusting the spatial coordinates and weights of the control points, the curvature trend and smoothness of the curve can be changed, serving as parameters for the fitted trajectory. Vibration energy is a quantitative index (unit: J or mm² / s²) calculated based on the amplitude of the vibration sensor, with the formula E∝A² (where A is the vibration amplitude). It represents the severity of the spindle box's unbalanced vibration at the corresponding characteristic moment and is used to dynamically adjust the control point weights. Kinematic constraints restrict the physical motion of the spindle box during operation, such as the spindle rotation direction (clockwise / counterclockwise), maximum swing angle, axial / radial displacement range, and component motion interference boundaries, ensuring that the fitted trajectory conforms to actual operating laws. Curvature continuity refers to the smooth and abrupt change in curvature at the connection points of any adjacent segments of the fitted trajectory curve. The non-uniform rational B-spline curve interpolation algorithm is a mathematical method for accurately describing and fitting complex curves and surfaces, widely used in computer-aided design, CNC machining, and trajectory planning. The non-uniform rational B-spline curve interpolation algorithm defines the curve shape using a set of control points, node vectors, and weights. "Non-uniform" means the parameter intervals of the node vectors can be unequal, allowing for flexible adjustment of the curve's fitting accuracy in different regions. "Rational" means each control point has a weight, and changing the weights can adjust the curve's approximation of a specific point. B-splines provide local support properties, ensuring that modifying a control point only affects the local shape of the curve without altering the overall structure. This non-uniform rational B-spline curve interpolation algorithm can approximate discrete data points while maintaining curve smoothness and continuity, making it suitable for generating the three-dimensional oscillation trajectory of a machine tool spindle box.
[0062] From the above, it can be concluded that this embodiment determines the temporal distribution of characteristic moments through phase information and is based on a non-uniform rational B-spline curve interpolation algorithm. At the same time, it adjusts the weight of the curve control points with vibration energy and optimizes the continuity of trajectory curvature with the geometry of the spindle box and kinematic constraints. This fully utilizes phase information to ensure the accuracy of trajectory timing, highlights the displacement characteristics of high vibration energy moments through weight adjustment, and ensures the smoothness and continuity of the trajectory curve and its adaptability to actual motion through constraint optimization. This effectively avoids the problems of trajectory distortion or inconsistency with the actual motion state of the equipment that may occur with a single fitting algorithm.
[0063] In one embodiment of this application, after calculating the first unbalanced position based on the amplitude and phase information of the oscillation trajectory, the method further includes: Obtain the current spindle speed and machining load information of the machine tool; Based on the spindle speed and machining load information, query the pre-established machine tool working condition-stiffness mapping relationship table to determine the equivalent dynamic stiffness of the machine tool spindle box suspension system under the current working condition; Based on the equivalent dynamic stiffness, stiffness compensation correction is performed on the first unbalanced position to obtain the corrected first unbalanced position.
[0064] In this embodiment, firstly, the spindle speed and machining load information are acquired. For example, the spindle speed is acquired via an optical encoder at the spindle end, with a sampling frequency greater than or equal to 100Hz. The average speed over 5 seconds is taken as the current operating speed (error less than or equal to ±5r / min). Machining load information is preferentially acquired directly via a three-dimensional force sensor mounted on the spindle box or turret. If no force sensor is provided, it is indirectly derived based on a preset cutting load calculation model (load = Kf × cutting speed × feed rate × depth of cut, where Kf is the material cutting coefficient) and the current machining process parameters, ensuring that the load error is less than or equal to 10% of the actual value. After data acquisition, the data is filtered to remove abnormal peaks caused by cutting impacts and speed fluctuations, retaining valid data under stable operating conditions.
[0065] Secondly, a machine tool operating condition-stiffness mapping table is pre-established, encompassing the typical operating condition range of the machine tool. Specifically, based on the spindle speed (500-6000 r / min, step size 500 r / min) and machining load (0-5000 N, step size 1000 N), grid-like operating condition points are defined. At each operating condition point, the equivalent dynamic stiffness of the spindle box suspension system is measured through modal testing or vibration testing. During the test, a vibrator applies sinusoidal excitation to the spindle box, and the vibration response is collected using an accelerometer. Based on the excitation force data from the force sensor, stiffness values at different frequencies are calculated using the frequency response function method. The stiffness corresponding to the fundamental frequency of spindle rotation is taken as the equivalent dynamic stiffness of that operating condition point. The speed, load, and corresponding stiffness values of all operating conditions are compiled into a mapping table. The missing stiffness values for non-grid operating conditions in the table are supplemented using bilinear interpolation, ensuring that effective stiffness data can be retrieved under any operating condition, with an interpolation error less than or equal to 3%.
[0066] When performing stiffness compensation correction, a correction model is established based on the principle of elastic deformation. Specifically, firstly, based on the retrieved equivalent dynamic stiffness (K) and the unbalanced force corresponding to the first unbalanced position (F = unbalance amount × ω², where ω is the principal axis angular velocity), the positional offset of the spindle box caused by the elastic deformation of the suspension system is calculated (Δx = F / K, i.e., Δx = unbalance amount × ω² / K). Subsequently, based on the spatial relationship between the deformation direction and the unbalanced position, reverse compensation is performed on the first unbalanced position. For example, if the first unbalanced position is in the positive Y-axis direction (coordinate Y1), and the elastic deformation causes the spindle box to shift Δy in the positive Y-axis direction, then the corrected Y-axis coordinate is Y2 = Y1 - Δy, and the X-axis and Z-axis coordinates are corrected similarly. During the compensation process, based on the anisotropy of stiffness (i.e., the stiffness in the X, Y, and Z directions may be different), the equivalent dynamic stiffness in the three directions is retrieved or calculated separately, and dimensional compensation is performed.
[0067] After stiffness compensation correction is completed at the first imbalance position, the corrected first imbalance position is verified. For example, the positional deviation before and after compensation is compared, and the correction effect is judged based on the allowable positioning error of the spindle box (less than or equal to 0.02mm). If the deviation is greater than the allowable range, the accuracy of the working condition information acquisition, the accuracy of the mapping relationship table data, and the compensation model parameters need to be checked. If necessary, stiffness test data under this working condition needs to be supplemented, and the mapping relationship table needs to be optimized. At the same time, the working condition parameters, equivalent dynamic stiffness, compensation amount, and correction results are recorded and archived.
[0068] From the above, it can be concluded that this embodiment obtains the equivalent dynamic stiffness of the spindle box suspension system under the current working condition through the machine tool working condition-stiffness mapping relationship table, and performs stiffness compensation correction on the first unbalanced position, effectively offsetting the interference of dynamic stiffness changes under different working conditions on the detection of unbalanced position, and improving the calculation accuracy and working condition adaptability of the first unbalanced position.
[0069] In one embodiment of this application, the counterweight adjustment device is driven to perform adjustment based on the target imbalance amount and the target imbalance position, including: Convert the target imbalance position into the target phase angle on the counterweight plate; Calculate the required target counterweight mass based on the target imbalance and the preset unit mass of the counterweight block; If the counterweight adjustment device is a movable counterweight type, the target radial displacement of the counterweight on the radial guide rail of the counterweight plate is calculated based on the target imbalance and the mass of the counterweight. Based on the target phase angle and the target counterweight mass or target radial displacement, generate counterweight adjustment drive commands; Based on the drive command, the servo drive unit is controlled to move the counterweight to the target phase angle and the corresponding target radial position.
[0070] In this embodiment, firstly, a unified mapping relationship needs to be established for the target phase angle conversion. For example, using the mechanical zero position (keyway, scale line) on the counterweight plate as a reference, the circumferential orientation (angle derived from three-dimensional coordinates) of the target imbalance position is converted into the target phase angle of the counterweight plate. During the conversion, it is necessary to ensure 180° reverse compensation with the target imbalance position. For example, if the target imbalance position corresponds to a counterweight plate phase angle of 60°, then the target phase angle is 240°. At the same time, the phase error caused by the installation deviation of the counterweight plate is corrected through camera vision calibration or grating encoder feedback. If there is an axial offset in the target imbalance position, the phase angle is simplified to the radial plane based on the spindle rotation plane.
[0071] Specifically, for a fixed counterweight device, first determine the reference radius of the counterweight plate. Calculate the target counterweight mass using the formula: Target Unbalance / Reference Radius of Counterweight Plate. If the result is not an integer multiple of the unit mass of the counterweight, a rounding + fine-tuning compensation strategy is adopted. For example, if the calculation requires 12.3g, a 12g counterweight is selected, and the deviation is subsequently corrected through radial micro-adjustments. For a movable counterweight device (with a fixed counterweight mass), calculate the target radial position using the formula: Target Radial Position = Target Unbalance / Counterweight Mass. Subtract the initial radial position to obtain the target radial displacement. The calculation needs to be based on the range limitation of the radial guide rail of the counterweight plate. If the target radial position is greater than the range, it is necessary to feed back to the preceding steps to adjust the target unbalance calculation or replace the counterweight with one of different masses.
[0072] In this embodiment, the counterweight adjustment drive command includes fixed device commands and movable device commands. The fixed device command includes the target phase angle and the target counterweight mass, and also specifies the specifications and quantity of the counterweight blocks to be installed (240° phase angle, install two 5g counterweight blocks). The movable device command includes the target phase angle and the target radial position, determining the circumferential movement angle and the radial movement distance. After the counterweight adjustment drive command is generated, its validity is verified. Specifically, it checks whether the target phase angle is within the range of 0°-360°, whether the target radial position exceeds the guide rail range, and whether the target counterweight mass exceeds the upper limit of the counterweight plate's load capacity. If any abnormality is found, the process returns to the previous step for recalculation to avoid device malfunction due to command errors.
[0073] After receiving the command, the servo drive unit first drives the servo motor to rotate the counterweight disk (or the counterweight block circumferential drive mechanism). The current phase angle of the counterweight block is collected in real time by a grating ruler and compared with the target phase angle. A PID algorithm is used to correct the rotation speed and direction until the phase deviation is less than or equal to 0.05°. Subsequently, the fixed device fixes the counterweight block through a mechanical locking mechanism (if it is an automatic addition / reduction type, the counterweight block installation is completed through an electromagnetic adsorption / release mechanism). The movable device drives a radial servo motor, which moves the counterweight block along the guide rail via a ball screw. The grating ruler provides real-time feedback on the radial position until the radial deviation is less than or equal to 0.02mm. The servo drive unit is a drive module consisting of a servo motor, a ball screw, and a grating ruler (position feedback). The target radial position is the final stopping position of the counterweight block on the radial guide rail of the counterweight disk. The counterweight disk is a ring structure installed at the end of the machine tool spindle or related rotating components to support the counterweight block.
[0074] As can be seen from the above, this embodiment achieves digitalization, precision, and automation of counterweight adjustment, improving adjustment efficiency and accuracy. By mapping the spatial imbalance position to the phase angle of the counterweight plate, the imbalance is converted into a quantifiable counterweight mass or radial displacement, making the counterweight adjustment parameters more intuitive and controllable, effectively avoiding the subjectivity and errors of traditional manual adjustment. At the same time, selecting appropriate adjustment strategies for different types of counterweight adjustment devices enhances the versatility and adaptability of the method.
[0075] In one embodiment of this application, a method for adjusting the counterweight balance of a machine tool spindle box further includes: During the driving process, feedback data on the current and torque of the servo drive unit are acquired; The feedback data is compared with the expected current and torque values calculated based on the target counterweight mass, moving acceleration, and mechanism friction model to obtain the comparison difference. If the difference between the comparison values exceeds the preset safety tolerance, the drive will be stopped and the fault diagnosis and alarm process will be triggered.
[0076] In this embodiment, the current data of the servo drive unit is acquired through an internal current sensor in the driver, with a sampling frequency greater than or equal to 1kHz. Torque data is acquired from a torque sensor at the motor shaft end or derived from the formula torque = Kt × current (Kt is the motor torque constant). The acquisition period is synchronized with the adjustment action (a set of data is recorded every 10ms), and the corresponding adjustment stage (phase movement / radial movement) and current position are recorded simultaneously. During the feedback data acquisition process, if data loss or jumps occur (current sudden change greater than 2A), a temporary warning is immediately triggered, the adjustment action is paused, and data is reacquired.
[0077] The calculation of the expected current and torque values is based on multi-factor modeling. Specifically, firstly, based on the target counterweight mass (or the fixed mass of the counterweight block) and the preset moving acceleration, the basic power value required for driving is calculated using the dynamic formula (F=ma, torque=force×lever arm). Then, the values are substituted into the mechanism friction model, and the additional power value corresponding to the friction resistance is corrected based on the moving speed during the current adjustment stage (initial phase movement speed 100mm / s, radial movement constant speed 50mm / s) and the real-time temperature of the equipment (collected through an ambient temperature sensor). Finally, the comprehensive expected current and torque value is obtained. For example, with a target counterweight mass of 20g and a radial movement acceleration of 300mm / s², the basic force F=0.02kg×300mm / s²=6N, the additional friction resistance calculated according to the friction model is 2N, the total driving force is 8N, and the expected torque is calculated based on the ball screw lever arm (0.01m) = 0.08. And the expected current is calculated by converting the motor torque constant.
[0078] This embodiment compares each set of data with the expected value of the corresponding stage and calculates the absolute difference. If the difference between n consecutive sets of data is greater than the preset safety tolerance, it is determined to be a drive abnormality, and a stop command is immediately executed. For example, the servo drive unit cuts off the power output and locks the mechanical structure of the counterweight adjustment device (activating the electromagnetic brake) to prevent the counterweight from shifting due to inertia. Subsequently, a fault diagnosis process is triggered. Specifically, by analyzing the changing trend of the comparison difference and based on the current adjustment position and action stage, the fault type (mechanical jamming / load abnormality / motor failure) is initially identified. At the same time, an audible and visual alarm is activated, and the fault code (E01 - phase movement jamming), abnormal data peak value and occurrence location are displayed on the control system interface. The fault time, adjustment parameters and other information are automatically recorded to facilitate troubleshooting by maintenance personnel. Here, n is determined comprehensively based on the sampling frequency of the servo drive unit, the response speed of the adjustment action, and the real-time and reliability requirements for abnormality judgment, and its value ranges from 3 to 10.
[0079] The mechanism friction model is a pre-established mathematical model that characterizes the frictional resistance characteristics of the mechanical transmission mechanism (ball screw, guide rail, gear) in the counterweight adjustment device. The input parameters include moving speed, load mass, and temperature, and the output is the estimated frictional torque / force, which is the key basis for calculating the expected current torque value. The expected current torque value is the theoretical output value of the servo drive unit calculated by the dynamic formula based on the target counterweight mass, preset moving acceleration, and mechanism friction model. The preset safety tolerance is set based on the allowable difference range between the equipment's rated parameters and historical fault data.
[0080] As can be seen from the above, this embodiment can capture potential faults such as abnormal resistance, mechanical jamming, or wear of transmission components during the driving process by performing difference analysis between actual feedback and theoretical expectations. Once the difference exceeds the preset safety tolerance, the drive will stop immediately and an alarm will be triggered, which effectively avoids overload operation caused by the failure of the counterweight adjustment mechanism, prevents secondary damage to key components such as servo motors, guide rails, and counterweight plates, and improves the safety and reliability of the counterweight adjustment process.
[0081] In one embodiment of this application, after comparing the feedback data with the expected current-torque value calculated based on the target counterweight mass, moving acceleration, and mechanism friction model, and obtaining the comparison difference, the method further includes: If the difference between the comparison values is not greater than the preset safety tolerance but continues to be greater than the preset warning threshold, then the friction coefficient in the mechanism friction model is corrected based on the feedback data to obtain the corrected mechanism friction model. The expected current torque value was recalculated using the modified mechanism friction model to obtain the target expected current torque value. The drive parameters of the servo drive unit are adjusted based on the target expected current and torque values until the difference is less than the warning threshold.
[0082] In this embodiment, if the difference between the comparison values is not greater than the safety tolerance but remains higher than the warning threshold, it indicates that although the drive system has not failed, the friction characteristics of the mechanism have deviated due to factors such as temperature changes, decreased lubrication, and load fluctuations, and the original mechanism friction model can no longer reflect the actual resistance. At this point, it is necessary to correct the friction model online using real-time feedback data to avoid the accumulation of deviations that could lead to subsequent adjustment errors or failure risks. The preset warning threshold is determined based on the rated current and rated torque of the servo drive unit and the historical deviation statistics of the mechanism friction model.
[0083] Specifically, based on the current and torque values in the feedback data and the known electromechanical parameters of the servo drive unit, the actual resistance during the movement of the counterweight is calculated in reverse. Based on the target radial displacement and moving speed of the counterweight and the actual resistance, and based on the preset friction coefficient-velocity-position relationship model, the dynamic friction coefficient and static friction coefficient in the mechanism friction model are iteratively solved and updated. The updated friction coefficient is substituted into the mechanism friction model to obtain the corrected mechanism friction model.
[0084] After obtaining the corrected mechanism friction model, the target expected current and torque values are recalculated using the corrected mechanism friction model. Subsequently, the drive parameters of the servo drive unit are optimized and adjusted based on the target expected current and torque values. For example, the feedforward compensation amounts of the current loop and speed loop are adjusted according to the target expected current and torque values to make the motor output smoother in each stage of acceleration, constant speed, and deceleration; if the deviation is mainly concentrated in a specific speed range, the friction compensation curve in that range is locally refined. The adjustment process adopts a closed-loop iterative method. Specifically, after each adjustment of the drive parameters, the feedback data is re-compared with the target expected value. If the difference is still greater than the warning threshold, the friction model and drive parameters are fine-tuned until the difference is stably lower than the warning threshold.
[0085] As can be seen from the above, this embodiment achieves dynamic adaptive compensation for the friction characteristics of the counterweight adjustment mechanism, effectively improving the accuracy and robustness of servo drive control. With increasing equipment operating time, factors such as guide rail wear and changes in lubrication conditions can cause the friction coefficient to drift. A fixed model may fail to reflect the actual resistance. However, by correcting the friction model online, the expected current and torque values can be made more closely match the real-time operating conditions, avoiding overshoot or lag in drive parameters caused by deviations in the mechanism's friction model, resulting in a smoother and more precise movement of the counterweight.
[0086] In one embodiment of this application, after controlling the servo drive unit to move the counterweight to the target phase angle and the corresponding target radial position based on the drive command, the method further includes: Capture local images of the counterweight after it has been placed using a camera; Identify the actual contour center position of the counterweight block in the local image and compare it with the theoretical contour center position calculated based on the target phase angle and the target radial displacement; If the deviation between the actual contour center position and the theoretical contour center position is greater than the preset installation tolerance, a position compensation command will be generated. According to the position compensation command, the servo drive unit is controlled to make adjustments until the deviation between the actual contour center position and the theoretical contour center position is less than the preset installation tolerance.
[0087] In this embodiment, firstly, the industrial camera is fixed on a support that is stationary relative to the counterweight plate, and the shooting direction is perpendicular to the plane where the counterweight is located. The focal length and exposure parameters are kept consistent with those during the previous positioning to avoid image distortion caused by changes in lighting or angle shifts. At the same time, a local close-up shooting mode is adopted to focus on the counterweight body and the phase scale lines and radial guide rail scale around it.
[0088] Image processing algorithms are employed to identify the actual center position of the contour. Specifically, the local image is first preprocessed by enhancing grayscale and using Gaussian filtering to eliminate noise interference. Then, the Canny edge detection algorithm is used to extract the complete contour of the counterweight, eliminating interference factors such as background texture and scale lines. For irregularly shaped counterweights, the center position of the contour is determined by least bounding rectangle fitting or centroid calculation. During the calculation, pixel coordinates are converted to physical coordinates (mm) based on camera calibration parameters (pixel equivalent, distortion coefficient). If the contour extraction is incomplete (e.g., occlusion or reflection causing missing edges), a reshoot is automatically triggered until a valid contour is obtained.
[0089] This embodiment first calculates the deviations between the actual contour center position and the theoretical contour center position in the phase direction (circumferential direction) and radial direction, respectively, and compares them with the preset installation tolerance. If the phase deviation is greater than the preset installation tolerance, a phase compensation command is generated, controlling the servo drive unit to fine-tune the counterweight along the circumferential direction, with each adjustment being 50% of the deviation value. If the radial deviation is greater than the installation tolerance, a radial compensation command is generated, driving the counterweight along the guide rail via a ball screw. During the fine-tuning process, images are acquired in real time and the deviation value is updated until the deviation between the actual contour center position and the theoretical contour center position is less than the installation tolerance. The generated position compensation command includes both phase compensation and radial compensation commands. The preset installation tolerance is determined comprehensively based on the machining accuracy level of the machine tool spindle box, the mechanical transmission accuracy of the counterweight adjustment device, and the pixel equivalent of the vision inspection system.
[0090] As can be seen from the above, this embodiment further eliminates positional deviations caused by mechanical transmission errors and assembly gaps through visual closed-loop compensation, improving the final positioning accuracy of the counterweight. Visual recognition can reflect the true position of the counterweight, unaffected by the cumulative error of the motor encoder or the elastic deformation of the mechanism, thereby achieving effective verification and correction of the servo drive control. By continuously adjusting until the deviation meets the tolerance requirements, the counterweight can be made to be strictly in the target phase angle and radial position, making the counterweight compensation effect more accurate and reliable, which is beneficial to further reduce spindle box vibration and improve machining stability.
[0091] In one embodiment of this application, if the comparison difference is not greater than a preset safety tolerance but continues to be greater than a preset warning threshold, then based on the feedback data, the friction coefficient in the mechanism friction model is corrected to obtain a corrected mechanism friction model, including: The coefficient of friction includes the coefficient of dynamic friction and the coefficient of static friction; Based on the current and torque values in the feedback data and the known electromechanical parameters of the servo drive unit, the actual resistance during the movement of the counterweight is calculated in reverse. Based on the target radial displacement and moving speed of the counterweight and the actual resistance, and based on the preset friction coefficient-velocity-position relationship model, the dynamic friction coefficient and static friction coefficient in the friction model of the updated mechanism are iteratively solved. Substituting the updated friction coefficient into the mechanism friction model yields the corrected mechanism friction model.
[0092] In this embodiment, the static friction coefficient dominates the resistance characteristics of the counterweight at the moment of startup (speed equal to or close to 0), while the dynamic friction coefficient dominates the resistance characteristics during the uniform speed movement phase (stable speed). The distinction between the two is based on the speed signal in the feedback data. For example, when the moving speed is less than a preset threshold, it is determined that static friction dominates; when the moving speed is greater than the preset threshold, it is determined that dynamic friction dominates. The preset threshold is determined comprehensively based on the mechanical characteristics of the counterweight adjustment device, the speed control accuracy of the servo drive unit, and the typical speed range for the transition from static friction to dynamic friction, and is used to distinguish whether the counterweight is in the startup phase or the uniform speed movement phase.
[0093] This embodiment is based on the known electromechanical parameters of the servo drive unit. First, the feedback current value is converted into output torque using the formula: torque = motor torque constant × current × transmission ratio × mechanical efficiency. Then, based on the ball screw lead (unit: mm / rev), the torque is converted into driving force along the radial guide rail (force = torque × 2π / lead). Finally, based on the dynamic balance relationship (driving force = inertial force + actual resistance), the inertial force (inertial force = counterweight mass × moving acceleration) is subtracted, and the actual resistance is finally calculated.
[0094] Specifically, when iteratively solving for the friction coefficient, the friction coefficient-velocity-position relationship model is used as the basis, and updates are performed in stages. For example, for the static friction coefficient, the actual resistance data of the counterweight in the starting stage (velocity less than or equal to 1 mm / s) is selected, and the optimal static friction coefficient is solved by substituting it into the mechanism friction model according to the target radial position of this stage (different radial positions correspond to different forces on the guide rail, resulting in different friction coefficients). For the dynamic friction coefficient, the actual resistance data of the uniform movement stage (stable speed greater than or equal to 5 mm / s) is selected, and the dynamic friction coefficient is solved for the corresponding speed range according to the speed range (e.g., 5-20 mm / s, 20-50 mm / s), forming a dynamic friction coefficient curve that varies with speed. During the iteration process, a convergence condition is set (e.g., the difference between two adjacent calculated friction coefficients is less than or equal to 0.001). When the convergence condition is met, the iteration stops to avoid over-computation. If the number of iterations exceeds the preset upper limit (20 times) and convergence is still not achieved, the model self-check is triggered to check the validity of the feedback data or the rationality of the associated model parameters.
[0095] Substituting the updated dynamic and static friction coefficients into the mechanism friction model yields the corrected mechanism friction model.
[0096] As can be seen from the above, this embodiment depicts the real friction characteristics of the counterweight adjustment mechanism in different motion stages (start, constant speed, and stop), achieving refined and dynamic correction of the friction model. This staged and typed friction coefficient update mechanism effectively solves the problem that traditional fixed friction models are difficult to adapt to guide rail wear, lubrication changes, and load fluctuations, enabling the corrected mechanism friction model to more realistically reflect the resistance state of the mechanical system. By iteratively solving and continuously approximating the actual friction parameters, the calculation accuracy of the expected current and torque values is improved, thereby optimizing the control parameters of the servo drive unit, reducing shocks and vibrations during the drive process, making the movement of the counterweight block smoother and the response faster, further ensuring the accuracy of counterweight adjustment and the reliability of equipment operation.
[0097] In one embodiment of this application, the method for determining the preset calibration coefficient includes: Install a movable reference counterweight of known mass and position on the machine tool spindle box; The driving reference counterweight block runs sequentially at multiple preset test positions, and simultaneously collects image data and vibration sensor data at each test position; For each test location, the image pixel displacement is calculated based on the image data, and the actual three-dimensional spatial vibration amplitude is calculated based on the vibration sensor data. By fitting with the least squares method, a mapping relationship between image pixel displacement and three-dimensional spatial vibration amplitude is established, and the calibration coefficients are updated.
[0098] In this embodiment, firstly, a standard counterweight with uniform mass and regular shape is selected, its mass is calibrated by a balance, and after being installed at the reference mounting position on the counterweight plate, it is moved to the initial zero position by a servo drive unit, and the installation deviation is confirmed to be less than or equal to 0.01mm by visual positioning.
[0099] Specifically, based on the preset radial and phase test positions, the servo drive unit sequentially moves the reference counterweight to each test position, with a dwell time of no less than 5 seconds, allowing the spindle box to stabilize before data acquisition. When acquiring image and vibration sensor data at each test position, the industrial camera and vibration sensor must be synchronously triggered based on the same timestamp. The camera's shooting frequency must be greater than or equal to 30fps, acquiring 50 frames for pixel displacement calculation; the vibration sensor's sampling frequency must be greater than or equal to 1kHz, acquiring vibration data within 3 seconds for amplitude calculation. Simultaneously, the radial coordinates, phase angle, and other parameters of each test position are recorded, establishing a one-to-one correspondence between data and position. If the data at a certain test position is abnormal (e.g., abrupt changes in vibration amplitude or image blurring), the data for that position must be reacquired.
[0100] This embodiment preprocesses the image data at each test location (grayscale correction, noise filtering, edge enhancement), and uses optical flow combined with contour centroid calculation to obtain the image pixel displacement of the reference counterweight. Bandpass filtering is applied to the vibration sensor data to select the vibration signal corresponding to the spindle rotation fundamental frequency. The actual three-dimensional spatial vibration amplitude is calculated using a peak detection algorithm (calculated separately for the X, Y, and Z dimensions). Subsequently, the pixel displacement and vibration amplitude in each dimension are fitted using the least squares method: if the two are linearly related, a linear equation is obtained (y=kx+b, where k is the calibration coefficient and b is the correction term); if they are nonlinearly related (e.g., due to camera distortion or sensor nonlinearity), a polynomial fitting is used (e.g., y= x²+ x+b), during the fitting process, the coefficient of determination R² is calculated (R² needs to be greater than or equal to 0.98).
[0101] For example, select 3-5 verification locations that were not involved in the fitting process, move the benchmark counterweight to these locations, collect images and vibration data, calculate the three-dimensional spatial vibration amplitude using the fitted mapping relationship, and compare it with the actual amplitude directly calculated by the sensor. If the deviation is less than or equal to 0.003 mm, the calibration coefficient is considered valid; if the deviation is greater than the allowable range, the number of test locations needs to be increased (especially in areas with large deviations), and data collection and fitting should be repeated until the verification is successful. Finally, the determined calibration coefficients are stored in the system database, and information such as calibration time, benchmark counterweight parameters, and test conditions are recorded to form a calibration file.
[0102] As can be seen from the above, this embodiment effectively eliminates system deviations caused by factors such as camera distortion, installation angle error, and uncertain imaging ratio by introducing a benchmark counterweight with clear physical meaning for multi-point calibration, enabling the image pixel displacement to be accurately converted into real physical space displacement. The application of the least squares method further optimizes the fitting accuracy of the mapping relationship, reduces the influence of random measurement noise, and improves the stability and robustness of the calibration coefficients.
[0103] In one embodiment of this application, verifying the adjustment effect by collecting adjusted sensor data and image data includes: After the counterweight adjustment device is activated and the machine tool spindle box has run at least one complete cycle, acquire verification sensor data and verification image data. The residual imbalance and residual vibration energy were calculated based on the verification sensor data and verification image data. If the residual imbalance is less than the second threshold and the peak value of the residual vibration energy is less than the preset safety threshold, the adjustment effect is deemed to be qualified. Otherwise, the residual imbalance and its corresponding position are used as new inputs, and the adjustment steps of a machine tool spindle box counterweight balance adjustment method are iteratively executed until the adjustment effect meets the qualified conditions or the maximum number of iterations is reached.
[0104] In this embodiment, firstly, after the counterweight adjustment device completes its operation, it is necessary to wait for the machine tool spindle box to run at least one complete rotation cycle, and to start data acquisition only after the spindle speed and vibration state have stabilized. When verifying sensor data and verifying image data acquisition, it is necessary to maintain the same operating conditions (spindle speed, load, ambient temperature) as before adjustment, and the sensor installation position, sampling frequency, and camera shooting parameters should not be changed.
[0105] Secondly, for the residual unbalance, the same logic as for calculating the first unbalance is adopted. First, spectral analysis is performed on the verification sensor data to extract the vibration amplitude corresponding to the fundamental frequency of the spindle rotation. Then, based on the phase information of the residual unbalance position in the verification image data, it is calculated using a preset unbalance mapping model. Simultaneously, based on the time-series analysis of the verification image data, the amplitude of the residual oscillation trajectory of the spindle box is extracted to cross-verify the accuracy of the residual unbalance, ensuring that the calculation error is less than or equal to 5%. For the residual vibration energy, based on the time-domain vibration amplitude of the verification sensor data, the total energy is calculated according to the formula E=∫(A(t))²dt (t is the acquisition duration). At the same time, the energy peak value is extracted as the core indicator for judging whether the vibration exceeds the standard. In the process of calculating the residual vibration energy, abnormal peak values caused by instantaneous impact interference need to be removed, and valid vibration energy data is retained.
[0106] In this embodiment, if the residual imbalance is less than the second threshold and the peak value of the residual vibration energy is less than the safety threshold, it indicates that the imbalance has been effectively compensated, the adjustment effect is deemed qualified, and the entire process data of this adjustment is recorded to form an adjustment file. If any indicator fails to meet the standard, the calculated residual imbalance and the corresponding residual imbalance position (determined by verification image data and sensor data) are used as new input parameters, and the counterweight balance adjustment process is restarted, iteratively executing the steps of determining the target position, calculating the target amount, driving the adjustment, and verifying the effect. To avoid invalid iterations, a maximum number of iterations (3 times) is preset. If the standard is still not met after reaching the maximum number of iterations, the adjustment is deemed a failure, an alarm process is triggered, and fault information is displayed on the control system interface: residual imbalance exceeds the standard. At the same time, the last residual parameters and adjustment data are recorded to facilitate maintenance personnel in troubleshooting the cause. The causes to be investigated include counterweight device failure, abnormal sensor data, and unreasonable threshold settings. As can be seen from the above, this embodiment effectively avoids transient interference during adjustment by waiting for at least one complete cycle before verification, making the verification data more reflective of the actual steady-state operation. Simultaneously, the combination of residual unbalance and residual vibration energy as dual indicators for judgment not only considers the magnitude of the unbalance but also the actual performance of the kinetic energy, making the evaluation of the adjustment effect more comprehensive and accurate. For cases where the target is not met, iterative execution of the adjustment steps can correct the deviation, gradually approaching the optimal equilibrium state, improving the success rate and stability of the adjustment, effectively reducing the vibration and noise of the spindle box, and further improving machining accuracy.
[0107] Corresponding to the machine tool spindle box counterweight balance adjustment method in the above embodiment, Figure 2 This is a structural block diagram of a machine tool spindle box counterweight balancing adjustment system provided in one embodiment of this application. For ease of explanation, only the parts relevant to the embodiment of this application are shown. References Figure 2 The machine tool spindle box counterweight balance adjustment system 20 includes: a data acquisition module 21, a preliminary analysis module 22, a data fusion module 23, an intelligent identification module 24, a position determination module 25, a difference calculation module 26, an imbalance determination module 27, a control execution module 28, and an effect verification module 29.
[0108] Among them, the data acquisition module 21 is used to acquire sensor data and image data of the machine tool spindle box operating status through cameras and sensors; The preliminary analysis module 22 is used to determine the first imbalance position based on image data and the first imbalance amount based on sensor data; Data fusion module 23 is used to fuse sensor data and image data to obtain fused data; The intelligent recognition module 24 is used to input the fused data into a pre-trained neural network model to obtain the second imbalance position and the second imbalance quantity; Position determination module 25 is used to take the position where the first unbalanced position and the second unbalanced position coincide as the target unbalanced position; Difference calculation module 26 is used to calculate the difference between the first imbalance amount and the second imbalance amount corresponding to the target imbalance position, and obtain the imbalance amount difference. The imbalance quantity determination module 27 is used to take the average of the first imbalance quantity and the second imbalance quantity corresponding to the imbalance quantity difference being less than a preset first threshold as the target imbalance quantity. The control execution module 28 is used to drive the counterweight adjustment device to make adjustments based on the target imbalance amount and the target imbalance position. The effect verification module 29 is used to collect the adjusted sensor data and image data to verify the adjustment effect.
[0109] See Figure 3 , Figure 3 This is a schematic block diagram of an electronic device provided according to an embodiment of this application. Figure 3 The electronic device 300 in this embodiment may include one or more processors 301, one or more input devices 302, one or more output devices 303, and one or more memories 304. The processors 301, input devices 302, output devices 303, and memories 304 communicate with each other via a communication bus 305. The memories 304 store computer programs, including program instructions. The processors 301 execute the program instructions stored in the memories 304. Specifically, the processors 301 are configured to invoke the program instructions to perform the functions of the modules in the aforementioned device embodiments, for example... Figure 2 The functions of the data acquisition module 21, preliminary analysis module 22, data fusion module 23, intelligent recognition module 24, position determination module 25, difference calculation module 26, imbalance determination module 27, control execution module 28, and effect verification module 29 are shown.
[0110] It should be understood that, in the embodiments of this application, the processor 301 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0111] Input device 302 may include a touchpad, a fingerprint sensor (for collecting the user's fingerprint information and fingerprint orientation information), a microphone, etc., and output device 303 may include a display (LCD, etc.), a speaker, etc.
[0112] The memory 304 may include read-only memory and random access memory, and provides instructions and data to the processor 301. A portion of the memory 304 may also include non-volatile random access memory. For example, the memory 304 may also store device type information.
[0113] In specific implementations, the processor 301, input device 302, and output device 303 described in the embodiments of this application can execute the implementation methods described in any embodiment of the machine tool spindle box counterweight balance adjustment method provided in the embodiments of this application, or they can execute the implementation methods of the electronic devices described in the embodiments of this application, which will not be repeated here.
[0114] In another embodiment of this application, a computer-readable storage medium is provided. This computer-readable storage medium stores a computer program, which includes program instructions. When executed by a processor, the program instructions implement all or part of the processes in the methods described above. Alternatively, the computer program can instruct related hardware to complete the process. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include any entity or device capable of carrying computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0115] The computer-readable storage medium can be an internal storage unit of the electronic device in any of the foregoing embodiments, such as a hard disk or memory of the electronic device. The computer-readable storage medium can also be an external storage device of the electronic device, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the electronic device. Furthermore, the computer-readable storage medium can include both internal and external storage units of the electronic device. The computer-readable storage medium is used to store computer programs and other programs and data required by the electronic device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0116] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.
[0117] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the electronic devices and units described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0118] In the several embodiments provided in this application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces or units, or it may be an electrical, mechanical, or other form of connection.
[0119] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.
[0120] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0121] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for adjusting the counterweight balance of a machine tool spindle box, characterized in that, include: Sensor data and image data on the operating status of the machine tool spindle box are collected using cameras and sensors; The first imbalance position is determined based on the image data, and the first imbalance amount is determined based on the sensor data; The sensor data and the image data are fused to obtain fused data; The fused data is input into a pre-trained neural network model to obtain the second imbalance position and the second imbalance amount; The position where the first imbalance position coincides with the second imbalance position is taken as the target imbalance position; Calculate the difference between the first imbalance amount and the second imbalance amount corresponding to the target imbalance position to obtain the imbalance amount difference; The average of the first imbalance and the second imbalance, where the difference in the imbalance is less than a preset first threshold, is taken as the target imbalance. The counterweight adjustment device is driven to adjust based on the target imbalance amount and the target imbalance position; The adjusted sensor data and image data were collected to verify the adjustment effect.
2. The method for adjusting the counterweight balance of a machine tool spindle box according to claim 1, characterized in that, Determining the first imbalance position based on the image data and determining the first imbalance amount based on the sensor data includes: Perform time-series analysis on the image data to extract the image displacement of the machine tool spindle box relative to the stationary reference frame at multiple characteristic operating moments; Based on the image displacement at the multiple feature operation times, the swing trajectory of the machine tool spindle box in three-dimensional space is fitted and generated; Based on the amplitude and phase information of the swing trajectory, the first unbalanced position is calculated; The sensor data is subjected to spectrum analysis and amplitude calculation. Based on a preset imbalance mapping model, the first imbalance quantity corresponding to the first imbalance position is calculated and determined.
3. The method for adjusting the counterweight balance of a machine tool spindle box according to claim 2, characterized in that, The step of fitting and generating the swing trajectory of the machine tool spindle box in three-dimensional space based on the image displacement of the multiple characteristic operating times includes: Obtain vibration sensor data corresponding to the operating times of the multiple features; The image displacement at each characteristic running time is correlated with the vibration sensor amplitude at the corresponding characteristic running time to obtain the correlated image displacement. Based on preset calibration coefficients, the associated image displacement is converted into a three-dimensional spatial displacement. Based on the three-dimensional spatial displacement and the phase information in the vibration sensor data, the oscillation trajectory in the three-dimensional space is generated by a spatial curve interpolation algorithm.
4. The method for adjusting the counterweight balance of a machine tool spindle box according to claim 3, characterized in that, The step of generating the oscillation trajectory in the three-dimensional space based on the three-dimensional spatial displacement and the phase information in the vibration sensor data through a spatial curve interpolation algorithm includes: Based on the phase information in the vibration sensor data, the temporal distribution of the multiple characteristic operating moments within the spindle rotation cycle is determined; Based on the aforementioned temporal distribution, a non-uniform rational B-spline curve interpolation algorithm is used to fit the three-dimensional spatial displacement, wherein the weights of the curve control points are adjusted according to the vibration energy at the corresponding time. In the interpolation process of the non-uniform rational B-spline curve interpolation algorithm, the curvature continuity of the fitted trajectory curve is constrained and optimized based on the known geometric structure and kinematic constraints of the machine tool spindle box as optimization conditions, thereby generating the swing trajectory.
5. The method for adjusting the counterweight balance of a machine tool spindle box according to claim 2, characterized in that, After calculating the first unbalanced position based on the amplitude and phase information of the swing trajectory, the method further includes: Obtain the current spindle speed and machining load information of the machine tool; Based on the spindle speed and machining load information, query the pre-established machine tool working condition-stiffness mapping relationship table to determine the equivalent dynamic stiffness of the machine tool spindle box suspension system under the current working condition. Based on the equivalent dynamic stiffness, stiffness compensation correction is performed on the first unbalanced position to obtain the corrected first unbalanced position.
6. The method for adjusting the counterweight balance of a machine tool spindle box according to claim 1, characterized in that, The adjustment based on the target imbalance and the target imbalance position, driven by the counterweight adjustment device, includes: The target imbalance position is converted into a target phase angle on the counterweight plate; Calculate the required target counterweight mass based on the target imbalance and the preset unit mass of the counterweight block; If the counterweight adjustment device is a movable counterweight block type, then the target radial displacement of the counterweight block on the radial guide rail of the counterweight plate is calculated based on the target imbalance and the mass of the counterweight block. Based on the target phase angle and the target counterweight mass or the target radial displacement, a counterweight adjustment drive command is generated; Based on the driving command, the servo drive unit is controlled to drive the counterweight to move to the target phase angle and the corresponding target radial position.
7. A method for adjusting the counterweight balance of a machine tool spindle box according to claim 6, characterized in that, Also includes: During the driving process, feedback data of the current and torque of the servo drive unit are acquired; The feedback data is compared with the expected current and torque values calculated based on the target counterweight mass, moving acceleration, and mechanism friction model to obtain the comparison difference. If the comparison difference is greater than the preset safety tolerance, the drive will be stopped and the fault diagnosis and alarm process will be triggered.
8. The method for adjusting the counterweight balance of a machine tool spindle box according to claim 7, characterized in that, The step of comparing the feedback data with the expected current-torque value calculated based on the target counterweight mass, moving acceleration, and mechanism friction model, and obtaining the comparison difference, further includes: If the comparison difference is not greater than the preset safety tolerance but continues to be greater than the preset warning threshold, then based on the feedback data, the friction coefficient in the mechanism friction model is corrected to obtain the corrected mechanism friction model. The expected current torque value is recalculated using the modified mechanism friction model to obtain the target expected current torque value. The drive parameters of the servo drive unit are adjusted based on the target expected current and torque value until the comparison difference is less than the warning threshold.
9. A method for adjusting the counterweight balance of a machine tool spindle box according to claim 7, characterized in that, After controlling the servo drive unit to move the counterweight to the target phase angle and corresponding target radial position based on the drive command, the method further includes: The camera captures a local image of the counterweight after it is in place. Identify the actual contour center position of the counterweight block in the local image and compare it with the theoretical contour center position calculated based on the target phase angle and target radial displacement; If the deviation between the actual contour center position and the theoretical contour center position is greater than the preset installation tolerance, a position compensation command is generated. According to the position compensation command, the servo drive unit is controlled to make adjustments until the deviation between the actual contour center position and the theoretical contour center position is less than the preset installation tolerance.
10. A machine tool spindle box counterweight balance adjustment system, characterized in that, include: The data acquisition module is used to acquire sensor data and image data of the machine tool spindle box operating status through cameras and sensors; The preliminary analysis module is used to determine the first imbalance position based on the image data and to determine the first imbalance amount based on the sensor data; The data fusion module is used to fuse the sensor data and the image data to obtain fused data; The intelligent recognition module is used to input the fused data into a pre-trained neural network model to obtain the second imbalance position and the second imbalance amount; The position determination module is used to take the position where the first unbalanced position and the second unbalanced position coincide as the target unbalanced position; The difference calculation module is used to calculate the difference between the first imbalance amount and the second imbalance amount corresponding to the target imbalance position, and obtain the imbalance amount difference. The imbalance quantity determination module is used to take the average of the first imbalance quantity and the second imbalance quantity, which are corresponding to an imbalance quantity difference that is less than a preset first threshold, as the target imbalance quantity. The control execution module is used to drive the counterweight adjustment device to adjust based on the target imbalance amount and the target imbalance position; The effect verification module is used to collect adjusted sensor data and image data to verify the adjustment effect.