# Interpolation Algorithm and Mathematical Model in Automated Welding of Saddle-Shaped Weld

Authors: Lianghao Xue; Min Wei; Tao Yang; Yongxin Lu; Ningqiang Shi; Zhiyang Zhang
Journal: Modelling and Simulation in Engineering
 (2018)

---

## Abstract

This paper presents welding torch pose model and interpolation algorithm of trajectory control of saddle-shaped weld formed by intersection of two pipes; the working principle, interpolation algorithm, welding experiment, and simulation result of the automatic welding system of the saddle-shaped weld are described. A variable angle interpolation method is used to control the trajectory and pose of the welding torch, which guarantees the constant linear terminal velocity. The mathematical model of the trajectory and pose of welding torch are established. Simulation and experiment have been carried out to verify the effectiveness of the proposed algorithm and mathematical model. The results demonstrate that the interpolation algorithm is well within the interpolation requirements of the saddle-shaped weld and ideal feed rate stability.


---

## Body

## 1. Introduction

In the production of pressure vessels, the welding problem between the cylinder and the pipe is often encountered, and sometimes a pressure vessel needs to weld dozens or even hundreds of pipes. In the project, the intersecting line, called the three-dimensional standard saddle-shaped weld, is formed by the combination of two orthogonal cylinders. Also, according to the different groove form, the multilayer continuous welding is required [1, 2]. Saddle-shaped weld is a complex space curve. In order to complete the welding work of the saddle seam, manual welding operation is still widely adopted. However, by doing this the welding quality and efficiency requirements are uncertain. Thus, the automation of the welding process is greatly significant.With the development of automatic welding system, obvious progress has been made in recent years. According to the welding process of saddle seam, there are two ways to build the automated welding system. One is to equip welding robots in their welding system; the other is to develop specially designed automated welding system. One of the most promising ways is to adopt proper curve interpolation algorithm in automated welding system [3]. Huo et al. [4] presented a real-time interpolation algorithm, which fits the intersecting curve with step-controllable segments. Ren et al. [5] established a geometrical model of the interpolation pipe’s weld seam and integrated the posture of the welding torch. Zhiming et al. [6] presented a real-time interpolation algorithm for NURBS curves; the proposed interpolator can maintain small contour errors and feed rate fluctuations. Real-time nonuniform rational B-spline interpolation algorithms were also introduced [7–9]. Tam et al. [10] proposed an algorithm for the interpolation of hybrid curves, based on interpolation of the projection of the hybrid curve into the parametric domain. Srijuntongsiri [11] proposed a new iterative hybrid algorithm to detect all intersections in the domain for nondegenerate and non-ill-posed cases. Direct interpolation algorithms [12, 13] do not have satisfied linear velocity control ability because welding quality is very sensitive. Only interpolation algorithm with ideal trajectory precision and linear velocity control ability can meet requirements of welding.In this paper, a spatial interpolation algorithm for the saddle-shaped curve is proposed by using the variable angle interpolation control method for the interpolation stepping angle and establishes welding torch pose model and trajectory model based on space analytic geometry. Simulation of the interpolation algorithm has been carried out to verify the correctness of the proposed algorithm and mathematical model. It demonstrates that algorithm has high trajectory precision and the mathematical model meets the requirements of welding.


## 2. Working Principle of Welding Machine

In this paper, the typical saddle-shaped weld is formed by the combination of two orthogonal cylinders and the pipe is taken as an example to illustrate the working principle of the saddle-shaped welding system, as shown in Figure1. The coordinate system O-xyz is established by the intersection of the cylinder and the axis of the pipe, selecting the saddle-shaped weld left side of the highest point A as the starting point of welding. The x- and y-axis two directions are driven by the entire welding system to achieve rotary motion. The z-axis direction is driven by the torch to achieve up and down reciprocating motion, which is also as a compensation movement to achieve saddle drop compensation. At the same time, the upper and lower movement of the output end are installed with angle adjustment mechanism; the welding torch is adjusted in real time with the rotary motion.Figure 1
Saddle weld and the reference frame configuration.According to the characteristic that this kind of weld joint in the horizontalxOy surface is round, based on the two-dimensional plane circular interpolation algorithm, the interpolation of saddle space weld can be decomposed into two two-dimensional interpolations [4]. The first interpolation is the z-axis vertical direction interpolation, and the second interpolation is an interpolation of horizontal rotation angel [14, 15].


## 3. Research of Saddle-Shaped Weld Interpolation Algorithm

Given that the radius of the cylinder isR and the radius of the pipe is r, the projection of the saddle-shaped weld in the xOy plane is shown as in Figure 2, θ being the angle parameter that can uniquely determine the pose of the point on the saddle-shaped space curve.Figure 2
The circular interpolation diagram.


### 3.1. The Circular Interpolation

Let pointPixi,yi and Pi+1xi+1,yi+1 be the current and next interpolation point on the saddle weld and the angle of the x-axis, respectively; θi and θi+1 be the angles between the two points for the Δθ, θi+1=θi+Δθ, and the coordinates of the Pi point are(1)xi=rsin⁡θiyi=rcos⁡θi.So the coordinates ofPi+1 can be expressed as(2)xi+1=rsin⁡θi+Δθ=rsin⁡θicos⁡Δθ-rcos⁡θisin⁡Δθ=yicos⁡Δθ-xisin⁡Δθyi+1=rcos⁡θi+Δθ=rcos⁡θicos⁡Δθ-rsin⁡θisin⁡Δθ=xicos⁡Δθ-yisin⁡Δθ.Whenθi+1≤2π, then continue interpolating; when θi+1>2π, to amend the last step Δθ, there will be an interpolation stepping Δθ′; then, Δθ′=2π-θi.So the new position of the interpolation point projected in thexOy plane can be expressed as(3)x=rsin⁡θi+Δθy=rcos⁡θi+Δθθi+1=θi+Δθ,where θi is the current angle, θi+1 is the angle of the next point, and Δθ is the added value of the angle.Based on the principle of space analytic geometry, we have(4)x2+y2-r2=0x2+z2-R2=0.To solve (4),(5)y2-z2=r2+R2,(6)z=R2-r2+y2.From (3) and (6), we also have(7)z=R2-r2+r2cos2⁡θi+Δθ=R2-r2sin2⁡θi+Δθ.


### 3.2. Welding Torch Posture Interpolation

Choose a point in the saddle-shaped weld; dihedral angle of the point on saddle weld is the angle between the cylinder’s tangent plane through this point and the pipe’s tangent plane. Dihedral angle is not equal at different points on saddle weld. Therefore,β is the dihedral angle of point Q on saddle weld (Figure 3). As can be seen from Figure 3, the diagonal angle at the starting point A is π/2 and the initial pose angle is ϕ (regular angle of welding torch’s pose).Figure 3
Relation diagram between dihedral angle and pose angle.Based on the principle of space analytic geometry, the equations of the cylinder and the pipes are given as(8)φ1x,y,z=x2+y2-r2=0φ2x,y,z=x2+z2-R2=0.Then the normal vectorsn→1 and n→2 at point Q are defined as(9)n→1=∂φ1∂x,∂φ1∂y,∂φ1∂z=x,y,0n→2=∂φ2∂x,∂φ2∂y,∂φ2∂z=x,0,z.Geometry is defined as(10)cos⁡β=n→1·n→2n→1×n→2=x2R×r.From (3) and (10), we have(11)β=arccosrsin2⁡θi+ΔθR.It can be seen from Figure3 that although dihedral angles of point on saddle weld differ from each other, they all have certain relationship with pose angle. As the rotation axis rotates from point A to point Q, the dihedral angle changes from the original π/2 to β, and pose angle is supposed to change π/2-β in order to meet pose angle requirements. So expression of dihedral angle is as follows: δ=π/2-β+ϕ.Put formula (11) into it; then(12)δ=π2-arccosrsin2⁡θi+ΔθR+ϕ.After the rotation angle changesΔθ from θi to θi+1, according to (3), (7) and (12) can calculate the coordinates of the new interpolation point Pi+1(x,y,z,θi+1,δ). Selecting the appropriate Δθ, one can obtain interpolation saddle weld by providing the cylinder and the pipe radius R, r, welding torch starting pose angle ϕ.


### 3.3. Control Law of Variable AngleΔθ

The control of the interpolation stepping angleΔθ is divided into equal angle interpolation and variable angle interpolation. Equal angle interpolation mode is to keep the stepping angle Δθ constant, and actual welding linear velocity of welding torch is not constant, affecting the quality of welding. Variable angle interpolation is to make every step interpolation stepping angle Δθ with θ to make a change. In the ΔT fixed conditions, welding linear velocity is constant and each step of the interpolation stepping-length will be equal, to ensure the welding of high quality.Select a pointQ on the saddle-shaped weld; according to kinematics principle, linear velocity direction of the point Q is direction vector of intersection line of two intersection’s tangent planes at point Q (Figure 5). Suppose linear velocity of welding torch is V, interpolation cycle is ΔT, and the angle between the z-axis and linear velocity is α (shown in Figure 4).Figure 4
The schematic diagram of linear velocity.Figure 5
Linear velocity direction.As can be seen from Figure4,(13)r·Δθ=v·ΔT·sin⁡α(14)Δθ=v·ΔT·sin⁡αr.Set the coordinates of theQ point Q(xq,yq,zq).The tangent plane equation of the cylinder at the pointQ is expressed as(15)xq·x-xq+zq·z-zq=0.And then(16)xq·x+zq·z=xq2+zq2=R2.Similarly the tangent plane equation of the pipe at the pointQ is expressed as(17)xq·x+yq·y=xq2+yq2=r2.Equations of intersection line of two tangent plans are(18)xq·x+zq·z=xq2+zq2=R2xq·x+yq·y=xq2+yq2=r2.The two pointsQ(xq,yq,zq) and 0,r2/yq,R2/zq are on the intersection line of two tangent planes, and the direction vector of the tangent line equation is calculated as(19)n→3=-xq,r2yq-yq,R2zq-zq=-xq,xq2yq,xq2zq.The direction vector of thez-axis is n→4=0,0,1; one can get following equation:(20)cos⁡α=n→3·n→4n→3n→4=xq/zq1+xq/yq2+xq/zq2.Then(21)sin⁡α=1-cos2⁡α=1+xq/yq21+xq/yq2+xq/zq2.And because of theQ point in the saddle-shaped space curve, according to (3), we have(22)xqyq=tan⁡θi+Δθ,xqzq=rsin⁡θi+ΔθR2-r2sin2⁡θi+Δθ.Substituting (22) into (21),(23)sin⁡α=1+tan2⁡θi+Δθrsin⁡θi+Δθ2/R2-rsin⁡θi+Δθ2+tan2⁡θi+Δθ+1.Substituting (23) into (14),(24)Δθ=v·ΔT·1+tan2⁡θi+Δθr·rsin⁡θi+Δθ2/R2-rsin⁡θi+Δθ2+tan2⁡θi+Δθ+1.From (24), interpolation step angle Δθ changes in real time with the change of θi to ensure that practical linear velocity of the welding torch is kept constant so as to meet the requirement of the welding process.


## 3.1. The Circular Interpolation

Let pointPixi,yi and Pi+1xi+1,yi+1 be the current and next interpolation point on the saddle weld and the angle of the x-axis, respectively; θi and θi+1 be the angles between the two points for the Δθ, θi+1=θi+Δθ, and the coordinates of the Pi point are(1)xi=rsin⁡θiyi=rcos⁡θi.So the coordinates ofPi+1 can be expressed as(2)xi+1=rsin⁡θi+Δθ=rsin⁡θicos⁡Δθ-rcos⁡θisin⁡Δθ=yicos⁡Δθ-xisin⁡Δθyi+1=rcos⁡θi+Δθ=rcos⁡θicos⁡Δθ-rsin⁡θisin⁡Δθ=xicos⁡Δθ-yisin⁡Δθ.Whenθi+1≤2π, then continue interpolating; when θi+1>2π, to amend the last step Δθ, there will be an interpolation stepping Δθ′; then, Δθ′=2π-θi.So the new position of the interpolation point projected in thexOy plane can be expressed as(3)x=rsin⁡θi+Δθy=rcos⁡θi+Δθθi+1=θi+Δθ,where θi is the current angle, θi+1 is the angle of the next point, and Δθ is the added value of the angle.Based on the principle of space analytic geometry, we have(4)x2+y2-r2=0x2+z2-R2=0.To solve (4),(5)y2-z2=r2+R2,(6)z=R2-r2+y2.From (3) and (6), we also have(7)z=R2-r2+r2cos2⁡θi+Δθ=R2-r2sin2⁡θi+Δθ.


## 3.2. Welding Torch Posture Interpolation

Choose a point in the saddle-shaped weld; dihedral angle of the point on saddle weld is the angle between the cylinder’s tangent plane through this point and the pipe’s tangent plane. Dihedral angle is not equal at different points on saddle weld. Therefore,β is the dihedral angle of point Q on saddle weld (Figure 3). As can be seen from Figure 3, the diagonal angle at the starting point A is π/2 and the initial pose angle is ϕ (regular angle of welding torch’s pose).Figure 3
Relation diagram between dihedral angle and pose angle.Based on the principle of space analytic geometry, the equations of the cylinder and the pipes are given as(8)φ1x,y,z=x2+y2-r2=0φ2x,y,z=x2+z2-R2=0.Then the normal vectorsn→1 and n→2 at point Q are defined as(9)n→1=∂φ1∂x,∂φ1∂y,∂φ1∂z=x,y,0n→2=∂φ2∂x,∂φ2∂y,∂φ2∂z=x,0,z.Geometry is defined as(10)cos⁡β=n→1·n→2n→1×n→2=x2R×r.From (3) and (10), we have(11)β=arccosrsin2⁡θi+ΔθR.It can be seen from Figure3 that although dihedral angles of point on saddle weld differ from each other, they all have certain relationship with pose angle. As the rotation axis rotates from point A to point Q, the dihedral angle changes from the original π/2 to β, and pose angle is supposed to change π/2-β in order to meet pose angle requirements. So expression of dihedral angle is as follows: δ=π/2-β+ϕ.Put formula (11) into it; then(12)δ=π2-arccosrsin2⁡θi+ΔθR+ϕ.After the rotation angle changesΔθ from θi to θi+1, according to (3), (7) and (12) can calculate the coordinates of the new interpolation point Pi+1(x,y,z,θi+1,δ). Selecting the appropriate Δθ, one can obtain interpolation saddle weld by providing the cylinder and the pipe radius R, r, welding torch starting pose angle ϕ.


## 3.3. Control Law of Variable AngleΔθ

The control of the interpolation stepping angleΔθ is divided into equal angle interpolation and variable angle interpolation. Equal angle interpolation mode is to keep the stepping angle Δθ constant, and actual welding linear velocity of welding torch is not constant, affecting the quality of welding. Variable angle interpolation is to make every step interpolation stepping angle Δθ with θ to make a change. In the ΔT fixed conditions, welding linear velocity is constant and each step of the interpolation stepping-length will be equal, to ensure the welding of high quality.Select a pointQ on the saddle-shaped weld; according to kinematics principle, linear velocity direction of the point Q is direction vector of intersection line of two intersection’s tangent planes at point Q (Figure 5). Suppose linear velocity of welding torch is V, interpolation cycle is ΔT, and the angle between the z-axis and linear velocity is α (shown in Figure 4).Figure 4
The schematic diagram of linear velocity.Figure 5
Linear velocity direction.As can be seen from Figure4,(13)r·Δθ=v·ΔT·sin⁡α(14)Δθ=v·ΔT·sin⁡αr.Set the coordinates of theQ point Q(xq,yq,zq).The tangent plane equation of the cylinder at the pointQ is expressed as(15)xq·x-xq+zq·z-zq=0.And then(16)xq·x+zq·z=xq2+zq2=R2.Similarly the tangent plane equation of the pipe at the pointQ is expressed as(17)xq·x+yq·y=xq2+yq2=r2.Equations of intersection line of two tangent plans are(18)xq·x+zq·z=xq2+zq2=R2xq·x+yq·y=xq2+yq2=r2.The two pointsQ(xq,yq,zq) and 0,r2/yq,R2/zq are on the intersection line of two tangent planes, and the direction vector of the tangent line equation is calculated as(19)n→3=-xq,r2yq-yq,R2zq-zq=-xq,xq2yq,xq2zq.The direction vector of thez-axis is n→4=0,0,1; one can get following equation:(20)cos⁡α=n→3·n→4n→3n→4=xq/zq1+xq/yq2+xq/zq2.Then(21)sin⁡α=1-cos2⁡α=1+xq/yq21+xq/yq2+xq/zq2.And because of theQ point in the saddle-shaped space curve, according to (3), we have(22)xqyq=tan⁡θi+Δθ,xqzq=rsin⁡θi+ΔθR2-r2sin2⁡θi+Δθ.Substituting (22) into (21),(23)sin⁡α=1+tan2⁡θi+Δθrsin⁡θi+Δθ2/R2-rsin⁡θi+Δθ2+tan2⁡θi+Δθ+1.Substituting (23) into (14),(24)Δθ=v·ΔT·1+tan2⁡θi+Δθr·rsin⁡θi+Δθ2/R2-rsin⁡θi+Δθ2+tan2⁡θi+Δθ+1.From (24), interpolation step angle Δθ changes in real time with the change of θi to ensure that practical linear velocity of the welding torch is kept constant so as to meet the requirement of the welding process.


## 4. Simulation Results

In order to verify the correctness of the mathematical model and algorithm, using programming takes simulation experiment, taking orthogonal saddle welding, for example, assume that practical welding parameters are as follows: the radius of cylinderR=600 mm, the radius of pipe r=150 mm, the starting pose angle =π/4, and ΔT=0.004 s. MATLAB simulation results are shown in Figures 6–11. The interpolation data of θ and (x,y,z,δ) by algorithm are shown in Table 1.Table 1
The interpolation data.
Interpolationtimes
Rotation angleθ/rad
Coordinate ofx  x/mm
Coordinate ofy  y/mm
Coordinate ofz  z/mm
Pose angle of torchδ/mm
(
1
)
0.0000
0.0000
150.0000
600.0000
0.7854
(
2
)
0.1571
23.4652
148.1533
599.5410
0.7915
(
3
)
0.3142
46.3525
142.6585
598.2069
0.8093
(
4
)
0.4712
68.0986
133.6510
596.1230
0.8369
(
5
)
0.6283
88.1678
121.3525
593.4867
0.8719
(
6
)
0.7854
106.0660
106.0660
590.5506
0.9107
(
7
)
0.9425
121.3525
88.1678
587.5998
0.9498
(
8
)
1.0996
133.6510
68.0986
584.9251
0.9852
(
9
)
1.2566
142.6585
46.3525
582.7938
1.0135
(
10
)
1.4137
148.1533
23.4652
581.4212
1.0318
(
11
)
1.5708
150.0000
0.0000
580.9475
1.0381
(
12
)
1.7279
148.1533
−23.4652
581.4212
1.0318
(
13
)
1.8850
142.6585
−46.3525
582.7938
1.0135
(
14
)
2.0420
133.6510
−68.0986
584.9251
0.9852
(
15
)
2.1991
121.3525
−88.1678
587.5998
0.9498
(
16
)
2.3562
106.0660
−106.0660
590.5506
0.9107
(
17
)
2.5133
88.1678
−121.3525
593.4867
0.8719
(
18
)
2.6704
68.0986
−133.6510
596.1230
0.8369
(
19
)
2.8274
46.3525
−142.6585
598.2069
0.8093
(
20
)
2.9845
23.4652
−148.1533
599.5410
0.7915
(
21
)
3.1416
0.0000
−150.0000
600.0000
0.7854
(
22
)
3.2987
−23.4652
−148.1533
599.5410
0.7915
(
23
)
3.4558
−46.3525
−142.6585
598.2069
0.8093
(
24
)
3.6128
−68.0986
−133.6510
596.1230
0.8369
(
25
)
3.7699
−88.1678
−121.3525
593.4867
0.8719
(
26
)
3.9270
−106.0660
−106.0660
590.5506
0.9107
(
27
)
4.0841
−121.3525
−88.1678
587.5998
0.9498
(
28
)
4.2412
−133.6510
−68.0986
584.9251
0.9852
(
29
)
4.3982
−142.6585
−46.3525
582.7938
1.0135
(
30
)
4.5553
−148.1533
−23.4652
581.4212
1.0318
(
31
)
4.7124
−150.0000
0.0000
580.9475
1.0381
(
32
)
4.8695
−148.1533
23.4652
581.4212
1.0318
(
33
)
5.0265
−142.6585
46.3525
582.7938
1.0135
(
34
)
5.1836
−133.6510
68.0986
584.9251
0.9852
(
35
)
5.3407
−121.3525
88.1678
587.5998
0.9498
(
36
)
5.4978
−106.0660
106.0660
590.5506
0.9107
(
37
)
5.6549
−88.1678
121.3525
593.4867
0.8719
(
38
)
5.8119
−68.0986
133.6510
596.1230
0.8369
(
39
)
5.9690
−46.3525
142.6585
598.2069
0.8093
(
40
)
6.1261
−23.4652
148.1533
599.5410
0.7915
(
41
)
6.2832
0.0000
150.0000
600.0000
0.7854Figure 6
Simulation result of the trajectory interpolation algorithm.Figure 7
Simulation figure of the relation between rotation angle and pose angle.Figure 8
Simulation figure of the relationship between rotation angle andx-axis coordinate value.Figure 9
Simulation figure of the relationship between rotation angle andy-axis coordinate value.Figure 10
Simulation figure of the relationship between rotation angle andz-axis coordinate value.Figure 11
Relationship between rotation angle and interpolation step-length.


## 5. Welding Experiment

According to the welding process of the saddle weld, the main parameters of the welding experiment are listed in Table2. The photograph of the saddle seam surface is shown in Figures 12 and 13.Table 2
Welding experiment parameters.
Parameter
Value
Radius of cylinder
600 mm
Radius of branch pipe
150 mm
Welding type
GMAW
Welding current
230 A
Arc voltage
25.3 V
Welding speed
80 mm/min
Wire feed rate
6 m/min
Wire diameter
1.2 mm
Pose angle
25°
Wire extension
12 mmFigure 12
Photograph of the saddle seam surface.Figure 13
Photograph of the saddle seam surface.Correct saddle seam is reflected in the photos, which verify the feasibility of the interpolation algorithm.


## 6. Conclusions

According to the welding technology of saddle seam, the working principle of auto-welding machine for saddle-shaped weld is proposed, and the mathematical model and interpolation algorithm of saddle-shaped weld are established.The interpolation algorithm can well meet the technical requirement of automatic welding and can achieve trajectory control of welding of saddle-shaped weld and can also achieve control of welding torch’s pose, to ensure better welding conditions.A variable angle interpolation method is used for real-time change interpolation stepping angle and to guarantee that practical linear velocity of the welding torch is kept constant and improve the quality of the weld seam.



---

*Source: 8045162-2018-03-01.xml*