1 Introduction

Owing to their inherent high flexibility, excellent adaptability and natural and safe interoperability, continuum robots are receiving increasing attention in the fields of medical care [1], manipulation [2], rescue [3], inspection [4] and wearable devices [5], among others, demonstrating significant development potential [6, 7]. The rapid evolution of this technology has led to new solutions and bright prospects in the areas of safety and flexibility, which poses difficult challenges for the traditional robots operating in complex environments [8, 9]. However, the high degrees of freedom and the acting internal and external forces, still complicate the establishment of a computationally accurate and efficient kinematics model [10, 11].

Examples of continuum robot actuator modules include flexible driven rods [12,13,14] and pneumatic actuators [15,16,17]. Unlike the traditional rigid–link robots, the elasticity should actually be considered in the modeling of a continuum robot. Static analysis is carried out, instead of kinematics, in order to accurately describe the occurring deformation [18]. Desired spatial curves are described using mathematical methods, and fitting continuum robots to these curves as closely as possible. [19, 20]. The current modeling methods are mainly based on constant curvature [21] and variable curvature approaches [22].

The constant curvature approach is a simplified perception, also called the piecewise constant curvature method [14, 23]. According to this approach, a series of tangent arcs is used to approximate the configuration of the continuum robot [24]. The advantages of a simple model and easy solution make the constant curvature method widely used in the field of continuum robot modeling [25]. Based on this method, Robert et al. [26] and Rucker et al. [27] established a kinematic model of a concentric tube continuum robot, which could predict the robot deformation. Escande et al. [28] developed a model for a soft manipulator and proposed two experimental setups, in order to conduct model calibration and validation. Gong et al. [29] combined computer vision and proposed a kinematic modeling method for a three-degree-of-freedom continuum robot, grasping sea cucumbers underwater. Yang et al. [30] developed a model of a continuum robot with adjustable stiffness and analyzed the deformation of the robot under external forces.

Variable curvature approaches have also been developed, to serve in cases where the constant curvature approach is not suitable, such as when the local curvature changes greatly. Godage et al. [31] proposed a novel model for continuum robots based on mode shape functions (MSFs), which can predict robot bending very well. Gonthina et al. [32] proposed a model based on Euler spiral curve and proved the superiority of their approach, compared to the constant curvature approach. Singh et al. [33] described a model based on Pythagorean hodograph (PH) curves, which can obtain the bending deformation ofcontinuum robot in the three-dimensional space. Bieze et al. [34] presented a model based on the finite element method, which can perform forward and inverse kinematics analysis of a soft continuum robot. Huang et al. [35] considered the external forces and proposed a model based on the absolute nodal coordinates formulation. The aforementioned approaches considered the kinematics of the robot body and the influence of the load, describing the kinematics more precisely; however, they did not consider the robot-obstacle interaction.

In future applications of continuum robots, the interaction with the environment needs to be considered [36, 37], since they are susceptible to gravity and to obstacles in unstructured operating environments. Therefore, a continuum robot model should not only consider the ontology, but also focus on the influence and constraints introduced by the obstacle. The occurrence of an obstacle contact during path planning results in the advantage that it limits the uncertainty of motion [38, 39], but it also poses certain difficulties in the theoretical modeling approach. Some scholars have considered the modeling of continuum robots operating in a constrained environment. Zhang et al. [40] developed a contact model of a cable-driven continuum robot with obstacle while bending in a two-dimensional plane, which can calculate the contact force of the robot without the need of force sensor. Yip et al. [41] achieved the first model-free control method based on the interaction between a continuum robot and constrained environment. Chen et al. [42] proposed a 1-DOF pneumatic soft robot modelling method for contact detection and contact position estimation, and the algorithm was able to successfully estimate the contact position. Della Santina et al. [43] considered the impact of environmental constraints on the robot endpoint moving in a two-dimensional space. They proposed an alternative formula for the dynamics of robots and introduced two control frameworks to achieve more accurate curvature control. Greer et al. [44] studied the obstacle avoidance problem in the case of continuum robots operating in a chaotic environment. They exploited the contact to avoid obstacle when it was beneficial for navigation. However, continuum robots inevitably encounter situations, wherein they need to bypass obstacles, while operating in a three–dimensional space. Moreover, existing modeling methods are ineffective in solving this problem, thus motivating for the present study.

This work investigated a continuum robot variable curvature modeling method, which considered environmental constraints. At first, an unconstrained continuum robot model with boundary conditions was established. Next, a model with obstacle constraint was established, by describing the robot-obstacle contact occurrence using an inequality function. Based on the least squares method, the solution of equations system was coverted into a constrained nonlinear optimization problem. The Lagrange multiplier method and Levenberg–Marquarelt (LM) algorithm were used to solve the model. The configurations of the continuum robot were obtained by interpolation and fitting the discrete nodes. A novel 10-section continuum robot prototype, driven by origami airbags, was developed, along with the design of a control system. The theoretical model was verified experimentally.

This paper is organized as follows: in Sect. 2, a quasi-static model of a continuum robot is established and the solution method is introduced. Section 3 describes the development of a continuum robot prototype with 10 sections, driven by origami airbags, used in three sets of experiments, in order to verify the proposed model. Finally, the conclusion is presented in Sect. 4.

2 Modeling

2.1 Main model

A continuum robot driven by origami airbags (OAs) generally consists of several sections, which is composed of two constraint disks and three OAs, which are juxtaposed in each section apart, as shown in Fig. 1. The backbone, which is located at the center of the constraint disk, typically uses an elastic rod. The working principle of the drive OAs is that the working length can be changed, so the structure with telescopic function can be used as a drive actuator. The configuration of the backbone can be used as the configuration of the robot because the structure of the robot has a symmetric distribution.

Fig. 1
figure 1

Generalized structure of continuum robot driven by OAs

As depicted in Fig. 2, a continuum robot is discretized into n elements, and \(N_{i}\) represents the ith nodes. The spindle coordinate system of \(N_{i}\) is \(N_{i} - x_{i} y_{i} z_{i}\). The gravitational force of the robot is \(f_{g}\), and the contact force \(f_{c,i}\) are applied at \(N_{i}\). The position vector of \(N_{i}\) in the inertial coordinate system \(O - XYZ\) is \({\varvec{r}}_{i}\). The sectional angular displacement is defined as \(\Delta \boldsymbol{\varphi }\). The robot length between \(N_{i - 1}\) and \(N_{i}\) is \(l_{r}\), \(l_{r} = L/n\), where L denotes the length of the robot. There are m constraint disks, where the section between \(disk_{i - 1}\) and \(disk_{i}\) is called \(Sec_{i}\). Evidently, there are b (\(b = n/m\)) nodes in \(Sec_{i}\). The length of \(OA_{j}\) in \(Sec_{i}\) is \(l_{i,j}\).

Fig. 2
figure 2

Geometric schematic view used to describe a continuum robot

The configuration of the robot can be determined from the pose matrix R and the position vector r of these nodes. The arc coordinates are designated as s, \(s \in \left[ {0,L} \right]\). Let

$${\varvec{Q}} = \left[ {\begin{array}{*{20}c} {\varvec{R}} & {\varvec{r}} \\ 0 & 1 \\ \end{array} } \right].$$
(1)

The advantages of quaternions to avoid singular solutions are more suitable for numerical calculations [45]. Therefor, R can be represented by quaternions \({\varvec{q}} = \left[ {\begin{array}{*{20}c} {q_{1} } & {q_{2} } & {q_{3} } & {q_{4} } \\ \end{array} } \right]^{\text{T}}\):

$${\varvec{R}}(s) = \left[ {\begin{array}{*{20}c} {q_{1}^{2} + q_{2}^{2} - q_{3}^{2} - q_{4}^{2} } & {2(q_{2} q_{3} - q_{1} q_{4} )} & {2(q_{2} q_{4} + q_{1} q_{3} )} \\ {2(q_{2} q_{3} + q_{1} q_{4} )} & {q_{1}^{2} - q_{2}^{2} + q_{3}^{2} - q_{4}^{2} } & {2(q_{3} q_{4} - q_{1} q_{2} )} \\ {2(q_{2} q_{4} - q_{1} q_{3} )} & {2(q_{3} q_{4} + q_{1} q_{2} )} & {q_{1}^{2} - q_{2}^{2} - q_{3}^{2} + q_{4}^{2} } \\ \end{array} } \right].$$
(2)

The position vector r can be obtained by integrating the third column of the pose matrix R:

$${\varvec{r}}(s) = \left[ {\begin{array}{*{20}c} {X(s)} \\ {Y(s)} \\ {Z(s)} \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {2\int_{0}^{s} {(q_{2} (\sigma )q_{4} (\sigma ) + q_{1} (\sigma )q_{3} (\sigma )) \, {\rm d}\sigma } } \\ {2\int_{0}^{s} {(q_{3} (\sigma )q_{4} (\sigma ) - q_{1} (\sigma )q_{2} (\sigma )) \, {\rm d}\sigma } } \\ {\int_{0}^{s} {(q_{1}^{2} (\sigma ) - q_{2}^{2} (\sigma ) - q_{3}^{2} (\sigma ) + q_{4}^{2} (\sigma )) \, {\rm d}\sigma } } \\ \end{array} } \right],$$
(3)

where \(\sigma\) denotes the integral variable.

Suppose the Young’s modulus of the continuum robot is E, shear modulus is G, the diameter of backbone is \(d_{e}\). the diameter of robot is \(d\). The rate of change of \(\Delta \boldsymbol{\varphi }\) relative to s is defined as \({\varvec{\omega}}\):

$${\varvec{\omega}} = \mathop {\lim }\limits_{\Delta s \to 0} \frac{{\Delta \boldsymbol{\varphi }}}{\Delta s}.$$
(4)

The values of \({\varvec{\omega}}\) and q satisfy

$${\varvec{\omega}} = \boldsymbol{\Gamma q^{\prime},}$$
(5)

where \(\boldsymbol{q^{\prime}} = \frac{{{\rm d}{\varvec{q}}}}{{{\rm d}s}}\), and

$${\varvec{\varGamma}}= 2\left[ {\begin{array}{*{20}c} {\begin{array}{*{20}c} { - q_{2} } & {q_{1} } \\ \end{array} } & {q_{4} } & { - q_{3} } \\ {\begin{array}{*{20}c} { - q_{3} } & { - q_{4} } \\ \end{array} } & {q_{1} } & {q_{2} } \\ {\begin{array}{*{20}c} { - q_{4} } & {q_{3} } \\ \end{array} } & { - q_{2} } & {q_{1} } \\ \end{array} } \right].$$
(6)

The total elastic potential energy, \(E_{t}\), of the continuum robot includes elastic strain energy \(E_{e}\) and external force potential energy \(E_{p}\). The variation in \(E_{p}\) represents the negative value of the external force virtual work, \(\delta E_{p} = - \delta W\). When there is no obstacle constraint, the virtual work of external force is \(\delta W\) the virtual work of gravity \(\delta W_{g}\). Thus, the variation of \(E_{t}\) is found as follows:

$$\delta E_{t} = \delta E_{e} - \delta W_{g} .$$
(7)

When the robot is in balance,

$$\delta E_{t} = 0.$$
(8)

The elastic strain energy can be obtained as follows:

$$E_{e} = \frac{1}{2}\int_{0}^{L} {(k_{x} \omega_{x}^{2} + k_{y} \omega_{y}^{2} + k_{z} \omega_{z}^{2} {) }{\rm d}s} ,$$
(9)

where \((k_{x} ,k_{y} ,k_{z} )\) represents the bending stiffness around the coordinate axis.

$$k_{x} = E\frac{{\pi d_{e}^{4} }}{64}\quad k_{y} = E\frac{{\pi d_{e}^{4} }}{64}\quad k_{z} = G\frac{{\pi d_{e}^{4} }}{32}.$$
(10)

Substituting Eq. (5) into Eq. (9), the \(E_{e}\) can be rewritten as follows:

$$E_{e} = \frac{1}{2}\int_{0}^{L} {{\rm (}{\varvec{\omega}}^{{\rm T}} \boldsymbol{D\omega }{\rm ) d}s} ,$$
(11)

where \({\varvec{D}} = {\rm diag}(k_{x} \, k_{y} \, k_{z} )\).

Consider the variation of Eq. (11),

$$\delta E_{e} = \int_{0}^{L} {\left[ {\left( {\boldsymbol{D\omega }} \right)^{{\rm T}} \delta {\varvec{\omega}}} \right]{\rm d}s} ,$$
(12)

where \(\delta {\varvec{\omega}}\) can be obtained from Eq. (5)

$$\delta {\varvec{\omega}} ={\varvec{\varGamma}}\delta \boldsymbol{q^{\prime}} - \boldsymbol{\Gamma^{\prime}}\delta {\varvec{q}}\boldsymbol{.}$$
(13)

Suppose that q at the \(N_{i}\) is \({\varvec{q}}_{i} (s)\),

$${\varvec{q}}_{i} (s) = \left[ {\begin{array}{*{20}c} {q_{1,i} } & {q_{2,i} } & {q_{3,i} } & {q_{4,i} } \\ \end{array} } \right]^{{\rm T}} .$$
(14)

The forward difference scheme is used to calculate the derivative of \(q_{k,i} (k = 1,2,3,4)\):

$$q^{\prime}_{k,i} = \frac{{q_{k,i} - q_{k,i - 1} }}{2}\quad (i \ge 1).$$
(15)

The q values at the \(N_{i - 1}\) and \(N_{i}\) are combined into an 8 order array as follows:

$${\varvec{q}}_{i - 1,i} = \left( {\begin{array}{*{20}c} {{\varvec{q}}_{i - 1}^{{\rm T}} } & {{\varvec{q}}_{i}^{{\rm T}} } \\ \end{array} } \right)^{{\rm T}} .$$
(16)

Then, \({\varvec{q}}_{i}\) and \(\boldsymbol{q^{\prime}}_{i}\) can be expressed with \({\varvec{q}}_{i - 1,i}\) as follows:

$${\varvec{q}}_{i} {\rm = }\boldsymbol{\Psi q}_{i - 1,i} \quad \boldsymbol{q^{\prime}}_{i} = \boldsymbol{\Phi q}_{i - 1,i} ,$$
(17)

where \({\varvec{\varPsi}}\) and \({\varvec{\varPhi}}\) are \(4 \times 8\) matrices composed of 4 order zero matrix \(\boldsymbol{\rm O}_{4}\) and identity matrix \({\varvec{E}}_{4}\), respectively.

$${\varvec{\varPsi}}= \left[ {\begin{array}{*{20}c} {\boldsymbol{\rm O}_{4} } & {{\varvec{E}}_{4} } \\ \end{array} } \right]\quad{\varvec{\varPhi}}= \frac{1}{{l_{r} }}\left[ {\begin{array}{*{20}c} {\boldsymbol{ - {\rm E}}_{4} } & {{\varvec{E}}_{4} } \\ \end{array} } \right].$$
(18)

From Eqs. (5), (13) and (17), the \({\varvec{\omega}}\) and \(\delta {\varvec{\omega}}\) can be written as:

$${\varvec{\omega}} = \boldsymbol{\Gamma \Phi q}_{i - 1,i} \, \delta {\varvec{\omega}} = \boldsymbol{\Gamma \Phi }\delta {\varvec{q}}_{i - 1,i} - \boldsymbol{\Gamma^{\prime}\Psi }\delta {\varvec{q}}_{i - 1,i} .$$
(19)

Substituting Eq. (19) into Eq. (12), the strain energy of the robot can be discretized as follows:

$$\delta E_{e} = \sum\limits_{i = 1}^{n} {({\varvec{q}}_{i - 1,i}^{{\rm T}}{\varvec{\varPhi}}^{{\rm T}}{\varvec{\varGamma}}_{i}^{{\rm T}} {\varvec{D}}^{{\rm T}} )({\varvec{\varGamma}}_{i}{\varvec{\varPhi}}- \boldsymbol{\Gamma^{\prime}}_{i}{\varvec{\varPsi}})} \delta {\varvec{q}}_{i - 1,i} .$$
(20)

Then, Eq. (20) can be abbreviated as follows:

$$\delta E_{e} = \sum\limits_{i = 1}^{n} {({\varvec{q}}_{i - 1,i}^{{\rm T}} {\varvec{K}}_{i} )\delta {\varvec{q}}_{i - 1,i} } ,$$
(21)

where

$$\boldsymbol{\rm K}_{i} {\rm = }{\varvec{\varPhi}}^{{\rm T}}{\varvec{\varGamma}}_{i}^{{\rm T}} {\varvec{D}}^{{\rm T}} ({\varvec{\varGamma}}_{i}{\varvec{\varPhi}}- \boldsymbol{\Gamma^{\prime}}_{i}{\varvec{\varPsi}}).$$
(22)

The quaternions at the \(N_{i + 1}\) are arranged into \(4(n + 1)\) order arrays, \({\varvec{q}}_{a}\), as follows:

$${\varvec{q}}_{a} = \left( {\begin{array}{*{20}c} {{\varvec{q}}_{1}^{{\rm T}} } & {{\varvec{q}}_{2}^{{\rm T}} } & \cdots & {{\varvec{q}}_{n + 1}^{{\rm T}} } \\ \end{array} } \right)^{{\rm T}} .$$
(23)

The n matrices \({\varvec{K}}_{i}\) are arranged diagonally. The starting point of each unit and the ending point of the previous unit are the same. Thus, each matrix is moved by four rows and columns to the top and left. Then, the first four rows and columns of \({\varvec{K}}_{i}\) overlap with the last four rows and columns of \({\varvec{K}}_{i - 1}\), and the elements of the overlapping part are added one by one to form the \(4(n + 1) \times 4(n + 1)\) order matrix K. Subsequently, Eq. (21) can be expressed as follows:

$$\delta E_{e} = ({\varvec{q}}_{a}^{{\rm T}} {\varvec{K}})\delta {\varvec{q}}_{a} .$$
(24)

When the robot is not considered to be in contact with the obstacle, the external force \({\varvec{f}}_{c}\) can be ignored. The virtual work of gravity force is found as follows:

$$\delta W_{g} = \int_{0}^{L} {{\varvec{f}}_{g}^{{\rm T}} \delta {\varvec{r}} \, {\rm d}s} ,$$
(25)

where \(\delta {\varvec{r}}\) denotes the virtual displacement.

Appling the Simpson interpolation formula to Eq. (3) produces the following:

$$\left\{ \begin{array}{ll} X_{i} = \frac{{l_{r} }}{3}((2q_{2,i - 1} + q_{2,i} )q_{4,i - 1} + (2q_{2,i} + q_{2,i - 1} )q_{4,i} \\ + (2q_{1,i - 1} + q_{1,i} )q_{3,i - 1} + (2q_{1,i} + q_{1,i - 1} )q_{3,i} ) + X_{i - 1} \\ Y_{i} = \frac{{l_{r} }}{3}((2q_{3,i - 1} + q_{3,i} )q_{4,i - 1} + (2q_{3,i} + q_{3,i - 1} )q_{4,i} \\ - (2q_{1,i - 1} + q_{1,i} )q_{2,i - 1} - (2q_{1,i} + q_{1,i - 1} )q_{2,i} ) + Y_{i - 1} \\ Z_{i} = \frac{{l_{r} }}{3}(q_{1,i - 1}^{2} + q_{1,i - 1} q_{1,i} + q_{1,i}^{2} - q_{2,i - 1}^{2} - q_{2,i - 1} q_{2,i} - q_{2,i}^{2} \\ - q_{3,i - 1}^{2} - q_{3,i - 1} q_{3,i} - q_{3,i}^{2} + q_{4,i - 1}^{2} + q_{4,i - 1} q_{4,i} + q_{4,i}^{2} ) + Z_{i - 1} \\ \end{array} \right..$$
(26)

Then, \({\varvec{r}}_{i}\) can be expressed by \({\varvec{U}}_{i}\) as follows:

$${\varvec{r}}_{i} = \frac{1}{3}l_{r} \sum\limits_{j = 1}^{i} {{\varvec{U}}_{j} {\varvec{q}}_{j - 1,j} } ,$$
(27)

where

$${\varvec{U}}_{i}^{(1)} = \left[ {\begin{array}{*{20}r} \hfill {2q_{3,i - 1} } & \hfill {2q_{4,i - 1} } & \hfill {q_{1,i} } & \hfill {q_{2,i} } \\ \hfill { - 2q_{2,i - 1} } & \hfill { - q_{1,i} } & \hfill {2q_{4,i - 1} } & \hfill {q_{3,i} } \\ \hfill {q_{1,i - 1} + q_{1,i} } & \hfill { - (q_{2,i - 1} + q_{2,i} )} & \hfill { - (q_{3,i - 1} + q_{3,i} )} & \hfill {q_{4,i - 1} + q_{4,i} } \\ \end{array} } \right]$$
$${\varvec{U}}_{i}^{(2)} = \left[ {\begin{array}{*{20}r} \hfill {2q_{3,i} } & \hfill {2q_{4,i} } & \hfill {q_{1,i - 1} } & \hfill {q_{2,i - 1} } \\ \hfill { - 2q_{2,i} } & \hfill { - q_{1,i - 1} } & \hfill {2q_{4,i} } & \hfill {q_{3,i - 1} } \\ \hfill {q_{1,i} } & \hfill {q_{2,i} } & \hfill {q_{3,i} } & \hfill {q_{4,i} } \\ \end{array} } \right]$$
$${\varvec{U}}_{i} = \left[ {\begin{array}{*{20}c} {{\varvec{U}}_{i}^{(1)} } & {{\varvec{U}}_{i}^{(2)} } \\ \end{array} } \right].$$
(28)

Matrices \({\varvec{U}}_{i}\) are arranged horizontally, where each matrix is moved by four columns to the left to form matrix U. Then, Eq. (25) can be abbreviated as follows:

$$\delta W_{g} = {\varvec{f}}_{g}^{{\rm T}} {\varvec{U}}\delta {\varvec{q}}_{a} .$$
(29)

From Eqs. (24) and (29), the variation of \(E_{t}\) is as follows:

$$\delta E_{t} = ({\varvec{q}}_{a}^{{\rm T}} {\varvec{K}} + {\varvec{f}}_{g}^{{\rm T}} {\varvec{U}}{\rm )}\delta {\varvec{q}}_{a} .$$
(30)

The following can be obtained from the robot balance condition Eq. (8):

$${\varvec{q}}_{a}^{{\rm T}} {\varvec{K}} + {\varvec{f}}_{g}^{{\rm T}} \boldsymbol{U = }{\mathbf{0}}{\mathbf{.}}$$
(31)

Equation (31) is the unconstrained model of the robot.

2.2 Boundary conditions

When the robot runs along the pre-designed path, \({\varvec{P}}_{Des}\), it is necessary to add the boundary conditions of the robot’s endpoint position.

$${\varvec{r}}_{n} = {\varvec{P}}_{Des}$$
(32)

2.3 Quasi-static model without obstacle constraints

Equations (31) and (32) constitute the unconstrained quasi-static model of the soft continuum robot.

$${\varvec{f}}({\varvec{q}}_{a} ) = \left[ {\begin{array}{*{20}c} {{\varvec{q}}_{a}^{{\rm T}} {\varvec{K}} + {\varvec{f}}_{g}^{{\rm T}} {\varvec{U}}} \\ {{\varvec{r}}_{n} - {\varvec{P}}_{Des} } \\ \end{array} } \right] = {\mathbf{0}}$$
(33)

Using the least-squares method, the solution of Eq. (33) can be solved by LM optimization, and the LM algorithm flow is shown in Table 1, which could been implemented in MATLAB. In the LM algorithm, \(\varepsilon\) is a very small number, and \(\alpha\), \(\beta\), \(\mu\) and \(w\) are parameters, where \(\alpha = 0.4\), \(\beta = 0.55\), \(\mu = 0.1\) and \(w = 2\). Substituting the solution into Eq. (26) makes it possible to obtain the positions of each node, and the robot configuration can be obtained by interpolation fitting.

Table 1 LM algorithm flow

2.4 Quasi-static model with obstacle constraints

A continuum robot is subjected to multiple types of constraints in the environment, mainly including the point, plane and surface constraints, where the surface constraints are the most complex. This study considered the cylinder constraint as an example, which is also the most common constraint in actual work, establishing a model with obstacle constraints.

A schematic diagram of a robot with the cylinder constraint is shown in Fig. 3. Because the actual calculation is for the configuration of the robot centerline, when considering environmental constraints, the diameter of the robot cannot be ignored. Suppose that the actual diameter of the constrained cylinder is \(w_{1}\), but calculated diameter \(w_{2}\) is used as a variable, \(w_{2} = w_{1} + d/2\). Part of the robot nodes is in contact with the constrained surface. Consider \(N_{i}\) as an example, which is simultaneously subjected to the force of gravity, \(f_{g}\), and the force of the contact surface, \(f_{c}\). The direction of \(f_{c}\) is the same as that of \({\varvec{n}}_{c}\), which is the normal vector of the cylinder at \(N_{i}\).

Fig. 3
figure 3

Schematic of continuum robot with cylinder constraint

When the robot is in contact with the constrainted surface, the influence of \(f_{c}\) on the system energy needs to be considered. Suppose the set of nodes in contact with the constrained surface is \({\varvec{\varOmega}}\). The virtual work of the \({\varvec{f}}_{c}\) is:

$$\delta W_{c} = \sum\limits_{{i \in{\varvec{\varOmega}}}} {{\varvec{f}}_{c,i}^{{\rm T}} \cdot \delta {\varvec{r}}_{i} } .$$
(34)

The method of forming matrix \({\varvec{U}}_{c,i}\) is similar to the calculation of matrix U, but there are some difference. Matrices \({\varvec{U}}_{c,j} (j \le i)\) are arranged horizontally, where each matrix is moved by four columns to the left to form matrix \({\varvec{U}}_{c,i}\). \({\varvec{U}}_{c,i}\) is a \(3 \times 4(i + 1)\) order matrix, expanding \({\varvec{U}}_{c,i}\) to a \(3 \times 4(n + 1)\) order matrix, as shown in follows:

$${\varvec{U}}_{c,i} = \left[\begin{array}{*{20}c} {{\varvec{U}}_{c,i} } & {{\varvec{O}}_{3 \times 4(n - i)} } \\ \end{array} \right],$$
(35)

where \({\varvec{O}}_{3 \times 4(n - i)}\) is \(3 \times 4(n - i)\) order zero matrix.

Substituting Eq. (35) into Eq. (34), the virtual work of \({\varvec{f}}_{c}\) is:

$$\delta W_{c} = \sum\limits_{{i \in{\varvec{\varOmega}}}} {{\varvec{f}}_{c,i}^{{\rm T}} {\varvec{U}}_{c,i} \delta {\varvec{q}}_{a} } .$$
(36)

The variation of \(E_{t}\) needs to be adjusted to Eq. (37).

$$\delta E_{t} = \left({\varvec{q}}_{a}^{{\rm T}} {\varvec{K}} + {\varvec{f}}_{g}^{{\rm T}} {\varvec{U}} + \sum\limits_{{i \in{\varvec{\varOmega}}}} {{\varvec{f}}_{c,i}^{{\rm T}} {\varvec{U}}_{c,i} } \right)\delta {\varvec{q}}_{a} .$$
(37)

Then the balance equation is:

$${\varvec{q}}_{a}^{{\rm T}} {\varvec{K}} + {\varvec{f}}_{g}^{{\rm T}} {\varvec{U}} + \sum\limits_{{i \in{\varvec{\varOmega}}}} {{\varvec{f}}_{c,i}^{{\rm T}} {\varvec{U}}_{c,i} } = {\mathbf{0}}{\mathbf{.}}$$
(38)

In addition, because the robot cannot cross the constraint surface, the configuration should also meet geometric constraints. The equation for a cylinder is denoted as:

$$c(X,Y,Z) = 0.$$
(39)

The normal vector \({\varvec{n}}_{c}\) at any point on the cylinder is:

$${\varvec{n}}_{c} = \left[ {\begin{array}{*{20}c} {\frac{\partial c}{{\partial X}}} & {\frac{\partial c}{{\partial Y}}} & {\frac{\partial c}{{\partial Z}}} \\ \end{array} } \right]^{{\rm T}} .$$
(40)

From Eq. (2), the direction vector T at any node of the robot is:

$${\varvec{T}} = \left[ {\begin{array}{*{20}c} {2(q_{2} q_{4} + q_{1} q_{3} )} & {2(q_{3} q_{4} - q_{1} q_{2} )} & {q_{1}^{2} - q_{2}^{2} - q_{3}^{2} + q_{4}^{2} } \\ \end{array} } \right]^{{\rm T}} .$$
(41)

When the robot is in contact with the constraint surface,\({\varvec{f}}_{c} \ne 0\) but \(c(X,Y,Z) = 0\). In this situation, the direction of the robot is orthogonal to the surface, \({\varvec{n}}_{c} \cdot {\varvec{T}} = 0\). When the robot is detached from the constraint surface, \({\varvec{f}}_{c} = {\mathbf{0}}\), but \(c(X,Y,Z) \ne 0\), and the value of \({\varvec{n}}_{c} \cdot {\varvec{T}}\) is uncertain. Thus, (41) is valid for any situations of the robot:

$$v_{i} = f_{c,i} \cdot c_{i} + f_{c,i} \cdot ({\varvec{n}}_{c} \cdot {\varvec{T}}_{i} ) = 0.$$
(42)

Because the robot is always outside the constraint surface, any nodes \(N_{i}\) also needs to satisfy Eq. (43).

$$c(X_{i} ,Y_{i} ,Z_{i} ) \ge 0$$
(43)

Let v and c be sets found using of Eqs. (42) and (43) and composed of all the nodes in \({\varvec{\varOmega}}\), respectively.

$${\varvec{v}} = \left[ {\begin{array}{*{20}c} {v_{i1} } \\ \vdots \\ {v_{ih} } \\ \end{array} } \right] = {\mathbf{0}} \, {\varvec{c}} = \left[ {\begin{array}{*{20}c} {c_{i1} } \\ \vdots \\ {c_{ih} } \\ \end{array} } \right] \ge {\mathbf{0}}\quad (i1, \ldots ,ih) \in{\varvec{\varOmega}}$$
(44)

Then, Eqs. (32), (38) and (44) constitute the constraint model of the soft continuum robot.

$$\left\{ \begin{gathered} {\varvec{q}}_{a}^{{\rm T}} {\varvec{K}} + {\varvec{f}}_{g}^{{\rm T}} {\varvec{U}} + \sum\limits_{{i \in{\varvec{\varOmega}}}} {{\varvec{f}}_{c,i}^{{\rm T}} {\varvec{U}}_{c,i} } = {\mathbf{0}} \hfill \\ {\varvec{r}}_{n + 1} - {\varvec{P}}_{Des} = {\mathbf{0}} \hfill \\ {\varvec{v}} = {\mathbf{0}} \hfill \\ {\varvec{c}} \ge {\mathbf{0}} \hfill \\ \end{gathered} \right.$$
(45)

To solve Eq. (45) effectively, the Lagrange multiplier method is used to transform the inequality into an equality:

$$\rho {\varvec{c}} - {\varvec{\lambda}}^{(k)} = {\mathbf{0,}}$$
(46)

where \(\rho\) denotes the penalty factor, \({\varvec{\lambda}}^{(k)}\) is updated during each iteration, k represents the kth iteration, and the updating criterion is as follows:

$${\varvec{\lambda}}^{(k + 1)} = \left| {\rho {\varvec{c}} - {\varvec{\lambda}}^{(k)} } \right|.$$
(47)

After the transformation, only the equality in Eq. (45) remains, and the the constraint model could be written as:

$${\varvec{f}}\left( {{\varvec{q}}_{a} } \right) = \left[ {\begin{array}{*{20}c} {{\varvec{q}}_{a}^{{\rm T}} {\varvec{K}} + {\varvec{f}}_{g}^{{\rm T}} {\varvec{U}} + \sum\limits_{{i \in{\varvec{\varOmega}}}} {{\varvec{f}}_{c,i}^{{\rm T}} {\varvec{U}}_{c,i} } } \\ {{\varvec{r}}_{n + 1} - {\varvec{P}}_{Des} } \\ {\varvec{v}} \\ {\rho {\varvec{c}} - {\varvec{\lambda}}^{(k)} } \\ \end{array} } \right] = {\mathbf{0}}{\mathbf{.}}$$
(48)

Equation (48) could be solved by LM algorithm, as shown in Table 1.

When there is a constraint surface, firstly assuming that the obstacle constraint does not exist, and calculating the robot configuration. When the distance between a node and the axis of the obstacle cylinder is less than the radius of the cylinder, which means that the node passes through the obstacle, and the node is defined as an “interference node”. Let \({\varvec{\varOmega}}\) be the set of interference nodes, and calculate Eq. (48). If there are still exit some interference nodes in the calculation result, update \({\varvec{\varOmega}}\) and Eq. (47) and calculate Eq. (48) again. Repeat this step until \({\varvec{\varOmega}}= \emptyset\). The solving algorithm of soft continuum robot constraint model is shown in Table 2.

Table 2 Solving algorithm of soft continuum robot constraint model

3 Results

3.1 Experiment preparation

At first, a continuum robot prototype driven by OAs was developed. Each section was driven by three airbags, and the lengths of the airbags could be varied by inflating or deflating them [46, 47]. The backbone of the robot was made up of an elastic rod. Based on the above structural design, a prototype with 10 sections was developed. The robot was covered with a woven net. The experimental platform was composed of a continuum robot, a camera, and driving components, as illustrated in Fig. 4a. The drive component could be divided into two parts that were used for airbag inflation and deflation. The control system comprised upper computer (PC), lower computer (STM32), relays, and solenoid valves, as depicted in Fig. 4b. The upper computer control program was written in VC++ and communicated with the lower computer via Bluetooth. A group of relays and solenoid valves (30 each) were connected to an air compressor to inflate the airbags, with another group connected to a vacuum pump to deflate them, as depicted in Fig. 4(c). Installing pressure-regulating valves on the air compressors and vacuum pumps enabled precise control of the inflation/deflation speed. The camera, which could detect the space environment, was installed at the endpoint of the robot. An electromagnetic sensor (3D Guidance trakSTAR) could detect the position of robot endpoint. Only the inflation/deflation time is required to control the airbag length. The relationship between the airbag length and the inflation/deflation time was measured, as shown in Fig. 5. The parameters of the robot and algorithm are shown in Table 3.

Fig. 4
figure 4

a Illustration of the experimental platform. b Schematic of control components. c Flowchart of control system. The thin blue line represents the direction of the electrical signal transmission, and the thick purple line represents the direction of the airflow. BC bluetooth communication, AC air compressor, PRV pressure-regulating valve, SV solenoid valve, VP vacuum pump (Color figure online)

Fig. 5
figure 5

Variation in the length of the airbag under the conditions of inflation (red line) and deflation (blue line). The maximum length of a single airbag is 100 mm, and minimum length is 35 mm (Color figure online)

Table 3 Robot and algorithm parameters

For the continuum robot model, it was only possible to calculate the numerical solution, without being able to obtain an analytical solution. Therefore, thecontinuum robot model inevitably had calculation errors. Specifically, for point P in the task space, the solution obtained by solving the inverse kinematics model could be introduced to the forward kinematics model to obtain \(P^{\prime}\), but P and \(P^{\prime}\) were not completely coincident. The error in the Euclidean distance between P and \(P^{\prime}\) was defined as the model error, \(e_{m}\).

The number of elements had an important influence on \(e_{m}\). In order to select the most appropriate number of elements. The \(e_{m}\) values and calculation times are depicted in Fig. 6. It is generally believed that a large number of elements produces a more model accurate model. However, the calculations in this study indicated that when the number of elements increased from 5 to 20, \(e_{m}\) gradually decreased, but when the number increased from 20 to 50, \(e_{m}\) gradually increased. This was because although additional elements could describe the robot more accurately, they also substantially increased the dimensionality and enhanced the nonlinearity of the equations, which reduced the accuracy of convergence. The calculation time is proportional to the number of units. When the number of elements was 20, the calculation time was 3.04 ms. Therefore, the influence of the model error and calculation time were comprehensively considered, and 20 was selected as the optimal number of model elements.

Fig. 6
figure 6

Model error and calculation time values with different numbers of elements

3.2 Experiment 1—moving to target points

Based on the unconstrained model Eq. (33), an experiment involving “moving to target points” was firstly conducted with five target points. The positions of the target points were introduced into the model as boundary conditions, and the calculated results were applied to control the robot to move to the target points. The endpoint position was measured with an electromagnetic sensor and output to the computer. Comparisons between the simulation and experimental results are depicted in Fig. 7. In the experiment, we placed a ping pong ball at the target point to clarify the location of the target points. The simulation of the robot configurations matches the experimental results well.

Fig. 7
figure 7

a Simulation results for robot configurations with different target points. b Comparison of the simulation and the experimental results for the endpoint positions. Ex_Results 1, 2 and 3 are the experimental results of model 1, 2 and 3. c Experimental photos of the proposed model

The ratio of the Euclidean distance between the actual position of the endpoint and the target point to the length of the robot is defined as the error. We compared the control effect of robot with other two commonly used model—piecewise constant curvature method and Cosserat rod method. The proposed model, piecewise constant curvature method and Cosserat rod method are named model 1, 2 and 3, respectively. Figure 8 shows the errors of the robot endpoints corresponding to different target points. The errors, which named Errors 1, 2 and 3, are 2.02%, 2.97% and 2.54% of the model 1, 2 and 3, respectively.

Fig. 8
figure 8

Endpoints errors of different modelling methods

3.3 Experiment 2—complex trajectory tracking (“SIA”)

Specific path tasks must often be accomplished for a soft continuum robot, which can be discretized into a series of target points. Thus, it was only necessary to “moving to target points”, which could be achieved by the proposed model, as demonstrated in experiment 1. At First, The paths for the three letters “SIA” were defined, with “S” and “A” discretized into 10 points, and “I” discretized into 5 points. Then, all the points were calculated. The theoretical predicted values and experimental results of the robot configurations and paths are depicted in Fig. 9, and the endpoint position errors are shown in Fig. 10. The average position errors of the model 1, 2, and 3 are 2.07%, 3.05% and 2.54%, respectively.

Fig. 9
figure 9

ac Show the soft continuum robot simulation configurations for “S”, “I”, and “A”, respectively. df Show the simulation and experimental paths for the endpoints of “S”, “I” and “A”, respectively. gi Show the experimental photographs of the paths for “S”, “I”, and “A”, respectively. Ex_Results 1, 2 and 3 are the experimental results of model 1, 2 and 3, respectively. In gi, the red arrows indicate the positions being passed, dark blue arrows indicate the positions that have been passed, and the light blue arrows indicate the positions that have not yet been passed (Color figure online)

Fig. 10
figure 10

Errors for endpoints of complex paths—“SIA”

3.4 Experiment 3—contact with obstacles

Continuum robots inevitably encounter obstacle constraints when moving in cluttered environments, and such constraints typically have a serious impact on robot motion. Based on the proposed obstacle constraint model for continuum robots, two experiments were conducted with spatial cylindrical constraints. First, constrained cylinder and target points were defined in a three-dimensional space. The proposed model was then used to calculate and control the motion of the robot, which needed to bypass the obstacles to reach the target points. Two sets of experiments (E3.1 and E3.2) were conducted to define two different sets of cylindrical constraints and target points, respectively. The axis of the space cylinder in the first and second sets of experiments are \(- 1.42y + z + 37.79 = 0\) and \(1.42y + z + 37.79 = 0\), respectively. The radius is 7 cm. The simulation and experimental results of the robot configurations are shown in Fig. 11, where it can be observed that the simulation and experimental results are considerably close. The endpoint position errors when reaching the target points in the first and second sets of experiments were 2.386% and 2.262%, respectively, and the average value of the error was 2.446%, as depicted in Fig. 12.

Fig. 11
figure 11

a, c Are depict simulation results for the configuration of the robot with an obstacle in the first and second sets, respectively. In a, point 1 represents the initial state of the robot, and when the robot moves to points 2–5 it makes contact with the obstacle (cylindrical constraint). In c, point represents the initial state of the robot, and when the robot moves to points 7–10 it makes contact with the obstacle. b, d Show the comparisons between the theoretical and experimental results in the first and second sets, respectively. e, f Show the experimental photographs for the first and second sets, respectively

Fig. 12
figure 12

Errors for endpoints with cylindrical obstacle constraints

3.5 Discussion

Three sets of experiments were conducted to validate the proposed model. For the case without obstacle constraints, the mean errors of the robot endpoints corresponding to the proposed model, piecewise constant curvature method and Cosserat rod method, are 2.045%, 3.01%, and 2.54%, respectively. Compared with the other two models, the proposed model has higher accuracy. For the case with an obstacle constraint, the mean error of the robot endpoint was 2.446%. According to the experimental results, the proposed model could predict the robot configuration and control the robot endpoint move to the target points well. When there was an obstacle constraint, the obstacle had an important influence on the robot configuration, which proved the necessity of the theoretical modeling in this study.

4 Conclusion

This work investigated a variable-curvature modelling method of soft continuum robots based on the principle of virtual work, and an obstacle constraint model was established. The proposed model could be used for motion control effectively.

The proposed model could be used for soft continuum robot design analysis and path following, particularly in the environments with obstacle constraints. Feedforward control based on the proposed model would eliminate the need for an additional sensor system to measure the real-time configuration of the robot, which is important for extending the range of applications of soft continuum robots and interacting safely with complex environments.

The proposed method is applicable to the case where the constrained surface parameters are known. In future work, we will try to combine the method of this paper with vision, collecting constraint information through machine vision to build a model of the constrained surface parameters, and then the model could be applied to a strange environment.