*3.6. Simulation of the Model*

Using the above equations, the mathematical model can be represented by simulation. From the inputs, inclination and orientation, the inverse kinematics is made, and the linear displacement of the tendons is calculated. Those values are turned into and angular displacement for each motor. The motor encoders can be used as sensors to measure the real angular motor position and close the control loop.

The motor models are represented as a function using the values from the motor datasheet. Following a general control diagram, where *K* is the motor speed constant in rpm/V, and *τ* is the mechanical time constant in seconds, we obtain the transfer function G(s) [32], such that:

$$G(s) = \frac{K}{s(1+\tau s)} = \frac{352}{s(1+0.00875s)}\tag{16}$$

For the simulation, a control loop is created in Simulink Matlab, in which the input values are entered interactively, Figure 16. The tendon lengths for these inputs are obtained through a Matlab function that has been designed from Equation (9), called "Inverse Kinematics", Algorithm 1.

#### **Algorithm 1** Inverse kinematics.

1: *input: θ*, *ψ* 2: *internal constant:* N, L, a 3: **procedure** 4: *β* ← *block-angle-equation*(*ψ*) 5: **if** *β* < *θ*/*N* **then** 6: *θ* = *β* · *N* 7: *φ<sup>i</sup>* ← *phi-equation*(*ψ*) 8: *Li* ← *length-equation*(*L*, *a*, *φi*) 9: **return** *Li*

The three values of *Li* returned by the inverse kinematics block are used to obtain the target Ω (target angular position of the motors), using the "*Li* to Omega" function block described by Equation (1), Algorithm 2.


From these target Ω values, the motor control loops return the current Ω values. The direct kinematics is performed using the "Direct Kinematics and 3D representation" function block defined by Equations (14) and (15), Algorithm 3. The current inclination and orientation of the free end through the simulation are obtained. This function block also provides the position of the simulated soft joint represented in a 3D space, Figure 17.

**Figure 16.** Simulink schematic for the soft joint model simulation.

**Figure 17.** Three-dimensional representation of the simulation of the soft joint for different input values.

**Algorithm 3** Direct Kinematics and 3D representation.


#### **4. Experimental Tests**

The soft joint assessment is performed through two types of experimental tests. These tests allow us to evaluate motion performance and kinematics model accuracy, based on the error between the target end position and the real end position of the soft joint. A video showing these tests performance can be viewed at https://vimeo.com/537605947 (accessed on 10 May 2021).

Data were collected from the tests in two ways. Position data from motor encoders provided information on inclination and orientation through the direct kinematics. Data from the inertial sensor 3DM-GX5-10 IMU, the yaw, roll and pitch data, were transformed into inclination and orientation data for comparison with references.
