Improvement of trajectory tracking by robot manipulator based on a new co-operative optimization algorithm

: The tracking of a predeﬁned trajectory with less error, system-settling time, system, and overshoot is the main challenge with the robot-manipulator controller. In this regard, this paper introduces a new design for the robot-manipulator controller based on a recently developed algorithm named the butterﬂy optimization algorithm (BOA). The proposed BOA utilizes the neighboring butterﬂies’ co-operation by sharing their knowledge in order to tackle the issue of trapping at the local optima and enhance the global search. Furthermore, the BOA requires few adjustable parameters via other optimization algorithms for the optimal design of the robot-manipulator controller. The BOA is combined with a developed ﬁgure of demerit ﬁtness function in order to improve the trajectory tracking, which is speciﬁed by the simultaneous minimization of the response steady-state error, settling time, and overshoot by the robot manipulator. Various test scenarios are created to conﬁrm the performance of the BOA-based robot manipulator to track different trajectories, including linear and nonlinear manners. Besides, the proposed algorithm can provide a maximum overshoot and settling time of less than 1.8101% and 0.1138 s, respectively, for the robot’s response compared to other optimization algorithms in the literature. The results emphasize the capability of the BOA-based robot manipulator to provide the best performance compared to the other techniques.


Introduction
The robot-manipulator dynamics are driven by a set of high, nonlinear and hardly coupled differential equations.Thus, in order to design the controller based on the traditional tuning methods and to provide accurate motion for the manipulator, a complicated mathematical formulation of the optimization problem is required.In addition, the trajectory variation during the robot's motion represents a significant challenge of robotic manipulators [1].However, the simple, decentralized proportional integral derivative (PID) controller can be utilized for each robot-manipulator arm instead of the complicated, centralized torque-computation scheme.Furthermore, the decentralized PID control scheme can decrease the complicated online computation that is associated with the inverse dynamics of the robot manipulator.However, the tuning of the controller gains demonstrates the challenging requirements of the robotic manipulator to perform well.
Recently, various control approaches have been devoted to controlling the movement of the robotic manipulator.In [2], a robust PID controller was designed based on Lyapunov's direct theory for cable-driven parallel robots.A wearable robotic system was utilized with a PID controller in order to guarantee the asymptotic stability of the robot in [3].In [4], A PID controller was applied to a quadrotor based on the analysis of the dynamic characteristics of the robotic system.However, the applied PID controller in these works was tuned based on the trial-and-error method.In [5], adaptive fuzzy logic (FL) was utilized to adjust the robot-controller parameters and motion trajectories.A type-2 fuzzy logic with neural networks was optimized by particle-swarm optimization (PSO) for agricultural robots in [6].Thus, the FL requires a fine adjusting for the membership functions, which complicates its implementation.In [7], a robotic manipulator based on neural networks (NNs) was reported for different applications.In [8], a distributed NN scheme was utilized for multiple redundant manipulators with co-operative control.An adaptive tracking was performed based on NNs with a robust compensator for robot manipulators [9].
However, the NN requires an adjustable dataset in order to create the predictive model for the training and validation processes.Besides, the computational process requires a high-speed microprocessor during the training and validation processes.Among the previous control techniques, the simple implementation of the PID controller is the main reason that it is the popular controller in most industrial systems [10,11].Thus, the gains of the PID controller require fine-tuning in order to yield a good performance.Various conventional tuning methods such as Ziegler Nichols (ZN) and graphical systems adjust the PID controller gains in the literature [12,13].The ZN is structured based on fixed rules by which all systems tune the PID gains that would otherwise fail in most applications in order to yield a good response [14].On the other hand, the graphical methods require a complicated formulation, especially in large systems, in order to solve the tuning problem.
Furthermore, graphical methods require a long computational time and are nonoptimal [15].Recently, artificial intelligence (AI) techniques effectively solved the optimization issues in various engineering applications [16].In [17], an optimal tuning of the controller of the robotic manipulator was performed by the genetic algorithm (GA) in order to adjust the output torque of the robot.A developed PSO variant was presented to optimize a fractional PID controller in [18].In [19], the ant-colony optimization (ACO) was applied to select the proper gains of the fuzzy controller for a mobile robot.The cuckoo search algorithm (CSA) was introduced for the path planning of a mobile robot in [20].In [21], the CSA was utilized to optimize the parameters of a sliding-mode controller for a robot with multiple degrees of freedom.In [22], a hybrid optimization algorithm was developed based on the GA, PSO, and probabilistic neural network (PNN) for gear-fault diagnosis.In [23][24][25], ring probabilistic logic neural networks (RPLNN) based on the concept of the PLNN were developed in order to solve the optimization issue [26].The main problem of these optimization algorithms is issue of trapping at a local optimum.
The contribution of this paper is to suggest a developed optimization algorithm, termed the butterfly optimization algorithm (BOA), for the proper tuning of a robotic manipulator controller.This algorithm requires few adjustable parameters and utilizes the co-operative movement between the butterflies in order to obtain the optimal global solution, as well as to avoid being trapped at a possible local optimum point.The performance of the suggested algorithm is compared to the performances of the GA-based controller [27] and the cuckoo-search-algorithm (CSA)-based controller [28].Furthermore, the performance of the suggested method is confirmed by carrying out different test scenarios.
The following points are the core contributions of the paper:

•
Introducing a new intelligent design for the robotic manipulator controller in order to track linear and nonlinear trajectories.

•
The tuning of the controller is performed based on an optimization algorithm with fewer adjustable parameters known as the BOA.

•
The proposed BOA is combined with a new figure of demerit objective function in order to handle the minimization of the system overshoot, steady-state error, and settling time in a co-ordinated way.

•
The proposed BOA is evaluated with different methods in the literature.

•
The results confirm the superiority of the BOA-based robotic manipulator controller to track the linear and nonlinear trajectories with a low steady-state error and system overshoot accepted and a short system-settling time.
The remaining sections of this paper are organized as follows.Section 2 describes an overview of the optimization algorithms.Then, the model of the robotic manipulator is illustrated in Section 3. Next, the results and discussions are presented in Section 4. Finally, Section 5 contains the conclusion of this research.

Optimization Algorithms-Based Optimality 2.1. Overview
Recently, optimization algorithms (OAs) have become widely utilized to tune unknown gains [29,30].Such OA solutions have been widely applied to engineering applications with promising performances .The calculation of the OA is devoted to adjusting the proper values of unknown gains in order to provide an acceptable performance for the controller.According to the target, the optimization problem is defined as a single or multi-objective fitness function [57,58].The inputs and outputs of the system are combined by mathematical formulation to describe the fitness function [59,60].The OA investigates the proper values of the controller gains within a predefined limit in regards to the controller and system dynamics.The nonlinear and hardly coupled differential equations of the robotic manipulator make the tuning of the controller more difficult.The OA provides an effective solution for this issue in various control applications for conventional methods [61,62].The solution process of the OA ensures the determination of the optimal global solutions for complex optimization models [63][64][65][66][67][68][69].The use of statistical tests was investigated in [70] for comparing swarm and evolutionary computing algorithms.The adjustable gains and the trapping at local solutions represent the main issues against the implementation of the OA to tune the controller gains.In [71][72][73], the PID tuning was performed using the BOA for different engineering problems.This paper proposes the BOA as a recent OA that requires few adjustable parameters.Furthermore, the co-operation between different agents is utilized in the BOA in order to expand the expected exploration behavior that enhances the global search and decreases the trapping possibility at a particular local optimum point.The key structure of the proposed BOA is described in the following subsection.

Butterfly Optimization Algorithm Concepts
The butterfly optimization algorithm is a novel AI technique that imitates the foraging behavior of butterflies [74,75].The co-operation between butterflies is the inspiration for the global-search behavior of this algorithm.The BOA is divided into three phases named the initial, iterative, and final stages.In the initial stage, the algorithm's parameters and the objective function are defined, the initial population is randomly started, and the initial solutions are determined.After the initial population, the iterative stage starts by calculating the fitness function of all the butterflies.Then, the butterflies generate the fragrance according to stimulus intensity as follows: where The value of fragrance c The sensory modality I The stimulus intensity a The absorption indicator According to the fitness function, each butterfly in the algorithm produces a different fragrance in intensity.The algorithm has two search steps, named global and local search, with switching probability (P).In the global search, the butterfly moves to the best butterfly, or solution, as follows: where The current solution vector t The current iteration i The butterfly index g* The current best solution f i and r The random number within [0, 1] In the local search, the butterfly moves randomly to the neighboring butterfly, or solution, as follows: where x j (t) and x k (t) are the neighboring butterflies of the current solution.This local movement between the butterflies increases the exploration manner of the algorithm and prevents it from being trapped at a local optimum solution.The flowchart shown in Figure 1 gives the detailed steps of the BOA.It is important to note that the key purpose of this paper is to handle the trajectory tracking by the robot manipulator, which any available optimization algorithm can solve.We have nominated the recent butterfly optimization algorithm (BOA) as it has a high performance according to several previous publications (see ref. [62]), which means that it can quickly find the optimal global solution.Specifically, PSO and other optimizers have been compared with the BOA in [62], where the superiority of the BOA was proven after considering different optimization problems.

Robotic Manipulator Modeling
A set of differential equations are utilized to describe the robot dynamics.These equations consist of different terms named inertia, torque, load, and gravity.The movements of the links in a defined trajectory with a certain speed require that an appropriate torque be applied to the actuator of the links.The modeling of the manipulator, which represents the robot dynamics of n-links, is governed by the following nonlinear equations [27]: where The robotic manipulator utilized in this paper is a two-degrees-of-freedom robotic manipulator and it has 'n = 2' of links.The dynamics equations that represent these manipulator links, which are shown in Figure 2, are described as follows [75]: .

Results and Discussions
The tracking issue of both linear and nonlinear trajectories is the main target of the robotic manipulator movement.Subsequently, a particular robotic manipulator necessitates the proper torque for its links to track the reference trajectories.The PID controller is The proper torque for each link is adjusted by the output control signal based on the PID, as described in the following equation: where er i represents the error signal and θ d,i characterizes the desired reference trajectory.Note that θ i characterizes the output angular displacement.

Results and Discussions
The tracking issue of both linear and nonlinear trajectories is the main target of the robotic manipulator movement.Subsequently, a particular robotic manipulator necessitates the proper torque for its links to track the reference trajectories.The PID controller is proposed as a simple controller to adjust the torque of each link.Thus, the PID gains require fine-tuning in order to provide good performance with less settling time and steadystate error, as well as a low system overshoot.This paper introduces a developed figure of demerit objective function that can handle the minimization of the system overshoot, steady-state error, and settling time in a co-ordinated way.Therefore, the anticipated BOA is tasked with tuning the links' controllers to yield suitable gains in order to track trajectories with less error, settling time, and maximum overshoot based on a reduction of the developed figure of demerit objective function.This function is represented as follows: where, E SS,i , t s,i , and M P,i represent the steady-state error, settling time, and the maximum overshoot of the response due to each link, respectively.Additionally, β is utilized a weighting factor to stabilize the minimization of two parts of the figure of demerit objective function.In this work, β is made equal to 0.7 because, at this point the weighting (1 − e −β ) ≈ e −β and the BOA will equilibrate the minimization of the steady-state error, settling time of the system, and the maximum overshoot of the system.If β is less than 0.7, the BOA will focus on minimizing the settling time.Otherwise, if β is higher than 0.7, the BOA will focus on minimizing the overshoot.The BOA performed the tuning of the controller gains at the nominal parameters of the robotic manipulator, the limits of the controller's gain [K P,i ; K I,i ; K D,i ] for each link are (lower limit = [0;0;0] and upper limit = [250;1;20]).The BOA parameters of the system are as follows: the extreme number of the possible agents is designated to be 100 while adopting an iteration number of 50.
The optimization is performed at a linear unit-step trajectory in order to determine the steady-state error, settling time, and the maximum overshoot of the response due to each link.The results are driven after around 30 runs.The system parameters are: (1) the m1 and m2 values are 0.1 kg; (2) the l1 value is 0.8 m; (3) the l2 value is 0.4 m; and (4) the g value is 9.81 m/s 2 [27].The proposed BOA-based PID controller is compared with the GA-based PID controller from [27] and the CSA-based PID controller from [28].The controller parameters and the corresponding value of the objective function (J) are recorded in Table 1. Figure 3 presents the value of the objective function due to each technique in the bar chart as an illuminated comparison technique.The optimization operation is performed by a MATLAB R2019b intel CORE i7 and 8g RAM computer.Note that the procedure of the BOA to tune the controller gains is concluded in the pseudo-code as follows (Algorithm 1 [62]):  It is clear from Figure 2 and Table 1 that the introduced BOA can minimize the objective function better than the GA from [27] and the CSA from [28].Table 2 compares the Integral of Absolute Error (IAE) and the Integral of Squared Error (ISE) performance index values based on each algorithm.As noticed, the IAE and ISE values by the proposed BOA are lower than those of the other two controllers.Likewise, the introduced BOA has lower values of tuning factor when compared to the other algorithms (see Table 3), which enhance the performance of the robot with a fast convergence rate at 6 iterations, as shown in Figure 4, which was less than the CSA-based PID [28] which reach after approximately 44 iterations.However, the multi-objective GA utilized in [27] has a different convergence  It is clear from Figure 2 and Table 1 that the introduced BOA can minimize the objective function better than the GA from [27] and the CSA from [28].Table 2 compares the Integral of Absolute Error (IAE) and the Integral of Squared Error (ISE) performance index values based on each algorithm.As noticed, the IAE and ISE values by the proposed BOA are lower than those of the other two controllers.Likewise, the introduced BOA has lower values of tuning factor when compared to the other algorithms (see Table 3), which enhance the performance of the robot with a fast convergence rate at 6 iterations, as shown in Figure 4, which was less than the CSA-based PID [28] which reach after approximately 44 iterations.However, the multi-objective GA utilized in [27] has a different convergence curve.Note that the effectiveness of the proposed technique is confirmed by applying the following test scenarios:

Scenario 1: Step Reference Trajectory
In this Scenario, the effectiveness of the introduced BOA based on the developed figure of demerit objective function is confirmed by applying the unit-step input as a reference trajectory for each link.Figures 5 and 6 show the output responses of the robotic manipulator due to each method.The maximum overshoots and the settling times of the output responses of each link are recorded in Table 4. Figure 7 presents the maximum overshoots and the settling times of the output responses of each link as a bar chart for more clarification.It is clear that the proposed BOA-based PID controller has a high damped performance and less settling time and overshoot when compared to the GAbased controller and the CSA-based controller, as shown in Figures 5-7 and Table 4.

Scenario 1: Step Reference Trajectory
In this Scenario, the effectiveness of the introduced BOA based on the developed figure of demerit objective function is confirmed by applying the unit-step input as a reference trajectory for each link.Figures 5 and 6 show the output responses of the robotic manipulator due to each method.The maximum overshoots and the settling times of the output responses of each link are recorded in Table 4. Figure 7 presents the maximum overshoots and the settling times of the output responses of each link as a bar chart for more clarification.It is clear that the proposed BOA-based PID controller has a high damped performance and less settling time and overshoot when compared to the GA-based controller and the CSA-based controller, as shown in Figures 5-7 and Table 4.

Scenario 1: Step Reference Trajectory
In this Scenario, the effectiveness of the introduced BOA based on the developed figure of demerit objective function is confirmed by applying the unit-step input as a reference trajectory for each link.Figures 5 and 6 show the output responses of the robotic manipulator due to each method.The maximum overshoots and the settling times of the output responses of each link are recorded in Table 4. Figure 7 presents the maximum overshoots and the settling times of the output responses of each link as a bar chart for more clarification.It is clear that the proposed BOA-based PID controller has a high damped performance and less settling time and overshoot when compared to the GAbased controller and the CSA-based controller, as shown in Figures 5-7 and Table 4.

Scenario 2: Nonlinear Reference Trajectory
This scenario is performed by applying a cubic reference trajectory to each robot link.The cubic reference is generated based on the following formulation [75]: where

Scenario 2: Nonlinear Reference Trajectory
This scenario is performed by applying a cubic reference trajectory to each ro The cubic reference is generated based on the following formulation [75]: The generated cubic references at every possible link are presented in Figure 8.Note that the output response of each link due to this scenario is shown in Figures 9 and 10.It is confirmed from these Figures that the introduced BOA-based PID controller successfully tracks the nonlinear cubic reference trajectory with a low error when compared to the GA-based PID controller as well as the CSA-based PID controller.

Scenario 3: The Parameters Uncertainty Test for Each Technique
This test is performed to confirm the effectiveness of the PID controller gains based on the proposed BOA against the change of system parameters.The test is carried out by changing the masses as well as the lengths of the robot links by ±20% considering the rated values.Figures 11 and 12

Scenario 3: The Parameters Uncertainty Test for Each Technique
This test is performed to confirm the effectiveness of the PID controller gains based on the proposed BOA against the change of system parameters.The test is carried out by changing the masses as well as the lengths of the robot links by ±20% considering the rated values.Figures 11 and 12 indicate that the PID controller gains based on the proposed BOA are effective against the parameters' uncertainty and have a high damped performance when compared to the GA-based PID controller as well as the CSA-based PID controller. (a)

Scenario 3: Parameters Uncertainty Test for Each Technique
This test is performed to confirm the effectiveness of the PID controller ga on the proposed BOA against the change of system parameters.The test is carri changing the masses as well as the lengths of the robot links by ±20% considering values.Figures 11 and 12 indicate that the PID controller gains based on the BOA are effective against the parameters' uncertainty and have a high dampe mance when compared to the GA-based PID controller as well as the CSA-based troller.

Scenario 4: Random Trajectory
The inspired technique has been tested in this scenario to track several p jectories.Specifically, the assessment is carried out in two steps.The first step by creating a random step-position reference to each arm, as shown in Figure 14 and 15 depict the system output due to this step.Compared to previous these data show that the suggested BOA-based controller can track the rand erence with low steady-state error, the shortest settling time, and insignificant

Scenario 4: Random Trajectory
The inspired technique has been tested in this scenario to track several position trajectories.Specifically, the assessment is carried out in two steps.The first step is generated by creating a random step-position reference to each arm, as shown in Figure 13.Figures 14 and 15 depict the system output due to this step.Compared to previous approaches, these data show that the suggested BOA-based controller can track the random step reference with low steady-state error, the shortest settling time, and insignificant overshoots.

Scenario 4: Random Trajectory
The inspired technique has been tested in this scenario to track several position trajectories.Specifically, the assessment is carried out in two steps.The first step is generated by creating a random step-position reference to each arm, as shown in Figure 13.Figures 14 and 15 depict the system output due to this step.Compared to previous approaches, these data show that the suggested BOA-based controller can track the random step reference with low steady-state error, the shortest settling time, and insignificant overshoots.

Summary
The main discussions of the above test scenarios are concluded in the following points:

•
The robotic manipulator effectively tracked the linear trajectory based on the introduced BOA-based PID controller, as presented in scenario 1.Furthermore, the output position response of each link had less settling time and overshoot based on the introduced BOA-based PID controller compared to other techniques.

•
The introduced BOA-based PID controller successfully tracked the nonlinear trajectory with a low error, as presented in scenario 2.Moreover, the introduced BOA-based PID controller had a better damped response than both the GA-based PID and CSA-based PID control schemes.

•
The designed PID controller gains based on the introduced BOA were tested against the robotic manipulator parameter uncertainties, as clarified in scenario 3. The re-sults of this scenario confirm the superiority of the designed PID controller gains based on the introduced BOA to provide high damped performance against the uncertainty of the parameters in regards to both the GA-based PID and CSA-based PID control schemes.

Summary
The main discussions of the above test scenarios are concluded in the following points:

•
The robotic manipulator effectively tracked the linear trajectory based on the introduced BOA-based PID controller, as presented in scenario 1.Furthermore, the output position response of each link had less settling time and overshoot based on the introduced BOA-based PID controller compared to other techniques.

•
The introduced BOA-based PID controller successfully tracked the nonlinear trajectory with a low error, as presented in scenario 2.Moreover, the introduced BOAbased PID controller had a better damped response than both the GA-based PID and CSA-based PID control schemes.

•
The designed PID controller gains based on the introduced BOA were tested against the robotic manipulator parameter uncertainties, as clarified in scenario 3. The results

Conclusions
This paper introduces a recently developed global optimization algorithm named the BOA for tuning the robotic manipulator controller gains.The proposed BOA is tasked with adjusting the controllers' gains to minimize an innovative developed figure of demerit objective function.Specifically, the developed figure of demerit objective function can handle the problem of the reduction of the system steady-state error, system-settling time, and the system overshoot in a co-ordinated manner.The introduced the BOA-based PID controller is compared with two previous techniques named the GA-PID and the CSA-PID control schemes.The simulation results emphasize that the introduced BOA-based PID controller has a high damped and effective performance with a maximum overshoot and settling time less than 1.8101% and 0.1138s, respectively, compared with other methods in the tracking of linear and nonlinear trajectories.Furthermore, the proposed BOA based on the introduced figure of demerit objective function can be utilized in different control systems of future works in order to simultaneously enhance the system response with less settling time and fewer oscillations.

Figure 2 .
Figure 2. The geometric representation of two degrees of freedom robotic manipulator.

Figure 2 .
Figure 2. The geometric representation of two degrees of freedom robotic manipulator.

Figure 3 .
Figure 3.The value of the objective function due to each technique.

Figure 3 .
Figure 3.The value of the objective function due to each technique.

Figure 4 .
Figure 4.The convergence curve of the proposed BOA.

Figure 4 .
Figure 4.The convergence curve of the proposed BOA.

Figure 4 .
Figure 4.The convergence curve of the proposed BOA.

Figure 5 .
Figure 5.The output response of link1 in the case of Scenario 1.Figure 5.The output response of link1 in the case of Scenario 1.

Figure 6 .
Figure 6.The output response of link2 in the case of Scenario 1.

Figure 7 .
Figure 7.The dynamic characteristics of each technique (a) system extreme overshoot (b) system-settling time.

Figure 7 .
Figure 7.The dynamic characteristics of each technique (a) system extreme overshoot (b) systemsettling time.

Figure 9 .
Figure 9.The output position due to link1 in the case of cubic reference.

Figure 8 . 22 Figure 8 .
Figure 8.The cubic references for each robot link.

Figure 9 .
Figure 9.The output position due to link1 in the case of cubic reference.Figure 9.The output position due to link 1 in the case of cubic reference.

Figure 9 .
Figure 9.The output position due to link1 in the case of cubic reference.Figure 9.The output position due to link 1 in the case of cubic reference.

22 Figure 10 .
Figure 10.The output position due to link2 in the case of cubic reference.

Figure 10 .
Figure 10.The output position due to link 2 in the case of cubic reference.

Figure 10 .
Figure 10.The output position due to link2 in the case of cubic reference.

Figure 13 .
Figure 13.Random step-position trajectories of the two links.

Figure 12 .
Figure 12. output position of in case of increasing the parameters by +20% (a) the position of link 1 , (b) the position of link 2 .

Figure 12 .
Figure 12.The output position of in case of increasing the parameters by +20% (a) the position of link1, (b) the position of link2.

Figure 13 .
Figure 13.Random step-position trajectories of the two links.

Figure 13 .
Figure 13.Random trajectories of the links.

Figure 14 .
Figure 14.The link1 output wave of as a result of random step-position trajectories; (a) link1 position (b) link1 position deviation.Figure 14.The link 1 output wave of as a result of random step-position trajectories; (a) link 1 position (b) link 1 position deviation.

Figure 14 .
Figure 14.The link1 output wave of as a result of random step-position trajectories; (a) link1 position (b) link1 position deviation.Figure 14.The link 1 output wave of as a result of random step-position trajectories; (a) link 1 position (b) link 1 position deviation.

Figure 15 .
Figure 15.The link 2 output wave of as a result of random step-position trajectories; (a) link 2 position (b) link 2 position deviation.

Algorithm 1 .
The pseudo-code of the proposed BOA to adjust the controller gains

Table 1 .
The controller gains of each technique and the corresponding value of the objective function (J).

Table 2 .
The IAE and ISE performance indexes values based on each algorithm.

Table 3 .
Adjusted settings for various techniques.

Table 4 .
The supreme overshoot as well as the settling time of the system responses for Scenario 1 due to each technique.

Table 4 .
The supreme overshoot as well as the settling time of the system responses for due to each technique.