**1. Introduction**

The paper addresses data processing (in particular those of joints coordinates, which are, in the case at hand, the angles of rotation) designated for a stationary robotic arm composed of the so-called URM modules, described in detail in [1–3]. We briefly mention their main attributes, which are unlimited rotation of the module around its own axis, availability of intrinsic power and modularity units. Thanks to the modularity and the advantages it represents [4–7], individual modules can be used for building various configurations and thus to adjust the arm to a function required of it, to create machines with different mobility capabilities, several degrees of freedom. In general, modular and reconfigurable robots offer great versatility, robustness and—thanks to their series production—low costs, which is mentioned by many authors addressing this issue [8–10]. Those modular, reconfigurable robots that consist of many modules (the number of their degrees of freedom is usually

Šašala, M.; Bobovský, Z.; Stejskal, T.; Dobránsky, J.; Demeˇc, P.; Hrivniak, L. Inverse Kinematics Data Adaptation to Non-Standard Modular Robotic Arm Consisting of Unique Rotational Modules. *Appl. Sci.* **2021**, *11*, 1203. https://doi.org/10.3390/app11031203

**Citation:** Ondoˇcko, t.; Svetlík, J.;

Academic Editor: José Luis Guzmán Sánchez Received: 6 January 2021 Accepted: 25 January 2021 Published: 28 January 2021

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

much greater than 6) have the ability to reconfigure themselves into a large number of shapes. If this is the case, the robot can change its shape to meet the requirements of different tasks.

Modular robotic systems are systems composed of modules that can be disconnected and reconnected in various configurations, subject to maintaining the precision and rigidity parameters, which can thus create a new system enabling new or value-added functions [11]. The concept of the URM system has been conceived in accordance with the total productive maintenance principal implementation rules [12,13]. Individual rotation positions are the result of the inverse kinematics of the mentioned robot's arm. When it comes to kinematics of an inverse position, we look for such joint coordinate vectors of the open kinematic chain (assuming that the mechanism's size is known) as would suit the required position and the orientation of the end effector's coordinate system. Unlike the forward task, where the position vector is a function of the joint coordinate vector, the inverse task is substantially more complex because it necessitates solving a set of strongly nonlinear algebraic equations. These problems were first postulated by Paden B. [14] and Kahan W [15]. In most cases, these systems cannot be solved analytically. Thus, various types of iterative numerical methods are used, most often employing the Jacobian [16–21]. In calculating the inverse function, the inability to solve the task stems from the (configuration) workspace limitation, delimited by the configuration itself and the mechanism's physical properties. If we are located outside this workspace, there is, of course, no solution. Several solutions may exist since the end effector's defined position may be obtained in several manners. The situation can be even more varied in the case of the so-called redundant manipulators, where the joint coordinate vector's number of elements is greater than the degree of freedom in the given workspace or plane. This results in an infinite number of configurations through which the defined position and orientation can be reached. We do not deal directly with the inverse function in this paper. The respective joint coordinates are obtained from the model's CoppeliaSim Edu simulation (Coppelia Robotics AG, 8049 Zürich, Switzerland). The software calculating the inverse kinematics uses the pseudoinverse computational method, also called the Moore–Penrose method and the method of dampened least squares (DLS), also called the Levenberg–Marquardt method. More information about these and other methods can be found in [16,22–24]. Since other URM module configurations are contemplated for the future, or the redundant manipulator creation will be requested, it was mandatory to search for flexible solutions. To this end, the inverse kinematics is addressed in the CoppeliaSim Edu software. When the model is created in this environment, it enables the simulation of many types of movements and also the design of a working trajectory taking into account hurdles in the robotic arm's configuration space. Joint coordinate vector coordinates are obtained from the model created in the CoppeliaSim Edu. Thus, we have the individual joints coordinates available, which is necessary for their subsequent implementation into the models, this time in Matlab (MathWorks, 1 Apple Hill Drive, Natick, MA 01760, USA) and in SolidWorks (Dassault Systèmes, 10 rue Marcel Dassault, CS 40501, 78946 Vélizy-Villacoublay CEDEX, France). These data are subsequently compared to check the models' designs in the respective software environments. Should the designer's work show ideal precision, these results should be, especially for the position kinematics, identical. This should hold regardless of the fact that two different software environments are used.

#### **2. Model Creation and Data Processing**

Relations describing the position kinematics by means of position vectors *p***i**, where *i*-<1;7> at individual open kinematic chain segments have also been derived in [25,26]. This is the case of the robotic arm's forward kinematics. The relations serve the purpose of calculating the position of a point that would enable the attachment of either an effector or another device. Thus, the position of a point [*pxi*, *pyi*, *pzi*] on the module will be defined by the function of the rotation positions *ϕi*, *ϑ<sup>i</sup>* and the segment size of the structure at hand—|*ri*|; *p<sup>i</sup> = f(ϕi*, *ϑi*, *ri)*. The basis of the arm [1,2] is an autonomous, cylinder-shaped

module. Such modules have a single degree of freedom, namely the rotational one. The rotation happens around the module's main axis and is not limited in the interval under consideration ranging from 0 to 360 degrees. The rotation may occur continuously in either direction of rotation without limitation. The modules and joints are contemplated to be perfectly solid bodies. The individual modules' axes of rotation cross each other at the point where they are joined by passive joints, Figure 1. The distances of section points in space are quantified by the *r<sup>i</sup>* vector (a kinematic chain segment), and this vector has its own Cartesian system of *Si*{*Oi*, *xi*, *yi*, *zi*}. The segment's rotation around the *zi* axis is defined by the rotation matrix *Rzi*(*ϕi*) [3–5]. The segment's rotation around the *yi* axis is defined by the rotation matrix *Ryi*(*ϑi*).

**Figure 1.** Robotic arm vector model composed of the universal rotational modules (URM) modules.

Thus, we can write the following for *Rzi*(*ϕi*):

$$\mathcal{R}\_{zi}(\varphi\_i) = \begin{bmatrix} \cos(\varphi\_i) & -\sin(\varphi\_i) & 0\\ \sin(\varphi\_i) & \cos(\varphi\_i) & 0\\ 0 & 0 & 1 \end{bmatrix} \tag{1}$$

Moreover, the following for *Ryi*(*ϑi*):

$$\mathbf{R}\_{yi}(\boldsymbol{\theta}\_{i}) = \begin{bmatrix} \cos(\boldsymbol{\theta}\_{i}) & 0 & \sin(\boldsymbol{\theta}\_{i}) \\ 0 & 1 & 0 \\ -\sin(\boldsymbol{\theta}\_{i}) & 0 & \cos(\boldsymbol{\theta}\_{i}) \end{bmatrix} \tag{2}$$

The *r*<sup>1</sup> vector is connected to the base perpendicularly to the plane with the *x*1, *y*<sup>1</sup> axes. *<sup>p</sup>*<sup>1</sup> <sup>≡</sup> *<sup>r</sup>*1, because the coordinate system is orthogonal. According to Figure 1, the following applies to the position vector *p*1:

$$p\_1 = \mathcal{R}\_{z1}(\varphi\_1) \times r\_1 \tag{3}$$

According to Figure 1, the following applies to the position vectors *p*2, *p*3, *p*4, to *p*i:

$$\mathfrak{p}\_2 = \mathfrak{p}\_1 + \mathfrak{R}\_{z1}(\mathfrak{q}\_1) \times \mathfrak{R}\_{y2}(\mathfrak{e}\_2) \times \mathfrak{R}\_{z2}(\mathfrak{q}\_2) \times \mathfrak{r}\_2 \tag{4}$$

$$\mathbf{p}\_3 = \mathbf{p}\_2 + \mathbf{R}\_{z1}(\boldsymbol{\varphi}\_1) \times \mathbf{R}\_{\bar{y}2}(\boldsymbol{\theta}\_2) \times \mathbf{R}\_{z2}(\boldsymbol{\varphi}\_2) \times \mathbf{R}\_{\bar{y}3}(\boldsymbol{\theta}\_3) \times \mathbf{R}\_{z3}(\boldsymbol{\varphi}\_3) \times \mathbf{r}3 \tag{5}$$

$$p\_4 = p\_3 + \mathcal{R}\_{z1}(\varphi\_1) \times \mathcal{R}\_{\bar{y}2}(\vartheta\_2) \times \mathcal{R}\_{z2}(\varphi\_2) \times \mathcal{R}\_{\bar{y}3}(\vartheta\_3) \times \mathcal{R}\_{z3}(\varphi\_3) \times \mathcal{R}\_{y4}(\vartheta\_4) \times \mathcal{R}\_{z4}(\varphi\_4) \times r\_4 \tag{6}$$

A general position vector formula of this *p<sup>i</sup>* structure will thus be:

$$\boldsymbol{\mathfrak{p}}\_{i+1} = \mathbf{R}\_{z1}(\boldsymbol{\uprho}\_1) \times \left[ \mathbf{r}\_1 + \sum\_{k=1}^{i} \left[ \prod\_{j=1}^{k} \left( \mathbf{R}\_{y(j+1)} \left( \boldsymbol{\uptheta}\_{j+1} \right) \times \mathbf{R}\_{z(j+1)} \left( \boldsymbol{\uprho}\_{j+1} \right) \right) \right] \times \mathbf{r}\_{k+1} \right] \tag{7}$$

The resulting orientation of the *r<sup>i</sup>* vector defined by the Euler's angle can be seen in [27] according to the *R*z(*γ*)*R*y(*β*)*R*x(*α*) option will be determined from the relation below based on the final arm rotation:

$$\mathcal{R}\_{ZYX(i+1)} = \mathcal{R}\_{z1}(\varphi\_1) \times \prod\_{j=1}^{i} \left( \mathcal{R}\_{y(j+1)} \left( \vartheta\_{j+1} \right) \times \mathcal{R}\_{z(j+1)} \left( \varphi\_{j+1} \right) \right) \tag{8}$$

Generally speaking, the final shape of the *RZYX*(*i*+1) in terms of its *<sup>i</sup>*-segment will look as follows:

$$\mathbf{R}\_{ZYX(i+1)} = \begin{bmatrix} \mathbf{a}\_{11} & \mathbf{a}\_{12} & \mathbf{a}\_{13} \\ \mathbf{a}\_{21} & \mathbf{a}\_{22} & \mathbf{a}\_{23} \\ \mathbf{a}\_{31} & \mathbf{a}\_{32} & \mathbf{a}\_{33} \end{bmatrix} \tag{9}$$

where aij for *i* = 1, 2, 3, *j* = 1, 2, 3 are the matrix elements. Considering the *Rz*(*γ*)*Ry*(*β*)*Rx*(*α*) option, the Euler's angles will then be as follows:

$$\alpha = \arctan\left(\frac{\mathfrak{a}\_{32}}{\mathfrak{a}\_{33}}\right) \tag{10}$$

$$
\beta = \arcsin(-\mathfrak{a}\_{\mathfrak{I}1})\tag{11}
$$

or also:

$$\beta = \arctan\left(\frac{-\mathbf{a}\_{31}}{\sqrt{\mathbf{a}\_{32}^2 + \mathbf{a}\_{33}^2}}\right) \tag{12}$$

$$\gamma = \arctan\left(\frac{\mathbf{a}\_{21}}{\mathbf{a}\_{11}}\right) \tag{13}$$

Thus, for example, in the case of an arm with 3 active degrees of freedom, i.e., for the *r*<sup>4</sup> vector, the final rotation according to Equation (8) will be as follows:

$$\mathcal{R}\_{\overline{z}\overline{y}X4} = \mathcal{R}\_{z1}(\varphi\_1) \times \mathcal{R}\_{y2}(\vartheta\_2) \times \mathcal{R}\_{z2}(\varphi\_2) \times \mathcal{R}\_{y3}(\vartheta\_3) \times \mathcal{R}\_{z3}(\varphi\_3) \times \mathcal{R}\_{y4}(\vartheta\_4) \tag{14}$$

Our case involves 6 degrees of freedom.
