Path Planning for an HEXA Parallel Mechanism using a Modied PSO Algorithm

This paper presents a method for determining the optimal trajectory of the characteristic point based on the kinematic analysis of a HEXA parallel mechanism. The optimization was performed based on a modified PSO algorithm based on Hermite polynomials (MH-PSO). The change made to the initial algorithm consists in restricting the search space of the solutions by using the Hermite polynomial expressions of the geometric parameters as time functions for defining the movements of the end-effector. The MH-PSO algorithm, from its inception, ensures a faster convergence of solutions and ease of computational effort and is the main advantage of the method presented. During the optimization process, the function followed was the length of the trajectory described by the sequence of positions of the characteristic point, belonging to the end effector element, in compliance with additional conditions imposed. The use of the Hermite functions and PSO algorithm leads to minimal effort for analysis and mathematical formulation of the optimization problem.


Introduction
Optimization in the design process is a mathematical analysis tool, used to determine the optimal solutions representing all the complex problems of this process. In general, the basic elements of an optimization problem are the objective function, the design variables, the constraints and the limits within the variables can take values. The objective function is the mathematical expression that represents the purpose of optimization. The optimization process actually aims to minimize or maximize this function. The design variables are the unknowns of the optimization problem to be determined. These are numeric values that correspond to the value of the objective function. In the optimization process, constraints are a set of conditions that must be met for this process to be feasible. Constraints allow design variables to take certain values and exclude others. The limits on which variables can take values limit the range in which they can take values and, together with the constraints, are used to determine whether solutions are feasible or impossible to achieve. When considering the robot's route planning, the main objectives pursued in the optimization process are: finding a trajectory that avoids collisions, from the starting position to the final position; the time during which the movement is performed; characteristic point speed. To solve the optimization problem, a number of researchers undertook a series of studies in which heuristic algorithms were used. Heuristic techniques are an alternative way of solving optimization problems that are difficult to solve by classical methods [1]. The usefulness of heuristic search algorithms has been demonstrated for problems for which either there is no mathematical model of direct solving, or this model is too complicated to implement. The range of applications of heuristic algorithms is quite varied, especially since most reallife problems start from these premises. Solving an optimization problem using heuristic algorithms means determining the values of the design variables to minimize the objective function (FO) depending on the constraints imposed. If the solution found does not satisfy the imposed constraints, it is not accepted even if the value of the FO function is minimal. The algorithm adds a penalty function (FP) to the FO function. The two functions (FP and FO) form the fitness function (FF). There are two situations in this way: -if the constraints are in the feasible zone then FP = 0; -if the constraints are not in the feasible area then the FF function is penalized by the FP function. Generally, an algorithm starts with a number of randomly generated initial solutions. These solutions represent the initial values of the design variables. The value of the FO function is calculated with these initial values. If the initial values satisfy the constraints, the FF function will be the same as the FO function. The second set of solutions is generated, with values close to the initial solutions. Between the two FF functions, the one with the minimum value is designated as the preferred solution. As long as the iteration continues, the algorithm converges to the global minimum value [2]. An important problem in the case of heuristic algorithms is the local minimums which represent a blockage for them. Various strategies have been developed to avoid this blockage. In the first iterations, the algorithm looks for global solutions with large steps to avoid local minimums and in the following iterations, it looks for solutions with small steps to find the best minimum. Another way to solve optimization problems is with the help of particle swarm optimization (PSO). The concept of PSO was introduced by James Kennedy and Russell Eberhart in 1995 representing at that time a revolutionary computing technique inspired by the social interaction between insects or animals. Like genetic algorithms (GA), PSO mimics the natural biological evolution, on the principle of survival of the fittest in order to obtain the best solution. In general, heuristic algorithms do not seek to find an optimal solution but try to find an acceptable solution near the optimal solution within a reasonable time. PSO is simpler than GA because it does not have evolution operators such as "crossover" and "mutation" as in the latter [3]. As an optimization algorithm, PSO is less complex and more efficient compared to other optimization algorithms [4][5][6][7]. Among the advantages can be listed: simplicity, fast convergence, some parameters to be adjusted, and no operator [8,9]. PSO is applied for a wide range of applications, such as function optimization, power system applications, planning problems in research operations, and for a number of robotics applications [10,11].
More simulation results shows the applicability of PSO in path planning in static or dynamic environments [12,13]. Also, a multi-objective particle swarm optimization algorithm is applied to minimize the travel time, energy and the distance of the end-effector [14].

Polynomial formulation of the motion parameters for the HEXA parallel mechanism
One of the kinematic chain scheme of the HEXA parallel mechanism is presented in Fig.1. Each of thease chain has the kinematic revolute joint at point k and the kinematic spherical joints at points k and k respectively. The actuating arms k are rotated at an angle k around the axis of the unit vector passing through the point k . The HEXA mechanism has the following particularities: 1. axis of rotational active joints by unit vector are two-by-two coincidentand, coplanar and centralsymmetrically disposed; 2. actuating arms k are of equal length; 3. the rods k are of equal length; 4. centers of spherical joints k are coplanar and located on the vertices of a regular hexagon; The Based on Hermite polynomials each of the three equations can be formed. A polynomial function having the expression (2) will respect the same conditions at the ends of a range [ 1 , 2 ] : ( ) = 1 ( ) + 2 ( ) + 3 ( ) + 4 ( ) + 5 ( ) + 6 ( ) The functions j will be defined by a linear transformation of some more general ℎ j ( ) functions such that: where λ is the new independent variable defined by linear transformation: The equation (2) becomes: The equation of motion of the point projected on the three axes becomes: The coefficients 1 … 2 ′′ of the functions ℎ j ( ) represent the values of the coordinates of the fixed points of the extremities of the interval respectively their derivatives / and 2 / 2 . On the interval will have two times and corresponding to the moment of time when j is identical with point respectively with point . We considered = 3[ ], = 8[ ]. represents the time of motion ( − ) on a certain interval. The coefficients 1 … 2 ′′ has the expressions: The directions of velocities and accelerations of the extreme points of the interval is given by the angles 1,2 and 1,2 (Fig. 2).
The Deriving the equation (6,7,8) to time and taking into account that: the expressions of speed and acceleration of the point as exemple will be:

The optimal trajectory obtained based on modified PSO algotithm
The orientation of the platform is given by the angles  =  = 0°,  = constant. The three angular parameters , ,  represent Euler's angles in the Roll-Pitch-Yaw system and describe the orientation of the platform.  (Fig . 3).
Let points and belong to ℎ . We propose that starting from the Hermite functions i ( ), based on the PSO algorithm to optimize the length of the trajectory traveled by the characteristic point on the interval AB. The algorithm is initiated by determining the position of the points on the curve on the interval by means of the functions i ( ) whose expression was established on the basis of the relations (6)(7)(8).
( This points represents the initial condition by which we restrict the search for solutions among the set of points that belong to the technological workspace. Next we call the objective function which calculates the length of the trajectory described by the sequence of points j based on their coordinates. The expression of this function is: = ∑ j+1,j ; j+1,j = √ ( P j+1 − P j ) 2 + ( P j+1 − P j ) 2 + ( P j+1 − P j ) 2 ; The program compares the value found for with a value imposed for it, denoted = 600 . The value imposed for can be any other value depending on the design requirements. If the limit is reached, the program stops and displays the coordinate values of the points for which the condition is met. If the condition is not met, the program proceeds to the next step. In the next step, the speeds are updated according to equation (17).
where:  , +1 -represent the speed of point at iteration respectively at + 1 iteration;  -represent the position vector of point at iteration;  -represent BLP for point at iteration;  -represent BGP for point at iteration;  1 , 2 -are two constants representing the cognitive and social parameters (or acceleration parameters) that determine the convergence of solutions to the best local and global positions. Generally the constants must satisfy the condition, 1 + 2 ≤ 4 [15];  1 , 2 -are two matrices by 3 × 3 dimension, randomly generated in range interval [0,1] for each j point at each iteration  -constant of inertia [16]. The expression of this parameter has been discussed in various specialized papers and its value is in the range [0.4, 0.9]; Recent experiments have shown that for a series of values of the parameters of acceleration and inertia, the velocity vectors tend to infinity producing the swarm explosion. The causes of these divergences have been analyzed by a number of researchers [17][18][19] who have concluded that better stability of the system is given by the assignment of the following values for the acceleration coefficients and the inertia coefficient: In this paper we considered the values from relation (19) for the acceleration and the inertia coefficient. With these notations equation (17) becomes: In the next step, based on the speeds updated in the previous step, we will update the positions of the j points with relation (22): The points +2 are displayed and based on them the new value of the function is calculated by setting the condition +1 < +2 ≤ . The speeds and positions of the j points are updated successively as above: The points +3 are displayed and based on them the new value of the function is calculated by setting the condition +2 < +3 ≤ . The algorithm continues analogously and stops when the value of + satisfies the condition + ≥ .
Flowchart of the MH-PSO algorithm is shown in Fig. 4. The following gives a relatively complete presentation of the algorithm. The code program was write in C++ language with Visual Studio 2019 software.

The PSO ending when
In order to get an unbiased comparison of CPU times, all the experiments are performed using the same PC with the following configuration shown in Table 1. The modified MH-PSO algorithm identifies those paths that are in the vicinity of the curve described by the sequence of points based on the Hermite functions and that satisfy the imposed length condition. The user can thus view this route and can choose from the multitude of solutions that satisfy the requirements of a certain application.
For a better visualization of the trajectory and to validate the results obtained based on the presented algorithm, we represented the sequence of points inside the technological workspace for a few objective function based on a CAD program. The figures above show the path generated by the sequence of points (Fig. 5) and the optimized trajectory based on the modified MH-PSO algorithm for PSO 915 and PSO 520 (Fig. 6). We specify that all curves were drawn with the AutoLisp script program in AutoCAD software. Fig. 5 The trajectory generated by points. Fig. 6 The trajectory generated by MH-PSO for PSO 915 and PSO 520 To be able to verify the efficiency of the algorithm, 9 Run sets were done. The best value for the objective function, resulting from the algorithm for the first such set, was obtained for Run 1 as seen in the Figure 7 with = 600.85 . The highest value for the objective function is given by Run 8 with = 650.17 (Fig. 8). Also, for the first set of 9 Run , we obtain a quick convergence for Run 8 after 223 iterations and a slow convergence for Run 5 and Run 9 with 957 respectively 1108 iterations (Fig. 9,10). For a better evaluation of the algorithm, we create four Set of nine Run iteration and we compared all best function values for this. The highest value for the objective function is given by Set 1 with = 650. 17 and a good dispersion of value function is obtain for Set 2 (Fig. 11). In Table 2 was listeted best, worst and mean value for each Set number. Depending on the random matrices 1,2 and the matrix used for generated , the number of iterations for MH-PSO algorithm vary from PSO 223 to PSO 1108 . Also the time for algorithm execution vary from 1 to 4.2 seconds. In the figures below (Fig. 12) there was obtained an evolution of depending on the number of PSO iterations for each Run compilation of the algorithm program.

Conclusions
The application of the PSO algorithm on a HEXA mechanism was done taking into account the complexity of the mechanisms with six degrees of freedom and the need to reduce the computational effort necessary to determine the trajectories of the positions of the characteristic point attached to the endeffector.
This paper presents a method for determining the optimal trajectory of the characteristic point based on the kinematic analysis of a parallel HEXA mechanism. The movement of the end-effector element described in the presented optimization process has a strong dynamic character. The optimization was performed based on a modified PSO algorithm ussing a Hermite polynomials (MH-PSO). During the optimization process, the function followed was the length of the trajectory described by the sequence of positions of the characteristic point, belonging to the effector element, in compliance with additional conditions imposed. The elements of the classical optimization method were highlighted, based on an objective function and some restrictions. The paper highlights that using the MH-PSO algorithm, leads to minimal effort for the analysis and mathematical formulation of the optimization problem. Addressing the optimization problem proposed in this paper provides easy implementation, stable convergence features, and good computational efficiency. The proposed optimization method can be generalized to various types of mechanisms. The approach and steps taken can be the source of inspiration for other similar issues. Indeed, the obtained results revealed that the proposed method yielded satisfactory results. To validate theese results obtained based on the presented algorithm, the sequence of points inside the technological workspace was represented for a few objective functions using a script program implemented in a CAD software.