1 Introduction

Metallic tubular parts are widely used in many high-end industries such as aviation, aerospace, and automobile. In modern turbofan aero-engines, it is reported that the weight of an external piping system is nearly 60 ~ 70% of the total weight of external structures [1,2,3]. According to statistics, 50% of all aero-engine failures are caused by the external piping system, electric wire, and sensors [4, 5]. Therefore, improving the usability of the external piping system is an important strategy for extending the life span of an aero-engine. When designing the structures of the external piping system, the influences of general layouts, rigid strength, flow resistance characters, and vibration performance should be considered.

A good tubular product should possess some special characteristics, such as lightweight, high strength, low impedance, and high vibration resistance. In geometrical characters, the tube axis should be smooth and uniform in curvature distribution. However, under current conditions, the tubular parts in aero-engines are mainly formed by the rotary-draw-bending (RDB) process, which can form 2D shapes precisely but can not be applied for manufacturing complex spatial tubular products. As a result, the maximum usability of tubular parts is limited in the RDB process.

To overcome the deficiencies in the RDB process, free bending technology is proposed and considered an innovative process for manufacturing freeform bending tubes and profiles. The new bending technology inherits the high flexible characters in the traditional push bending process. Without changing tools, different bending curvatures and bending angles can be obtained easily [6,7,8]. Besides, the free bending technology extends the forming scope of the push bending process greatly. A typical model for the free bending process is shown in Fig. 1. The mobile die can shift around the fixed die freely. The clamp can provide a pushing force and a torque on the tube axis. When forming process begins, the mobile die deflects from the original position and forces the tube blank to be plastic. At the same time, the clamp forces the tube blank to move along the feeding direction. If torque is added to the clamp, a spatial tubular product can be formed easily.

Fig. 1
figure 1

Principle of the free bending process

In the current literature, Guo et al. [9, 10] established several mathematical models for determining the bending die positions during free bending and investigated the strain stress distributions along bending lines numerically. Plettke et al. [11,12,13] investigated the relationship between mobile tool position and forming curvatures for push bending numerically and established the curvature distribution along bending lines when manufacturing arc-shaped products. Vatter and Plettke [14] investigated the influence of mobile die position, tools stiffness, and clamp motion on bending curvature distributions and finally built a series of forming theories under single variable conditions. Engel et al. [15] investigated the influence of mobile tool loci on forming curvatures distribution and designed a series of strategies for reducing the length of transition zones on bending lines. Based on the existing experimental datum, Groth et al. [16] summarized the forming characters of curvature distribution along bending lines. When the bending process begins, the bending curvature would experience a viscous damping vibration before reaching constant. At the end of the bending process, there would be a sudden decrease in curvature values. Based on such a phenomenon, the curvature distribution along the bending line is divided into three parts: transition zone, constant curvature zone, and outfeed zone in Fig. 2.

Fig. 2
figure 2

Characteristic periodical curvature distribution along the bending line [16]

It should be pointed out that the mentioned references above are mainly focused on arc-shaped bending instances. For 3D complex tube bending, the existing researches still need to be improved. Comparing with the arc-shaped bending, 3D bending is more complex. During the forming process, there exists a continuous change of bending planes along the bending line. Existing research has also shown that the torque can also influence the bending curvatures [17, 18]. To precisely form a spatial tube product, an extensive relationship among mobile die motion, clamp motion, and geometrical characters of forming products should be proposed.

However, due to the irregular shape of these variable-curvature tubes, their geometric and physical non-linearity is stronger than those ordinary constant-curvature tubes. Therefore, the theoretical analytical models’ insufficiency and test measuring data should be short and on the other hand be not accurate. Moreover, the control of its forming accuracy is more difficult, especially for the precise forming of variable-curvature tubes.

In this paper, a piece-wise function is adopted to simplify the curvature distribution along the bending line. Then, a series of control parameters is extracted, and the relation between controlling parameters and mobile tool motion is investigated. Based on this investigation, a new strategy based on the extended Kalman filter (EKF) algorithm is suggested for the forming control.

2 The fundamental knowledge about spatial curves and extended Kalman filter

2.1 Fundamental theories about spatial curves

According to the theories of spatial geometry, a typical spatial curve can be expressed as Fig. 3. Assuming that the natural parametric function of a spatial curve is \({\varvec{r}}={\varvec{r}}(s)\) and point \(\mathrm{O}\) is on the spatial curve, the active coordinate system at point \(\mathrm{O}\) can be marked by tangent vector \({\varvec{t}}(s)\), normal vector \({\varvec{n}}(s)\), and bi-normal vector \({\varvec{b}}(\mathrm{s})\) in Fig. 3. The triangular pyramid constituted by \({\varvec{t}}(s)\), \({\varvec{n}}(s),\) and \({\varvec{b}}(s)\) is known as the Frenet mark. The Frenet mark can reflect the variation tendency of curvature and torsion on the spatial curve.

Fig. 3
figure 3

Description of a spatial curve in the coordinate system

According to the theories of spatial geometry, the relationship of \({\varvec{t}}(s)\), \({\varvec{n}}(s)\), and \({\varvec{b}}\left( s \right)\) can be expressed as Eq. (1).

$$\left\{ {\begin{array}{*{20}l} {\dot{\user2{t}}\left( s \right) = k\left( s \right) \cdot {\varvec{n}}\left( s \right)} \hfill \\ {\dot{\user2{n}}\left( s \right) = - k\left( s \right) \cdot {\varvec{t}}\left( s \right) + \tau \left( s \right) \cdot {\varvec{b}}\left( s \right)} \hfill \\ {\dot{\user2{b}}\left( s \right) = - \tau \left( s \right) \cdot {\varvec{n}}\left( s \right)} \hfill \\ \end{array} } \right.$$
(1)

where \(k(s)\) and \(\tau (s)\) refer to the curvature and torsion separately. \(k(s)\) and \(\tau (s)\) can be calculated by Eq. (2).

$$\left\{ {\begin{array}{*{20}c} {k\left( s \right) = \left| {\varvec{\ddot{r}}(s)} \right|} \\ { \tau \left( s \right) = \left| {\varvec{\ddot{b}}(s)} \right|} \\ \end{array} } \right.$$
(2)

2.2 A brief introduction of extended Kalman filter

2.2.1 Principle fundamental

The main features of the EKF are the Taylor series expansion for the non-linear system, and if just one order term is considered, this non-linear system would be treated as linear. After this approximation, the state evaluation should be done through the EKE algorithm framework. Commonly, a non-linear system can be described as Eqs. (3) and (4).

State equation:

$$x_{k} = f\left( {x_{k - 1} ,u_{k - 1} ,w_{k - 1} } \right)$$
(3)

Measurement equation:

$$z_{k} = h\left( {x_{k} ,v_{k} } \right)$$
(4)

where Eq. (3) includes the control function \(u_{k - 1}\) and noise \(w_{k - 1}\); function f will establish the mapping between the current state at time t and the state at time t − 1. In Eq. (4), function h represents the non-linear relation between the measurement variable \(z_{k}\) and state variable \(x_{k}\).

2.2.2 The algorithm of EKF

  1. 1.

    Evaluation part

State evaluating:

$$\hat{x}_{{\overline{k}}} = f\left( {\hat{x}_{k - 1} ,u_{k} ,w_{k} } \right)$$
(5)

Co-variables predicting:

$$P_{{\overline{k}}} = AP_{k - 1} A^{T} + Q$$
(6)
  1. 2.

    adjustment part

Matrix of transmission gaining:

$$K_{k} = P_{{\overline{k}}} H^{T} \left( {HP_{{\overline{k}}} H^{T} + R} \right)^{ - 1}$$
(7)

Filtering equation:

$$\hat{x}_{k} = \hat{x}_{{\overline{k}}} + K_{k} \left( {z_{k} - h\left( {\hat{x}_{{\overline{k}}} } \right)} \right)$$
(8)

Up-dated co-variables:

$$P_{k} = \left( {I - K_{k} H} \right)P_{{\overline{k}}}$$
(9)

The above five equations from Eqs. (5) to (9) are the key elements for EKF, and the Jacobian matrix through the differential of function f with x is as

$$A = \frac{\partial f}{{\partial x}} = \left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} {\frac{{\partial f_{1} }}{{\partial x_{1} }}} \\ {\frac{{\partial f_{2} }}{{\partial x_{1} }}} \\ \vdots \\ \end{array} } & {\begin{array}{*{20}c} {\frac{{\partial f_{1} }}{{\partial x_{2} }}} & \cdots & {\frac{{\partial f_{1} }}{{\partial x_{n} }}} \\ {\frac{{\partial f_{2} }}{{\partial x_{2} }}} & \cdots & {\frac{{\partial f_{2} }}{{\partial x_{n} }}} \\ \vdots & \vdots & \vdots \\ \end{array} } \\ {\frac{{\partial f_{n} }}{{\partial x_{1} }}} & {\begin{array}{*{20}c} {\frac{{\partial f_{n} }}{{\partial x_{1} }}} & \cdots & {\frac{{\partial f_{n} }}{{\partial x_{n} }}} \\ \end{array} } \\ \end{array} } \right]$$
(10)

And in the same way, the Jacobian matrix through the differential of function h with x is shown as:

$$H = \frac{\partial h}{{\partial x}} = \left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} {\frac{{\partial h_{1} }}{{\partial x_{1} }}} \\ {\frac{{\partial h_{2} }}{{\partial x_{1} }}} \\ \vdots \\ \end{array} } & {\begin{array}{*{20}c} {\frac{{\partial h_{1} }}{{\partial x_{2} }}} & \cdots & {\frac{{\partial h_{1} }}{{\partial x_{n} }}} \\ {\frac{{\partial h_{2} }}{{\partial x_{2} }}} & \cdots & {\frac{{\partial h_{2} }}{{\partial x_{n} }}} \\ \vdots & \vdots & \vdots \\ \end{array} } \\ {\frac{{\partial h_{n} }}{{\partial x_{1} }}} & {\begin{array}{*{20}c} {\frac{{\partial h_{n} }}{{\partial x_{1} }}} & \cdots & {\frac{{\partial h_{n} }}{{\partial x_{n} }}} \\ \end{array} } \\ \end{array} } \right]$$
(11)

After the linear processing using the one order Taylor series, we have the following formulas.

State formula:

$$x_{k} \approx f(\hat{x}_{k - 1} ,u_{k - 1} ) + \frac{\partial f}{{\partial x_{k - 1} }}(x - x_{k - 1} ) + w_{k}$$
(12)

Observation formula:

$$z_{k} \approx h(x_{k} ) + \frac{\partial h}{{\partial x_{k} }}(x_{k} - \hat{x}_{k - 1} ) + v_{k}$$
(13)

The key characteristic of the EKF algorithm consists in the Kalman gaining \(K_{k}\), and the Jacobin matrix H can transfer useful observing information. Put simply, the framework of the EKF algorithm is presented in Fig. 4.

Fig. 4
figure 4

The framework EKF algorithm

3 The application of EKF in 3D tube

3.1 The simulation of the free bending process

In this paper, a numerical model for push bending (shown in Fig. 5) is a built-in ABAQUS/Explicit system. The following assumptions are applied to facilitate the analysis: (i) Tube is the only deformable part in the model and other parts are considered rigid bodies; (ii) material property is considered isotropic and obeys Mises criteria; (iii) friction coefficients are constant values. The dimension of the tube in the simulation is \(\Phi 10.0\mathrm{mm}\times 3.0\mathrm{mm}\) (diameter × thickness). True stress–strain curve and mechanical properties of the pure aluminum are presented as Fig. 6.

Fig. 5
figure 5

FEM model for free bending

Fig. 6
figure 6

True stress–strain curve and mechanical properties of the pure aluminum

3.2 Strategies for selecting the axis of the tube

When using the numerical method for tube spring-back analysis, a key procedure is to extract the tube axis from the FE model. In this section, a strategy for extracting tube axis from the FE model considering the influence of wall thinning and cross-section distortion is introduced.

As shown in Fig. 7, nodes on the tube outer surface are defined as the intersections of U-curves and V-curves (U-curves are defined as curves that are approximately parallel to the tube axis and V-curves are defined as curves that are approximately vertical to the tube axis). The nodes on the same V-curve are chosen and noted as \(\left({x}_{i},{y}_{i}, {z}_{i}\right)\). To determine the best cross-section plane, Eq. (14) is defined as an optimization function.

$$\mathrm{min}\overline{d }=\sqrt{\frac{1}{n}{\sum}_{i=1}^{n}\frac{{\left(A{x}_{i}+B{y}_{i}+C{z}_{i}-D\right)}^{2}}{{A}^{2}+{B}^{2}+{C}^{2}}}$$
(14)

where \(n\) refers to the number of nodes; \(A\), \(B\), \(C,\) and \(D\) are parameters that need to be determined.

Fig. 7
figure 7

Determination of the normal plane

Equation (14) can be solved. When \(A\), \(B\), \(C\), and \(D\) are determined, the best cross-section plane can be described as Eq. (15) in the Cartesian coordinate system.

$$Ax+By+Cz=D$$
(15)

If the nodes \(\left({x}_{i},{y}_{i}, {z}_{i}\right)\) are projected to the cross-section plane above, Fig. 8 can be obtained. Node coordinates after projection are noted as \(\left({x}_{i}^{\mathrm{^{\prime}}},{y}_{i}^{\mathrm{^{\prime}}}, {z}_{i}^{\mathrm{^{\prime}}}\right)\). In Fig. 12, \(\left(x,y,z\right)\) is defined as the center of the ideal surface, of which the diameter is equal to that of the tube blank. Equation (16) is defined as a function to optimize the center coordinates. The solution of Eq. (16) is considered the center of the tube cross-section.

Fig. 8
figure 8

Projection of nodes on the normal plane

$$\left\{\begin{array}{c}\mathrm{min}\sqrt{\frac{1}{n}\sum_{i=1}^{n}{\left(R-\sqrt{{\left({x}_{i}^{\mathrm{^{\prime}}}-x\right)}^{2}+{\left({y}_{i}^{\mathrm{^{\prime}}}-y\right)}^{2}+{\left({z}_{i}^{\mathrm{^{\prime}}}-z\right)}^{2}}\right)}^{2}}\\ s.t. \;Ax+By+Cz=D\end{array}\right.$$
(16)

where \(R\) refers to the outer radius of the tube. Repeating the strategies above several times, a series of tube cross-sections and center points can be determined. If we connect the center points using a B-spline, the tube axis can be geometrically built as Fig. 9.

Fig. 9
figure 9

Generation of the tube axis using a series of center points

After extracting the tube axis, the curvature distribution along the bending line can be analyzed in the CREO modeling system as Fig. 10.

Fig. 10
figure 10

Curvature distribution analysis

3.3 The forecasting and optimization of formed tube trajectory

A new strategy for acquiring the forming parameters is proposed in this paper, which is based on segmented arcs (or segmented spirals in 3D) approximation. In this way, the motion model, which would be fundamental for the EKF solution together with the measurement model, will be more effective. And the forecasting and optimization of formed tube trajectory would be dealt with efficiently.

3.3.1 Initial processing parameters

In the case of the 2D tube in Fig. 11, eleven uniformly distributed points are selected up along its axis from a designed CAD model.

Fig. 11
figure 11

The eleven uniformly distributed points of object tube

Making interpolation through these points using the cubic B-spline, we can acquire the spline equation, and through differential operation, the curvature \(k\left( s \right)\) can be calculated, shown in Fig. 12. The fluctuation phenomenon in Fig. 12 came from the curvature calculating algorithm that is much more sensitive to the point number and its distribution. Therefore, the “lowness” method in MATLAB is used to wipe off this noise and smooth the curvature curve. Selecting parameters \(t(0 \le t \le 1)\) corresponding with eleven uniformly distributed points, the curvature k and associated radii are as in Table 1.

Fig. 12
figure 12

Curvature distribution of \(k\left( s \right)\)

Table 1 Curvature distributions with different parameter t

Then, making an approximation of tube axis through segmented arcs to guarantee the co-alignment of tangent and normal directions at the starting point on the second arc and the final point on the first arc, respectively. After finishing the approximation section-by-section in the same way mentioned above, the approximation’s accuracy could be evaluated by Eq. (17), and a better approximation is taken in Table 2.

$$\left\{ {\begin{array}{*{20}l} {\Delta e = \sqrt {\frac{1}{n}\mathop \sum \limits_{i = 1}^{n} {\Delta }l_{i}^{2} } \le \varepsilon } \\ {e_{max} = \mathop {\max }\limits_{0 \le i \le n} \left\{ {{\Delta }l_{i} } \right\} \le \delta } \\ \end{array} } \right.$$
(17)

where \(\Delta l_{i}\) is the distance between the objective point and the correspondent arc endpoint; \(\varepsilon\) is the total averaged tolerance; \(\delta\) is the maximum tolerance.

Table 2 Arc sections along the tube axis

After approximating, some transformation from the design model to the processing model should be done. For simplicity, one section arc is taken as an example. As shown in Fig. 13, if the forming radii are R, the various angles have the following relationships

$$\left\{ {\begin{array}{*{20}l} {\alpha_{2} + \alpha_{4} = \pi /2} \hfill \\ {\alpha_{1} + 2\alpha_{4} = \pi } \hfill \\ {\alpha_{1} = \alpha_{3} } \hfill \\ \end{array} } \right. \Rightarrow \alpha_{1} = \alpha_{3} = 2\alpha_{2}$$
(18)
Fig. 13
figure 13

Geometric relations of the various angles

The distance between die center A and initial forming point O is always constant, so we can have the relation of D with R

$$\frac{D/2}{R} = \sin \left( {\frac{{\alpha_{1} }}{2}} \right)$$
(19)

Grant being free of jam, the bending die should not only rotate around fixed die indexed by \(\alpha_{2}\) but also around the axis itself indexed as \(\alpha_{3} - \alpha_{2}\). In this situation, if the radii R is available, the angle \(\alpha_{2}\), and \(\alpha_{3} - \alpha_{2}\) can be calculated from Eq. (18). When the arc length s, feeding speed v, and feeding time is given, we have the following simple relations

$$s = vt$$
(20)
$$\theta = \frac{s}{R}$$
(21)

where \(\theta\) is the center angle of wanted tube arc.

3.3.2 Tube motion model

Correctly selecting state variables could make the system model simple, and the EKE algorithm is more efficient. In general, the system state variables evolve with time step-by-step. In this way, differential equations, which are formulated by one order Taylor series with time, are used to represent this evolution. Through differential regarding state variables, the state transferring matrix can be obtained. Keeping in mind if the state variables are not dependent, this transferring matrix should be a unit matrix, and this is not what we want. In the case of arc tube forming, we choose non-independent variables as object position coordinates x and y, rotating angle \(\theta\), and feeding speed v.

$$X = [x,y,\theta ,v]^{T}$$
(22)

The schematic diagram is shown in Fig. 14. Firstly, when the forming process begins, the feeding speed varies from 0 to v, then the bending die rotates hypothetically to a position with the arc center angle \(\alpha_{1}\) in a short time. Continually feeding, the arc no. 1 is formed, and \(\theta_{1}\) value has a change of \(v/R\) from time k to time k + 1. After finishing arc no. 1 forming, the die moves to a new position with arc center angle \(\alpha_{2}\), and then repeating this step, all processing progress can be finished.

Fig. 14
figure 14

The schematic diagram of tube forming

The motion equation for a certain arc is

$$\left\{ {\begin{array}{*{20}l} {x = R\sin (\alpha + \theta )} \hfill \\ {y = R(1 - \cos (\alpha + \theta ))} \hfill \\ {\theta = \frac{vt}{R}} \hfill \\ {v = v} \hfill \\ \end{array} } \right.$$
(23)

Through one order Taylor series approximation, then we have

$$\lambda (X_{k + 1} ) = \lambda (X_{k} ) + \left( {X_{k + 1} - X_{k} } \right)\lambda^{^{\prime}} \left( {X_{k} } \right)$$
(24)

The state transformation equation is

$$\left\{ {\begin{array}{*{20}l} {x_{k + 1} = x_{k} + v\cos (\alpha + \theta ) + w_{kx} } \hfill \\ {y_{k + 1} = y_{k} + v\sin (\alpha + \theta ) + w_{ky} } \hfill \\ {\theta_{k + 1} = \theta_{k} + \frac{v}{R} + w_{k\theta } } \hfill \\ {v_{k + 1} = v_{k} } \hfill \\ \end{array} } \right.$$
(25)

Making differential to state variables, we obtain the following Jacobian matrix, the state transformation matrix.

$$F = \frac{\partial f}{{\partial X}} = \left[ {\begin{array}{*{20}c} 1 & 0 & { - v\sin (\alpha + \theta )} & {\cos (\alpha + \theta )} \\ 0 & 1 & {v\cos (\alpha + \theta )} & {\sin (\alpha + \theta )} \\ 0 & 0 & 1 & \frac{1}{R} \\ 0 & 0 & 0 & 1 \\ \end{array} } \right]$$
(26)

3.3.3 Observation model

Monitoring the formed tube instantly, shown in Fig. 15, we can get the observation model that we need. Because the EKE algorithm is adopted, the observation model should be non-linear. With an eye on point A at a certain time, the distance r from point B to point A and the angle \(\Delta\) between axis x and line AB are selected as observing variables, which can be calculated from monitored coordinates x and y.

Fig. 15
figure 15

Schematic of monitoring the formed tube

Observation variables

$$Z = \left[ {r,\Delta } \right]$$
(27)

The relationship between observed variables and state variables are

$$\left\{ {\begin{array}{*{20}l} {r = \sqrt {x^{2} + y^{2} } + v_{r} } \hfill \\ {\Delta = a\tan (y/x) + v_{\Delta } } \hfill \\ \end{array} } \right.$$
(28)

The observation matrix H is

$$H = \frac{\partial h}{{\partial X}} = \left[ {\begin{array}{*{20}c} {\frac{x}{{\sqrt {x^{2} + y^{2} } }}} & {\frac{y}{{\sqrt {x^{2} + y^{2} } }}} & 0 & 0 \\ {\frac{{ - \frac{y}{{x^{2} }}}}{{1 + (y/x)^{2} }}} & {\frac{\frac{1}{x}}{{1 + (y/x)^{2} }}} & 0 & 0 \\ \end{array} } \right]$$
(29)

As shown in Fig. 16, at first, monitoring the trajectory of point A from the time \(t = 0\), if \(t = t_{1} /4\), while we think a quarter of the arc no. 1 was formed, we stop monitoring point A and continue our monitoring on point B. By the same way, if \(t = t_{1} /2\), we stop the monitoring on point B. Through this process, the formed tube part ABC, which is just half part of arc no. 1 section, is available and this obtained half part will be regarded as an observation model. Based on a comparison between the design shape and this half part, further calculation relating to compensation could be considered on the second half tube part. As for the second half part monitoring is finished, just repeat the above steps for the next section.

Fig. 16
figure 16

Monitoring the trajectory of points

3.3.4 EKE application

For calculating efficiently and easily, the diagonal noise co-variable matrix could be used in this study with smaller initial values \(P_{0}\) = diag[0.001,0.001]. The matrix A and Q could be calculated by multiple experiments (Piippo A). Because the tube axis calculated through the FEM data does have some tolerances, the observing noise co-variable matrix is assumed as R = diag[0.09,0.09] in this situation. According to reference (Piippo A.), we choose Q = diag[0.01,0.01,0.01,0]. Assuming the coordinates \(\left( {x_{i,c} ,y_{i,c} } \right)\) are objective point i, and the point coordinates \(\left( {x_{i,e} ,y_{i,e} } \right)\) on the trajectory are calculated by EKF, therefore, the deviation between these two points is

$$\Delta e_{i} = \sqrt {(x_{i,c} - x_{i,e} )^{2} + (y_{i,c} - y_{i,e} )^{2} }$$
(30)

The maximum and mean deviations are

$$\left\{ {\begin{array}{*{20}l} {E_{max} = \mathop {\max }\limits_{{1 \le {\text{i}} \le {\text{n}}}} \Delta e_{i} } \\ {E_{ave} = \frac{{\mathop \sum \nolimits_{i = 1}^{n} \Delta e_{i} }}{n}} \\ \end{array} } \right.$$
(31)

In this study, the maximum deviation limit is set to be \(\varepsilon_{\max }\) = 2 mm, and the mean value is \(\varepsilon_{ave}\) = 1.5 mm. Running the EKF algorithm section by section, the 1st section arc is performed by processing parameters \(\alpha_{1}\) = 0.1745 rad, \(v_{1}\) = 30 mm/s, and \(t_{1}\) = 2 s, simulating and monitoring the first arc part, then finishing the filtering operation both on the established motion model, and observing model taken from FEM simulation. As shown in Fig. 17, the true half tube part trajectory can be calculated by the EKF using motion and observation models, and since the deviation between the true shape and objective one is within the tolerance, so no adjusting operation is needed.

Fig. 17
figure 17

Arc no. 1. a The first part of no. 1. b All section of no. 2

For the second half part, we choose the processing parameters as \(\alpha_{2}\) = 0.3054 rad, \(v_{2}\) = 30 mm/s, and \(t_{2}\) = 2 s. After the EKF calculating and deviation analysis, shown in Fig. 18, the deviation is larger than the mean value \(\varepsilon_{ave}\) and the projected true trajectory goes away from the objective one; therefore, processing parameters should be adjusted to make some compensation.

Fig. 18
figure 18

Arc no. 2. a The first part of no. 2. b Second part of no. 2

According to the deviation measured from the comparison between predicted trajectory and objective, we can determine a compensated direction. Based on careful analysis, the projected bending radii are too small and the bending angle is too larger; therefore, a new adjusted processing parameter bending angle \(\alpha_{2}^{^{\prime}}\) = 0.2618 rad is used for the second half tube section, shown in Fig. 19.

Fig. 19
figure 19

Arc no. 3. a The first part of arc no. 3. b All sections of arc no. 3

And after this compensation, the mean deviation is well below the limit \(E_{ave}\), which means the true trajectory is redressed to a reasonable position closer to the designed shape.

A set of initial processing parameters \(\alpha_{3}\) = 0.4538 rad, \(v_{3}\) = 30 mm/s, and \(t_{3}\) = 1 s is adopted for the third arc part of the tube; the deviation concerning the first half is within the limit value, shown in Fig. 19, so nothing would be done for the second half. After all, through the EKF calculating and compensating, a better result is shown in Fig. 20b, contrasting with a result without compensation in Fig. 20a. Figure 21 shows us the normalized processing parameters varying with time, the red dot line representing the adjusted die rotating values, and the black dot line the initial values.

Fig. 20
figure 20

Deviations before and after compensation. a Before compensation. b After compensation

Fig. 21
figure 21

Processing parameters

4 Application of EKF in 3D tube

4.1 Spiral based approximation for 3D tube

A spiral line can be drawn out by moving a point both along a circle with radii a and an axis vertical to the circle plane at some constant speeds. As shown in Fig. 22, radii a and pitch b are the two main features of this spiral line.

Fig. 22
figure 22

The main features of spiral

In Cartesian coordinate bases, the parameter equations of the spiral are as

$$\left\{ {\begin{array}{*{20}l} {x = a\cos \theta } \hfill \\ {y = a\sin \theta } \hfill \\ {z = b\theta } \hfill \\ \end{array} } \right.$$
(32)

where the value a is the base radii of the column, b is pitch, and \(\theta = \omega t\), where \(\omega\) is the angle speed. If we choose the arc length s as the parameter, then we have Eq. (33). And the arc length can be calculated using Eq. (34).

$${\varvec{r}}\left( s \right) = \left( {a\cos \frac{s}{{\sqrt {a^{2} + b^{2} } }},\;a\sin \frac{s}{{\sqrt {a^{2} + b^{2} } }},\frac{bs}{{\sqrt {a^{2} + b^{2} } }}} \right)$$
(33)
$$s = \mathop \smallint \nolimits_{0}^{\theta } \sqrt {\left( {\frac{dx}{{d\theta }}} \right)^{2} + \left( {\frac{dy}{{d\theta }}} \right)^{2} + \left( {\frac{dz}{{d\theta }}} \right)^{2} } d\theta$$
(34)

The curvature \(k\left( s \right)\) and torsion \(\tau \left( s \right)\) are measured in Eq. (35) according to reference [17].

$$\left\{ {\begin{array}{*{20}c} {k\left( s \right) = \left| {\varvec{\ddot{r}}\left( s \right)} \right| = \frac{a}{{a^{2} + b^{2} }}} \\ {\tau \left( s \right) = \left| {\varvec{\ddot{b}}\left( s \right)} \right| = \frac{b}{{a^{2} + b^{2} }}} \\ \end{array} } \right.$$
(35)

The Frenet frame at starting point is

$$\left\{ {\begin{array}{*{20}l} {{\varvec{t}}\left( 0 \right) = \left( {0,\frac{a}{{\sqrt {a^{2} + b^{2} } }},\frac{b}{{\sqrt {a^{2} + b^{2} } }}} \right)} \hfill \\ {{\varvec{n}}\left( 0 \right) = \left( { - 1,0,0} \right)} \hfill \\ {{\varvec{b}}\left( 0 \right) = \left( {0, - \frac{b}{{\sqrt {a^{2} + b^{2} } }},\frac{a}{{\sqrt {a^{2} + b^{2} } }}} \right)} \hfill \\ \end{array} } \right.$$
(36)

The Frenet frame at finishing points is

$$\left\{ {\begin{array}{*{20}l} {{\varvec{t}}\left( s \right) = \left( { - \frac{a}{{\sqrt {a^{2} + b^{2} } }}\sin \frac{s}{{\sqrt {a^{2} + b^{2} } }},\frac{a}{{\sqrt {a^{2} + b^{2} } }}\cos \frac{s}{{\sqrt {a^{2} + b^{2} } }},\frac{b}{{\sqrt {a^{2} + b^{2} } }}} \right)} \hfill \\ {{\varvec{n}}\left( s \right) = \left( { - \cos \frac{s}{{\sqrt {a^{2} + b^{2} } }}, - \sin \frac{s}{{\sqrt {a^{2} + b^{2} } }},0} \right)} \hfill \\ {{\varvec{b}}\left( s \right) = {\varvec{t}}\left( s \right) \times {\varvec{n}}\left( s \right)} \hfill \\ \end{array} } \right.$$
(37)

The normal vector always points to the curvature center. And curvature can reflect the bending intensity of the curve. The torsion of the curve can express the deviation tendency of this curve to the osculating plane. In other words, curvature and torsion are used to describe the bending and twisting intensity of the spatial curve.

When a spatial product is available, we firstly should define the representation and connection method of the tube elements so that the forming parameters \(\left(\rho , \varphi \right)\) can be obtained. Generally, if the tube elements are small enough, they can be considered a series of spirals. Figure 23 shows the representation of the spatial tube by spirals. Two adjacent elements share the same tangent vector \({\varvec{t}}\left(s\right)\), normal vector \({\varvec{n}}(s)\), and binormal vector \({\varvec{b}}(s)\) at the common joint point. For each spiral element, curvature and torsion can be determined. So, a series of parameters \(\left(\rho , \varphi \right)\) can be obtained.

Fig. 23
figure 23

Spatial tube representation using bi-spirals

4.2 Correlating the geometric parameters with processing parameters

4.2.1 Geometric parameters

For a case of the 3D tube in Fig. 24, eleven uniformly distributed points are selected up along its axis.

Fig. 24
figure 24

The eleven uniformly distributed points of object tube

Making interpolation using these points based on the triple spline, we can get the spline equation, and through differential operation, we can calculate the curvature and torsion shown in Fig. 25. The curvature and torsion at each point are in Table 3.

Fig. 25
figure 25

Curvature and torsion distributions. a Curvature distribution. b Torsion distribution

Table 3 Curvature and torsion at each selected point

According to this analysis, three sections of spiral lines with different features, shown in Table 4, were selected to construct an approximation curve that will be used to coordinate the processing parameters.

Table 4 Spiral sections along the tube axis

4.2.2 Processing parameters

For 3D tube forming, the rotating speed of the clamp should be considered another processing parameter. In the situation of the spiral, the base radii a and pitch b will be coordinated with processing parameters: die rotating angle, feeding speed, and clamp rotating speed.

In the simulation using ABAQUS, the die rotating angle, feeding speed, and clamp rotating speed will be set as boundary conditions, similar to 2D simulation. When the die rotating angle is \(\varphi\) = 0.14 rad, feeding speed v = 100 mm/s, and clamp rotating speed is set as 0.1 rad/s, 0.2 rad/s, 0.3 rad/s, and 0.4 rad/s respectively, the values a and b of formed spiral tubes are shown in Fig. 26.

Fig. 26
figure 26

Relation between spiral features and twisting angle

It is clear that the base radii change a little and the pitch b increases much more with the rotating speed \(\omega\). And for a point at the spiral line, the curvature k and torsion \(\tau\) could be calculated from Eq. (38).

$$\left\{ {\begin{array}{*{20}c} {\frac{1}{\rho } = k} \\ {\eta = \tau } \\ \end{array} } \right.$$
(38)

where \(1/\rho\) is the bend radii and \(\eta\) is the twisting angle per length. Combining Eqs. (38) and (35), we can get the value \(\eta\)

$$\eta = \tau = \frac{b}{{a^{2} + b^{2} }}$$
(39)

And the spiral length s is

$$s = \mathop \smallint \nolimits_{\alpha }^{\beta } \sqrt {\left( {\left( {acos\theta } \right)^{\prime } } \right)^{2} + \left( {\left( {acos\theta } \right)^{\prime } } \right)^{2} + \left( {\left( {b\theta } \right)^{\prime } } \right)^{2} } d\theta ,\theta \in \left[ {\alpha ,\beta } \right]$$
(40)

The clamp rotating speed is

$$\omega = \eta \cdot v = \frac{b}{{a^{2} + b^{2} }} \cdot v$$
(41)

After the above analyses, the relationship between geometrical parameters and initial processing parameters has been established.

4.2.3 Motion model

In the case of 3D tube forming, we choose status variables such as object position coordinates x, y, z, rotating angle \(\theta\), feeding speed v, and twisting speed \(\omega\).

$$X = [x,y,z,\theta ,v,\omega ]^{T}$$
(42)

The schematic diagram is shown in Fig. 27. Firstly, when the forming process starts, the feeding speed varies from 0 to v, then the bending die rotates to a position with the arc center angle \(\varphi_{1}\) in a short time and simultaneously clamp twists at a speed of \(\omega_{1}\). Continually feeding, the spiral no. 1 is formed, and \(\varphi_{1}\) value has changed to \(\varphi_{2}\) and \(\omega_{1}\) to \(\omega_{2}\), repeating the procedure until the last spiral section is finished.

Fig. 27
figure 27

Motion schematic of 3D tube forming

The motion equation is

$$\left\{ {\begin{array}{*{20}l} {x = a \cdot \sin (\theta + \varphi )} \\ {y = a \cdot (1 - \cos (\theta + \varphi ))} \\ {z = b \cdot \theta } \\ \begin{array}{l} \theta = \omega \cdot t \\ v = v \end{array} \\ {\omega = \omega } \end{array} } \right.$$
(43)

Through one order Taylor series approximation, then we have

$$\left\{ {\begin{array}{*{20}l} {x_{k + 1} = x_{k} + a \cdot \omega \cdot \cos (\theta + \varphi )} \hfill \\ {y_{k + 1} = y_{k} + a \cdot \omega \cdot \sin (\theta + \varphi )} \hfill \\ {z_{k + 1} = z_{k} + b \cdot \omega } \hfill \\ {\begin{array}{*{20}l} {\theta_{k + 1} = \theta_{k} + \omega } \hfill \\ {v_{k + 1} = v_{k} } \hfill \\ {\omega_{k + 1} = \omega_{k} } \hfill \\ \end{array} } \hfill \\ \end{array} } \right.$$
(44)

Making differential to state variables, we obtain the following Jacobian matrix that is the state transformation matrix.

$$F=\frac{\partial f}{\partial X}=\begin{bmatrix}1&0&0&-\alpha\cdot\omega\cdot\sin\left(\theta+\varphi\right)&0&\alpha\cdot\cos\left(\theta+\varphi\right)\\0&1&0&\alpha\cdot\omega\cdot\cos\left(\theta+\varphi\right)&0&\alpha\cdot\sin\left(\theta+\varphi\right)\\0&0&1&0&0&b\\0&0&0&1&0&1\\0&0&0&0&1&0\\0&0&0&0&0&1\end{bmatrix}$$
(45)

4.2.4 Observation model

Monitoring the formed tube, shown in Fig. 28. For point A at a certain time, the distance r from point B to point A, the angle \(\phi\) between axis z and line AB, the angle \(\psi\) between axis x, and the project of line AB to the x-o-y plane are selected as observing variables.

Fig. 28
figure 28

Schematic of monitoring the formed tube

Observation variables

$$Z = \left[ {r,\psi ,\phi } \right]$$
(46)

The relationship between observed variables and state variables

$$\left\{ {\begin{array}{*{20}l} {r = \sqrt {x^{2} + y^{2} + z^{2} } + v_{r} } \hfill \\ {\psi = \arctan (\frac{y}{x}) + v_{\psi } } \hfill \\ {\phi = \arccos (\frac{z}{{\sqrt {x^{2} + y^{2} + z^{2} } }}) + v_{\phi } } \hfill \\ \end{array} } \right.$$
(47)

Observation matrix H

$$\begin{array}{l} H = \frac{\partial h}{{\partial X}} = \hfill \\ \left[ {\begin{array}{*{20}r} \hfill {\frac{x}{{\sqrt {x^{2} + y^{2} + z^{2} } }}} & \hfill {\frac{y}{{\sqrt {x^{2} + y^{2} + z^{2} } }}} & \hfill {\begin{array}{*{20}c} {\frac{z}{{\sqrt {x^{2} + y^{2} + z^{2} } }}} & 0 & 0 \\ \end{array} } & \hfill 0 \\ \hfill {\frac{{ - y/x^{2} }}{{1 + (y/x)^{2} }}} & \hfill {\frac{1/x}{{1 + (y/x)^{2} }}} & \hfill {\begin{array}{*{20}c} 0 & 0 & 0 \\ \end{array} } & \hfill 0 \\ \hfill {\frac{{z \cdot x \cdot (\sqrt {x^{2} + y^{2} + z^{2} } )^{ - 3} }}{{1 - (\frac{z}{{\sqrt {x^{2} + y^{2} + z^{2} } }})^{2} }}} & \hfill {\frac{{z \cdot y \cdot (\sqrt {x^{2} + y^{2} + z^{2} } )^{ - 3} }}{{1 - (\frac{z}{{\sqrt {x^{2} + y^{2} + z^{2} } }})^{2} }}} & \hfill {\begin{array}{*{20}c} {\frac{{z^{2} \cdot (\sqrt {x^{2} + y^{2} + z^{2} } )^{ - 3} - (\sqrt {x^{2} + y^{2} + z^{2} } )^{ - 1} }}{{1 - (\frac{z}{{\sqrt {x^{2} + y^{2} + z^{2} } }})^{2} }}} & 0 & 0 \\ \end{array} } & \hfill 0 \\ \end{array} } \right] \hfill \\ \end{array}$$
(48)

4.2.5 Simulation and analysis

Similar to 3.3.4 regarding EKF, the co-variable matrix is \(P_{0}\) = diag[0.001,0.001,0.001,0.001,0.001,0.001], the noise observation co-variable matrix R is set as R = diag[0.1,0.1,0.1], and the co-variable matrix Q = diag[0.01,0.01,0.01,0.01,0,0]. Assuming the coordinates \(\left( {x_{i,c} ,y_{i,c} ,z_{i,c} } \right)\) are the objective point i, and the point coordinates \(\left( {x_{i,e} ,y_{i,e} ,z_{i,e} } \right)\) on the trajectory are calculated by EKF, therefore, the deviation between these two points is as follows

$$\begin{array}{*{20}c} {\Delta e_{i} = \sqrt {(x_{i,c} - x_{i,e} )^{2} + (y_{i,c} - y_{i,e} )^{2} + (z_{i,c} - z_{i,e} )^{2} } } \\ \end{array}$$
(49)

The maximum deviation is set as \(\varepsilon_{\max }\) = 3 mm, and the mean deviation \(E_{ave}\) is \(\varepsilon_{ave}\) = 2 mm. The 1st section arc is performed by processing parameters \(\alpha_{1}\) = 0.1745 rad, \(\omega_{1}\) = 0.3556 rad/s, \(v_{1}\) = 30 mm/s, and \(t_{1}\) = 2 s, simulating and monitoring the first spiral part and then finishing the filtering operation both on the established motion model and observation model taken from FEM simulation. As shown in Fig. 29, the deviation between the true shape and objective one is within the tolerance, so no adjusting operation is needed. For the second part of the spiral, the initial processing parameters are set as \(\omega_{2}\) = 0.4494 rad/s, \(v_{2}\) = 40 mm/s, and \(t_{2}\) = 2 s.

Fig. 29
figure 29

Spiral no. 1. a The first part. b Second part

Results from EKF, related to the first half of the spiral, are presented in Fig. 30a, together with objective and observation curves. The deviation between objective and EKF trajectory is becoming somewhat larger and larger along with the forming process. In this situation, an adjustment should be invoked. According to the base radii a and pitch b calculated from fitting the half EKF curve through spiral formula, it is clear that a set of smaller values of radii a and pitch b makes this kind of deviation. Through analysis, the bending angle \(\alpha_{2}^{\prime }\) = 0.6435 rad and twisting speed \(\omega_{2}^{\prime }\) = 0.4639 rad/s are carried out after several errors and tries. Figure 30b shows a better solution for the second half part of this section.

Fig. 30
figure 30

Spiral no. 2. a The first part. b Second part

A set of initial processing parameters \(\alpha_{3}\) = 0.3657 rad, \(\omega_{3}\) = 0.1838 rad/s, \(v_{3}\) = 40 mm/s, and \(t_{3}\) = 2 s is adopted for the third spiral part of the tube; the deviation concerning the first half is not within the limit value, shown in Fig. 31a; therefore, an adjustment has to be done for the second half. On the analysis similar to the second section, the base radii a should be somewhat larger. Therefore, new processing parameters \(\alpha_{3}^{\prime }\) = 0.4049 rad and \(\omega_{3}^{\prime }\) = 0.2320 rad/s are tried out, and a reasonable result is presented in Fig. 31b.

Fig. 31
figure 31

Spiral no. 3. a The first part. b Second part

Finally, the deviation cloud chart, obtained from the adjusted as well as not adjusted processing parameters, is shown in Fig. 32 respectively. Apparently, it is inspiring for us to consider this proposed processing parameter adjusting strategy.

Fig. 32
figure 32

Deviations before and after adjustment. a Before adjustment. b After adjustment

Figure 33 shows us the normalized processing parameters varying with time, the red dot line representing the adjusted die rotating and twisting values, and the black dot line the initial values.

Fig. 33
figure 33

Optimization of processing parameters

5 Discussions and conclusions

  1. 1.

    For complex tubes, according to the basic principles of free bending forming, the forming process of free bending is analyzed and the cubic B-spline curve is used to pick up the shape characteristic feature. This work lays a theoretical foundation for the subsequent correlation of geometric parameters and processing parameters.

  2. 2.

    The EKF algorithms were applied to analyze and calculate a typical nonlinear system with a concern of solving the problem of predicting the forming trajectory of the variable curvature tubes.

  3. 3.

    A finite element analysis model for the free tube bending forming is established, and the axis information of the formed tube is extracted. For typical plane curvature variable tubes, arc interpolation is used to obtain its curvature change, and its geometric parameters are obtained by segmented arc approximation; for typical spatial curvature variable tubes, its geometric parameters are obtained by segmented spiral approximation. A kinematic model and an observation model (numerical simulation) were established for the curvature variable tubes, and the EKF algorithm was used for the related calculation and process optimization, which verified the effectiveness of the algorithm in predicting the forming trajectory of the curvature variable tubes.