Positioning method and system for part machining
By constructing a dynamic adaptive search domain and introducing vibration signal analysis, the problem of large computational load in traditional Hough transform is solved, realizing high-frequency real-time positioning in the part processing process and improving processing stability and accuracy.
Patent Information
- Application Number
- CN202511629610.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-08
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-11-08
AI Technical Summary
Traditional Hough transform is computationally intensive in CNC machining and laser welding, which cannot meet real-time requirements and results in poor part processing stability.
A dynamic adaptive search domain based on a kinematic prediction model is constructed, and the computational load is reduced by local Hough transform. Combined with vibration signal analysis, the positioning accuracy and robustness are improved.
It achieves high-frequency real-time dynamic compensation, improves the stability and accuracy of part processing, meets the real-time requirements of CNC system in CNC machining, solves the calculation delay problem caused by global search in traditional Hough transform, and improves the stability and accuracy of part processing.
Smart Images

Figure CN121074142A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of positioning methods, in particular to a positioning method and system for part machining. BACKGROUND
[0002] In the manufacturing field of numerical control machining, laser welding, etc., in order to ensure the dimensional accuracy and surface quality of the final product, it is necessary to monitor and dynamically compensate the actual position of the part in the machining process. The part will be affected by cutting force, thermal stress and other factors during machining, resulting in small displacement and attitude change. If not compensated, it will directly lead to the deviation of the machining trajectory from the theoretical path, resulting in accuracy out of tolerance.
[0003] The positioning technology based on machine vision is the key to realize dynamic compensation. Among them, Hough Transform as a classic geometric feature detection algorithm, because it can stably identify key geometric features such as reference holes, reference edges from complex images, is applied to the positioning of parts. Hough Transform maps the edge points in the image space to the parameter space for voting, and searches for the cumulative peak in the parameter space to determine the parameters of the geometric feature, such as the center coordinates and radius of a circle.
[0004] However, the traditional Hough Transform has a limitation when applied to dynamic compensation in the machining process. In order to ensure the accuracy of detection, the standard Hough Transform needs to search and vote globally and indiscriminately in the entire preset parameter space on each frame of captured image. For example, when detecting a circular hole with a radius of , it needs to be calculated in the three-dimensional parameter space composed of the width , height and possible radius range of the entire image. This global search strategy brings huge computational overhead. In the dynamic compensation scenario, the response frequency of the compensation system is required to reach tens or even hundreds of hertz, and the time window left for single image processing is only milliseconds. The calculation delay of the traditional Hough Transform is large, which cannot meet the real-time requirement, resulting in poor stability of part machining. SUMMARY
[0005] In order to solve the technical problem that the existing Hough Transform cannot meet the dynamic compensation requirement of the machining process due to large amount of calculation caused by global search, the present application provides a positioning method and system for part machining.
[0006] In the first aspect, the present application provides a positioning method for part machining, which adopts the following technical scheme: Obtaining a part image of a part to be processed and a position parameter of a positioning feature on the part to be processed; constructing a kinematics prediction model based on the position parameter of the positioning feature, obtaining a velocity vector of the positioning feature at a next time, and obtaining a predicted position of the positioning feature at the next time based on the velocity vector; determining an adaptive search domain at the next time based on a degree of change in a motion state of the positioning feature; and performing local Hough transformation on the part image collected at the current time within the adaptive search domain to obtain a current position parameter of the positioning feature. The determination method of the adaptive search domain is as follows: calculating a motion acceleration factor at the current time, the motion acceleration factor representing a motion change state of the part to be processed; calculating a disturbance factor at the current time, the disturbance factor being positively correlated with the motion acceleration factor, adjusting a preset search boundary by using the disturbance factor to obtain a disturbance boundary, and obtaining the adaptive search domain based on the predicted position of the positioning feature and the disturbance boundary.
[0007] Compared with the prior art, each frame of image needs to be searched by global Hough transformation, resulting in a huge amount of calculation and poor real-time performance, the present application constructs a dynamic prediction model based on kinematics constraints, generates a dynamically adaptive search domain, and then performs local Hough transformation in the small search domain, thereby reducing the search space and calculation overhead, improving the running speed of the positioning algorithm, and meeting the high-frequency real-time dynamic compensation demand of dozens or even hundreds of hertz in the processing process, thereby effectively improving the stability and final precision of part processing.
[0008] Preferably, the positioning method further comprises: obtaining a vibration signal of the part fixing seat, further obtaining a vibration amplitude at each time, calculating a change rate of the vibration amplitude according to the vibration amplitude at each time, and performing normalization processing on the change rate by using a linear normalization method.
[0009] By additionally obtaining and analyzing the vibration signal of the part fixing seat, a direct data source about external physical impact is provided in addition to image information, compared with indirectly inferring the motion state by only using image displacement, introducing vibration signal analysis can directly and sensitively perceive sudden disturbance caused by cutting force, equipment jitter and the like, thereby providing a key physical basis for more accurately evaluating the motion trend and uncertainty of the part, and improving the accuracy and robustness of the prediction model.
[0010] Preferably, the velocity vector of the positioning feature at the next time is calculated, and the expression is as follows: ; In the formula, is the velocity vector of the predicted next time , represents a preset motion trend damping factor, is the time to the time Historical average speed to date For a moment The instantaneous velocity vector.
[0011] The current instantaneous velocity and the historical average velocity are weighted by a damping factor. Compared to simply using instantaneous velocity for linear extrapolation, this method introduces a smoothing mechanism, which can effectively suppress drastic fluctuations in predicted values caused by single-frame measurement errors or brief jumps. This allows the velocity prediction results to respond to current changes while also taking into account the stability of historical motion trends, thus obtaining a smoother and more reliable predicted position.
[0012] The preferred method for calculating the motion trend damping factor is as follows: In the formula, Indicates the damping factor of motion trend. Represents the normalized time. The rate of change of the vibration amplitude of the vibration signal and It is a moment The location feature coordinates, and It is a moment The location feature coordinates, This represents the activation function. It is a local minimum.
[0013] This allows the damping factor to adaptively adjust based on vibration signals and displacement changes. When vibration is severe and displacement is large (such as during an impact), the weight of the current instantaneous velocity is increased for a rapid response; when the motion is smooth, it relies more on the historical average velocity to maintain stability. Compared to using a fixed damping factor, this adaptive adjustment mechanism enables the prediction model to combine the agility of impact response with the stability of smooth operation, making it adaptable to different processing conditions.
[0014] Preferably, the expression for the motion acceleration factor is: in, For a moment The motion acceleration factor, Describes the Euclidean norm. It's time. Historical average speed to date For a moment The instantaneous velocity vector, where tanh represents the hyperbolic tangent function.
[0015] By calculating the difference between the current velocity vector and the historical average velocity vector, the drastic degree of change in the part's motion state is quantified. This provides a crucial, calculable input parameter for subsequent dynamic adjustment of the adaptive search domain size, ensuring that the search domain adjustment is based not on empirical estimation, but on a precise quantification of changes in motion trends.
[0016] Preferably, the method for calculating the disturbance factor is as follows: starting from the current moment, obtain the rate of change of vibration amplitude of vibration signal at multiple moments along the historical direction, construct a rate of change sequence using the rate of change, calculate the percentile rank of the rate of change at the current moment in the rate of change sequence, and use the product of the motion acceleration factor at the current moment and the percentile rank as the disturbance factor.
[0017] The significance of the disturbance was assessed by considering the current rate of change of vibration and calculating its percentile rank in the historical sequence. Compared with directly using the vibration amplitude, this approach can better determine whether the current disturbance is within the normal fluctuation range or an anomalous shock, thus more accurately assessing the degree of external influence and providing a more reliable basis for generating more reasonable disturbance boundaries.
[0018] Preferred, perturbation boundary The expression is: in, This is for predicting the time. The set perturbation boundary, These represent the maximum and minimum values of the preset search boundaries, respectively. Indicates time The disturbance factor.
[0019] Linear interpolation is performed between preset maximum and minimum boundary values based on the disturbance factor. This transforms the abstract disturbance factor into a specific pixel-level search range, directly enabling the search area to dynamically scale with the stability of the part's movement. When machining is smooth, the search domain shrinks to improve efficiency; when disturbances occur, the search domain expands to ensure the target is not lost, achieving a balance between computational efficiency and tracking robustness.
[0020] Preferably, the method for obtaining the position parameters of the positioning features on the part to be processed is as follows: At the initial moment of part processing, the first frame of part image is acquired, and a global Hough transform is performed on the part image to obtain the position parameters of the localization features.
[0021] Preferably, the localization method further includes: at the next moment, acquiring a new part image and performing edge detection, performing Hough transform within the adaptive search domain, finding the accumulator peak, and obtaining the localization result of the localization feature at the next moment.
[0022] Secondly, the present invention provides a positioning system for machining parts, which adopts the following technical solution: A positioning system for machining parts includes a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a positioning method for machining parts as described above is implemented.
[0023] A computer program is generated using the aforementioned part machining positioning method and stored in a memory for loading and execution by a processor. Thus, a system is created based on the memory and processor for convenient use.
[0024] The present invention has the following technical effects: This invention solves the problems of high computational cost and poor real-time performance of traditional Hough transform global search. Instead of relying on global search, this method constructs a kinematic prediction model and integrates motion acceleration from image analysis with vibration information monitored by sensors to adaptively generate a compact and dynamically changing adaptive search domain. Subsequently, local Hough transforms are performed only within this small domain, thereby greatly reducing computational complexity and achieving high-frequency, low-latency tracking of part pose during processing, improving the accuracy and response speed of dynamic compensation. Attached Figure Description
[0025] Figure 1 This is a flowchart of a positioning method for part processing according to the present invention. Detailed Implementation
[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] This invention discloses a positioning method for machining parts, referring to... Figure 1 The process includes the following steps, as detailed below: S1: Obtain the part image of the part to be processed.
[0028] At the initial moment of machining the parts Acquire the first frame of the part image. Since there is no prior information about the part's position at this time, a standard global Hough transformation is first performed to obtain the initial parameters of the positioning features, such as the center coordinates and radius of the reference hole.
[0029] First, the Canny operator is used to process the image. Perform edge detection to obtain an edge point set. Then, the Hough transform is performed in a pre-set global parameter space The size of the global parameter space is determined by the full size (width , height ) of the image and the radius range , of the part, which is a prior art and the specific steps are not described here. By searching the accumulator peak in , the center coordinates and the radius of the reference circular hole at the initial time are obtained.
[0030] S2: Construct a dynamic prediction model based on kinematic constraints.
[0031] In the high-frequency sampling interval required for dynamic compensation (for example, 10 milliseconds), due to the physical inertia of the part, the changes in its motion state (displacement and velocity) are continuous and limited. First, from the positioning results and of the continuous two frames and , the instantaneous velocity vector at the current time is calculated: where is the instantaneous velocity vector at time , and are the center coordinates at time , and are the center coordinates at time , is the time interval of image acquisition. The instantaneous velocity vector quantifies the motion state of the part in the latest time step.
[0032] During the machining of the part, there are vibrations and impacts, so the motion velocity of the part cannot be constant. Therefore, a motion trend damping factor is introduced to smooth the velocity prediction to reflect the damping effect. By combining the motion trend damping factor with the instantaneous velocity and the historical average velocity , a more robust predicted velocity is obtained, and the expression is: where is the velocity vector at the next time predicted, represents the motion trend damping factor, and its value is between 0 and 1, It's time. Historical average speed to date For a moment The instantaneous velocity vector.
[0033] The calculation method for the motion trend damping factor is as follows: The vibration signal of the fixed seat of the part to be processed is obtained, and the vibration amplitude at each moment is further obtained. The rate of change of the vibration amplitude is calculated based on the vibration amplitude at each moment, and the rate of change is normalized using a linear normalization method. The expression for the motion trend damping factor is: In the formula, Indicates the damping factor of motion trend. Represents the normalized time. The rate of change of the vibration amplitude of the vibration signal and It is a moment The coordinates of the center of the circle, and It is a moment The coordinates of the center of the circle, This represents the activation function, used for normalization. To set a minimum value to prevent the denominator from being 0, for example: The value is 0.01.
[0034] When a workpiece is subjected to an impact, the impact force is reflected on the machine tool base, causing a change in the base's vibration amplitude. The rate of change of the vibration amplitude indicates the magnitude of the impact force; the larger the rate of change, the greater the impact force on the workpiece. This reflects the degree of impact a part is subjected to from external forces. A higher value indicates a greater impact from the external force. Therefore, when... When the value is large, at the current time Instantaneous changes for the next moment The velocity vector has a significant impact and is suitable for impact responses; when A smaller value indicates that the part is less affected by external forces at the current moment, and the historical average trend has less influence on the next moment. The velocity vector has a significant impact and is suitable for smooth drifting.
[0035] S3: Generate time-varying perturbation boundaries and dynamic adaptive search domains.
[0036] To define the range of uncertainty regarding the position at the next moment, a time-varying perturbation boundary needs to be constructed. This boundary is not a fixed tolerance, but rather positively correlated with the intensity of the part's movement. The more intense the movement, the greater the uncertainty, and the larger the search range should be. Therefore, it is first necessary to quantify the intensity of the movement.
[0037] The acceleration factor at the current moment is calculated using the following expression: in, For a moment The motion acceleration factor represents the degree of drastic change in motion state. Denotes the Euclidean norm. It's time. Historical average speed to date For a moment The instantaneous velocity vector, where tanh represents the hyperbolic tangent function, is used for normalization. The larger the value, the more drastic the change in the motion state of the part.
[0038] The perturbation factor at the current moment is calculated as follows: [Calculation method follows, but is not explicitly stated in the original text.] Starting from the historical data point, the rate of change of vibration amplitude of the vibration signal at n time points is obtained. A rate of change sequence is constructed using this rate of change, and the current time point is calculated. rate of change The percentile rank S in the rate of change sequence Percentile rank refers to the relative position of a value within a set of data. Specifically, the percentile rank of a particular data point is equal to the percentage of all values smaller than that data point out of the total number of data points. This is existing technology, and the specific calculation method will not be elaborated here. If S( The larger the value of S, the more it indicates that the impact on the workpiece is ongoing or gradually increasing; if S( The smaller the value of S(), the more it indicates that the impact on the workpiece is attenuating; in other words, the smaller the value of S(), the less impact is on the workpiece. This indicates the degree of influence the part being processed is subject to external factors; a higher value indicates a greater influence, and vice versa. (The value represents the time interval between these parameters.) The product of the motion acceleration factor and the percentile rank is used as the disturbance factor, which comprehensively reflects the motion change state of the part.
[0039] Construct time-varying perturbation boundaries based on perturbation factors. The expression is: in, This is for predicting the time. The set perturbation boundary (unit: pixels). These represent the maximum and minimum values of the preset search boundaries, respectively. Indicates time The disturbance factor.
[0040] When the machining is smooth and less affected by external factors, tends to 0, the disturbance boundary shrinks to a minimum ; when the impact vibration occurs, the disturbance boundary expands to ensure that the subsequent adaptive search field can cover the true position of the reference circular hole.
[0041] Finally, based on the predicted speed , the next time , the center position of the reference circular hole : , it can be understood that The coordinates are: ( , ) ; then, with as the center and as the radius, define the dynamic adaptive search domain of the Hough transform at the next time , which is a very small parameter subspace, and the center coordinates (X, Y) range: ; ; Among them, , respectively represent the horizontal and vertical coordinates of the center position of the reference circular hole at the next time , and is the disturbance boundary set for the predicted time .
[0042] Because the radius changes very little during machining, the search range of the radius can be fixed in a small interval , , which represents the preset fluctuation range, the size of which is artificially set according to the actual situation, for example, The value of 5 pixels.
[0043] S4: Perform local Hough transform in the dynamic search domain and update iteratively.
[0044] At time , a new frame of image is collected and edge detection is performed. Perform Hough transform in the dynamic adaptive search domain generated in step S3, because The volume is much smaller than the global parameter space , so it can effectively reduce the amount of calculation.
[0045] The accumulator peak value found in the dynamic adaptive search domain is the positioning result at time and . This result will be used as input for the next iteration (dynamic adaptive search domain at the moment of the search) and sent to the numerical control system of the machine tool for real-time computation and compensation of the machining path.
[0046] The embodiment of the present application further discloses a positioning system for part machining, comprising a processor and a memory, and the memory stores computer program instructions which realize the positioning method for part machining according to the present application when executed by the processor.
[0047] The above system further comprises other components such as a communication bus and a communication interface which are well known to those skilled in the art, and the setting and functions thereof are known in the art, thus not described herein.
[0048] The above are preferred embodiments of the present application, which do not limit the protection scope of the present application, and thus: any equivalent changes made on the structure, shape and principle of the present application should be covered within the protection scope of the present application.
Claims
1. A positioning method for machining a part, characterized by, The method comprises the steps of: obtaining a part image of a part to be processed and a position parameter of a positioning feature on the part to be processed; constructing a kinematics prediction model based on the position parameter of the positioning feature, obtaining a velocity vector of the positioning feature at a next time, and obtaining a predicted position of the positioning feature at the next time based on the velocity vector; determining an adaptive search domain at the next time based on a degree of change in a motion state of the positioning feature; and performing local Hough transformation on the part image collected at the current time within the adaptive search domain to obtain a current position parameter of the positioning feature. The determination method of the adaptive search domain comprises the following steps: calculating a motion acceleration factor at the current time, wherein the motion acceleration factor represents a motion change state of the part to be processed; calculating a disturbance factor at the current time, wherein the disturbance factor is positively correlated with the motion acceleration factor; adjusting a preset search boundary by using the disturbance factor to obtain a disturbance boundary; and obtaining the adaptive search domain based on the predicted position of the positioning feature and the disturbance boundary.
2. The positioning method for machining a part according to claim 1, wherein The positioning method further comprises the following steps: obtaining a vibration signal of a fixing seat of the part to be processed, further obtaining a vibration amplitude at each time, calculating a change rate of the vibration amplitude according to the vibration amplitude at each time, and performing linear normalization processing on the change rate.
3. The positioning method for machining a part according to claim 2, wherein The expression for calculating the velocity vector of the positioning feature at the next time is: ; wherein is the predicted velocity vector at the next time instant , denotes a preset motion trend damping factor, is the historical average velocity up to time instant , is the instantaneous velocity vector at time instant .
4. The positioning method for machining a part according to claim 3, wherein The calculation method of the motion trend damping factor is: ; In the formula, represents a motion trend damping factor, represents a normalized time is a change rate of a vibration amplitude of a vibration signal, and is a time positioning feature coordinates, and is a time positioning feature coordinates, represents an activation function, is a minimum value.
5. The method of claim 1, wherein The expression for calculating the motion acceleration factor is: ; wherein is a motion acceleration factor at time denotes the Euclidean norm, is a historical average speed up to time is an instantaneous speed vector at time tanh denotes the hyperbolic tangent function. 6. The method of claim 2, wherein The calculation method of the disturbance factor comprises the following steps: obtaining change rates of vibration amplitudes of vibration signals at multiple times along a historical direction from the current time as a starting point, constructing a change rate sequence by using the change rates, calculating a percentile rank of the change rate at the current time in the change rate sequence, and taking a product of the motion acceleration factor at the current time and the percentile rank as the disturbance factor.
7. The method of claim 1, wherein Disturbance boundary The expression for the disturbance boundary is: ; wherein, is a disturbance boundary set for a prediction time is a disturbance boundary set for a prediction time respectively represent a maximum value and a minimum value of a preset search boundary, represents a disturbance factor at a time .
8. The positioning method for machining a part according to claim 1, characterized in that, The method for obtaining the position parameter of the positioning feature on the part to be processed comprises the following steps: At an initial time of processing the part, a first frame of part image is collected, global Hough transformation is performed on the part image, and the position parameter of the positioning feature is obtained.
9. The method of claim 1, wherein The positioning method further comprises the following steps: at the next time, a new part image is obtained and edge detection is performed, Hough transformation is performed within the adaptive search domain, a peak value of an accumulator is found, and a positioning result of the positioning feature at the next time is obtained.
10. A positioning system for part machining, characterized by, The device comprises: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a positioning method for part processing according to any one of claims 1-9 is realized.
Citation Information
Patent Citations
Local corner fairing method for five-axis short straight line segment track
CN112506139A
Laser cutting method for special-shaped workpiece
CN118768749A
Model adaptive predictive control method and system based on disturbance state compensation
CN119356079A
KR20250136804A