Method for guiding welding matching image and photographing pose number, welding equipment and storage medium
By setting up local point queues and local image queues on the welding equipment host computer, and using head pointers and tail pointers to synchronize data, the data synchronization problem of welding equipment in high-speed acquisition operations is solved, and data security and integrity are achieved. Improves operation accuracy and stability.
Patent Information
- Application Number
- CN202411578439.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-11
AI Technical Summary
Existing welding equipment has data synchronization problems in high-speed image and point acquisition operations, resulting in data loss and inaccurate operation, especially when dealing with dense point clouds.
By setting up local point queues and local image queues on the upper computer of the welding equipment, and using head pointers and tail pointers to synchronize data, combining the lower computer to divide storage space for setting point queues, realizing the point data and image data Precise synchronization.
It effectively reduces data loss caused by processing delays, ensures data security and integrity, and improves the accuracy and stability of welding equipment in high-speed acquisition operations.
Smart Images

Figure CN119417902A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of weld trajectory guidance, and in particular to a method for guiding the number of welding matching images and photographing postures, welding equipment and storage media. Background Art
[0002] In the field of automation and intelligent manufacturing, the visual guidance function of welding equipment plays a vital role, especially in precision welding, assembly and other operations that require high-precision positioning. These welding equipment usually rely on cameras to capture images of the workpiece and guide the robot or robot to perform tasks by analyzing these images. To achieve this goal, the trigger mechanism of the camera must be closely synchronized with the data processing capabilities of the host computer.
[0003] In the existing technology, a common method is that the lower computer controls the camera to take pictures through hard triggering. Specifically, the lower computer sends a trigger signal to the camera at the appropriate time to start the image capture process. However, this hard triggering method has some limitations: the trigger signal and the exposure completion signal of the camera usually do not automatically notify the upper computer. Therefore, the upper computer can only rely on the number of points reported unilaterally by the lower computer and the number of pictures taken by the camera to match to determine whether the visual guidance is correct. This method is particularly challenging when processing dense point clouds, because the shooting interval may be set to about 30 milliseconds, which requires the upper computer to process and respond to image data within this time window. Since the number of registers of the lower computer and the length of the image queue of the camera are quite limited. When the processing cycle of the upper computer exceeds this shooting interval, it may cause the point data stored in the register of the lower computer and the image data stored in the image queue of the camera to accumulate, eventually resulting in data out of bounds and loss. This situation greatly affects the accuracy and efficiency of the operation.
[0004] Another common method is to use the camera SDK to perform soft triggering to take photos through the host computer. The advantage of this method is that it is easy to use and can be more easily integrated into existing systems. However, it also has some disadvantages: soft triggering cannot flexibly adjust the frequency of the trigger signal, and the trigger speed is usually not as fast as hard triggering. In addition, the communication time between the host computer and the slave computer is relatively long, which may lead to a large gap between the actual photo pose and the timing of data acquisition.
[0005] In actual applications, the processing cycle of the host computer may change due to fluctuations in the execution content. At the same time, factors such as hardware interference or preemption of the host computer software thread may also cause the processing cycle to become longer occasionally. These unpredictable factors cause the processing cycle of the host computer to be extended, which may cause data synchronization problems at the least, or even cause the program to crash and terminate.
[0006] Therefore, it is necessary to develop a new method that can ensure the accuracy and stability of welding equipment in high-speed image and point acquisition operations under limited hardware resources. Summary of the invention
[0007] The purpose of this application is to provide a method for guiding welding matching images and the number of photographing postures, welding equipment and storage media, so as to ensure the accuracy and stability of the welding equipment in high-speed acquisition operations of images and points under limited hardware resources.
[0008] To solve the above technical problems, the present application provides a method for guiding the number of welding matching images and photographing postures, which is applied to welding equipment, wherein the welding equipment includes a host computer, a slave computer and a camera, and the slave computer hard triggers the camera to take pictures. The method for guiding the number of welding matching images and photographing postures includes: The welding equipment is preprocessed, the lower computer allocates a storage space capable of storing at least two and no more than five point data for setting a lower computer point queue, and sets a head pointer for the lower computer point queue, the head pointer indicates the total number of points that have been acquired for photographing, the upper computer sets a local point queue, and sets a tail pointer for the local point queue, the tail pointer indicates the total number of points that have been received by the upper computer, the upper computer creates a picture taking thread, the picture taking thread runs according to a set picture taking cycle, the picture taking cycle is less than the camera triggering picture taking interval, the camera triggering picture taking interval is the sum of the camera exposure time and the lower computer detecting exposure completion signal time, the upper computer creates a point taking thread, the point taking thread polls the lower computer according to the set polling cycle, the polling cycle is determined according to the number of data points that can be stored in the storage space and the picture taking cycle; After the preprocessing is completed, the upper computer sends the scanning trajectory data to the lower computer and notifies the lower computer to enter the guiding state; The lower computer moves to the scanning starting point and continues to move, and continuously triggers the photo signal to enable the camera to take photos; After each photo is taken, the camera stores the image data in the camera image queue. After each exposure is completed, the camera sends an exposure completion signal to the lower computer. The lower computer receives the exposure completion signal and stores the current point data into the lower computer point queue; The host computer starts the point acquisition thread. At the end of each polling cycle, the host computer calculates the number of points to be acquired according to the deviation between the head pointer and the tail pointer, and takes out the corresponding number of point data and stores them in the local point queue. The host computer starts the image acquisition thread. At the end of each image acquisition cycle, the host computer acquires images from the camera and stores the acquired images in the local image queue. The lower computer moves to the scanning end point and exits the guiding state. The upper computer compares the number of images in the local image queue with the number of points in the local point queue to see if they are the same. If so, it is determined that the match is successful, otherwise, it is determined that the match fails.
[0009] Preferably, the lower computer is divided into a storage space capable of storing five point data for setting the lower computer point queue, and the polling cycle does not exceed five times the map collection cycle.
[0010] Preferably, the storage space of the lower computer for setting the lower computer point queue is divided from the register of the lower computer.
[0011] The present application also provides welding equipment, including a host computer, a slave computer, a camera, a processor and a memory. The slave computer hard triggers the camera to take pictures. The processor stores a computer program. The processor calls the computer program in the memory to implement the above-mentioned method of guiding welding matching images and the number of photographing postures.
[0012] The present application also provides a storage medium, in which computer executable instructions are stored. When the computer executable instructions are loaded and executed by a processor, the steps of the above-mentioned method for guiding the welding matching image and the number of photographing postures are implemented.
[0013] One or more technical solutions provided in this application have at least the following technical effects or advantages: 1. By setting up local point queues and local image queues on the host computer, data loss caused by processing delays is reduced, especially the problem of camera image accumulation and loss due to time-consuming image processing, ensuring data security; 2. Through the coordinated use of the head pointer and the tail pointer, the point data between the upper computer and the lower computer are accurately synchronized to ensure the integrity and consistency of the data. Combined with the storage space of the lower computer that can store at least two and no more than five point data, it is used to set the lower computer point queue. It can deal with the problem of occasional lengthening of the actual polling cycle due to factors such as execution content fluctuations, hardware interference, and upper computer software thread preemption, and improve the accuracy and stability of high-speed point data collection of welding equipment.
[0014] In summary, the present application can ensure the accuracy and stability of welding equipment in high-speed acquisition operations of images and point data with limited hardware resources.
[0015] The present application also provides welding equipment and storage media, which also have the above-mentioned beneficial effects and will not be described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 It is a flow chart of the method for guiding the number of welding matching images and photographing poses provided in an embodiment of the present application. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described in the present application are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0019] The method for guiding the number of welding matching images and photographing postures is applied to welding equipment, wherein the welding equipment includes a host computer, a slave computer and a camera, and the slave computer hard triggers the camera to take pictures. The method for guiding the number of welding matching images and photographing postures includes: Combined with reference Figure 1 , pre-processing the welding equipment, the lower computer divides the storage space capable of storing five point data for setting the lower computer point queue, and sets a head pointer for the lower computer point queue, the head pointer indicates the total number of points that have been obtained for photographing, the upper computer sets a local point queue, and sets a tail pointer for the local point queue, the tail pointer indicates the total number of points that have been received by the upper computer, the upper computer creates a picture taking thread, the picture taking thread runs according to the set picture taking cycle, the picture taking cycle is less than the camera triggering picture taking interval, the camera triggering picture taking interval is the sum of the camera exposure time and the lower computer detecting exposure completion signal time, the upper computer creates a point taking thread, the point taking thread polls the lower computer according to the set polling cycle, the polling cycle is determined according to the number of data points that can be stored in the storage space and the picture taking cycle; Among them, the storage space of the lower computer used to set the lower computer point queue is divided from the register of the lower computer. The register access speed is extremely fast, but the space is usually very limited; for reference, in this embodiment, the camera exposure time is 15ms, and the lower computer detects the camera signal time is less than 10ms. Therefore, the minimum camera trigger shooting interval is 25ms under interference-free conditions, but in order to prevent interference in special circumstances, the camera trigger shooting interval is set to 30ms; the polling cycle is usually set to 20ms~40ms. Due to factors such as execution content fluctuations, hardware interference, and upper computer software thread preemption, the actual polling cycle occasionally becomes longer. Because the lower computer divides the storage space that can store five point data for setting the lower computer point queue, that is, it supports the upper computer to read and write 1~5 point data at a time, so the polling cycle of the upper computer is no more than five times the image acquisition cycle, which is sufficient to cope with the special situation where the actual polling cycle occasionally becomes longer. Specifically, the camera trigger shooting interval is 30ms, and the image acquisition cycle needs to be less than the camera trigger shooting interval. So, assuming that the image acquisition cycle is set to 25ms, the maximum polling cycle of the host computer can be no more than 125ms. The polling cycle is usually set to 20ms~40ms. Even if the actual polling cycle occasionally becomes longer, it will not exceed 125ms in most cases. Therefore, it can cope with the special situation that the actual polling cycle occasionally becomes longer.
[0020] After the preprocessing is completed, the upper computer sends the scanning trajectory data to the lower computer and notifies the lower computer to enter the guiding state; The lower computer moves to the scanning starting point and continues to move, and continuously triggers the photo signal to enable the camera to take photos; The guiding state of the lower computer includes the above steps, and further includes the lower computer exiting the guiding state after continuously moving to the scanning end point, and the scanning starting point is the initial guiding position set before guiding the lower computer each time.
[0021] After each photo is taken, the camera stores the image data in the camera image queue. After each exposure is completed, the camera sends an exposure completion signal to the lower computer. Among them, the length of the camera image queue is usually very limited and can only store a single image. This is mainly affected by factors such as cost control and size limitations in hardware design. The length of the camera image queue in this embodiment can only store a single image.
[0022] The lower computer receives the exposure completion signal and stores the current point data into the lower computer point queue; The host computer starts the point acquisition thread. At the end of each polling cycle, the host computer calculates the number of points to be acquired according to the deviation between the head pointer and the tail pointer, and takes out the corresponding number of point data and stores them in the local point queue. The host computer starts the image acquisition thread. At the end of each image acquisition cycle, the host computer acquires images from the camera and stores the acquired images in the local image queue. Among them, the upper computer can calculate the number of points to be taken according to the deviation between the head pointer and the tail pointer, which utilizes the characteristics of the queue. Specifically, when the queue executes the element enqueue operation, the tail pointer moves backward, and when the queue executes the element dequeue operation, the head pointer moves backward.
[0023] The lower computer moves to the scanning end point and exits the guiding state. The upper computer compares the number of images in the local image queue with the number of points in the local point queue to see if they are the same. If so, it is determined that the match is successful, otherwise, it is determined that the match fails.
[0024] The scanning end point is the end position of the guidance set before guiding the lower computer each time; a successful match indicates that the data recorded this time is valid data, and a failed match indicates that the data recorded this time is abnormal and needs to be re-collected.
[0025] The present application also provides a welding device, including a host computer, a slave computer, a camera, a processor and a memory, wherein the slave computer hard triggers the camera to take a photo, the processor stores a computer program, and the processor calls the computer program in the memory to implement the steps of the above-mentioned method for guiding the welding matching image and the number of photographing postures. Of course, the welding device may also include various network interfaces, power supplies and other components.
[0026] The present application also provides a storage medium, in which a computer executable instruction is stored, and when the computer executable instruction is loaded and executed by a processor, the steps of the above-mentioned method for guiding the welding matching image and the number of photographing postures are implemented. The storage medium may include: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes.
[0027] It should also be noted that in this specification, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A method for guiding the number of welding matching images and photographing poses, characterized in that: Applied to welding equipment, the welding equipment includes a host computer, a slave computer and a camera, the slave computer hard triggers the camera to take pictures, and the method for guiding the welding matching image and the number of photographing postures includes: The welding equipment is preprocessed, the camera sets a camera image queue, the lower computer divides a storage space capable of storing at least two and no more than five point data for setting the lower computer point queue, and sets a head pointer for the lower computer point queue, the head pointer indicates the total number of points that have been acquired for photographing, the upper computer sets a local image queue and a local point queue, and sets a tail pointer for the local point queue, the tail pointer indicates the total number of points that have been received by the upper computer, the upper computer creates a picture taking thread, the picture taking thread runs according to a set picture taking cycle, the picture taking cycle is less than the camera triggering picture taking interval, the camera triggering picture taking interval is the sum of the camera exposure time and the lower computer detecting exposure completion signal time, the upper computer creates a point taking thread, the point taking thread polls the lower computer according to the set polling cycle, the polling cycle is determined according to the number of data points that can be stored in the storage space and the picture taking cycle; After the preprocessing is completed, the upper computer sends the scanning trajectory data to the lower computer and notifies the lower computer to enter the guiding state; After the lower computer moves to the scanning starting point, it continues to move and continuously triggers a photo signal to enable the camera to take photos; After each photo is taken by the camera, the image data is stored in the camera image queue, and after each exposure is completed, the camera sends an exposure completion signal to the subordinate computer; The lower computer receives the exposure completion signal and stores the current point data into the lower computer point queue; The host computer starts the point acquisition thread. At the end of each polling cycle, the host computer calculates the number of points to be acquired according to the deviation between the head pointer and the tail pointer, and takes out the corresponding number of point data and stores them in the local point queue. The host computer starts the image acquisition thread. At the end of each image acquisition cycle, the host computer acquires images from the camera image queue of the camera and stores the acquired images in the local image queue. The lower computer moves to the scanning end point and exits the guiding state. The upper computer compares the number of images in the local image queue with the number of points in the local point queue to see if they are the same. If so, it is determined that the match is successful, otherwise, it is determined that the match fails.
2. The method for guiding welding matching images and the number of photographing poses according to claim 1, characterized in that: The lower computer allocates a storage space capable of storing five point data for setting the lower computer point queue, and the polling cycle does not exceed five times the map collection cycle.
3. The method for guiding welding matching images and photographing pose numbers according to claim 1 or 2, characterized in that: The storage space of the lower computer used for setting the lower computer point queue is divided from the register of the lower computer.
4. Welding equipment, characterized in that The method comprises a host computer, a slave computer, a camera, a processor and a memory, wherein the slave computer hard triggers the camera to take a photo, the processor stores a computer program, and the processor calls the computer program in the memory to implement the method for guiding welding matching images and the number of photographing postures as described in any one of claims 1 to 3.
5. A storage medium, characterized in that The storage medium stores computer executable instructions, and when the computer executable instructions are loaded and executed by the processor, the steps of the method for guiding the number of welding matching images and photographing postures as described in any one of claims 1 to 3 are implemented.