Developing a New Robust Swarm-Based Algorithm for Robot Analysis

: Metaheuristics are incapable of analyzing robot problems without being enhanced, modiﬁed, or hybridized. Enhanced metaheuristics reported in other works of literature are problem-speciﬁc and often not suitable for analyzing other robot conﬁgurations. The parameters of standard particle swarm optimization (SPSO) were shown to be incapable of resolving robot optimization problems. A novel algorithm for robot kinematic analysis with enhanced parameters is hereby presented. The algorithm is capable of analyzing all the known robot conﬁgurations. This was achieved by studying the convergence behavior of PSO under various robot conﬁgurations, with a view of determining new PSO parameters for robot analysis and a suitable adaptive technique for parameter identiﬁcation. Most of the parameters tested stagnated in the vicinity of strong local minimizers. A few parameters escaped stagnation but were incapable of ﬁnding the global minimum solution, this is undesirable because accuracy is an important criterion for robot analysis and control. The algorithm was trained to identify stagnating solutions. The algorithm proposed herein was found to compete favorably with other algorithms reported in the literature. There is a great potential of further expanding the ﬁndings herein for dynamic parameter identiﬁcation.


Introduction
The quest for developing improved techniques for parameter identification of industrial robots has resulted in the novel concept of a mutating particle swarm optimization (MuPSO) based algorithm for analyzing multi-degree of freedom robot manipulators which was briefly introduced in [1], the research sought to employ artificial intelligence, particularly population-based Evolutionary Algorithms (EA), and computational methods for solving kinematic and dynamic problems of industrial manipulators. A robot manipulator is an electro-mechanical device that depicts the upper human limb. It was originally used in industrial workspaces to carry out tasks that were deemed boring, repetitive, highly monotonous, or dangerous, and therefore not suitable for human labor. Recent applications of robot manipulators include aeronautics and medicine, where the tolerance is very tight and human errors could be fatal. A robot manipulator comprises of solid non-moveable links connected by joints which allow either rotational or translational motion between successive links.
The increasing demand for robot manipulators has required that the manipulators become more autonomous and therefore increased accuracy and stability. The kinematic problems of robot manipulators were traditionally computed using analytical techniques which sometimes required finding the derivative of computationally expensive functions. These problems were found to sometimes possess multiple solutions or even no solution at all. Recently, swarm-based techniques have been studied which promises improved computational efficiency. every iteration, the first part of the Equation (3) is the previous velocity which describes the particles previous experience, the second part of the equation is the cognitive component which describes the particles personal experience while the third part of the equation is the social component which describes the entire swarms best experience. The inertia weight w is a learning coefficient associated with the previous velocity, while c 1 and c 2 are learning coefficients associated with the cognitive and social components respectively. The fitness function is a mathematical representation of the real-world problem to be analyzed, it evaluates how well the particles adapt to the actual solution of the problem. The leader of the swarm (fittest particle) is the particle that best adapts to the solution as it is updated through every iteration. The algorithm keeps a record of the solution of the fittest particle and also that of the best position achieved by each particle. The personal best position ever achieved by ith particle and global best position of the swarm is defined as P iBest and G iBest in Equations (5) and (6). The particles in the swarm would be seen to consistently move towards the solution of the problem through every iteration by updating the particle's position, Equation (4), towards these two best memories (P iBest and G iBest ).
G iBest = (g iBest , g iBest , . . . , g iBest ), (6) where r j is a randomly generated number between [0, 1] and j [0, 1, 2]. PSO has a high convergence speed which is very desirable for robot applications, but this convergence speed sometimes results in stagnation which is a major limitation of the PSO algorithm. The characteristic of the PSO algorithm that allows it to define promising regions in search space is referred to as exploration while exploitation allows it to refine solutions within the defined promising region. These are the major characteristics of any PSO algorithm, a good algorithm balances these properties to find the best solution to a problem while avoiding stagnation. The contributions of [20] showed that these properties can be tuned by carefully selecting the value of w of the PSO algorithm. The concept of constriction coefficient was introduced, setting the inertia weight at 0.712 while the cognitive and social coefficient were both 1.494. This version of the PSO has come to be known today as the standard PSO (SPSO). The biological background of SPSO is believed to have evolved from the bird-like objects or BOIDS introduced by [21] to simulate flocking birds or animals in virtual reality studios. The BOIDS was governed by three basic rules; separation, alignment, and cohesion. The SPSO ignored the alignment and cohesion rules to reduce computational cost and increase convergence speed. Reference [22] proposed re-incorporating these rules reduces the convergence speed which is advantageous in pushing the algorithm out of stagnation. The effects of topologies on PSO were studied in [23], the SPSO has a star topology, where every individual is connected to other individuals such that information or direction of search is communicated and implemented throughout the swarm. Observing that this topology allows too much communication between the swarm particles and may be responsible for the quick convergence and stagnation of the SPSO, Reference [24] investigated the circle, wheel, and random topologies which isolate the individual particles of the swarm at different degrees so that information is communicated to the swarm by the focal individual or short-cuts between the isolated groups thereby causing a buffering effect which reduces the convergence speed of the swarm and improves search results. In [25], it was shown that the success of individual particles is not as a result of only the particle with the best fitness but by the influence of the entire swarm to a certain degree. An algorithm was presented that allowed every particle to have a weighted influence on other particles, based on their fitness such that particles with higher fitness exerted more influence. References [26,27] proposed the combination of SPSO with other computational search methods like conjugate gradient and steepest descent respectively. These variations of PSO also aimed at slowing down the convergence speed by allowing the algorithm to stop and search for promising regions in the local space, while [28] successfully merged PSO with ABC for nonlinear statistical analysis. Swarms are best suited for analyzing static search spaces with one global solution (unimodal). In reality, most robot analysis problems contain more than one local solution (multimodal) and the search space is sometimes dynamic, therefore maintaining diversity is crucial for the performance of PSO. Various strains of PSO involving sub-swarms have been developed for this purpose, PSO was combined with expanding neighborhood topology in [29] to solve the permutation flow-shop scheduling problem. The algorithm is initiated with sub-swarms of small size neighborhoods, slowly expanding through every iteration, absorbing other particles, taking advantage of both the global and local neighborhood structures to increase the performance of the PSO algorithm. Competitive strategy was used in [30] to manage convergence, while entropy measurement was employed to maintain the diversity of the swarm. In [31], an adaptive multi-swarm competition PSO was proposed where the swarm is adaptively divided into sub-swarms and a competition mechanism is used to maintain diversity in the swarms. The sub-swarms slowly converge, adaptively reducing the number of swarms while balancing between exploration and exploitation tendencies. Other algorithms that employed sub-swarms include [32][33][34][35]. Although multi-swarm based algorithms were found to be efficient for solving multimodal problems, these algorithms have very high computational cost [33]. The new trends of adaptive SPSO where the inertia weight and acceleration components are altered during the search process is capable of improving exploration and exploitation tendencies with less computational cost [36]. In [37][38][39][40] the parameters of the adaptive PSO were dependent on the quality of the solution and tailored to the specific problem, the parameters were updated by comparing the values of the best particles (P iBest and G iBest ). This technique was found favorable in analyzing both static and dynamic search spaces without incurring too much computational cost.

PSO and Robot Parameter Identification
Over the years, the use of PSO for robot parameter identification has been researched, a comparison between the linear least squares (LLS) method and the PSO was presented in [41] for the dynamic parameter identifications of a 3DOF Staubli RX-60 robot manipulator, where the PSO was found to produce better results. Reference [42] combined the linear simplification of the LLS and the non-linear optimization of the PSO for online and offline parameter identification of space robots. Space robots encounter changes in their kinematic parameters while running in the orbit. The non-linear model is first used for parameter identification in the offline mode while the LLS is used for online identification in the follow-up mission knowing that the parameters would not change much. These works and other similar research works exhibit the superiority of intelligent swarm-based techniques over traditional methods. A hybridized genetic algorithm and PSO (GAPSO) was implemented by [43] for parameter identification of a SCARA robot, [44] also implemented a hybridized BPNN and PSO for determining the kinematic parameters of a 6DOF robot manipulator, while [45] investigated the performance of seven PSO variants in solving the inverse kinematics of 2DOF robots. In [46,47], a combination of PSO and simulated annealing (SA) was used to optimize the geometric structure of non-redundant 6DOF manipulators. In [48] the Elitist Learning Strategy PSO (ELS-PSO) for dynamic parameter analysis of a 3DOF Staubli RX-60 robot manipulator. The Quantum-Behaved PSO (QPSO) was implemented for parameter identification of a puma 560 robot by [49] in two steps by first optimizing the individual joint parameters so that the identified values are close to the theoretical values, then all the joint parameters are further optimized simultaneously around the previously converged values. During the course of this research, it was observed that the solution for robot kinematic parameter identification problem did not converge under the basic parameters of the PSO especially when there were more than three degrees of freedom, and most published works implementing the PSO for robot parameter identification either used lower DOF robots or the algorithms were enhanced, modified and hybridized usually for specific robot manipulators, these algorithms are often not applicable for other robot configurations. Therefore, the concept of a novel Mutating PSO (MuPSO) algorithm was conceived for analyzing robot kinematics. To the best of our knowledge, there has not been any research tailored at determining the best range of PSO parameters to develop an algorithm for robot analysis, therefore this work aims to develop a new PSO variant capable of analyzing all robot configurations and least likely to fall into stagnation. This was achieved by first studying the behavior of PSO under various robot configurations and determining a new range of parameters for robot kinematic analysis, then a suitable adaptive technique was investigated and finally, the mutation function was implemented. A total of 54 different PSO parameters were tested on 6 robot manipulators. The rest of this paper is organized as follows; Section 2 presents the kinematic model of the robot configurations to be studied and the fitness function for the algorithm was formulated. Experiments studying the behavior of these robot configurations under various parameters were conducted in Section 3, the new adaptive strategy is presented in Section 4, comparing it with other variations of PSO. The results are presented in Section 5, the Mutation function was introduced in Section 6 and in Section 7 conclusions were drawn, while Section 8 presents the future thrust.

Kinematic Model of Robots
To determine a new set of parameters for robot analysis, the effect of four popular robot configurations was studied under various parameters. The robot configurations include the Articulate, Stanford, SCARA, and Dual-Arm robot configurations. These robot configurations were implemented on six different robot manipulators; the articulate configuration was implemented on a 3DOF robot manipulator because it is regarded as the most complex spatial robot configuration. The articulate robot configuration was also implemented on two different 6DOF robot manipulators of different sizes to study the effect of size on the PSO parameters.

Robot Configurations
Industrial manipulators usually have 6DOF as this gives the manipulator optimum dexterity, allowing it to complete most tasks in an industrial workspace. A robot with less than 6DOF is deficient, as it is easier to analyze and control but it cannot reach all the possible positions and orientations in its workspace. A redundant robot possesses more than 6DOF, they are more flexible, capable of maneuvering behind obstacles but more expensive to analyze and control. The SCARA manipulator is an example of a deficient robot manipulator, articulate manipulators are usually 6DOF while the dual-arm robot is a redundant manipulator (usually greater than 6DOF). It would be keen to note that the presence of a prismatic joint in any robot configuration simplifies the analysis while complicating the solution, it requires less computation but, like redundant configurations, there is a possibility of having numerous or even infinite solutions to every problem. The joints and end-effector of robots are always oriented along the z-axis of the coordinate frame.
• Scara Robot Configuration: The Selective Compliance Assembly Robot (SCARA) is one of the earliest industrial manipulators patented in 1981, it is usually a 4-or 5-DOF manipulator with all revolute joint, except one. In this analysis, a 4DOF SCARA manipulator shall be analyzed. The first joint of the manipulator being the prismatic joint, the other joints are revolute, parallel to each other and pointing along the direction of gravity. The SCARA manipulator is shown in Figure 1a and the DH-parameters are tabulated in Table 1.

•
Articulate Robot Configuration: The articulate manipulator is the most popular robot configurations used in industrial workspaces, its analysis and solutions are trivial, therefore a very high accuracy can be achieved. All the joints of the articulated robot are revolute with the first joint pointing along the direction of gravity.
The second third and fifth joints are parallel to each other and perpendicular to the first joint axis. The fourth and sixth joints are coincident and perpendicular to all the other joints. Three articulated manipulators were used in this analysis, one 3DOF articulated manipulator and two 6DOF articulated manipulators with significantly different sizes. The 3DOF articulate manipulator is configured exactly like the first three joints of the 6DOF articulate manipulator previously described. Figure 1b shows the 3DOF while Figure 2a shows the 6DOF robot configurations, their D-H parameters are tabulated in Tables 3-5.

•
Stanford Robot Configuration: The Stanford manipulator is also a 6DOF manipulator with five revolute joints and one prismatic joint. It is configured very much like the articulate arm except that the third arm is prismatic. The Stanford manipulator is shown in Figure 2b with its detailed D-H parameters defined in Table 2.

•
Dual-Arm Robot Configuration: The dual-arm robot is the most dexterous of the manipulators with a total of 17DOF which are all revolute. It is configured such that the first joint at the 'base' of the structure is pointing along the direction of gravity. The third joint is parallel to the first joint and coincident with the fourth joint. The fifth, seventh, and ninth joints are also coincident with the third joint.
Mathematics 2019, 7, x FOR PEER REVIEW 6 of 33 The second third and fifth joints are parallel to each other and perpendicular to the first joint axis. The fourth and sixth joints are coincident and perpendicular to all the other joints. Three articulated manipulators were used in this analysis, one 3DOF articulated manipulator and two 6DOF articulated manipulators with significantly different sizes. The 3DOF articulate manipulator is configured exactly like the first three joints of the 6DOF articulate manipulator previously described. Figure 1b shows the 3DOF while Figure 2a shows the 6DOF robot configurations, their D-H parameters are tabulated in Tables 2-4.  Stanford Robot Configuration: The Stanford manipulator is also a 6DOF manipulator with five revolute joints and one prismatic joint. It is configured very much like the articulate arm except that the third arm is prismatic. The Stanford manipulator is shown in Figure 2b with its detailed D-H parameters defined in Table 5.  Dual-Arm Robot Configuration: The dual-arm robot is the most dexterous of the manipulators with a total of 17DOF which are all revolute. It is configured such that the first joint at the 'base' of the structure is pointing along the direction of gravity. The third joint is parallel to the first joint and coincident with the fourth joint. The fifth, seventh, and ninth joints are also coincident with the third joint.              The fourth, sixth, and eight joints are parallel to each other and perpendicular to the first joint while the second joint is perpendicular to all the other joints. Figure 3 illustrates the dual-arm robot manipulator while Table 6 shows the D-H parameters of the robot. The fourth, sixth, and eight joints are parallel to each other and perpendicular to the first joint while the second joint is perpendicular to all the other joints. Figure 3 illustrates the dual-arm robot manipulator while Table 6 shows the D-H parameters of the robot.

Joint
Link

Fitness Function
The homogeneous matrix of each successive pair of frames can be obtained using the formula in (7) below from the D-H parameters. the transformation matrix T for the robot manipulator's end effector is a product of post multiplication as shown in the formula in (8).

Fitness Function
The homogeneous matrix of each successive pair of frames can be obtained using the formula in (7) below from the D-H parameters. the transformation matrix T for the robot manipulator's end effector is a product of post multiplication as shown in the formula in (8).
If the actual values of T read from sensors attached to the robot's end-effector is given in A, then the fitness function (Fitness) would be as described in Equations (10) and (11). Where k [1, 2, . . . , dof], subscripts i, j [1, 2, . . . ,4] and E = 1 × 10 −8 . Most robots are usually fitted with encoders, gyroscopes, and current controllers which can measure joint position, end-effector orientation, and actuator currents (torque) respectively. There are a variety of sensors that can also be mounted manually on robots.

Determining New PSO Parameters
An experiment aimed at studying the behavior of all popular robot configurations on different PSO parameters was performed to identify the best values of w and c that balances out exploration and exploitation tendencies while ensuring convergence of results and also to determine the solutions with the best computational efficiency. The initial value of w (w i ) was set to 0.7, increasing with an interval of 0.4 to a final value (w f ) at 1.5, such that w = 0.7:0.4:1.5. The initial value of c (c i ) was set at 1.5, increasing with an interval of 0.3 to a final value (c f ) at 3.9, such that c = 1.5:0.3:3.9 as elaborated in Figure 4. Then the experiment was repeated for c = 1.4:0.6:2.6 and w = 0.6:0.3:3.0. The 6 robot configurations were tested with 54 sets of PSO parameters in 30 generations and 2000 iterations. The mutation function was not implemented in this experiment, the results were tabulated and the performance of the PSO plotted. In Table 7, the average and standard deviation of the best solutions after thirty runs and the solution that best minimizes the problem were presented, the average number of iterations required to find the best solution for each of the six robot manipulators was also presented at w = 0.7. Tables 8 and 9 present a similar set of results for w at 1.1 and 1.5, respectively. To ease comparison and visualization of the results, a summary is presented in Table 10 showing the averages of normalized values obtained in Tables 7-9 while Figure 5a-f shows a pictorial plot of the performance of PSO for each of the robot manipulators. Similarly, Tables 11-14 and Figure 6a-f present the results and plots for the seco−nd experiment. The minimum solution for each robot manipulator problem was reported in this analysis because the average solutions (after 30 runs) usually reported in other works of literature does not completely capture the results obtained from the experiment especially in the SCARA, Stanford and dual-arm configurations where there is a possibility of multiple solutions to every problem. It can be shown that the average best solution alone is not enough to make a good comparison between the different scenarios. If the minimum solution presented in the tables represent the probability for the given parameters to find the minimum solution whereas the average best solution represents the probability for the solution to run into stagnation, then it can be shown that some parameters with very competitive average solutions are not capable of finding the minimum (global best) solution.
Mathematics 2019, 7, x FOR PEER REVIEW 10 of 33 run into stagnation, then it can be shown that some parameters with very competitive average solutions are not capable of finding the minimum (global best) solution. While some other parameters with very poor average best solutions are capable of finding the minimum solution. For example, the results for the SCARA robot configuration in Table 11 shows that when c is 1.4 and w is between 2.4-2.7 the average best solution dominates the results obtained when w was between 1.2-1.5, yet the solution of the former cannot find the global minimum solution, and many more instances can be sited. Accuracy is very important in robot analysis, therefore the best solution should be able to find the global minimum solution always, followed by the solution that can find the global minimum at least once. Algorithms that may produce competitive averages yet incapable of locating the global minimum are regarded as poor solutions. Therefore, the minimum solution achieved by every pair of parameters was reported in the tables as the minimum solution. The aggregate performance of the PSO presented in Table 10, and Table 14 is an average of the normalized values obtained in the experiments such that the variables with higher normalized  6.10 × 10 −9 6.10 × 10 −9 6.10 × 10 −9 6.10 × 10 −9 6.10 × 10 −9 6.10 × 10 −9 6.10 × 10 −9 6.10 × 10 −9 6.10 × 10 −9 Iteration 74.  6.10 × 10 −9 6.10 × 10 −9 6.10 × 10 −9 6.10 × 10 −9 6.10 × 10 −9 6.10 × 10 −9 6.10 × 10 −9 6.10 × 10 −9 6.10 × 10 −9  Table 9. Performance of PSO when w = 1.5.
Performance Rank   While some other parameters with very poor average best solutions are capable of finding the minimum solution. For example, the results for the SCARA robot configuration in Table 11 shows that when c is 1.4 and w is between 2.4-2.7 the average best solution dominates the results obtained when w was between 1.2-1.5, yet the solution of the former cannot find the global minimum solution, and many more instances can be sited. Accuracy is very important in robot analysis, therefore the best solution should be able to find the global minimum solution always, followed by the solution that can find the global minimum at least once. Algorithms that may produce competitive averages yet incapable of locating the global minimum are regarded as poor solutions. Therefore, the minimum solution achieved by every pair of parameters was reported in the tables as the minimum solution. The aggregate performance of the PSO presented in Table 10, and Table 14 is an average of the normalized values obtained in the experiments such that the variables with higher normalized values have better performance, also a penalty was introduced when solving the average of normalized values, where binary probability distribution was used to replace the normalized minimum solution such that the solutions capable of finding the global minimum solution were assigned the value 1 while other undesirable results were assigned the value 0.

Observations
For the 3DOF Articulate robot configuration in Table 10, a random-like fluctuation in the performance of the PSO can be observed. When w was at 0.7 the best result was achieved at c = 1.8, it can also be observed that when w was increased to 1.1 the best results occurred at around c = 2.7 then when w was further increased to 1.5 the best result occurred at c = 1.5. However, Figure 5a shows that the performance of the PSO increases with increasing w and decreasing learning coefficient (c).
The performance of the PSO is somewhat stable when c was between 1.8-2.4 and w at 1.5 was found to be dominant. On the other hand, it can be seen from the Table 14 that the best result obtained for the PSO was when w was 1.2 and c was 1.4, then when c was increased to 2.6 the best result was observed at w = 0.9 which suggests that an improved result was achieved with an increasing c and a decreasing w. Figure 6a shows that the performance of the PSO algorithm deteriorates with increasing c. From Table 14 and Figure 6a, it can also be observed that the algorithm was stable when w was between 0.6 and 1.2 with c = 1.4 being dominant.
From Table 7, that when w = 0.7 and c < 2.7, the PSO algorithm was incapable of finding the global minimum solution for the higher DOF robots, likewise in Table 12 when c = 2.0 and w < 1.2. These observations confirm that the standard PSO (SPSO) is only capable of analyzing robot manipulator configurations with lower degrees of freedom. Because the dominant solutions are within the range of the SPSO, but as the DOF increases, the dominant solutions would be seen to deviate from the range of the SPSO.
In the 4DOF SCARA robot configuration, it can be observed from Table 10 that when w was equal to 0.7, the best result was obtained at c = 2.1 when w was increased and c decreased, the performance of the PSO was seen to increases as made evident in Figure 5b. The algorithm can be seen to be stable when c is between 1.8-2.4 and w at 1.5 dominating other solutions. Likewise, from Table 14 and Figure 6b, although it can be observed that the algorithm was stable when w was between 0.6-1.8 the best solution was recorded when w was between 0.9-1.2. In the initial stages when w was small c = 1.4 was dominant, but as w increased, c = 2.0 became the dominant solution.
From Table 10 it would be observed that the best result obtained for a 6DOF Stanford robot occurred when w = 0.7 and c = 3.9. When w was increased to 1.5 the best result was obtained with a decreasing c at 1.5. From Figure 5c the performance of the algorithm can also be observed to deteriorate with increasing w. the algorithm was stable when c was between 1.8-3.6 with w = 1.5 being the dominant solution when c was small, then w = 0.7 becomes dominant when c increases beyond 2.4. In Table 14 when c = 1.4 the best result for the 6DOF Stanford manipulator was obtained at w = 1.5, this value decreases slightly with an increase in c such that at c = 2.6 the best result occurred at w = 1.2. The algorithm was found stable between w = 0.6-1.5 and the solutions of c = 2.0 and c = 2.6 can be seen to compete for dominance. The dominant solution would lay be between c = 2.0−2.6.
The trend of decreasing inertia weight (w) and increasing learning coefficient (c) is observed to continue for the 6DOF Articulate manipulator configurations (both small and big) it can be seen from Table 10 that the best results were obtained at c = 3.6 when w was 0.7 for both configurations, this value reduced to c = 1.8 and c = 2.7 for the small and big manipulators respectively while w increased to 1.5. From Figure 5d,e, it can be observed that the algorithm remains stable when c was between 2.7-3.9 for both configurations with w = 0.7 being the dominant solution. It can also be observed from both plots that the performance of the algorithm also deteriorated with increasing w. An even stronger correlation is observed from Table 14 where the best results occurred at w = 1.5 for all values of c with a slightly decreasing w observed in the larger Articulated robot configuration. From Figure 6d,e, it would be seen that the algorithm is stable when w was between 0.9-1.8 and the dominant solution of c lies between 2.0-2.6. It would, therefore, be safe to deduce that the size of the robot manipulator has little effect on the PSO solution, therefore any PSO algorithm that can analyze a given configuration is most likely able to analyze the different varieties of sizes within the same configuration.
From Table 8 when w = 1.1 at c = 2.3 and c = 3.3, fluctuating results were recorded in the dual-arm configuration which is believed to be a result of stagnation in the algorithm.
Similar results were recorded in Table 13 when c = 2.6 at w = 1.5 and w = 2.4, and also in Table 12 when c = 2.0 at w = 0.6. Otherwise, in Table 10 the best results were obtained at c = 3.0 for w = 0.7 and c = 1.5 when w increased to 1.5. the best result occurred with a decreased value of c at 1.5. Figure 5f shows the performance of the algorithm deteriorates with an increasing w. although the algorithm remained consistent for almost all values of c, a sharp deterioration can be observed when c was 1.5-2.1. w = 0.7 is the dominant solution.
In Table 14 the best results were obtained when c = 1.4 at w = 1.8, the best results were further observed to occur at a decreased w and increased c such that when c = 2.0 the best result was obtained at w = 0.9 and when c = 2.6, the best result was obtained at w = 0.6 which also supports the theory of decreasing w with an increasing c. From Figure 6f, the performance was stable when w was between 0.9-2.1 with c = 2.0 being the dominant solution.

Deductions
The performance of the PSO algorithm was seen to improve with a decreasing inertia weight (w) and an increasing learning coefficient (c) in all the robot manipulator configuration except in the 3DOF Articulate manipulator. Fortunately, our analysis is more concerned with higher DOF robot manipulators, therefore techniques for decreasing w and increasing c shall be investigated. From the observations above for all robot manipulator configurations, the optimal w was 0.6-2.1 while c was 1.8-3.9. These best values were plotted and a fitted curve generated which shall be used to determine a suitable adaptive technique in the next section.

Adaptive Computation Technique
In robot analysis, the multi-swarm variations of the PSO are best suited for trajectory analysis especially in mobile robots where the robot would be required to track or follow a moving target. Kinematic/dynamic analysis of industrial robots generally have static search spaces, so this solution is not suitable considering the increased computational cost. Although the variation of the adaptive PSO which is dependent on the best solution (P Best or G Best ) seems most promising as demonstrated in [45] but this requires knowledge of the established range of values for w and c that ensures exploitation and exploration. It was previously observed that the robot optimization problem does not converge under the conditions of basic parameters for most known EA. Therefore, this research was aimed at establishing a new set of parameters that ensure convergence. As such, the time-dependent variation of the Adaptive PSO shall be implemented for this analysis. Several time-varying algorithms have been reported in theory. A few of which shall be implemented in the foregoing experiment, a total of 13 distinct PSO algorithms shall be used for the experiment.
• PSO 1 : The linear decreasing inertia weight was reported in [40] where inertia weight (w) decreases linearly from 0.9 to 0.4, the governing equation for updating the w is where w max and w min are values of the initial and final inertia weight, t max is the maximum number of iterations while t iter is the current iteration. • PSO 2-3 : A non-linear decreasing inertia weight was also reported in [50] with w decreasing linearly from 0.9 to 0.4. The governing equation for updating the inertia weight is Observe that when n = 1, the inertia weight would be linearly decreasing as shown in Figure 7a, where n is a constant ranging from 0.9 to 1.3, the value n = 1.2 was reported as the recommended value for n in [50] but n = 3 was found to be more suitable for robot analysis. Therefore, the results for the two values n = 1.2 and n = 3.0 shall be presented in this experiment as PSO 2 and PSO 3 , respectively. • PSO 4 : A novel non-linear decreasing w and non-linear increasing c is hereby proposed. The parameters recorded for the best performance of PSO from the previous experiment were plotted and a fitted curve generated as shown in Figure 8. The non-linear technique presented in (15)-(17) exploits the experimental range of values for w and c, where n and m are problem dependent variables.
If the maximum number of iterations is 3000, then the values of the coefficients n and m can be easily determined. The parameter w in PSO 4 shall be updated according on Equation (15) while c 1 and c 2 are updated according to Equation (16), where the learning coefficients are not adaptive therefore a reduced computation cost can be achieved, while the parameters in PSO 11 shall be updated according to Equations (15)-(17) as originally proposed. • PSO 5-6 : The concept of multi-stage decreasing inertia weight was introduced in [51], where w was decreased linearly from 0.9 to 0.4 in three distinct stages. The inertia weight first decreases from the initial value to a predetermined value w m where it remains constant for a while before decreasing further to the final value. As shown in Figure 7b, five different scenarios were presented, and the governing equation for updating the value of the inertia weight in each of the scenarios is given in Equations (18)- (22) t 1 = 1 5 t max , 2 5 t max , 1 5 t max , 2 5 t max , 1 5 t max , 2 5 t max , 3 5 t max , 4 5 t max , 3 5 t max , 4 5 t max , 3 5 w n = 4(w max −w min ) 5 + w min , 2.5(w max −w min ) 5 w m = w n (1) w n (1) w n (2) w n (2) w n (3) w n (3) , The parameter for MLDIW 5 was recommended in [51] for inertia weight but the parameters of MLDIW 3 were found to be more suitable for the robot analysis. The results for the two values MLDIW 5 and MLDIW 3 shall also be presented as PSO 4 and PSO 5 respectively. • PSO 7 : All the aforementioned algorithms exploited only the inertia weight, leaving the learning factor constantly at 2.05. In [52] and [36], a linear decreasing and linear increasing inertia weights were proposed respectively, both with decreasing cognitive component and increasing social component, thereby these techniques exploited both the inertia weight and learning coefficients. The technique reported in [52] shall be utilized in this experiment as it incorporates a linear decreasing inertia weight which is in line with our objectives and its parameters are updated according to Equation (12) above while the cognitive and social components shall be updated as The inertia weight of PSO [8][9][10][11][12][13] shall be updated according to the equations for PSO 1-6 respectively, while the learning coefficients shall be updated according to Equations (16) and (17). For the sake of fair comparison, the adaptive values of w for all the aforementioned techniques shall decrease from the initial value of 2.1 to a final value of 0.6, the cognitive component remains at 2.24 while the social component is nonlinearly increasing from 1.8 to 3.9.
Mathematics 2019, 7, x FOR PEER REVIEW 24 of 33 The technique reported in [52] shall be utilized in this experiment as it incorporates a linear decreasing inertia weight which is in line with our objectives and its parameters are updated according to Equation (12) above while the cognitive and social components shall be updated as The inertia weight of PSO8-13 shall be updated according to the equations for PSO1-6 respectively, while the learning coefficients shall be updated according to Equations (16) and (17).

Results
For this experiment, the swarm size was again maintained at 200, a total of 13 adaptive PSO techniques were tested on all six robot manipulators with the maximum number of iterations for each run set at 3000 and a total of 30 runs each. As earlier presented in previous tables, the solution that best minimizes the problem (global minimum) was presented in Table 15 for every pair of robot configuration and PSO technique, the average and standard deviation of the best solution after 30 runs and the average number of iterations required to find the best solution are also presented. These values were normalized, summed, averaged, then ranked (sorted) such that the solution with the least rank possesses the best performance. The ranking of all tested PSO algorithms is presented in Table 16. The first column of Table 16 presents the PSO techniques according to their ranks. The second to the seventh column of Table 16 shows the individual ranks of all the PSO techniques against the six robot manipulators. In the second column, under 3DOF Articulate robot configuration, PSO 5 has the best solution for the particular robot manipulator followed by PSO 6 , then PSO 10 has the third-best solution, etc. The last column of Table 16 is the sum of all ranks presented in columns 2-7, PSO 13 having the lowest total rank is considered the best result overall. During the course of the experiment, it was observed that: • Most algorithms stagnate above 1 × 10 −3 , also most of the algorithms tested were found to either find the global minimum solution or run into stagnation. Accuracy is an important criterion for robot analysis and control, some algorithms were found to sometimes avoid stagnation but still incapable of finding the global minimum result even after 3000 iterations. This is an anomaly that was unfavorable in this analysis because when taking averages, these solutions gave competitive results, which is capable of confusing the algorithm. Therefore, another penalty was introduced such that if a solution is found to escape stagnation yet incapable of finding the global minimum solution, then the best solution for that run is recorded as 5.5. This signifies that the run gave bad results, and this problem is easily captured when taking averages. • It can be seen from Table 15 that using the parameters derived from the previous experiment in place of the parameters of the PSO enhances the results as all the adaptive PSO techniques implemented so far found the global minimum solution except in PSO 5 and PSO 12 . When the robot configuration has more than 4DOF PSO 5 was not capable of finding the global minimum solution while PSO 12 could not find the global minimum for the 6DOF Stanford robot configuration. Since almost all the algorithms were capable of finding the minimum solution, the quest was therefore reduced to finding the algorithm with the least computations and less likely to fall into stagnation.

•
From the results presented in Table 16, it can also be deduced that varying both the inertia weight and learning coefficient produces better results in adaptive PSO algorithms compared to only varying the inertia weight.

•
It would also be observed that the proposed algorithm (PSO 11 ) does not perform well at lower DOFs but performed better than PSO 10 at higher DOF configurations. PSO 13 perform well across all robot configurations. producing the best result for all techniques tested in this experiment.

•
In the NLDIW adaptive technique, although PSO 2 was recommended in [50], it can be seen from  (16) and (17) greatly improved the performance of the PSO algorithm as it can be seen that the modified algorithms in PSO [8][9][10][11][12][13] performed better than their counterparts with constant learning factors (PSO 1-6 ).

Mutation Function
Structural bias in population-based algorithms is a characteristic that confines the search in a constrained search space. Replacing randomly selected samples with newly generated random samples enhances unbiased coverage of the search space [53]. In the mutating PSO algorithm, when the algorithm stagnates at a local optimum solution, a mutation operation is used to replace the swarm with new samples. The mutation function is an artificial perturbation of the system used to push the algorithm out of stagnation. The mutation probability was set at 100%, because if any solution from the previous iteration should remain, then that solution shall be the global best solution for the next iteration, therefore, the entire swarm would converge on that solution causing a recurring stagnating cycle. Four variables and two end conditions were introduced to train the algorithm to identify a stagnating solution. When the two conditions are satisfied, the algorithm terminates the iteration signifying that the actual solution has been identified, while if only one condition is satisfied, it signifies that the algorithm has run into stagnation and the mutation function is initiated. The abandonment threshold (E) is the global minimum solution. The Fitness error (e) is the difference between the current Fitness and the previous Fitness as elaborated in Equation (25), and the abandonment counter (q) monitors the second differential of Fitness error. When the second differential of the Fitness error becomes small than E then the algorithm is assumed to have slowed down, therefore, the condition in Equation (26) states that when the difference in e is less than E then q begins to count consecutively through every iteration, and if the condition in (26) is broken then counter in q is reset to zero.
The two end conditions in Equation (27) states that when q is equal to or greater than the abandonment limit (Q) and E is less than 1 × 10 −8 then the algorithm has found the global minimum solution and should be terminated, but when only the first condition is met then this signifies that the algorithm has run into stagnation. Q should be large enough so as not to prematurely terminate a solution allowing the algorithm to break out of stagnation but must also not be too large to allow a failed solution to continue. Table 17 shows the performance of the a few variants of PSO modified with the mutating operator. The proposed mutating PSO algorithm is presented in the first column, followed by the basic PSO (w = 1.0 and c = 2.05). The MLDIW-PSO with the enhanced parameters is in the third column as Mu-MLDIW, while the basic MLDIW (w = 0.9-0.4) is in the fourth. Likewise, the NLDIW-PSO with enhanced parameters is presented in the fifth column as Mu-NLDIW, and the basic NLDIW is in the last column. All these algorithms were further enhanced with the mutating operation.
Observe that all the basic PSO algorithms were able to analyze the 3DOF articulate and 4DOF SCARA manipulators, but unable to find the minimum solution for the higher DOF manipulators. At lower DOFs, although the basic PSO algorithms gave better results, the results from the proposed MuPSO are sufficient for robot analysis as seen in Table 18 where the joint parameters of the robots are identified with an accuracy of three decimal places.
Converging results were not obtained for the Stanford and the Dual-arm configurations. In a real experiment, the robot would be required to move from a known initial position and orientation T i to a final destination T f , therefore introducing more constraints like minimizing the distance traveled by joints or the energy consumption of joints may improve the convergence of prismatic and redundant configurations. Table 17. Performance of the mutating particle swarm optimization.

Conclusions
Research into developing an intelligent swarm-based algorithm for robot analysis and parameter identification was proposed, experiments were performed to study the behavior of four popular robot configurations under various PSO parameters, and two anomalies were identified from the experimental results and successfully resolved. The anomalies were capable of masking poor solutions as good solutions. In this experiment, all the strong local minimizers have been identified; the 3DOF articulate configuration has only one strong local minimizer with Fitness = 2.0 at a position vector of [80, −40, −60] T . The 4DOF SCARA configuration also has only one local minimizer at Fitness = 4.0 with an infinite possibility of position vectors, while the other higher DOF robot configurations have at least five minimizers each. The minimizers are very sensitive, they are shifted by the slightest change in parameters therefore it is almost impossible to identify the stagnation points in real-time. An average solution is capable of breaking out of weak local minimizer but even the best solutions are helpless in the vicinity of a strong local minimizer. This is the basis of introducing the mutation function, to help break algorithms out of stagnation.
Since the algorithm can be taught to identify stagnating solutions, then the best solutions either find the global minimizer or stagnate at local minimum, but not linger without a solution. The two anomalies observed were capable of disguising poor solutions and confusing the algorithm therefore two penalties were introduced to help unmask poor solutions while distinctively identifying the best solutions. Some correlations were observed between the robot configurations and the various PSO parameters, a non-linear decreasing inertia weight and a non-linear increasing correction factor were adopted based on the experimental results. A new range of adaptive parameters were identified and implemented on the PSO algorithm. The algorithm was found to be capable of solving the robot kinematic problem for all four robot configurations. Algorithms from other works of literature were also modified with the newly identified adaptive parameters and compared with the proposed algorithm for solving robot kinematic problems. The proposed algorithm was found to dominate the other algorithms reported in the literature, succumbing to only the modified MLDIW-PSO that had the best overall performance, surpassing the runner up with large margins while the modified NLDIW and the proposed MuPSO algorithm closely contested the second position. More emphasis is on higher DOF configurations, therefore, if the lower DOF manipulators are ignored, the MuPSO would completely dominate the NLDIW-PSO in PSO 10 .

Future Thrust
The future aspirations of this work are to implement the algorithm in dynamic parameter identification of these robot manipulators, and also to compare the performance of the proposed algorithm with other metaheuristics on standard benchmark function. Testing the algorithm on benchmark functions would hopefully shed more light on the complex phenomena of modeling and control of non-linear dynamic systems. The algorithm described herein utilizes a time-dependent adaptive technique, a solution dependent (P Best or G Best based) adaptive technique seems more promising with better maneuverability, therefore since the range of parameters which ensure convergence of the robot dynamic problem has been established, it would be worthwhile to investigate a solution dependent algorithm for robot analysis. It has been established that even the best solution runs into stagnation, studying the initial conditions of the randomly populated swarm may give more insights on early identification of stagnating solutions so that the algorithm can be trained to completely avoid them.