Welding track generation method and device, equipment and medium
By scanning and image processing of titanium alloy products, the welding area is automatically identified and the target welding trajectory is generated, which solves the quality problems caused by product distortion during the welding process and improves the accuracy and efficiency of welding.
Patent Information
- Application Number
- CN202310991333.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-08
- Publication Date
- 2025-02-18
AI Technical Summary
During the welding process, the distortion of the titanium alloy product causes the welding equipment to be unable to adapt, resulting in inconsistent weld position and size, affecting the welding quality.
By scanning the template product, generating a template image, and selecting the welding area according to the preset area tool box, determining the preliminary welding trajectory of the two welding methods, combining it into a target welding trajectory, and realizing automatic identification and generation.
It improves the accuracy of welding trajectory generation and the production efficiency of welding products, improves the pass rate of welding products, and makes welding operation easier.
Smart Images

Figure CN119478111A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automated processing technology, and in particular to a method, device, equipment and medium for generating a welding trajectory. Background Art
[0002] Metal welding forming technology is widely used in the forming process of various structural parts due to its advantages of good connection performance, high strength, less materials and simple process. However, in welding technology, products made of titanium alloy metal bars will be distorted during the production process, and conventional welding equipment cannot adapt to product deformation, which will cause the positions and sizes of various welds to be inconsistent during the welding process due to factors such as failure to identify the welding area or identification errors, resulting in deviations between the weld grinding and polishing and the robot teaching path, making it difficult to ensure welding quality.
[0003] Therefore, there is an urgent need to accurately identify the welding position and form an accurate welding trajectory for welding. Summary of the invention
[0004] In view of the deficiencies of the above-mentioned prior art, the object of the present invention is to provide a method for generating a welding trajectory. Through the present invention, the welding position can be automatically identified, and welding trajectories of two welding methods can be generated according to the welding position. Welding can be performed independently according to the two welding trajectories, which can improve the accuracy of welding trajectory generation and the production efficiency of welding products, improve the qualified rate of welding products, and make welding operations easier.
[0005] According to an embodiment of the present invention, a first scheme is provided: a method for generating a welding trajectory, characterized in that the method comprises: scanning a template product to obtain a template image corresponding to the template product; selecting at least one welding area in the template image according to a preset area tool box; determining a first preliminary welding trajectory and a second preliminary welding trajectory according to the at least one welding area; and merging the first preliminary welding trajectory and the second preliminary welding trajectory to obtain a target welding trajectory.
[0006] Further, as a more preferred implementation scheme of the present invention, the selecting at least one welding area in the template image according to the preset area tool box includes: performing image feature point recognition on the template image to obtain at least one intersection point and edge contour image; in the edge contour image, determining that a line segment between two adjacent intersection points in at least one intersection point is an intersection line segment to obtain at least one intersection line segment; and selecting the area where at least one intersection line segment is located as at least one welding area according to the preset area tool box.
[0007] Further, as a more preferred implementation scheme of the present invention, determining the first preliminary welding trajectory and the second preliminary welding trajectory according to the at least one welding area includes: obtaining the first endpoint and the second endpoint of the corresponding intersection line segment in the at least one welding area, wherein the first endpoint is an intersection point close to the inner side of the template product relative to the adjacent intersection point, and the second endpoint is an intersection point far from the inner side of the template product relative to the adjacent intersection point; deleting the first endpoint in each welding area in the at least one welding area, setting the second endpoint retained in the at least one welding area as the first preliminary welding endpoint, and obtaining a plurality of first preliminary welding endpoints; connecting the plurality of first preliminary welding endpoints into a first preliminary welding trajectory; setting the first endpoint and the second endpoint of the corresponding intersection line segment in the at least one welding area as the second preliminary welding endpoint and the third preliminary welding endpoint, respectively, and setting the intersection line segment as a preliminary welding section; connecting the second preliminary welding endpoint, the third preliminary welding endpoint and the preliminary welding section into a second preliminary welding trajectory.
[0008] Further, as a more preferred implementation scheme of the present invention, the merging of the first preparation welding trajectory and the second preparation welding trajectory to obtain a target welding trajectory includes: establishing a first spatial coordinate system according to the template image; obtaining an X-axis, a Y-axis and a Z-axis in the first spatial coordinate system, wherein the X-axis, the Y-axis and the Z-axis are perpendicular to each other; obtaining the Z-axis coordinate of the edge contour image in the first spatial coordinate system; moving the first preparation welding trajectory along the positive direction of the Z-axis according to a preset segment length to obtain a raised first target welding trajectory, and moving the second preparation welding trajectory along the positive direction of the Z-axis according to a preset segment length to obtain a raised second target welding trajectory; merging the first target welding trajectory and the second target welding trajectory into a target welding trajectory, wherein the execution device performs welding according to the target welding trajectory.
[0009] Further, as a more preferred implementation scheme of the present invention, before connecting the multiple first preparatory welding end points into a first preparatory welding trajectory, the method also includes: drawing a first transition circle with the second endpoint as the center and the intersecting line segment corresponding to the second endpoint as the radius; in the first transition circle, the area except the center is the first transition area; connecting the multiple first preparatory welding end points into a first preparatory welding trajectory, the first preparatory welding trajectory does not include the first transition area.
[0010] Further, as a more preferred implementation scheme of the present invention, before connecting the second preparatory welding endpoint, the third preparatory welding endpoint and the preparatory welding section into a second preparatory welding trajectory, the method also includes: drawing a second transition circle with the first endpoint as the center and the intersecting line segment corresponding to the first endpoint as the radius; drawing a third transition circle with the second endpoint as the center and the intersecting line segment corresponding to the second endpoint as the radius; connecting the center of the second transition circle and the center of the third transition circle to obtain the preparatory welding section; defining the area except the center of the second transition circle, the center of the third transition circle and the preparatory welding section as the second transition area; connecting the second preparatory welding endpoint, the third preparatory welding endpoint and the preparatory welding section into a second preparatory welding trajectory, and the second welding trajectory does not include the second transition area.
[0011] Further, as a more preferred implementation scheme of the present invention, the first target welding trajectory and the second target welding trajectory are merged into a target welding trajectory, and the method also includes: welding sorting the welding end points in the first target welding trajectory to obtain a sorted first target welding trajectory; welding sorting the welding end points and welding sections in the second target welding trajectory to obtain a sorted second target welding trajectory; merging the sorted first target welding trajectory and the sorted second target welding trajectory to obtain a target welding trajectory.
[0012] According to an implementation scheme of the present invention, a second scheme is provided by using the present invention: a device for generating a welding trajectory, characterized in that the device comprises: a scanning module, used to scan the template product to obtain a template image corresponding to the template product; a selection module, used to select at least one welding area in the template image according to a preset area tool box; a determination module, used to determine a first preliminary welding trajectory and a second preliminary welding trajectory according to the at least one welding area; and a merging module, used to merge the first preliminary welding trajectory and the second preliminary welding trajectory to obtain a target welding trajectory.
[0013] According to an embodiment of the present invention, a third solution provided by the present invention is: a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the program includes instructions for the first solution.
[0014] According to an implementation scheme of the present invention, a fourth scheme provided by the present invention is: a computer storage medium is provided, wherein the computer storage medium stores one or more instructions, and the one or more instructions are suitable for being loaded by a processor and executing the steps of the above-mentioned first scheme and any possible implementation method thereof.
[0015] The present application first scans the template product to obtain a template image corresponding to the template product, then selects at least one welding area in the template image according to the preset area tool box, then determines the first preparation welding track and the second preparation welding track according to the at least one welding area, and finally merges the first preparation welding track and the second preparation welding track to obtain the target welding track. The present invention can automatically identify the welding position, generate welding tracks of two welding methods according to the welding position, and independently perform welding according to the two welding tracks, which can improve the accuracy of welding track generation and the production efficiency of welding products, improve the qualified rate of welding products, and make welding operations easier. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.
[0017] Figure 1 A schematic flow chart of a method for generating a welding trajectory provided in an embodiment of the present application;
[0018] Figure 2A A schematic diagram of a completed template image after splicing provided in an embodiment of the present application;
[0019] Figure 2B A schematic diagram of an edge contour image provided in an embodiment of the present application;
[0020] Figure 2C A schematic diagram of a welding area provided in an embodiment of the present application;
[0021] Figure 2D A schematic diagram of a welding trajectory provided in an embodiment of the present application;
[0022] Figure 2E Another schematic diagram of welding trajectory provided in an embodiment of the present application;
[0023] Figure 3 A schematic flow chart of a method for generating a welding trajectory provided in an embodiment of the present application;
[0024] Figure 4 A schematic diagram of the structure of a welding trajectory generation device provided in an embodiment of the present application;
[0025] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of this application.
[0027] It should be noted that when an element is referred to as being "fixed on" or "set on" another component, it can be directly on the other component or indirectly set on the other component; when a component is referred to as being "connected to" another component, it can be directly connected to the other component or indirectly connected to the other component.
[0028] It should be understood that the orientation or position relationship indicated by terms such as "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside" and "outside" are based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the device or component referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0029] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, "multiple" and "several" mean two or more, unless otherwise clearly and specifically defined.
[0030] It should be noted that the structures, proportions, sizes, etc. illustrated in the drawings of this specification are only used to match the contents disclosed in the specification for people familiar with this technology to understand and read, and are not used to limit the conditions under which this application can be implemented. Therefore, they have no substantive technical significance. Any structural modification, change in proportional relationship or adjustment of size should still fall within the scope of the technical content disclosed in this application without affecting the effects and purposes that can be achieved by this application.
[0031] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application.
[0032] See also Figure 1 , Figure 1 : is a flow chart of a method for generating a welding trajectory provided in an embodiment of the present application. The method may include:
[0033] 101. A computer device scans a template product to obtain a template image corresponding to the template product.
[0034] The template product is 3D scanned by a visual tool to obtain a template image of the template product. In one embodiment, the range of one scan is limited. For medium and large products, multiple scans are required, and then the results of the multiple scans are spliced to obtain a complete template image.
[0035] Among them, the above-mentioned template products can be aluminum alloy metal products containing hanging branches, and the hanging branches are a kind of clamps inside them, which is not the only limitation here.
[0036] For example, if Figure 2A As shown, Figure 2A is the complete template image for stitching.
[0037] 102. Select at least one welding area in the template image according to a preset area tool box.
[0038] Among them, the above-mentioned preset area tool box is a pre-deployed area tool box based on the 3D vision device, and its purpose is to identify the welding area. The identification can be manual mark recognition or image processing through 3D vision algorithm, which is not limited here.
[0039] Among them, since the above-mentioned template product can be a regular N-gon product or an irregular N-gon product, there can be N welding areas, which is not a sole limitation here.
[0040] In a possible example, selecting at least one welding area in the template image according to the preset area tool box includes: performing image feature point recognition on the template image to obtain at least one intersection point and edge contour image; in the edge contour image, determining that a line segment between two adjacent intersection points in at least one intersection point is an intersection line segment to obtain at least one intersection line segment; and selecting an area where at least one intersection line segment is located as at least one welding area according to the preset area tool box.
[0041] The above-mentioned image feature point recognition can be performed through a feature point algorithm, which is not limited here.
[0042] For example, Figure 2B It can be a schematic diagram of an edge contour image corresponding to the template image.
[0043] Optionally, in determining that a line segment between two adjacent intersection points among at least one intersection point is an intersection line segment, points between two intersection points whose interval is smaller than the interval between other intersection points are selected as adjacent intersection points.
[0044] Optionally, in the area where at least one intersecting line segment is located, the area is selected as at least one welding area according to the preset area tool box, the size of the template product corresponding to each of the at least one intersecting line segment is determined, and random area divisions are performed according to the template product size, but the random area divisions must include the intersecting line segments and do not overlap with other intersecting line segments.
[0045] For example, based on the above Figure 2B The edge contour image is displayed, on which the welding area is divided, such as Figure 2C As shown, Figure 2C The area enclosed by the middle rectangle is the welding area.
[0046] 103. Determine a first preliminary welding trajectory and a second preliminary welding trajectory according to the at least one welding area.
[0047] The above-mentioned preliminary welding track may be a discontinuous track, that is, a track with intervals.
[0048] Among them, the above-mentioned first preparatory welding trajectory can be welded using spot welding technology, and the above-mentioned second preparatory welding trajectory can be welded using full welding technology, and there is a common welding end point, both of which can be welded twice without avoidance.
[0049] In one possible example, determining the first preliminary welding trajectory and the second preliminary welding trajectory based on the at least one welding area includes: obtaining the first endpoint and the second endpoint of the corresponding intersecting line segment in the at least one welding area, wherein the first endpoint is an intersection point close to the inner side of the template product relative to the adjacent intersection point, and the second endpoint is an intersection point far from the inner side of the template product relative to the adjacent intersection point; deleting the first endpoint in each welding area of the at least one welding area, and setting the second endpoint retained in the at least one welding area as the first preliminary welding endpoint to obtain multiple first preliminary welding endpoints; connecting the multiple first preliminary welding endpoints into a first preliminary welding trajectory; setting the first endpoint and the second endpoint of the corresponding intersecting line segment in the at least one welding area as the second preliminary welding endpoint and the third preliminary welding endpoint, respectively, and setting the intersecting line segment as a preliminary welding section; connecting the second preliminary welding endpoint, the third preliminary welding endpoint and the preliminary welding section into a second preliminary welding trajectory.
[0050] The process of determining the first preliminary welding trajectory and the second preliminary welding trajectory is performed in parallel without a prescribed order.
[0051] For example, after deleting the first endpoint in each welding area of the at least one welding area, the second endpoint retained in the at least one welding area is set as the first preliminary welding endpoint, and the plurality of first preliminary welding endpoints are obtained, as follows: Figure 2D As shown, Figure 2D The dot in the circle is the first preliminary welding point.
[0052] For example, in connecting the second preparation welding end point, the third preparation welding end point and the preparation welding section to form a second preparation welding track, as Figure 2E As shown, Figure 2E The two dots in the intersecting circles are welding endpoints, and the line connecting the two dots is the welding endpoint.
[0053] Optionally, before connecting the multiple first preparatory welding endpoints into a first preparatory welding trajectory, the method also includes: drawing a first transition circle with the second endpoint as the center and the intersecting line segment corresponding to the second endpoint as the radius; in the first transition circle, the area except the center is the first transition area; connecting the multiple first preparatory welding endpoints into a first preparatory welding trajectory, the first preparatory welding trajectory does not include the first transition area.
[0054] Optionally, before connecting the second preparatory welding endpoint, the third preparatory welding endpoint and the preparatory welding section to form a second preparatory welding trajectory, the method also includes: drawing a second transition circle with the first endpoint as the center and the intersecting line segment corresponding to the first endpoint as the radius; drawing a third transition circle with the second endpoint as the center and the intersecting line segment corresponding to the second endpoint as the radius; connecting the center of the second transition circle and the center of the third transition circle to obtain a preparatory welding section; defining the area except the center of the second transition circle, the center of the third transition circle and the preparatory welding section as a second transition area; connecting the second preparatory welding endpoint, the third preparatory welding endpoint and the preparatory welding section to form a second preparatory welding trajectory, and the second welding trajectory does not include the second transition area.
[0055] Wherein, no welding operation is performed in the above transition area (the first or the second), and the execution equipment skips the transition area and only performs welding on the welding sections and welding points.
[0056] 104. Merge the first preliminary welding trajectory and the second preliminary welding trajectory to obtain a target welding trajectory.
[0057] The target welding trajectory may be a discontinuous trajectory, that is, a trajectory with intervals.
[0058] Among them, after the merging, the first target welding trajectory is first executed for spot welding, the purpose of which is to fix the product shape. After the spot welding is completed, full welding is performed according to the second target welding trajectory, the purpose of which is to weld the workpiece firmly.
[0059] In one possible example, the merging of the first preparation welding trajectory and the second preparation welding trajectory to obtain a target welding trajectory includes: establishing a first spatial coordinate system based on the template image; obtaining an X-axis, a Y-axis and a Z-axis in the first spatial coordinate system, wherein the X-axis, the Y-axis and the Z-axis are perpendicular to each other; obtaining the Z-axis coordinate of the edge contour image in the first spatial coordinate system; moving the first preparation welding trajectory along the positive direction of the Z-axis according to a preset segment length to obtain a raised first target welding trajectory, and moving the second preparation welding trajectory along the positive direction of the Z-axis according to a preset segment length to obtain a raised second target welding trajectory; merging the first target welding trajectory and the second target welding trajectory into a target welding trajectory, wherein the execution device performs welding according to the target welding trajectory.
[0060] like Figure 2B As shown, a camera space coordinate system (XYZ) is established in the template image.
[0061] Among them, the preset paragraph length can be obtained according to the template product type, the specified safety factor can be obtained according to the template product type, and the preset paragraph length can be determined according to the safety factor.
[0062] The execution device may be a robotic arm, a manipulator, a robot or other device capable of welding.
[0063] It can be seen that according to the elevated welding trajectory, welding can be made safer and the product can be better protected.
[0064] Optionally, the first target welding trajectory and the second target welding trajectory are merged into a target welding trajectory, and the method also includes: welding sorting the welding end points in the first target welding trajectory to obtain a sorted first target welding trajectory; welding sorting the welding end points and welding sections in the second target welding trajectory to obtain a sorted second target welding trajectory; merging the sorted first target welding trajectory and the sorted second target welding trajectory to obtain a target welding trajectory.
[0065] Among them, the above welding sequence can be counterclockwise.
[0066] Among them, the target welding trajectory is obtained by merging the sorted first target welding trajectory and the sorted second preparatory welding trajectory. The first target welding trajectory can be executed first, and then the second target welding trajectory is executed. The two merged trajectories are not fused, and each trajectory is an independent trajectory.
[0067] Optionally, the execution device can perform welding according to the above-mentioned target welding trajectory, and the welding at this time is welding with a safe distance.
[0068] Optionally, the target welding trajectory in the camera coordinate system is converted into a welding trajectory corresponding to the robot space coordinate system, and the robot directly performs welding operations according to the welding trajectory corresponding to the robot space coordinate system.
[0069] Figure 3 is a flow chart of another method for generating a welding trajectory provided in an embodiment of the present application, such as Figure 3 As shown, the method includes:
[0070] 301. Scan the template product to obtain a template image corresponding to the template product;
[0071] 302. Perform image feature point recognition on the template image to obtain at least one intersection point and an edge contour image;
[0072] 303. In the edge contour image, determine a line segment between two adjacent intersection points in at least one intersection point as an intersection line segment, and obtain at least one intersection line segment;
[0073] 304. Selecting, according to the preset area tool box, an area where at least one intersecting line segment is located as at least one welding area;
[0074] 305. Obtain a first endpoint and a second endpoint of a corresponding intersecting line segment in the at least one welding region;
[0075] 306. Delete the first endpoint of each welding area in the at least one welding area, and set the second endpoint retained in the at least one welding area as a first preliminary welding endpoint, to obtain a plurality of first preliminary welding endpoints;
[0076] 307. Connect the plurality of first preliminary welding end points into a first preliminary welding track;
[0077] 308. Set the first endpoint and the second endpoint of the corresponding intersecting line segment in the at least one welding area as the second preliminary welding endpoint and the third preliminary welding endpoint respectively, and set the intersecting line segment as the preliminary welding segment;
[0078] 309, connecting the second preliminary welding endpoint, the third preliminary welding endpoint and the preliminary welding section to form a second preliminary welding trajectory;
[0079] 310. Merge the first preliminary welding trajectory and the second preliminary welding trajectory to obtain a target welding trajectory.
[0080] The present application first scans the template product to obtain a template image corresponding to the template product, then selects at least one welding area in the template image according to the preset area tool box, then determines the first preparation welding track and the second preparation welding track according to the at least one welding area, and finally merges the first preparation welding track and the second preparation welding track to obtain the target welding track. The present invention can automatically identify the welding position, generate welding tracks of two welding methods according to the welding position, and independently perform welding according to the two welding tracks, which can improve the accuracy of welding track generation and the production efficiency of welding products, improve the qualified rate of welding products, and make welding operations easier.
[0081] Based on the description of the above-mentioned welding trajectory generation method embodiment, the present application embodiment also discloses a welding trajectory generation device, such as Figure 4 As shown, the welding trajectory generating device 400 includes:
[0082] A scanning module 401 is used to scan the template product to obtain a template image corresponding to the template product;
[0083] A selection module 402, configured to select at least one welding area in the template image according to a preset area tool box;
[0084] A determination module 403, configured to determine a first preliminary welding trajectory and a second preliminary welding trajectory according to the at least one welding area;
[0085] The merging module 404 is configured to merge the first preliminary welding trajectory and the second preliminary welding trajectory to obtain a target welding trajectory.
[0086] The present application first scans the template product to obtain a template image corresponding to the template product, then selects at least one welding area in the template image according to the preset area tool box, then determines the first preparation welding track and the second preparation welding track according to the at least one welding area, and finally merges the first preparation welding track and the second preparation welding track to obtain the target welding track. The present invention can automatically identify the welding position, generate welding tracks of two welding methods according to the welding position, and independently perform welding according to the two welding tracks, which can improve the accuracy of welding track generation and the production efficiency of welding products, improve the qualified rate of welding products, and make welding operations easier.
[0087] The embodiment of the present application also provides a computer storage medium (Memory), which is a memory device in an electronic device for storing programs and data. It is understandable that the computer storage medium here can include both built-in storage media in electronic devices and, of course, extended storage media supported by electronic devices. The computer storage medium provides a storage space that stores the operating system of the electronic device. In addition, one or more instructions suitable for being loaded and executed by a processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory, or a non-volatile memory, such as at least one disk storage; optionally, it can also be at least one computer storage medium located away from the aforementioned processor.
[0088] In one embodiment, one or more instructions stored in a computer storage medium may be loaded and executed by a processor to implement the corresponding steps in the above embodiment; in a specific implementation, one or more instructions in a computer storage medium may be loaded and executed by a processor. Figure 1 And / or any steps of the method in Figure 2 are not repeated here.
[0089] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0090] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the division of the module is only a logical function division, and there may be other division methods in actual implementation, for example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling, direct coupling, or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0091] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0092] Figure 5 FIG. 1 shows an internal structure diagram of a computer device in an embodiment. The computer device may be a terminal. Figure 5As shown, the computer device includes a processor, a memory and a network interface connected via a system bus. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement the above-mentioned method for generating a welding trajectory. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can execute the above-mentioned method for generating a welding trajectory. Those skilled in the art can understand that Figure 5 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the device to which the scheme of the present application is applied. The specific device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0093] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the processor executes the steps of the method for generating a welding trajectory in any of the above embodiments.
[0094] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method for generating a welding trajectory in any of the above embodiments.
[0095] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a read-only memory (ROM), or a random access memory (RAM), or a magnetic medium, such as a floppy disk, a hard disk, a tape, a magnetic disk, or an optical medium, such as a digital versatile disc (DVD), or a semiconductor medium, such as a solid state disk (SSD), etc.
[0096] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for generating a welding trajectory, characterized in that: The method comprises: Scanning the template product to obtain a template image corresponding to the template product; Selecting at least one welding area in the template image according to a preset area tool box; determining a first preliminary welding trajectory and a second preliminary welding trajectory according to the at least one welding area; The first preliminary welding trajectory and the second preliminary welding trajectory are combined to obtain a target welding trajectory.
2. The method according to claim 1, characterized in that: The step of selecting at least one welding area in the template image according to the preset area tool box includes: Performing image feature point recognition on the template image to obtain at least one intersection point and an edge contour image; In the edge contour image, determining a line segment between two adjacent intersection points of at least one intersection point as an intersection line segment, and obtaining at least one intersection line segment; According to the preset area tool box, an area where at least one intersecting line segment is located is selected as at least one welding area.
3. The method according to claim 1 or 2, characterized in that: The determining of the first preparation welding trajectory and the second preparation welding trajectory according to the at least one welding area comprises: Obtaining a first endpoint and a second endpoint of a corresponding intersection line segment in the at least one welding area, wherein the first endpoint is an intersection point closer to the inner side of the template product relative to an adjacent intersection point, and the second endpoint is an intersection point farther from the inner side of the template product relative to an adjacent intersection point; Deleting the first endpoint in each welding area of the at least one welding area, and setting the second endpoint retained in the at least one welding area as a first preliminary welding endpoint, to obtain a plurality of first preliminary welding endpoints; connecting the plurality of first preliminary welding end points into a first preliminary welding track; The first end point and the second end point of the corresponding intersecting line segment in the at least one welding area are respectively set as the second preliminary welding end point and the third preliminary welding end point, and the intersecting line segment is set as the preliminary welding section; The second preparation welding end point, the third preparation welding end point and the preparation welding section are connected to form a second preparation welding track.
4. The method according to claim 1, characterized in that The step of merging the first preliminary welding trajectory and the second preliminary welding trajectory to obtain a target welding trajectory includes: Establishing a first space coordinate system according to the template image; Obtaining an X-axis, a Y-axis, and a Z-axis in the first spatial coordinate system, wherein the X-axis, the Y-axis, and the Z-axis are perpendicular to each other; Acquire the Z-axis coordinate of the edge contour image in the first spatial coordinate system; The first preliminary welding trajectory is moved along the positive direction of the Z axis according to the preset segment length to obtain the first target welding trajectory after elevation. The second preliminary welding trajectory is moved along the positive direction of the Z axis according to a preset segment length to obtain a raised second target welding trajectory; The first target welding trajectory and the second target welding trajectory are merged into a target welding trajectory, wherein an execution device performs welding according to the target welding trajectory.
5. The method according to claim 3, characterized in that: Before connecting the plurality of first preparation welding end points into a first preparation welding track, the method further includes: Taking the second endpoint as the center and the intersecting line segment corresponding to the second endpoint as the radius, a first transition circle is drawn; In the first transition circle, the area except the center of the circle is the first transition area; The plurality of first preliminary welding end points are connected to form a first preliminary welding trajectory, wherein the first preliminary welding trajectory does not include the first transition region.
6. The method according to claim 3, characterized in that Before connecting the second preliminary welding end point, the third preliminary welding end point and the preliminary welding section into a second preliminary welding trajectory, the method further includes: Taking the first endpoint as the center and the intersecting line segment corresponding to the first endpoint as the radius, a second transition circle is drawn; Taking the second endpoint as the center and the intersecting line segment corresponding to the second endpoint as the radius, a third transition circle is drawn; Connecting the center of the second transition circle and the center of the third transition circle to obtain a preliminary welding section; The area except the center of the second transition circle, the center of the third transition circle and the preparatory welding section is defined as the second transition area; The second preparation welding end point, the third preparation welding end point and the preparation welding section are connected to form a second preparation welding trajectory, and the second welding trajectory does not include a second transition area.
7. The method according to claim 4, characterized in that The first target welding trajectory and the second target welding trajectory are merged into a target welding trajectory, and the method further includes: Sorting the welding end points in the first target welding trajectory to obtain a sorted first target welding trajectory; sorting the welding end points and welding sections in the second target welding trajectory to obtain a sorted second target welding trajectory; The sorted first target welding trajectory and the sorted second target welding trajectory are combined to obtain a target welding trajectory.
8. A device for generating a welding trajectory, characterized in that: The device comprises: A scanning module, used to scan the template product to obtain a template image corresponding to the template product; A selection module, used for selecting at least one welding area in the template image according to a preset area tool box; A determination module, configured to determine a first preliminary welding trajectory and a second preliminary welding trajectory according to the at least one welding area; A merging module is used to merge the first preliminary welding trajectory and the second preliminary welding trajectory to obtain a target welding trajectory.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method for generating a welding trajectory according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the processor executes the steps of the method for generating a welding trajectory as claimed in any one of claims 1 to 7.