High-precision shaft hole assembly shaft part positioning method based on machine learning

Through a high-precision shaft hole assembly method based on machine learning, combined with image processing, path planning and force-position mixing control algorithm, the problem of difficult force information in shaft hole assembly is solved, and high-precision shaft part positioning and installation are achieved.

CN119952729AActive Publication Date: 2025-05-09SHENZHEN SANYANG SHAFT

Patent Information

Application Number
CN202510431647.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-08
Publication Date
2025-05-09
Estimated Expiration
2045-04-08

AI Technical Summary

Technical Problem

During the shaft hole assembly process, it is difficult for the prior art to accurately control the force information during the assembly process, resulting in difficult to control the assembly accuracy and difficult to meet the accuracy requirements.

Method used

Using a high-precision shaft hole assembly method based on machine learning, the optimal assembly position and optimal assembly force are calculated by combining acquiring shaft part images, feature extraction, initial assembly position prediction, path planning and force-position mixing control algorithms to achieve accurate axis part positioning and installation.

Benefits of technology

The assembly accuracy of shaft hole components is improved, precise control of force information during assembly process is achieved, and the requirements of high-precision assembly are met.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119952729A_ABST
    Figure CN119952729A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of automatic assembly, and discloses a high-precision shaft hole assembly shaft part positioning method based on machine learning, and the method comprises the steps: obtaining a shaft part image; performing feature extraction on the shaft part image to obtain key point positions; inputting the key point position into a pre-trained assembly position positioning model, and outputting to obtain an initial assembly position; performing path planning according to the initial assembly position to obtain an optimal assembly path; according to the optimal assembly path, combining with a position hybrid control algorithm, and calculating to obtain an optimal assembly position and an optimal assembly force; and according to the optimal assembly path, the optimal assembly position and the optimal assembly force, installation of the countershaft part is completed. The method can improve the assembly precision of the shaft hole part.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automated assembly technology, and in particular to a high-precision shaft hole assembly shaft part positioning method based on machine learning. Background Art

[0002] In the development of modern industry, hole-shaft assembly parts are core parts in the industrial field, and are mainly used in aerospace, machinery manufacturing, and vehicle manufacturing. With the continuous improvement of the assembly level and assembly accuracy of equipment and industrial products in the fields of aerospace, shipbuilding, and automobiles, higher requirements are placed on the assembly equipment of large and complex hole-shaft products. In the process of hole-shaft assembly, due to the complex structure of the assembled parts and the deviation of posture and position, the assembly point and assembly path deviate from the optimal solution. In one prior art, the shaft hole assembly method mainly includes: controlling the robot to align the assembly through sensors. For example, a robot box fast clamping method based on reinforcement learning realizes the state representation of the robot box clamping process through the definition of state space and action space, constructs a state evaluator to evaluate the position information of the box workpiece, and iteratively optimizes the control strategy of the robot end effector to achieve assembly.

[0003] However, the force information during the shaft-hole assembly process is a necessary parameter to ensure assembly accuracy. The existing technology only focuses on the alignment assembly of manipulators or robots, and it is difficult to accurately control the force information during the assembly process, resulting in the difficulty in controlling the hole-shaft assembly accuracy and meeting the accuracy requirements. Summary of the invention

[0004] The present invention provides a high-precision shaft-hole assembly shaft part positioning method, device, electronic device and storage medium based on machine learning, so as to improve the accuracy of shaft-hole assembly shaft parts.

[0005] In the first aspect, in order to solve the above technical problems, the present invention provides a high-precision shaft hole assembly shaft part positioning method based on machine learning, comprising: Get the shaft part image; Extracting features from the shaft part image to obtain key point positions; Inputting the key point position into a pre-trained assembly position positioning model, and outputting an initial assembly position; Performing path planning according to the initial assembly position to obtain an optimal assembly path; According to the optimal assembly path, combined with the force-position hybrid control algorithm, the optimal assembly position and the optimal assembly force are calculated; The shaft parts are installed according to the optimal assembly path, the optimal assembly position and the optimal assembly force.

[0006] In an optional implementation, extracting features from the shaft part image to obtain key point positions includes: Preprocessing the shaft part image to obtain a grayscale shaft part image; Perform edge detection on the grayscale shaft part image to obtain a shaft part contour image; Perform axis point detection according to the axis part contour image to obtain key point positions; The key point positions include the center position of the shaft, the center of the circular hole at the end of the shaft, the center contact point and the center point of the contact surface.

[0007] In an optional implementation, the training process of the assembly position positioning model includes: An assembly position positioning model is constructed based on the historical key point positions and the historical assembly positions, the model is trained, and the training is determined to be completed after the loss function of the detection model meets the conditions, thereby obtaining a trained assembly position positioning model; The key point positions are input into the trained assembly position positioning model to obtain the initial assembly position.

[0008] In an optional implementation, performing path planning according to the initial assembly position to obtain an optimal assembly path includes: Randomly generate an initial search path according to the initial assembly position; The energy function is calculated according to the initial search path by the following formula: in, is the energy function, Plan the initial energy value for the search path, is the iteration coefficient, For the n The length of the search path obtained by iteration is The total length of the search path, n is the number of iterations; Iteratively search for paths using the gradient descent formula: in, For the The search path for the iterations, For the The search path for the iterations, is the learning rate, is the gradient of the energy function; When the energy function reaches a minimum value, the corresponding search path is used as the optimal assembly path.

[0009] In an optional implementation, the optimal assembly position and the optimal assembly force are calculated based on the optimal assembly path in combination with a force-position hybrid control algorithm, including: The expected assembly force is calculated using the following formula: in, for The expected assembly force in coordinates, is the distance between the axis of the workpiece's initial position and the axis of the position to be assembled. is the size of the shaft hole to be assembled, To plan the assembly force, is the path planning parameter corresponding to the optimal assembly path, is the initial assembly position; Get assembly movement time and assembly movement speed; The optimal assembly position is calculated according to the following formula: in, is the optimal assembly position, is the assembly movement speed, is the assembly movement time, for The expected assembly force in coordinates, is the workpiece quality, is the initial assembly position, is the assembly motion acceleration; The optimal assembly force is calculated by the following formula: in, For the optimal assembly force, is the position control gain, For force control gain, is the optimal assembly position, is the initial assembly position, for The expected assembly force in coordinates, Assemble force for the plan.

[0010] In an optional implementation, the step of completing the installation of the shaft parts according to the optimal assembly path, the optimal assembly position and the optimal assembly force includes: The workpieces are arranged along the optimal assembly path in sequence, and at each optimal assembly position, the optimal assembly force is used to complete the installation of the shaft parts.

[0011] In an optional implementation, after inputting the key point position into a pre-trained assembly position positioning model and outputting an initial assembly position, the method further includes: Performing distance calculation based on the initial assembly position and the pre-acquired planned assembly position to obtain a position deviation; When the position deviation is greater than a preset position threshold, replacing the initial assembly position with the planned assembly position; When the position deviation is less than the position threshold, proceed to the subsequent steps.

[0012] In a second aspect, the present invention provides a high-precision shaft hole assembly shaft parts positioning device based on machine learning, comprising: A data acquisition module, used for acquiring an image of a shaft part; A feature extraction module is used to extract features from the shaft part image to obtain key point positions; An initial positioning module, used to input the key point position into a pre-trained assembly position positioning model, and output an initial assembly position; A path optimization module, used for performing path planning according to the initial assembly position to obtain an optimal assembly path; A force-position optimization module, used to calculate the optimal assembly position and the optimal assembly force according to the optimal assembly path in combination with a force-position hybrid control algorithm; The workpiece installation module is used to complete the installation of the shaft parts according to the optimal assembly path, the optimal assembly position and the optimal assembly force.

[0013] In a third aspect, the present invention also provides an electronic device comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, it implements any one of the above-mentioned high-precision shaft-hole assembly shaft part positioning methods based on machine learning.

[0014] In a fourth aspect, the present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned high-precision shaft hole assembly shaft part positioning methods based on machine learning.

[0015] Compared with the prior art, the present invention has the following beneficial effects: the present invention discloses a high-precision shaft hole assembly shaft part positioning method based on machine learning, the method comprising acquiring a shaft part image; extracting features from the shaft part image to obtain key point positions; inputting the key point positions into a pre-trained assembly position positioning model, and outputting an initial assembly position; performing path planning according to the initial assembly position to obtain an optimal assembly path; according to the optimal assembly path, combining a force-position hybrid control algorithm, calculating an optimal assembly position and an optimal assembly force; completing the installation of the shaft part according to the optimal assembly path, the optimal assembly position, and the optimal assembly force. The present method can improve the assembly accuracy of shaft hole components.

[0016] Specifically, this method introduces an innovative path planning algorithm to determine the optimal assembly path. This method first randomly generates an initial search path based on the initial assembly position. This step provides a starting point for subsequent iterative optimization. Then, the quality of the search path after each iteration is evaluated by the defined energy function. The design of the energy function combines factors such as the initial energy value, the iteration coefficient, the search path length obtained in each iteration, and the total length of the search path, and quantifies the quality of the path in the form of a mathematical formula. The energy function reflects the sensitivity to changes in path length: when the path length is close to the total length of the search path, the energy function value tends to decrease, which means that the path is closer to the ideal state; conversely, if the path deviates from the ideal state, the energy function value increases. This design enables the algorithm to effectively distinguish paths of different qualities and guide the search to a better direction. Next, the gradient descent method is used for iterative optimization. The search path is adjusted according to the update rule, where the learning rate determines the size of each adjustment step, and the gradient of the energy function with respect to the path indicates the direction in which the current path needs to be improved. As the number of iterations increases, the search path gradually approaches the state that minimizes the energy function, that is, the optimal assembly path is found. This method applies the optimization concept in machine learning to the field of mechanical assembly, especially for the specific problem of shaft-hole assembly. By constructing a suitable objective function (the energy function in this method) and using an effective optimization algorithm (such as gradient descent), it achieves the purpose of automatically selecting the optimal solution from many possible assembly paths. Compared with the traditional method that relies on experience and manual parameter setting, this technology can provide more accurate and efficient assembly path planning, which helps to improve assembly accuracy and efficiency and reduce assembly errors.

[0017] Furthermore, this method deepens the application of the optimal assembly path, and accurately calculates the optimal assembly position and optimal assembly force by combining the force-position hybrid control algorithm. This method first defines a calculation formula for the expected assembly force, in which each parameter represents a specific physical meaning: the distance between the axis of the workpiece initial position point and the axis of the assembly position point, the size of the shaft hole to be assembled, the planned assembly force, the path planning parameters corresponding to the optimal assembly path, and the initial assembly position. This formula reflects the size of the assembly force required to be applied at different positions, and adjusts with the change of the distance x, ensuring the force adaptability during the assembly process. Then, after obtaining the assembly movement time and speed, the kinematic equation is used to determine the optimal assembly position. The assembly movement speed and time are introduced as variables, and the influence of the acceleration caused by the expected assembly force on the final position is taken into account. This step realizes the conversion from the theoretical optimal path to the specific position in actual operation, ensuring the consistency between theory and practice. Finally, in order to calculate the optimal assembly force, a formula containing position control gain and force control gain is used, which reflects the core idea of ​​force-position hybrid control. The position control part adjusts the force by comparing the deviation between the actual position and the expected position; the force control part makes fine adjustments based on the difference between the current expected assembly force and the planned assembly force. This design not only enables the entire assembly process to accurately reach the predetermined position, but also applies appropriate force to avoid excessive impact or insufficient contact force, thereby improving assembly quality and efficiency.

[0018] In general, this method combines the path planning results obtained by machine learning optimization with the classic force-position hybrid control theory to achieve intelligent decision-making in the shaft-hole assembly process, which can improve the assembly accuracy of shaft-hole components. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a schematic flow chart of a method for positioning shaft parts in high-precision shaft-hole assembly based on machine learning provided by the first embodiment of the present invention; Figure 2 It is a structural schematic diagram of a high-precision shaft-hole assembly shaft part positioning device based on machine learning provided by the second embodiment of the present invention. DETAILED DESCRIPTION

[0020] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0021] Reference Figure 1The first embodiment of the present invention provides a high-precision shaft hole assembly shaft part positioning method based on machine learning, comprising the following steps: S11, acquiring the image of the shaft part; S12, extracting features from the shaft part image to obtain key point positions; S13, inputting the key point position into a pre-trained assembly position positioning model, and outputting an initial assembly position; S14, performing path planning according to the initial assembly position to obtain an optimal assembly path; S15, according to the optimal assembly path, combined with the force-position hybrid control algorithm, calculate the optimal assembly position and the optimal assembly force; S16, completing the installation of the shaft parts according to the optimal assembly path, the optimal assembly position and the optimal assembly force.

[0022] In step S11, a shaft part image is acquired.

[0023] In one embodiment, the method of acquiring the image of the shaft part is through an industrial vision system. The industrial vision system is composed of multiple cameras, light sources, and software for capturing and processing images. In an industrial environment, in order to ensure the quality and consistency of the image, a specially designed high-resolution industrial camera is used, and a fixed shooting distance and angle are set to ensure that the image acquired each time has the same scale and viewing angle. This method uses the PNG format to store the acquired shaft part image. At the same time, in order to simplify the image preprocessing work in the model training and reasoning process, all images are adjusted to the same resolution, such as 1024x768 or higher resolution. The present invention is not limited to this.

[0024] In step S12, feature extraction is performed on the shaft part image to obtain key point positions.

[0025] In one embodiment, the shaft part image is preprocessed to obtain a grayscale shaft part image; edge detection is performed based on the grayscale shaft part image to obtain a shaft part contour image; shaft point detection is performed based on the shaft part contour image to obtain key point positions; wherein the key point positions include the shaft center position, the center of the circular hole at the shaft end, the center contact point and the contact surface center point.

[0026] It is worth noting that the purpose of preprocessing is to reduce noise interference, simplify the image, and prepare for subsequent edge detection and feature extraction. The specific method includes grayscale conversion, which uses the grayscale conversion formula to calculate the brightness value of each pixel from the RGB channel value of each pixel of the color shaft part image. Grayscale conversion belongs to the existing method and is not described in detail in this method. Then, a low-pass filter is used to smooth the image to reduce random fluctuations caused by sensor noise or ambient light changes. Finally, histogram equalization is used to improve the contrast of the grayscale image to obtain a grayscale shaft part image.

[0027] In one implementation, edge detection uses the Canny Edge Detection algorithm to perform edge detection. The purpose of edge detection is to extract the contour of an object on an image. In this method, the contour of the shaft part is extracted. The specific method includes: first applying a Gaussian filter to smooth the image, then calculating the image gradient amplitude and direction, then retaining only the maximum response point along the edge direction through non-maximum suppression, and finally using double thresholding combined with hysteresis tracking to determine the final edge.

[0028] In one embodiment, the purpose of shaft point detection is to locate the key geometric points of shaft parts, such as the center of the shaft, the center of the circular hole, etc. The core idea of ​​the Hough transform is to map each pixel point in the image space to a parameter space. In this new space, pixels from the same shape will form a peak, so that the existence and position of the shape can be determined by detecting these peaks. When applied to circle detection, the Hough transform maps each point in the image space to a three-dimensional parameter space, and then counts in the parameter space through an accumulator to find the peak, thereby determining the center and radius of the circle. The Hough transform is used for positioning, and the specific method includes: creating a three-dimensional accumulation array for recording all possible center positions and their corresponding radius values; for each edge point in the image, considering all possible circles passing through the point. For each such circle, the accumulator corresponding to its parameters is added by one; in the parameter space, the accumulated votes form a peak, and the position of the peak corresponds to the parameters of the existence of the circle in the image. When the cumulative number of votes at a position exceeds the threshold, it is considered that a circle is found, and the thresholds of different key geometric points are obtained according to historical data.

[0029] In step S13, the key point positions are input into a pre-trained assembly position positioning model, and the initial assembly position is output.

[0030] It is worth noting that an assembly position positioning model is constructed based on the historical key point positions and the historical assembly positions, the model is trained, and the training is determined to be completed after the loss function of the detection model meets the conditions, thereby obtaining the trained assembly position positioning model; the key point positions are input into the trained assembly position positioning model to obtain the initial assembly position.

[0031] In one embodiment, the assembly position positioning model is trained based on a BP neural network. The input layer receives the preprocessed key point coordinates. First, all weights and biases in the network are randomly initialized; the loss function is defined as the mean square error; Adam is set as the optimizer; the entire historical key point coordinate data set is divided into a training set, a validation set, and a test set, with a ratio of 7:1:2, which is not limited in this method. Then the training data is fed in batches, and the loss value of the current batch is calculated. Then the network parameters are updated using the back propagation mechanism to reduce the loss value. The assembly position positioning model can predict the initial assembly position by inputting the key point position.

[0032] In one embodiment, after the key point position is input into a pre-trained assembly position positioning model and the initial assembly position is output, the method further includes: performing distance calculation based on the initial assembly position and a pre-acquired planned assembly position to obtain a position deviation; when the position deviation is greater than a preset position threshold, replacing the initial assembly position with the planned assembly position; when the position deviation is less than the position threshold, continuing with subsequent steps.

[0033] It is worth noting that once the initial assembly position is obtained through the assembly position positioning model, it needs to be compared with the pre-determined planned assembly position. The planned assembly position refers to the ideal assembly position defined based on the design drawings or other specification documents, which represents the desired target state.

[0034] In step S14, path planning is performed according to the initial assembly position to obtain an optimal assembly path.

[0035] In one implementation, an initial search path is randomly generated based on the initial assembly position; The energy function is calculated according to the initial search path by the following formula: in, is the energy function, Plan the initial energy value for the search path, is the iteration coefficient, For the n The length of the search path obtained by iteration is The total length of the search path, n is the number of iterations; Iteratively search for paths using the gradient descent formula: in, For the The search path for the iterations, For the The search path for the iterations, is the learning rate, is the gradient of the energy function; When the energy function reaches a minimum value, the corresponding search path is used as the optimal assembly path.

[0036] It is worth noting that the energy function is designed to reduce the energy value gradually as the path length decreases until it reaches the minimum value. When the path becomes shorter, the corresponding energy will also become smaller, thus guiding the algorithm to converge to a better solution. The search path is iteratively updated using the gradient descent method. The core idea of ​​gradient descent is to adjust the parameters in the opposite direction of the energy function gradient to gradually reduce the energy value. For path optimization problems, the "parameters" here are the position coordinates of each point on the path. The initial energy value of the search path planning is a preset value, and the value has no effect on subsequent calculations. The iteration coefficient and the number of iterations define the maximum number of cycles of the optimization algorithm and the current cycle. The learning rate controls the magnitude of each step adjustment in the gradient descent method. A smaller learning rate means more subtle but slower improvements, while a larger learning rate speeds up convergence but is also prone to miss the optimal solution. The gradient of the energy function is calculated by a calculation tool.

[0037] In step S15, according to the optimal assembly path, combined with the force-position hybrid control algorithm, the optimal assembly position and the optimal assembly force are calculated.

[0038] In one implementation, the expected assembly force is calculated by the following formula: in, for The expected assembly force in coordinates, is the distance between the axis of the workpiece's initial position and the axis of the position to be assembled. is the size of the shaft hole to be assembled, To plan the assembly force, is the path planning parameter corresponding to the optimal assembly path, is the initial assembly position; Get assembly movement time and assembly movement speed; The optimal assembly position is calculated according to the following formula: in, is the optimal assembly position, is the assembly movement speed, is the assembly movement time, for The expected assembly force in coordinates, is the workpiece quality, is the initial assembly position, is the assembly motion acceleration; The optimal assembly force is calculated by the following formula: in, For the optimal assembly force, is the position control gain, For force control gain, is the optimal assembly position, is the initial assembly position, for The expected assembly force in coordinates, Assemble force for the plan.

[0039] It is worth mentioning that the size of the shaft hole to be assembled reflects the tightness of fit between the assembled parts. The path planning parameters corresponding to the optimal assembly path can be understood as coefficients related to the path shape, which are used to adjust the distribution of force and are obtained by calculating the path curvature. The distance between the axis of the initial position point of the workpiece and the axis of the position point to be assembled is accurately measured using a laser tracker. The size of the shaft hole to be assembled is directly provided by the design drawing. The position control gain is used to adjust the intensity of the influence of the position error on the output force. The force control gain is used to adjust the difference between the actual assembly force and the planned assembly force. The mass of the workpiece is obtained by a weighing device.

[0040] In step S16, the shaft parts are installed according to the optimal assembly path, the optimal assembly position and the optimal assembly force.

[0041] In one embodiment, the workpieces are arranged along the optimal assembly path in sequence, and the shaft parts are installed using the optimal assembly force for each optimal assembly position.

[0042] It is worth mentioning that, first of all, the workpiece needs to be moved step by step to the specified position according to the optimal assembly path. It can minimize the energy consumption during the assembly process and avoid possible obstacles. For shaft parts, this path should ensure that the parts can enter the predetermined position smoothly without unnecessary friction or collision. When the workpiece moves along the optimal assembly path, it will reach the so-called "optimal assembly position" at a specific point in time. These positions are key nodes that have been determined in the path planning stage, and they represent the various important stop points of the workpiece in the entire assembly process. At each of these positions, a specific assembly operation needs to be performed - that is, the shaft parts are fixed in place using appropriate tools and techniques. In order to ensure that the shaft parts are installed correctly, a force of the right size and direction must be applied, which is the so-called "optimal assembly force".

[0043] In summary, the present invention discloses a high-precision shaft-hole assembly shaft part positioning method based on machine learning, which aims to solve the assembly problem of complex hole shaft products in modern industry. The present invention proposes a solution combined with a machine learning algorithm. Specifically, the method first obtains the shaft part image through an industrial vision system, pre-processes it into a grayscale image, performs edge detection to obtain contour information, and then uses Hough transform and other technologies to extract key geometric feature points such as the shaft center position, the center of the circular hole, etc. These key points are then fed as input into a pre-trained assembly position positioning model, which is built based on historical data and can predict the initial assembly position. In order to ensure accuracy, after the initial assembly position is output, it will be compared with the predetermined planned assembly position. If the deviation between the two exceeds the set threshold, the planned assembly position is replaced. After obtaining the initial assembly position, the next step is the path planning stage. The method introduces a set of innovative path optimization algorithms to determine the optimal assembly path. The process begins by randomly generating an initial search path based on the initial assembly position, and then defines an energy function to evaluate the quality of the search path after each iteration. This energy function comprehensively considers factors such as the initial energy value, the iteration coefficient, and the path length obtained in each iteration, and quantifies the quality of the path through a mathematical formula. The gradient descent method is used to iteratively adjust the search path until the state that makes the energy function reach the minimum value is found, that is, the optimal assembly path is found. This method applies the optimization idea in machine learning to the field of mechanical assembly, especially for the specific problem of shaft-hole assembly, and achieves the purpose of automatically selecting the optimal solution from many possible paths. Finally, this method deepens the application of the optimal assembly path, and calculates the optimal assembly position and optimal assembly force by combining the force-position hybrid control algorithm. The calculation formula of the expected assembly force is defined here, considering the influence of multiple parameters such as the distance between the axis of the initial position point of the workpiece and the axis of the position point to be assembled, and the size of the shaft hole to be assembled. At the same time, variables such as assembly motion time and speed are introduced, and the kinematic equation is used to determine the optimal assembly position. For the calculation of the optimal assembly force, a formula containing position control gain and force control gain is used, which embodies the core idea of ​​force-position hybrid control, that is, the force size is adjusted according to the deviation between the actual position and the expected position, and fine-tuned according to the difference between the current expected assembly force and the planned assembly force, thereby ensuring the accuracy and adaptability of the assembly process.

[0044] In summary, the present invention provides a complete set of high-precision shaft-hole assembly shaft parts positioning methods based on machine learning, covering all links from image acquisition, feature extraction, initial assembly position prediction, path optimization to final assembly implementation. It not only solves the problems of difficult control of force information and difficult guarantee of assembly accuracy in traditional assembly methods, but also makes the entire assembly process more intelligent and adaptive through the application of the optimal assembly path and the combination of force-position hybrid control algorithm, thereby improving assembly accuracy and efficiency.

[0045] Reference Figure 2 The second embodiment of the present invention provides a high-precision shaft hole assembly shaft part positioning device based on machine learning, comprising: A data acquisition module, used for acquiring an image of a shaft part; A feature extraction module is used to extract features from the shaft part image to obtain key point positions; An initial positioning module, used to input the key point position into a pre-trained assembly position positioning model, and output an initial assembly position; A path optimization module, used for performing path planning according to the initial assembly position to obtain an optimal assembly path; A force-position optimization module, used to calculate the optimal assembly position and the optimal assembly force according to the optimal assembly path in combination with a force-position hybrid control algorithm; The workpiece installation module is used to complete the installation of the shaft parts according to the optimal assembly path, the optimal assembly position and the optimal assembly force.

[0046] Preferably, the data acquisition module is used to: Get the shaft part image.

[0047] Preferably, the feature extraction module is used to: Feature extraction is performed on the shaft part image to obtain key point positions, including: Preprocessing the shaft part image to obtain a grayscale shaft part image; Perform edge detection on the grayscale shaft part image to obtain a shaft part contour image; Perform axis point detection according to the axis part contour image to obtain key point positions; The key point positions include the center position of the shaft, the center of the circular hole at the end of the shaft, the center contact point and the center point of the contact surface.

[0048] Preferably, the initial positioning module is used to: The key point positions are input into a pre-trained assembly position positioning model, and the initial assembly position is output.

[0049] Preferably, after inputting the key point position into a pre-trained assembly position positioning model and outputting an initial assembly position, the method further comprises: Performing distance calculation based on the initial assembly position and the pre-acquired planned assembly position to obtain a position deviation; When the position deviation is greater than a preset position threshold, replacing the initial assembly position with the planned assembly position; When the position deviation is less than the position threshold, proceed to the subsequent steps.

[0050] Preferably, the training process of the assembly position positioning model includes: An assembly position positioning model is constructed based on the historical key point positions and the historical assembly positions, the model is trained, and the training is determined to be completed after the loss function of the detection model meets the conditions, thereby obtaining a trained assembly position positioning model; The key point positions are input into the trained assembly position positioning model to obtain the initial assembly position.

[0051] Preferably, the path optimization module is used to: Performing path planning according to the initial assembly position to obtain an optimal assembly path includes: Randomly generate an initial search path according to the initial assembly position; The energy function is calculated according to the initial search path by the following formula: in, is the energy function, Plan the initial energy value for the search path, is the iteration coefficient, For the n The length of the search path obtained by iteration is The total length of the search path, n is the number of iterations; Iteratively search for paths using the gradient descent formula: in, For the The search path for the iterations, For the The search path for the iterations, is the learning rate, is the gradient of the energy function; When the energy function reaches a minimum value, the corresponding search path is used as the optimal assembly path.

[0052] Preferably, the force position optimization module is used to: According to the optimal assembly path, combined with the force-position hybrid control algorithm, the optimal assembly position and the optimal assembly force are calculated, including: The expected assembly force is calculated using the following formula: in, for The expected assembly force in coordinates, is the distance between the axis of the workpiece's initial position and the axis of the position to be assembled. is the size of the shaft hole to be assembled, To plan the assembly force, is the path planning parameter corresponding to the optimal assembly path, is the initial assembly position; Get assembly movement time and assembly movement speed; The optimal assembly position is calculated according to the following formula: in, is the optimal assembly position, is the assembly movement speed, is the assembly movement time, for The expected assembly force in coordinates, is the workpiece quality, is the initial assembly position, is the assembly motion acceleration; The optimal assembly force is calculated by the following formula: in, For the optimal assembly force, is the position control gain, For force control gain, is the optimal assembly position, is the initial assembly position, for The expected assembly force in coordinates, Assemble force for the plan.

[0053] Preferably, the workpiece mounting module is used to: The installation of the shaft parts is completed according to the optimal assembly path, the optimal assembly position and the optimal assembly force, including: the workpieces are installed along the order of the optimal assembly path, and for each optimal assembly position, the shaft parts are installed using the optimal assembly force.

[0054] It should be noted that a high-precision shaft hole assembly shaft part positioning device based on machine learning provided in an embodiment of the present invention is used to execute all the process steps of a high-precision shaft hole assembly shaft part positioning method based on machine learning in the above-mentioned embodiment. The working principles and beneficial effects of the two correspond one to one, and therefore will not be repeated here.

[0055] The embodiment of the present invention also provides an electronic device. The electronic device includes: a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a data acquisition program. When the processor executes the computer program, the steps in the above-mentioned high-precision shaft hole assembly shaft part positioning method embodiments based on machine learning are implemented, such as Figure 1Alternatively, when the processor executes the computer program, the functions of the modules / units in the above-mentioned device embodiments are realized, such as the data acquisition module.

[0056] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the electronic device.

[0057] The electronic device may be a computing device such as a desktop computer, a notebook, a PDA, and a smart tablet. The electronic device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the above components are merely examples of electronic devices and do not constitute a limitation on the electronic device. The electronic device may include more or fewer components than the above components, or may combine certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.

[0058] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device.

[0059] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the electronic device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0060] Wherein, if the module / unit integrated in the electronic device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0061] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.

[0062] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A high-precision shaft hole assembly shaft parts positioning method based on machine learning, characterized in that: include: Get the shaft part image; Extracting features from the shaft part image to obtain key point positions; Inputting the key point position into a pre-trained assembly position positioning model, and outputting an initial assembly position; Performing path planning according to the initial assembly position to obtain an optimal assembly path; According to the optimal assembly path, combined with the force-position hybrid control algorithm, the optimal assembly position and the optimal assembly force are calculated; The shaft parts are installed according to the optimal assembly path, the optimal assembly position and the optimal assembly force.

2. The high-precision shaft hole assembly shaft parts positioning method based on machine learning according to claim 1 is characterized in that: The step of extracting features from the shaft part image to obtain key point positions includes: Preprocessing the shaft part image to obtain a grayscale shaft part image; Perform edge detection on the grayscale shaft part image to obtain a shaft part contour image; Perform axis point detection according to the axis part contour image to obtain key point positions; The key point positions include the center position of the shaft, the center of the circular hole at the end of the shaft, the center contact point and the center point of the contact surface.

3. The high-precision shaft hole assembly shaft parts positioning method based on machine learning according to claim 1 is characterized in that: The training process of the assembly position positioning model includes: An assembly position positioning model is constructed based on the historical key point positions and the historical assembly positions, the model is trained, and the training is determined to be completed after the loss function of the detection model meets the conditions, thereby obtaining a trained assembly position positioning model; The key point positions are input into the trained assembly position positioning model to obtain the initial assembly position.

4. The high-precision shaft hole assembly shaft parts positioning method based on machine learning according to claim 1 is characterized in that: The performing path planning according to the initial assembly position to obtain the optimal assembly path includes: Randomly generate an initial search path according to the initial assembly position; The energy function is calculated according to the initial search path by the following formula: in, is the energy function, Plan the initial energy value for the search path, is the iteration coefficient, For the n The length of the search path obtained by iteration is The total length of the search path, n is the number of iterations; Iteratively search for paths using the gradient descent formula: in, For the The search path for the iterations, For the The search path for the iterations, is the learning rate, is the gradient of the energy function; When the energy function reaches a minimum value, the corresponding search path is used as the optimal assembly path.

5. The high-precision shaft hole assembly shaft parts positioning method based on machine learning according to claim 1 is characterized in that: The method of calculating the optimal assembly position and the optimal assembly force according to the optimal assembly path and in combination with the force-position hybrid control algorithm includes: The expected assembly force is calculated using the following formula: in, for The expected assembly force in coordinates, is the distance between the axis of the workpiece's initial position and the axis of the position to be assembled. is the size of the shaft hole to be assembled, To plan the assembly force, is the path planning parameter corresponding to the optimal assembly path, is the initial assembly position; Get assembly movement time and assembly movement speed; The optimal assembly position is calculated according to the following formula: in, is the optimal assembly position, is the assembly movement speed, is the assembly movement time, for The expected assembly force in coordinates, is the workpiece quality, is the initial assembly position, is the assembly motion acceleration; The optimal assembly force is calculated by the following formula: in, For the optimal assembly force, is the position control gain, For force control gain, is the optimal assembly position, is the initial assembly position, for The expected assembly force in coordinates, Assemble force for the plan.

6. The high-precision shaft hole assembly shaft parts positioning method based on machine learning according to claim 1 is characterized in that: The step of completing the installation of the shaft parts according to the optimal assembly path, the optimal assembly position and the optimal assembly force includes: The workpieces are arranged along the optimal assembly path in sequence, and at each optimal assembly position, the optimal assembly force is used to complete the installation of the shaft parts.

7. The high-precision shaft hole assembly shaft parts positioning method based on machine learning according to claim 1 is characterized in that: After inputting the key point position into the pre-trained assembly position positioning model and outputting the initial assembly position, the method further includes: Performing distance calculation based on the initial assembly position and the pre-acquired planned assembly position to obtain a position deviation; When the position deviation is greater than a preset position threshold, replacing the initial assembly position with the planned assembly position; When the position deviation is less than the position threshold, proceed to the subsequent steps.

8. A high-precision shaft hole assembly shaft parts positioning device based on machine learning, characterized in that: include: A data acquisition module, used for acquiring an image of a shaft part; A feature extraction module is used to extract features from the shaft part image to obtain key point positions; An initial positioning module, used to input the key point position into a pre-trained assembly position positioning model, and output an initial assembly position; A path optimization module, used for performing path planning according to the initial assembly position to obtain an optimal assembly path; A force-position optimization module, used to calculate the optimal assembly position and the optimal assembly force according to the optimal assembly path in combination with a force-position hybrid control algorithm; The workpiece installation module is used to complete the installation of the shaft parts according to the optimal assembly path, the optimal assembly position and the optimal assembly force.

9. An electronic device, characterized in that: It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, it implements the high-precision shaft hole assembly shaft part positioning method based on machine learning as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the high-precision shaft-hole assembly shaft part positioning method based on machine learning as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Robot slender shaft precise assembly system and method based on force sense and visual sense

    CN106272416A

  • Task condition self-adaptive robot shaft hole assembling method and device

    CN114918651A

  • Flexible shaft hole assembling method based on contact state model and self-adaptive impedance control

    CN116175148A

  • Robot high-precision force-position hybrid control system based on teleoperation

    CN118046375A

  • Engineering machinery pin shaft assembly system and laser accurate positioning assembly method thereof

    CN118744324A

Cited By

  • Automatic overhead working truck path generation system and method based on machine learning

    CN121625150A