Comparative analysis of the speed of concurrent algorithms in solving the forward kinematics of a hexapod robot

The paper discusses the use of parallel computing on a central processing unit (CPU) to solve the forward kinematics of a parallel hexapod robot. The paper proposes two algorithms to solve the forward kinematics. The first is based on the direct use of the system of equations of kinematic relations of the mechanism. The approximation of a set of system solutions represents a problem of a nine-dimensional grade. The second approach is based on the approximation of a set of solutions to the system of inequalities of a three-dimensional grade. A software package for implementing the proposed algorithms was developed. The comparative analysis of the effect of parallel computing on the speed of the presented algorithms was carried out.


Introduction
From year to year the problem of speeding plays an increasingly important role in solving technical problems. This is caused by continuous availability of computing problems of various complexity and limited computing capacity. One of the possible solutions is the use of a multithread data processing (concurrent execution of parallel regions of the program). One of the key applied problems to which parallel computing can be applied is the design and control of parallel robots. Their peculiarity is that the end-effector is connected to the base by several kinematic chains. Parallel mechanisms have a number of advantages compared to serial structures [1][2][3]. Forward kinematics [4][5][6][7] determines the position of an end-effector at specified parameters (lengths) of links. Let us consider the solution of forward kinematics using the example of a spatial parallel robot.

Numerical algorithm for forward kinematics
The Gough-Stewart platform [1][2], also known as the hexapod, has 6 degrees of freedom and represents a mechanism consisting of 2 platforms. The movable platform is connected to the fixed one through 6 telescopic links ( , , , , , ) having spherical hinges at both ends (Fig. 1). The hinges on the fixed platform are arranged in pairs symmetrically over the entire circumference with the angle of rotation -120˚, angle α -between three pairs of adjacent points of link points. The centers of hinges of a movable platform form an equilateral triangle with length of side c. The desired position and orientation of the movable platform is achieved by changing the lengths of the drive links.

Fig. 1. Hexapod block diagram
The forward kinematics is solved by determining the position and orientation of the end-effectorpoint O. Its coordinates and the normal vector of the plane of the movable platform are uniquely determined using the coordinates of the movable platform vertices representing a regular triangle The system of kinematic equations of the hexapod relations is written as: The system includes 9 variables corresponding to the coordinates of the " vertices of the movable platform. To approximate a set of solutions of this system, an algorithm based on the method of nonuniform coverings [8][9] previously discussed in work [5] can be used to solve forward kinematics of a flat robot with three degrees of freedom. To accelerate its implementation, let us modify the algorithm using parallel computing. Its flowchart is shown in Fig. 2. The left parts of the system of equations (1) represent coordinate functions written as gi, i ϵ 1,…,9. The intervals of the variables corresponding to the coordinates of the " points are given as n-dimensional boxes. The initial box # $ , which includes the entire set of % solutions, is determined by the constraints of the intervals & ≤ ≤ ( , ) = 1, . . , ,.
It is added to the ℙ list. Let us extract an arbitrary box #. Let . # = max  diameter is not less than the specified accuracy =, and is added to the ℙ list. When the ℙ list is empty, the validation procedure is performed for boxes from the ℙ list. Those that cannot be excluded are divided into 2 smaller boxes and added to the ℙ list. Boxes in lists are checked using parallel computing. These cycles are highlighted in Fig. 2 by dashed lines. The covering represents a set of boxes ℙ with a diameter less than or equal to a predetermined approximation accuracy =. The resulting algorithm can be transformed in order to reduce dimension and increase speed taking into account the connectivity of the coordinates of the movable platform vertices.

Transformation of a system of nonlinear equations
Let us consider the method of transforming a system of nonlinear equations, which allows reducing the system (1) of a nine-dimensional grade to the system of inequalities of a three-dimensional grade. The set of positions of each of the " points, given only the restriction imposed by the connection with the > point, represents a sphere (Fig. 3a). By adding a constraint that takes into account the connection of two rods at one " point, the set of positions of the " points will decrease to the intersection of two spheres, i.e. to the circle U with the center ? , which is shown in Fig. 3   In case of discrete determination of the coordinates of the point " @ with a step ∆[ (Fig. 3), the maximum error ∆с is determined as the chord length between the calculated point " @ and the point located on the circle between the calculated point " ^ and the next point " ^ ∆с = 2M Z), Q ∆_ S Given the formula (4), let us compose the condition for checking the mutual arrangement of " @ points at the vertices of an equilateral triangle with a side length c The condition (5) allows checking the coordinates of " @ points calculated by formulas (2)

Simulation results
A software package C++ was developed on the Ubuntu 20.04 operating system for a comparative analysis of the proposed algorithms. The compiler was GCC 9.3.0, which includes the OpenMP version 5.0 library. Calculations were performed on two available machine configurations ( Table 1). The use of parallel computing using this library to solve the task of defining a workspace was previously discussed by the authors in [10]. Simulation results are visualized using the developed module for exporting 3D STL models into a binary format. Simulation was performed for the following initial data: = 1100 mm, = 1200 mm, = 900 mm, = 1050 mm, = 970 mm, = 960 mm, с = 400 mm, f = 30° (Fig. 1), approximation accuracy = = 0.01 mm. The number of solutions to the forward kinematics problem, which is eight, and the found positions (Table 2) for both algorithms coincided. Fig. 7 shows the visualization of hexapod positions for given lengths. The time of parallel computing and without parallel computing for both proposed approaches is shown in Table 3. The running time was fixed at the end of all calculations in ticks per second and divided by an equivalent system value, thus obtaining the desired amount of time in seconds.  Fig. 4. Hexapod positions for specified rod lengths. Comparing the proposed algorithms we can conclude that the numerical algorithm is calculated faster for both configurations of machines. The use of parallel computing reduced the operating time by more than a third for each experiment. The discrepancy in the computing time between the proposed algorithms on one particular platform is accompanied by the processing of a different number of possible solutions and the presence of critical sections. The algorithm for converting a system of nonlinear equations, despite the smaller dimension of the system of equations, processes a larger number of possible solutions. To improve its efficiency it is proposed to modify formulae (8) to (9) and eliminate critical sections in subsequent studies.

Conclusion
The results of the simulation confirmed the efficiency of parallel algorithms in solving the forward kinematics of the hexapod robot. The computing time of the first algorithm on the first computer configuration using parallel computing decreased by 62%, the second algorithm -by 67.9%, on the second computer configuration of the first algorithm it decreased by 79.5% and for the second -by 78.6%, which indicates a significant increase in performance. Future studies will consider the problems of choosing a solution to the forward kinematics from several solutions obtained, as well as the use of not only calculations on the CPU, but also the use of GPU resources. The obtained results can be used in selecting structural parameters of the hexapod robot, in solving problems of optimizing its trajectory, as well as in writing control programs.