An algorithm and system for handheld welding gun adaptive gun barrel focal length length
By calculating the linear proportional relationship between the scale factor and rotation angle of the handheld welding torch, the problem of welding accuracy and flexibility after changing the torch handle was solved, thus maintaining welding accuracy and precision and improving the adaptability and efficiency of the welding torch.
Patent Information
- Application Number
- CN202511221500.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-29
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2045-08-29
AI Technical Summary
Existing handheld welding torches require recalibration of the scale factor after the torch barrel is replaced, resulting in low flexibility, increased time and effort costs, and impact on welding precision and accuracy.
By calculating the scale factor and rotation angle of the first torch, and using a linear proportional relationship to calculate the scale factor of the second torch, the swing width of the welding torch remains unchanged after replacement. The Taylor expansion function is used to optimize the calculation efficiency.
It improves welding precision and accuracy, enhances the flexibility of handheld welding torches in changing environments, reduces the need for recalibrating scale factors, and saves time and resources.
Smart Images

Figure CN120744273B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of laser welding with handheld welding torches, and specifically to an algorithm and system for adaptive torch barrel focal length of a handheld welding torch. Background Technology
[0002] When using a handheld laser welding torch, the torch handle often needs to be changed when the application scenario changes. For example, if the weld seam is located deep inside the workpiece or in a very confined space, a standard-length torch handle may not be able to reach the required depth or achieve the appropriate welding angle. In such cases, a longer focal length torch handle is needed to allow the laser focus to reach the deeper welding location while keeping the torch body outside the workpiece. However, because the torch's scale factor is fixed, changes in the focal length of the new torch handle will cause changes in the welding swing width, resulting in a decrease in welding precision and accuracy.
[0003] In existing technologies, to avoid such problems, the welding torch's scale factor needs to be recalibrated after replacing the torch barrel. This is inflexible and increases labor and time costs. Summary of the Invention
[0004] In view of this, the present invention provides an algorithm for adaptive gun barrel focal length of a handheld welding torch. Specifically, the technical solution of the present invention is as follows:
[0005] S1: Obtain the first actual swing width and the first set swing width of the first gun barrel, and calculate the first scale factor, wherein the first actual swing width is the swing width when the first set swing width is at its maximum;
[0006] S2: Obtain the first focal length of the first gun barrel, and calculate the first rotation angle based on the first focal length and the first actual swing width;
[0007] S3: Obtain the second focal length of the second gun barrel, and calculate the second rotation angle based on the second focal length and the first actual swing width;
[0008] S4: Calculate the second scale factor based on the linear proportional relationship between the first scale factor, the first rotation angle, the second scale factor, and the second rotation angle.
[0009] Furthermore, in S1, the relevant expression for obtaining the first actual swing width and the first set swing width of the first gun barrel, and calculating the first scale factor, is as follows:
[0010] ,in, For the first actual swing width, Set the swing width for the first position. This is the motor fixed coefficient. This is the first scale factor;
[0011] Adjust the first scale factor Until the first setting of the swing width and the first actual swing width The values are equal, at this time .
[0012] According to a preferred embodiment, the first actual swing width is obtained. When n measurements are taken, the minimum and maximum values are removed, and the average of the remaining data is calculated.
[0013] According to a preferred embodiment, if the final calculated first actual swing width If the value is less than the judgment threshold, it is corrected by a correction coefficient. The judgment threshold is related to the characteristics of the galvanometer motor of the handheld welding torch and its position sensor, and is generally in the millimeter range.
[0014] Furthermore, in S2, the first focal length of the first gun barrel is obtained, and the relevant expression for calculating the first rotation angle based on the first focal length and the first actual swing width is as follows:
[0015] ,in Indicates the first rotation angle. This represents half the actual width of the first swing arm. This indicates the first focal length.
[0016] Furthermore, in step S3, the second focal length of the second gun barrel is obtained, and based on the second focal length and the first actual swing width, the relevant expression for calculating the second rotation angle is as follows:
[0017] ,in Indicates the second rotation angle. This indicates that the target swing width of the second gun barrel is half of its actual width, and , This indicates the second focal length.
[0018] Furthermore, based on the linear proportional relationship between the first scale factor, the first rotation angle, the second scale factor, and the second rotation angle, the second scale factor is calculated as follows:
[0019] The linear proportional relationship is as follows: ,in To indicate the second scale factor, then .
[0020] According to a preferred embodiment, the arctangent function is calculated using the Taylor expansion function.
[0021] According to a preferred embodiment, when the maximum approximation error is allowed to be below 0.0015 rad, the Taylor expansion function is expressed as follows:
[0022] ,in, express or .
[0023] Accordingly, the present invention also provides a system for adaptive gun barrel focal length of a handheld welding torch, for executing the algorithm described in any of the above, and is built into the handheld welding torch.
[0024] This invention calculates the first scale factor and the first rotation angle of the first welding torch, and calculates the second rotation angle by setting the swing width of the second welding torch to the first actual swing width. Finally, based on the linear proportional relationship between the first scale factor, the first rotation angle, the second scale factor, and the second rotation angle, the second scale factor is calculated. This ensures that the maximum swing width of the replaced welding torch is equal to the swing width before replacement, guaranteeing welding precision and accuracy, and improving the flexibility of the handheld welding torch when the scene changes. Attached Figure Description
[0025] Figure 1 This is a flowchart illustrating the algorithm steps for adaptive gun barrel focal length of a handheld welding torch in this invention.
[0026] Figure 2 This is a schematic diagram of the swing of the first and second gun barrels in this invention. Detailed Implementation
[0027] When using a handheld laser welding torch, the torch handle often needs to be changed when the application scenario changes. For example, if the weld seam is located deep inside the workpiece or in a very confined space, a standard-length torch handle may not be able to reach the required depth or achieve the appropriate welding angle. In such cases, a longer focal length torch handle is needed to allow the laser focus to reach the deeper welding location while keeping the torch body outside the workpiece. However, because the torch's scale factor is fixed, changes in the focal length of the new torch handle will cause changes in the welding swing width, resulting in a decrease in welding precision and accuracy.
[0028] In existing technologies, to avoid such problems, the welding torch's scale factor needs to be recalibrated after replacing the torch barrel. This is inflexible and increases labor and time costs.
[0029] In view of this, the present invention provides an algorithm for adaptive gun barrel focal length of a handheld welding torch. To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the various embodiments of this application will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been presented in the various embodiments of this application to enable the reader to better understand this application. However, the technical solutions claimed in this application can be implemented even without these technical details and various changes and modifications based on the following embodiments.
[0030] In the following description, certain specific details are set forth for the purpose of illustrating various disclosed embodiments in order to provide a thorough understanding of the various disclosed embodiments. However, those skilled in the art will recognize that embodiments may be practiced without one or more of these specific details. In other instances, well-known apparatuses, structures, and techniques associated with this application may not have been shown or described in detail to avoid unnecessarily obscuring the description of the embodiments.
[0031] Unless the context requires otherwise, throughout the specification and claims, the word “comprising” and its variations, such as “including” and “having”, shall be understood to have an open, inclusive meaning, that is, to be interpreted as “including, but not limited to”.
[0032] The embodiments of this application will be described in detail below with reference to the accompanying drawings to provide a clearer understanding of the purpose, features, and advantages of this application. It should be understood that the embodiments shown in the drawings are not intended to limit the scope of this application, but are merely for illustrating the essential spirit of the technical solution of this application.
[0033] Throughout this specification, references to "an embodiment" or "an embodiment" indicate that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment. Therefore, the appearance of "in an embodiment" or "an embodiment" in various places throughout the specification does not necessarily refer to the same embodiment. Furthermore, a particular feature, structure, or characteristic may be combined in any manner in one or more embodiments.
[0034] Specifically, such as Figure 1 As shown in one embodiment of the application, the present invention provides an algorithm for adaptive gun barrel focal length of a handheld welding torch, such as... Figure 1 As shown, it includes the following steps:
[0035] S1: Obtain the first actual swing width and the first set swing width of the first gun barrel, and calculate the first scale factor, wherein the first actual swing width is the swing width when the first set swing width is at its maximum;
[0036] S2: Obtain the first focal length of the first gun barrel, and calculate the first rotation angle based on the first focal length and the first actual swing width;
[0037] S3: Obtain the second focal length of the second gun barrel, and calculate the second rotation angle based on the second focal length and the first actual swing width;
[0038] S4: Calculate the second scale factor based on the linear proportional relationship between the first scale factor, the first rotation angle, the second scale factor, and the second rotation angle.
[0039] This invention calculates the first scale factor and first rotation angle of the first welding torch (i.e., the initial torch), and calculates the second rotation angle by setting the swing width of the second torch (i.e., the replaced torch) to the first actual swing width. Finally, based on the linear proportional relationship between the first scale factor, the first rotation angle, the second scale factor, and the second rotation angle, the second scale factor is calculated. This ensures that the maximum swing width of the replaced welding torch is equal to the swing width before replacement, guaranteeing welding precision and accuracy, and improving the flexibility of the handheld welding torch when the scene changes.
[0040] Next, combine Figure 2 A more detailed explanation of the algorithm steps:
[0041] The handheld welding torch's swing width is achieved mainly by using a galvanometer motor to drive a rotor, which in turn drives a reflector mounted on the rotor to rotate. The reflector reflects the laser, and the rotor rotates symmetrically around the center point to achieve energy spot welding in a line. The swing width is related to the angle of the motor's rotation and the focal length of the torch.
[0042] The swing of the first welding torch can be viewed as an isosceles triangle AGH. The height AM of triangle AGH is the focal length of the first welding torch, and GH is the first actual swing width, which is the maximum swing width that can be achieved. The scale factor is an attribute of the handheld welding torch and is positively correlated with the swing angle. The first scale factor represents the scale factor of the handheld welding torch when using the first welding torch, corresponding to the angle GAH.
[0043] After replacing the gun barrel, the swing can be considered as a new isosceles triangle ABC. The focal length of the second gun barrel is greater than that of the first gun barrel, meaning the second focal length is greater than the first focal length. Correspondingly, the height AD of triangle ABC is the second focal length of the second gun barrel. When the first scale factor remains unchanged, i.e., the corresponding angle GAH remains unchanged, the swing width is BC, which shows that BC > GH. Understandably, since the swing width has changed, the operational precision and accuracy decrease. Therefore, the purpose of this invention is to ensure that the swing width after replacing the gun barrel still maintains the size of the previous first actual swing width GH.
[0044] Specifically, by drawing perpendicular lines from points G and H to BC, intersecting at E and O respectively, we know that the length GH = EO. Therefore, knowing the size of angle EAO is sufficient to make the swing width of the second welding torch equal to the actual swing width of the first torch. Once the size of angle EAO is known, the scale factor at this point can be calculated, which is the scale factor for holding the welding torch when using the second welding torch – the second scale factor.
[0045] Furthermore, in S1, the relevant expression for obtaining the first actual swing width and the first set swing width of the first gun barrel, and calculating the first scale factor, is as follows:
[0046] ,in, For the first actual swing width, Set the swing width for the first position. This is the motor fixed coefficient. This is the first scale factor;
[0047] Adjust the first scale factor Until the first setting of the swing width and the first actual swing width The values are equal, at this time .
[0048] In the above, the first actual swing width is the maximum swing width that can be achieved, which is obtained by maximizing the first set swing width.
[0049] Furthermore, obtain the first actual swing width When taking n measurements, the minimum and maximum values are removed, and the average of the remaining data is calculated. This avoids errors from a single measurement and maximizes data stability.
[0050] When judging the swing width of a small swing, due to the large error in motor position resolution, the swing width needs to be corrected. The correction coefficient is [value missing]. , so that the correction factor and the first actual swing width Multiplication. Correction factor. The specific value can be obtained from experimental data to reduce the impact of resolution errors.
[0051] Furthermore, in S2, the first focal length of the first gun barrel is obtained, and the relevant expression for calculating the first rotation angle based on the first focal length and the first actual swing width is as follows:
[0052] ,in Indicates the first rotation angle. This represents half of the first actual swing width, which is half of GH in the diagram, GM. This indicates the first focal length, AM.
[0053] Furthermore, in step S3, the second focal length of the second gun barrel is obtained, and based on the second focal length and the first actual swing width, the relevant expression for calculating the second rotation angle is as follows:
[0054] ,in Indicates the second rotation angle. This indicates that the target swing width of the second gun barrel is half of EO, i.e., half of ED. That is, ED=GM. Let AD represent the second focal length. Therefore, the calculation of the second rotation angle is achieved, ensuring the swing width remains unchanged. Furthermore, the focal length values mentioned above are all known.
[0055] In the above, considering computational complexity, the first rotation angle Second rotation angle In reality, these are half of their actual rotation angles. That is, half of angles GAH and EAO. Directly calculating these two angles using the conventional arctangent function would consume more computational resources, making it impractical for microcontroller systems using handheld welding torches. This invention employs a Taylor expansion fitting calculation method, improving computational efficiency.
[0056] Furthermore, the rotation angle of the motor and the scale factor are linearly related. That is, in S4, based on the linear proportional relationship between the first scale factor, the first rotation angle, the second scale factor, and the second rotation angle, the second scale factor is calculated as follows:
[0057] The linear proportional relationship is as follows: ,in To indicate the second scale factor, then And because Then the final .
[0058] The trigonometric functions built into the microcontroller system of a handheld welding torch often require a significant amount of time for calculation. Considering practical applications, to save runtime while sacrificing acceptable accuracy, a Taylor expansion function is used to calculate the arctangent function. For example, when the maximum approximation error is allowed to be below 0.0015 rad, the Taylor expansion function is as follows:
[0059] ,in, express or To take into account practical conditions as much as possible.
[0060] Accordingly, the present invention also discloses a system for adaptive gun barrel focal length of a handheld welding torch, which is used to execute the above algorithm and is built into the handheld welding torch, such as in a microcontroller, to achieve automatic calculation and improve efficiency and flexibility.
[0061] The above provides a detailed description of an algorithm and system for adaptive focal length of a handheld welding torch, as provided in the embodiments of this application. The various embodiments are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
[0062] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0063] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in flash memory, random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art.
Claims
1. An algorithm for handheld welding torch to adaptively determine the focal length of the torch's barrel, characterized by, The method comprises the following steps: S1: obtaining a first actual swing width and a first set swing width of a first gun rod, and calculating a first scale factor, wherein the first actual swing width is the swing width when the first set swing width is maximum, The related expression is: wherein, is a first actual swing width, is a first set swing width, is a motor fixed coefficient, is a first scale factor; adjusting the first scaling factor until the first set spread and the first actual spread are numerically equivalent ; S2: obtaining a first focal length of the first gun rod, and calculating a first rotation angle based on the first focal length and the first actual swing width, The related expression is: wherein denotes the first rotation angle, denotes half of the first actual swing width size, denotes the first focal length; S3: obtaining a second focal length of a second gun rod, and calculating a second rotation angle based on the second focal length and the first actual swing width, The related expression is: wherein denotes a second rotation angle, denotes half of a target swing width size of the second gun barrel, and , denotes a second focal length; S4: calculating a second scale factor based on a linear proportional relationship between the first scale factor, the first rotation angle and the second scale factor, and the second rotation angle.
2. The algorithm for handheld welding torch adaptive gun barrel focal length length of claim 1, wherein, acquiring a first actual swing width When, n times of measurement are carried out, the minimum value and the maximum value are removed, and the average value of the remaining data is processed.
3. The algorithm for handheld welding torch adaptive gun barrel focal length length of claim 2, wherein, If the first actual swing width calculated finally is less than the judgment threshold, the correction is made by the correction coefficient.
4. The algorithm for handheld welding torch adaptive gun barrel focal length length of claim 1, wherein, In the S4, the second scale factor is calculated based on a linear proportional relationship between the first scale factor, the first rotation angle and the second scale factor, and the second rotation angle. The linear proportionality is wherein denotes the second scaling factor, then .
5. The algorithm for handheld welding torch adaptive gun barrel focal length length of claim 1, wherein, The arctangent function is calculated by a Taylor expansion function.
6. The algorithm for handheld welding torch adaptive gun barrel focal length length of claim 5, wherein, When the maximum approximation error is allowed to be below 0.0015 rad, the Taylor expansion function adopts the following formula: wherein represents or .
7. A system for a handheld welding torch to adaptively determine the focal length of the torch barrel, the system comprising: The algorithm is used for executing any one of claims 1-6, and is built in a handheld welding gun.
Citation Information
Patent Citations
Welding system and welding method for all-position automatic welding of small-diameter pipeline
CN113385786A
Method and system for determining laser welding focal length
CN117961268A