1. Introduction
Artificial intelligence technologies and modeling methods have a decisive influence on the development of modern robotic systems [
1,
2,
3]. Modeling robotic manipulators allows studying their characteristics in a virtual mode based on a numerical experiment. Mathematical models used to model robot motion are the basis for developing robot control systems [
3,
4]. In addition, much attention is currently paid to the problem of controlling several robots of different types working together under changing conditions, which requires the use of scenario control methods, linear programming, and machine learning [
5].
When modeling the motion of robots, various kinematic and dynamic problems can be considered. The kinematics of robot manipulators is usually considered in two coordinate systems. Thus, the planning of the trajectories of the working element is performed in Cartesian coordinates, and the control of the robot’s motion is carried out in axial (generalized) coordinates.
The direct kinematics problem consists of determining the kinematic parameters, velocities, and accelerations of the robot’s manipulation system links when it moves along a given trajectory. The inverse kinematics problem is reduced to determining the axial coordinates corresponding to the movement of the robot’s working element along a trajectory given in Cartesian coordinates. The studies presented in this article are devoted to algorithms for solving the direct kinematics problem.
The problems of kinematics and dynamics of robot manipulators have been previously considered by many researchers. Thus, in works [
6,
7], new methods for solving the inverse kinematics problem for robot manipulators are presented. The study [
8] aims to construct a kinematic model of a hexapod leg with two degrees of freedom (2-DOF) for a walking robot. The study [
9] is focused on the design of a small-sized robot manipulator with three degrees of freedom (3-DOF) to perform the “pick and move” task using the inverse kinematics method. The study [
10] aims to teach robot programming based on a 5-DOF robot manipulator prototype and open-source software.
The paper [
11] considers analytical solutions to the direct and inverse kinematics problems for a hybrid 5-DOF robot that consists of a parallel mechanism with three degrees of freedom and a rotating head with two degrees of freedom. The paper [
12] considers the features of solving the inverse kinematics problem for serial-parallel manipulators.
The paper [
13] presents a detailed review of the methods used in robotic machining of lightweight materials. The paper [
14,
15] proposes a method for constructing a tool path for a 5-DOF industrial robot during the machining process. The paper [
16] considers the calibration problem for a 5-DOF hybrid machining robot. This paper presents a semi-analytical continuous toolpath corner smoothing method for a 5-DOF (degree of freedom) hybrid robot. The paper [
17] proposes a criterion for estimating the maximum load on the actuator of a 6-DOF industrial robot when performing a forming process. In study [
18], the technology of kinematic calibration of a 5-DOF robot manipulator was investigated. Study [
19] proposes a simple inverse kinematics calculation scheme for an industrial serial manipulator. The proposed technique can calculate appropriate values of the joint variables to realize the desired end-effector position and orientation while considering the motion costs of each joint. The article [
20] describes fuzzy adaptive compensation control for space manipulators. The works [
21] demonstrate algorithms for solving the inverse kinematics problem for a robot manipulator with seven degrees of freedom (7-DOF), and the works [
22] use the deep reinforcement learning algorithm for this purpose. The works [
23,
24] develop efficient algorithms based on topological analysis that are capable of finding the optimal solution to the inverse kinematics problem for robot manipulators with kinematic redundancy. The paper [
25] focuses on the theoretical and experimental analysis of a three-axis MEMS gyroscope, implementing an innovative feedforward PI quadrature compensation architecture.
Currently, the study of the problems of kinematics and dynamics of robotic manipulators also remains relevant. A promising direction for the development of applied research in this area is the development of neuromorphic algorithms for modeling and controlling robotic manipulators [
26,
27].
In our research, we develop the theme of developing parallel algorithms based on an object-oriented approach and borrow part of the material from our previously published article [
28] to complete the additionally published material. The previous article described in detail the method for constructing parallel algorithms using the object-oriented approach. The method was illustrated by constructing a parallel algorithm for calculating the dynamic model of a robot manipulator.
The published material of this article examines the application of the method described earlier for compiling algorithms for solving problems of the kinematics of robot manipulators. The object-oriented approach in this case allowed us to modify the mathematical dependencies obtained for calculating the kinematic characteristics of robot manipulators. At the same time, an analysis of the computational complexity of the algorithms was carried out. The main emphasis in the new work is on increasing the efficiency of algorithms for calculating the kinematic parameters of robotic manipulators intended for creating software and mathematical support for robot control systems.
The above review of publications aimed at solving problems in robot manipulator kinematics shows the high relevance of solving these problems in various fields. The method of compiling computational algorithms for solving these problems that we have described allows us to significantly increase their efficiency.
2. Methods of Kinematic Analysis
Robot manipulators are multi-link mechanisms with a sequential kinematic structure. Kinematic diagrams of mechanisms are used to describe such structures. Examples of a robot manipulator with six links (6-DOF) and the corresponding kinematic diagram are presented below (see
Figure 1 and
Figure 2).
On the kinematic diagram of the mechanism in the selected scale, the links are depicted by straight lines. Hinges are depicted at the nodes of the links. The arrangement of the links on the kinematic diagram of the robot manipulator is determined by the lengths of the links li and the values of the coordinates of the hinges qi, i = 1,…,n; n—is the number of links. When the mechanism moves, its image on the kinematic diagram at each moment of time t will be determined by the values of the hinge coordinates, which are functions qi = qi(t).
To specify the position of the links in space, it is necessary to associate the Cartesian coordinate system
Si(
Xi,
Yi,
Zi) with each link. The movement of the robot manipulator is considered in the coordinate system
S0(
X0,
Y0,
Z0), associated with the fixed base (see
Figure 2).
The transformation of the bases of the coordinate systems associated with the links can be performed using the (4 × 4) matrices of the transformation of homogeneous coordinates. The structure of such a matrix for the case of mapping the basis of the system
Si into the system
S(i−1) has the form:
where
A(i−1),i is a 4 × 4 matrix, that performs the homogeneous coordinate transformation from the
Si, system, corresponding to
i-th link, into the
S(i−1) system, corresponding to (
i − 1)-th;
R(i−1),i is a 3 × 3 rotation matrix containing the cosines of the angles between the corresponding axes of the
Si and
S(i−1) coordinate systems;
—link length (
i − 1),
—projections of the (
i − 1)-th link onto the axes of the coordinate system
S(i−1).
Since the components of the matrices A(i−1),i are functions of the hinge (generalized) coordinates: R(i−1),i = R(i−1),i(qi), if the i-th hinge is rotational, l(i−1)= l(i−1)(qi), if it is translational (telescopic), then the matrix A(i−1),i = A(i−1)(qi), is also a function of the hinge coordinates.
The set of 4 × 4 homogeneous transformation matrices, defined by the expression:
performs mappings:
where
Sk is a coordinate system corresponding to the
k-th link.
Since the matrices A(i−1),i = A(i−1)(qi) are functions of the hinge coordinates, then the matrices A0,k = A0,k(q), q = (q1, q2, …, qk), will also be functions of the hinge coordinates.
Then the absolute coordinates of an arbitrary point of the
k-th link in the
S0 fixed coordinate system, which are the projections of the radius vector
, can be determined from the equation:
where
is a radius vector that defines the local coordinates of the selected point, given in the
Sk, connected with the
k-th link;
q is the vector of hinge coordinates.
In the future, when writing equations, we will denote matrices with capital letters, and vectors and scalars with small letters. This will simplify the writing of equations and will not lead to confusion, since each vector is pre-defined, and the scalars in the equations will only be indices, time, and hinge coordinates.
To obtain linear kinematic parameters, it is necessary to differentiate function (5) an appropriate number of times. The arbitrary point speed of the
k-th link in the
S0 system will have the form:
and the acceleration of the same point is
In expressions (6) and (7) used to calculate the kinematic parameters, it is necessary to calculate the partial derivatives of the transformation matrices of homogeneous coordinates, according to the corresponding generalized coordinates:
In accordance with (3), we will have
Calculating the differentiated transformation matrices of homogeneous coordinates (8) and (9) can be performed using intermediary matrices
Di:
Matrices
Di of differentiating transformation matrices of homogeneous coordinates have the form:
where β
i is the coefficient corresponding to the type of the
i-th kinematic pair. β
i = 1, if the
i-th kinematic pair is rotational and β
i = 0, if it is translational.
To use the differentiation matrix in the form (11), it is necessary to direct the axes
Zi coordinate systems
Si along the axes of the hinges connecting the links (
i − 1) and
i. Then the matrix
A(i−1),i(
qi) can be represented as a product of two matrices
A(i−1),i =
A(i−1),(i−1)*A(i−1)*,i(
qi), in this case the matrix
A(i−1)*,i(
qi) will look as follows:
When multiplying a matrix
A(i−1)*,i both left and right on the matrix
Di, for example, at β
i = 1 we obtain the derivative matrix
Using expressions (10) instead of (9) significantly increases the algorithm efficiency for calculating the kinematic parameters.
3. Object Modeling of Kinematics
We will consider expression (3) as an integral part of the mathematical model (1)–(5), which determines the relative position of each link of the manipulation robot relative to the fixed coordinate system. Based on the matrices that make up Equation (3), we will create objects of the corresponding classes. These classes inherit the properties of their base Matrix class, which contains the necessary constructors for initializing objects and methods for performing basic operations on matrices.
Figure 3 shows the object scheme of the mathematical model (1)–(5), for the case
k = 3, corresponding to a three-link (3-DOF) manipulation robot.
Matrix objects are depicted in the diagram as rectangular elements. The multiplication operation is represented by adding on the right or left of the matrix object another corresponding matrix object. The rules for constructing object diagrams of mathematical models of manipulation robots are considered in [
28].
When calculating the kinematic parameters, the operation of differentiating the transformation matrices of homogeneous coordinates is performed. As it has already been noted, this operation can be fulfilled using differentiation matrices (8)–(11). Object schemes for calculating partial derivatives of transformation matrices of homogeneous coordinates when modelling the kinematics of the 6-DoF robot are presented below (see
Figure 4,
Figure 5 and
Figure 6).
The expression for calculating the speed of a certain point of the third link of the manipulation robot in the
S0 fixed coordinate system, according to (6) for the case
k = 3, will have the form
Using differentiation matrices (11) allows representing expression (12) in the form
Thus, the object scheme for calculating the certain point speed of the third link of the manipulation robot in the
S0 fixed coordinate system, given by its radius vector
r(3) in the
S3 coordinate system, corresponding to expression (13), will have the form (see
Figure 7).
On the object scheme (see
Figure 7), scalar elements are shown in the form of triangles. The operation of multiplying an object by a scalar is represented by attaching a triangle with one of its vertices to the side of the rectangle representing the object being multiplied by a scalar.
Consider expression (7) for calculating the acceleration of a certain point of the 3rd link of the manipulation robot in the
S0 fixed coordinate system.
Similarly to (13), expression (14) can be represented by the expression
the object scheme for a certain point acceleration calculation of the manipulation robot 3rd link in the
S0 fixed coordinate system, given by its radius vector
r(3) in the
S3 coordinate system, corresponding to expression (15), will look as follows (see
Figure 8).
4. Computational Complexity of Algorithms
Let us analyze the computational complexity of the matrix algorithm execution. In this case, we will be based on comparing the number of addition and multiplication operations performed with matrix elements. Let us compare the number of addition (+) and multiplication (×) operations performed when executing matrix expressions with elements of n × n matrices and n × 1 vectors.
When multiplying two n × n matrices, the number of addition operations is K+ = n2(n − 1), and the number of multiplication operations is K× = n3. When multiplying an n × n matrix by an n × 1 vector, the number of addition operations is K+ = n(n − 1), and the number of multiplication operations is K× = n2.
Consider a more general case representing the product of several matrices and a vector
The number of addition operations on the left side of the matrix Equation (16) is
K+(L) =
n2(
n − 1)(
k − 1) +
n(
n − 1) =
n(
n − 1)((
k − 1)
n + 1), and on the right side it is
K+(R) =
kn(
n − 1). The ratio of these coefficients shows
The number of multiplication operations on the left side of the matrix Equation (16) is
K×(L) =
n2((
k − 1)
n + 1), and on the right side it is
K×(R) =
kn2. The ratio of these coefficients shows
Analysing the computational complexity of expression (13) for calculating the point acceleration shows that the number of addition operations when this expression is executed is K+(13) = 9n3 − 6n2 − n, for n = 4 it equals K+(13) = 476, and the number of multiplication operations is K×(13) = 9n3 + 4n2, for n = 4 it equals K×(13) = 640.
Based on results (17) and (18), we can assume that reducing expression (13) to the form
will decrease in the number of addition and multiplication operations performed.
The number of addition operations when executing expression (19) K+(19) = 2n(6n − 5), for n = 4, equals K+(19) = 152, and the number of multiplication operations K×(19) = 15n2, for n = 4, equals K×(19) = 240.
The ratio of the coefficients obtained for mathematical models (13) and (19) for
n = 4 shows
Analysing the computational complexity of expression (15) for calculating the point acceleration shows that the number of addition operations when this expression is executed is K+(15) = 33n3 − 24n2 − n, for n = 4 it equals K+(15) = 1724, and the number of multiplication operations is K×(15) = 11n2(3n + 1), for n = 4 it equals K×(15) = 2288.
Based on results (17) and (18), similarly to the transformations performed for the speed, we transform expression (15) to the form
The number of addition operations when executing expression (21) K+(21) = 2n(21n − 17), for n = 4 equals K+(21) = 536, and the number of multiplication operations K×(21) = 51n2 + 9, for n = 4 equals K×(21) = 825.
The ratio of the coefficients obtained for mathematical models (15) and (21) for
n = 4 shows
Taking the direction of executing sequential calculations in the rows of object circuits (
Figure 8 and
Figure 9) from right to left, we obtain that the calculation efficiency is proportional to the calculated values (20) and (22).
An analysis of the computational complexity of matrix expressions (19) and (21) shows that the transformation of matrix expressions based on the associativity property makes it possible to increase the efficiency of algorithms for calculating the kinematic parameters of robotic manipulators by approximately three times.
To test the efficiency of the proposed algorithms, a computational experiment was conducted. The computer program was written in the C programming language. The program contained algorithms for calculating kinematic parameters in accordance with expressions (13), (15), (19), and (21). Special operators were included in the program code [
29]:
where CalcKinemParam()—function for calculating kinematic parameters in accordance with expressions (13), (15), (19), (21); t_ns—function execution time.
The computer program provided the determination of the execution time of the CalcKinemParam() function with excess precision measured in nanoseconds. However, the relevance of the experiment is not absolute, since, when executing the computer program, not only the time spent performing arithmetic operations was taken into account, but also the time spent calling functions, transferring data to processor registers, and accessing RAM. Let us attribute these factors to associated errors.
The calculations were carried out under the Windows 11 operating system on a computer equipped with an Intel Celeron central processor, 2 Cores, 1.1–2.8 GHz, 8 GB.
The kinematic structures of robot manipulators from 2-DOF to 6-DOF were studied. The speed calculation results are presented in the diagram (
Figure 9). The data shown in the diagram are labeled “Usual” and correspond to algorithm (13), while those labeled “Optimized” correspond to algorithm (19). The numerical values correspond to the calculation time in microseconds (mks).
The results of the computational experiment showed that for different kinematic structures, the ratio of the execution time of the functions corresponding to expressions (13) and (15), as well as (19) and (21), varied in the range from 1.5 to 3. Taking into account the associated errors, the efficiency of algorithms (13) and (19) in comparison with similar algorithms (15) and (21) averaged 2.5–3, or more than twice. Which is in good agreement with the coefficients (20) and (22).
5. Algorithms for Parallel Computing
Consider the graph of the computational process of a 4 × 4 matrix product by a 4 × 1 vector (see
Figure 10), based on the ratio.
When calculating the product of an
n ×
n matrix by the corresponding vector, the number of necessary scalar operations of addition and multiplication can be estimated by the value
Analysing the graph of the computational process (
Figure 11) shows that parallel methods for solving the problem of the matrix product by a vector can be obtained based on applying parallel summation algorithms; in this case, a cascade summation algorithm is used. In addition, the way in which parallel computing is organized will depend on the number of available processors.
It should be noted that the sequences of performed operations of multiplying individual
n matrix rows by a vector are independent and can be fulfilled in parallel. The operations of multiplying each row by a vector involve
n independent elementwise multiplications and can also be performed in parallel. Thus, the maximum required number of processors is determined by the value:
The execution time of a parallel algorithm, referred to as the execution time of one scalar operation, when using
p processors, is determined by the execution time of the multiplication operation and the execution time of the cascade summation algorithm:
Efficiency indicators of the parallel algorithm are,
where
Sp is the acceleration for
p processors obtained by using a parallel algorithm;
where
Ep is the efficient use of processors.
The information graph corresponding to the computational process of multiplying the
i-th row of the 4 × 4 matrix by the 4 × 1 vector (
Figure 11), built on the basis of 4 processors (see
Figure 11).
The problem of multiplying rectangular matrices is defined by the relation:
In the case of multiplying
n ×
n square matrices, the number of scalar multiplication and addition operations is proportional to
n3, and the value can be used to evaluate them.
The sequences of the performed operations of multiplying individual rows of the first matrix by the corresponding column of the second matrix are independent and can be performed in parallel. An algorithm for parallel computation of matrix multiplication can be built on the basis of the considered computational algorithm for matrix-vector multiplication. Accordingly, the required number of processors for maximum parallelization of the computational algorithm will be determined by the value:
The information graph corresponding to the computational process of the 4 × 4 matrix multiplication, built on the basis of 64 processors (see
Figure 12).
The execution time of the parallel algorithm, as before, will be determined by expression (26). The resulting acceleration for
p processors will increase:
and the efficiency of using processors in accordance with (28) will not change.
Reducing the number of processors used will require restructuring the information graph (see
Figure 12), which reflects the computational process of matrix multiplication. This will increase the computation time.
Matrices must be calculated first
A(i−1),i (
i = 1,…,
n) (2). At this stage, the number of independently calculated matrices is proportional to the number
n degrees of freedom of the manipulation system. Since the maximum number of processors required for the simultaneous calculation of the 4 × 4 matrices is 64, the required number of processors for implementing parallel computing at the lower level will be:
At the next stage, the objects corresponding to the matrices
A0,k (
k = 1,…,
n) (3) and the matrices of their partial derivatives (8)–(10) are calculated. When calculating matrices of partial derivatives, it must be considered that these matrices will vanish under the conditions:
Number
N1 of the calculated partial derivative matrices
(
k,
s = 1,…,
n) will be determined by the expression
and in accordance with the property,
number
N2 of the second partial derivative matrices will be determined by the expression
Accordingly, for implementing parallel computing at level (II), the maximum number of processors will be
For most manipulative robots,
n = 6. The graph of the computational process of the matrix
A0,6 (see
Figure 13).
The graph of the computational process of the matrix
, using differentiation matrices (10) and (11) (see
Figure 14), and matrices
(see
Figure 15).
The calculations of the kinematic parameters are completed in accordance with expressions (13) and (15). However, as was shown above, expressions (19) and (21), obtained on the basis of using the associativity property, allow increasing the efficiency of the computational process by three times.
It should be noted that the issues of constructing a methodology and creating high-performance computers with a parallel structure have been considered earlier, for example, in the works [
30,
31,
32].
6. Conclusions
A method for compiling object schemes is proposed, allowing the construction of algorithms for calculating the kinematic parameters of robot manipulators. The method is based on the use of matrices (4 × 4) of the transformation of homogeneous coordinates. Examples of compiling object schemes for calculating the velocities and accelerations of points selected on the links of manipulator robots are considered.
An analysis of the computational complexity of algorithms for calculating the kinematic parameters of robotic manipulators was carried out, and a method was proposed that allows for a significant increase in the efficiency of calculations by reducing the number of addition and multiplication operations performed based on the use of the associativity property.
Information and computational graphs illustrating the developed algorithms are presented. The proposed algorithms allow parallel calculations, which will further an increase in the efficiency of calculations when using multiprocessor computing systems.
Low-code visual programming technology can be implemented on the basis of the proposed object approach. Object schemes created using this technology are assembled from basic elements. Elements are connected to each other in accordance with the type of corresponding mathematical expressions. In this case, the assembly of complex objects is regulated by the compatibility of the simple objects that make them up.
The object approach and the algorithm development methods developed on its basis can be used in robot control systems. The conducted research is designed to automate the process of developing algorithms for calculating the kinematic parameters of robot manipulators. This will allow reconfiguring the model of the controlled object in the mode of dialogue with the human operator. This eliminates the stages associated with the process of creating a special program and the procedure for reprogramming the microcontroller.
The algorithms presented in this article were used in the development of the trajectory planning function for a robotic manipulator in the control system of an automated apple harvesting complex. (Complex for Harvesting Apple Crops) [
33].
The methods for increasing the efficiency of computational algorithms substantiated in the article can also be used in control systems for robotic manipulators built on the basis of multiprocessor computing systems.