Intelligent swarm algorithms for optimizing nonlinear sliding mode controller for robot manipulator

This work introduces an accurate and fast approach for optimizing the parameters of robot manipulator controller. The approach of sliding mode control (SMC) was proposed as it documented an effective tool for designing robust controllers for complex high-order linear and nonlinear dynamic systems operating under uncertain conditions. In this work Intelligent particle swarm optimization (PSO) and social spider optimization (SSO) were used for obtaining the best values for the parameters of sliding mode control (SMC) to achieve consistency, stability and robustness. Additional design of integral sliding mode control (ISMC) was implemented to the dynamic system to achieve the high control theory of sliding mode controller. For designing particle swarm optimizer (PSO) and social spider optimization (SSO) processes, mean square error performances index was considered. The effectiveness of the proposed system was tested with six degrees of freedom robot manipulator by using (PUMA) robot. The iteration of SSO and PSO algorithms with mean square error and objective function were obtained, with best fitness for (SSO) =4.4876 𝑒 -6 and (PSO)=3.4948 𝑒 -4 .


INTRODUCTION
Programming the multi degrees of freedom (DOF) of robot arms in order to maximize their functionality has recently remained a challenging job, time-consuming and costly operation in particular. Indeed, the coupling effects of multiple joints must be taken into account by controlling robot manipulator parameters [1]. In this work, programmable universal manipulation arm (PUMA) robot, which has six degrees of freedom (6-DOF), all are rotary joints with serial connections, was used as a study case. The first three joints are used to control the robot's handle position. The second three joints are to obtain the orientation of the robot's wrist locus. PUMA robot manipulator is widely used in medical, automotive, education and other important applications. The parameters and dimensions of this robot were all known and documented in different literatures [2]. Figure 1 illustrates the global model of PUMA robot the 6-DOF manipulator.
Designing a stable and strong controller is an important part for sensitive and various applications for robot manipulator. The most common nonlinear model-based controller is sliding mode controller (SMC) which has been properly applied in various applications such as motor control, space system, automatic flight control and finally robot control. It is considered as a powerful advance stable robotic manipulator control system that can achieve and solve the most important tasks in control systems, which are robustness and The essential benefits of the SMC method are achieving of asymptotic reactivity and stability in implementation regarding to all notched internal and external uncertainties and disturbances. The SMC can be split into two key components, which are the discontinuous part ( ) that's used to design appropriate tracking performance centered on linear methodology requiring identical fast switching. But it is caused to system instability and the occurrence of chatter. The second part is equivalent controller ( ) which is the effect of nonlinear terms that induced reliability and used to fine-tune the sliding surface slopes [4]. In addition, SMC has two major disadvantages, namely are chattering phenomenon in control response, and nonlinear equivalent analogous functional formulation in indeterminate and uncertain dynamic parameters [5]. The rising in switching frequency of the control in discontinuous issue happened due to a phenomenon called (chattering), which can be considered as an unwanted feature that appear in the control behavior of SMC. It is a limited value with restricted frequency of oscillation that can cause some severe mechanical problems, such as distortion and heating of robot manipulator mechanical components. This chattering influences on the stability of the system, due to this reason chattering effect should be cancelled or minimized. So, adjusting the sliding mode control parameters is an important part to reduce the chattering disadvantage and developing a stable coefficient for nonlinear controllers [6]. In recent times, artificial intelligence (AI) techniques have been implemented to overcome the disadvantage in conventional controller design, which is an effective tool for solving many applications with intelligent techniques. These innovative approaches are methods of biological inspired optimization, which can randomly transfer a solution of one candidate into a new one with better fitness function [7]. Researchers have been obsessed with insect or animal species' collective intelligent actions in nature, such as bird flocks, ant colonies, fish schools, bee swarms, where the relation between the collection of insects or animals is referred to as swarm behaviour. This division of AI is often referred to as swarm intelligence (SI), which deals with the mutual behavior of swarms by the active coordination and interaction of individuals without supervision. SI provides a benefits that including scalability, fault tolerance, flexibility, speed, mobility, autonomy, parallelism, and adaptation [8]. In this work, particle swarm optimization (PSO), and social spider optimization (SSO), which are an efficient algorithms of SI, were suggested to adjust the nonlinear coefficients and optimizing the parameters of the proposed controllers. These algorithms can create the perfect solution, with a high quality and a lower computing time than other techniques, with progressively stable assembly characteristics, they efficiently change the parameters with sufficient convergence to achieve impressive acceleration of the system [9]. This paper has been arranged accordingly. Some related works are presented in the second section. The third section deals with the analysis, modelling and simulation of the dynamic model of PUMA robot. Section four concentrates on the strategy of controller model, and the method that used in designing SMC and ISMC for controlling the dynamic part of the robot. Section 5 discusses the method of PSO and SSO algorithms. The outcome of the debate and simulation is shown in the sixth section. The last section in the paper introduces the conclusion and future work.

LITERATURE REVIEW
Researchers have been working hard to control the robot manipulator and to create best solutions for the dynamic model, to obtain stable response with minimum steady state error. Several controllers have been developed with various SI algorithms. A concise summary of previous related works is shown in this section. In [10] mentioned that to solve the trajectory monitoring problem for a nonlinear design of wheeled robot, PSO has been used to get the best values for the parameters of sliding mode control. In [11], the robotic device stability was demonstrated using Lyapunov impedance based technique, with PSO algorithm for optimization the parameters of the control. Jalali [12] introduced an adaptive sliding-mode controller with PSO algorithm for optimizing PUMA robot manipulator, this controller can respond and adapt itself to change system parameters according to the external intervention. PSO algorithm was used to enhance the parameters of the sliding function and minimize the chattering action. Boundjou [13] developed a stable adaptive controller with Particle Swarm Optimizer for automatic and systematic tuning of PID gains for two degrees of freedom robot arm, thus optimizing the cost function of the parameters. In [14], evaluating of SMC efficiency with PID was done, taking into account the ziegler-nichols (ZN) and the PSO tuning algorithm implemented in the sliding surface. The computational and simulation results showed that compared to traditional ZN variables the SMC is able to do well with the PSO variables added to the sliding board.
PID controller auto-tuning system was implemented for PUMA robot manipulators [15]. Two methods of SI multi-objective optimization were tested, namely multi objective cuckoo scan (MOCS) and multi objective particle swarm optimization (MOPSO). Comparison was made between the results of the two algorithms in the case of achieving a predefined trajectory with a reasonable tracking accuracy. Sliding mode controller with boundary layer was presented for dynamic design with control of 6-DOF robot arm manipulator type IRB-120 [16]. The chattering that generates unreliable signal with high frequency oscillation in the sliding mode control was eliminated by using the boundary layer which provides the controller with stabilization and improve the total performance. New technique was presented for robot manipulators with a robust high degree composite, super-twisting of sliding mode controller (HOS-TSMC) [17]. The suggested approach extends the traditional and conventional controller of sliding mode (TSMC) and the approximate state of sliding mode (ESMC) to ameliorate the chatter. To minimize the influence of numerous external disturbances, the non-linear simulator of the saturation integral backstepping controller was implemented and the particle swarm algorithm was used to evaluate the controller parameters [18]. Three types of external disturbances (constant, intermittent, and random disturbances) were used separately during the quadrotor aircraft's flight control. The outcome of the simulation reveals that in anti-disturbance power, the saturation integral backstepping controller was much stronger than the classical backstepping controller and integral back stepping controller. A modern adaptive terminal sliding mode controller with a non-single specialty was used to control the behavior of quad rotor flight [19]. Besides, the controller of backstepping sliding mode, was introduced to control the path of the quadrotor, despite the influence of external disturbances, this leads to quick and reliable observation. The design process was illustrated with Lyapunov principle. Then, the proposed controllers of backstepping, integral sliding mode and the second sliding mode, were investigate with several flights checks. Where the simulation result shows an improvement in the convergence of time, with good robustness and chattering free for control efforts.
Akkar and Haddad [4] introduced a strategy for tuning three types of dynamic control techniques that were developed for the PUMA 560 robot manipulator, which are proportional integral derived (PID), sliding mode control (SMC), and the modified type of integral sliding mode control (ISMC). Intelligent particle swarm optimization (PSO) has been suggested to achieve the best parameters in order to maximize the parameters in the proposed strategies. The PSO optimization approach has improved the parameters of each controller according to the initial values of the particles, such as their swarm size and initial velocity.

CONTRIBUTION
In this work, based on the theory of SMC, an integral optimal control law was designed for the 6-DOF PUMA robot manipulator. The integral sliding mode controller (ISMC) was proposed to improve the manipulator output to perform the desired tasks with high stability. Then, particle swarm algorithm for optimization (PSO), and social spider optimization (SSO) algorithm, were suggested to adjust the nonlinear coefficients and optimizing the parameters of the ISMC. Where, adjusting the integral sliding mode control parameters is an important part to reduce the chattering disadvantage and developing a stable coefficient for nonlinear controllers.

DYNAMIC DESIGN OF PUMA ROBOT MANIPULATOR
The dynamic equation of multi DOF for PUMA robot manipulator is about the analysis of motion concerning forces. Dynamic design modelling is required for mechanical part model, control and finally in implementing the simulation. It is used to define the parameters of the dynamic and also to explain the relationship between displacement, distance, acceleration and the force that acts on the manipulator of the robot. Lagrange-Euler mathematical model of the robot is used for calculation the control laws and design the dynamic system of the robot. In of a multi DOF for robot manipulator is calculate is being as [20], [21]: Dynamic equation as an outcome for the robot can be described is being as: where: (գ):Symmetric positive matrix considered for kinetic energy and inertia matrix,with dimension. (գ): is for Coriolis torques matrix, with ( − 1)/2 dimension. (գ) : is for centrifugal torques, with nxn dimension. (գ) : is for gravity torques, with nx1 dimension. գ: is the joint position (or joint angle), for գ = [գ 1 , գ 2 , … գ ], գ̇:is consider as n-vector for joint velocities, գ̈: is consider as n-vector of accelerations. And τ: is consider as the joint force vector (torque).
[գ̇2]: that can a vector given by [գ̇1 2 , գ̇2 2 , … … գ̇2 ] , [գ̇գ̇]: that can a vector given :[գ̇1գ̇2, գ̇1գ̇3, . . գ̇1գ̇, գ̇2գ̇3 … . ] . The input of the dynamic system is torque matrix in the robotic manipulator arrangement while the outcomes are real variables displacement and joints, as a result it can be written is being as: All the parameters of the forward and inverse kinematics and matrix of PUMA robot have been computed as mentioned in [2], [22], [23]. In this work only the first, second and third links of PUMA robot manipulator will be taken into consideration. Figure 2 illustrates the block diagram for dynamic and kinematics model for PUMA robot manipulator.

METHOD OF DESIGNING SLIDING MODE CONTROL SMC
SMC is applied to impose the system's state path to pass through the sliding surface, then imposes the state's system path to ''slide" along the switching surface till it stays on the origin [4]. In order to define the equation that control the total design of SMC, the nonlinear input single for dynamic system define is being as: where (υ) is consider as the vector of the control input , is the ℎ derivative of the state vector . δ is consider as unknown nonlinear function or uncertainty of dynamic, (Z) is switching [ ] function. The key objective of designing SMC is to train the appropriate state desire position according to the actual joint variables, the trucking error vector will be defined is being as [3], [5].
where: Ζ is for real and actual position, is the desired position, and ̃ : is for estimated trucking error vector. According to the theory of the sliding mode controller, sliding surface is the key important part to design this controller, the calculation of time varying for sliding surface S (z, t) , and the integral part of sliding surface is shown is being as: μ is the sliding surface slope coefficient and it is positive constant, in this method the main target is to keep the sliding surface slope near to zero. Therefore, best strategies to achieve this is to find the input control υ outside the sliding surface and remains on it. To keep the ( ,̇ ) close to zero, the law control is design to achieve the sliding condition of Lyapunov function [4], [6], is being as: So, the time derivative becomes ̇= (̇2 ) and the control is chosen such that: where is consider appositive constant [3], [6], so the sliding surface will have computed is being as: Derivative of (15), will consider as the change in sliding surface, is being as: Since : Z̈= + So : By imposing → 0 also ̇ → 0 , If we put ̇ = 0, in (17), as shown in where is the uncertainty of dynamic, under this hypothesis we get the best approximation for control (̂) which can be define as: Using the uncertainty switching control low to control the dynamic parameters of sliding mode: where : is a positive constant function of ( , ), and is the switching function define is being as: Keep the ( ,) close to zero in order to satisfy the sliding condition of Lyapunov function. So (9) and (61) can be arranged is being as: So, the approximation of ̂ is computed is being as: The SMC for robot manipulator with multi DOF is being as. Figure 3 shows the total of the :

Modified integral approach for sliding mode controller (ISMC)
In order to enhance the performance designed of the proposed controller scheme which is based on SMC, besides improve stability and minimize total error, integral sliding mode controller (ISMC) was designed, our goal is to keep the sliding surface close to zero all the time [4], [6], [10]. The formula that defines ISMC surface is being as: In the SMC model, two parameters (K, μ) must be adjusted. If these parameters are appropriately changed, the controller will reject external disturbances disrupting the tracking path and increase the torque of the robot joints. PSO and SSO are the two algorithms that used in this work to pick the best values to the parameters of both SMC and ISMC. Figure 4 shows the total output torque for ISMC design. Particle swarm optimization (PSO) algorithm used initial random solutions called particles, which fly over the search space size by following the obtained optimum particle and their own acquired experiences. The principle of this optimization is to use its best known positions of particles to converge the swarm population in the solution space to a single optimal. The PSO algorithm requires, at each point, changing the location and velocity of the particle to its and for each particle, the velocity is modified iteratively by its personal best position, which is found by the particle, and also by the best position found by the particles in its vicinity [24], as shown in (31), (32): where: : is for particles number. : for dimensions' number. = which are two for SMC. Χ : is fordimensional position vector ( Χ 1 , Χ 2 , . . , Χ ). : velocity of the particle ( 1 , 1 , ….., ). : best visited position for the particles.
: best position explored in the population. 1 2 : consider as random integer between 0 and 1. Φ : inertia weight. 1 2 : positive constants. : for iteration pointer. Coefficients 1 2 include the relative weight of the probabilities that accelerate each particle in and position. Sufficient choice of inertia weight (Φ) will allow for a balance between global and local exploration, which enables reduced aggregate iteration in order to find a fairly optimum solution. Table 1 illustrates the global pseudo code for PSO [25]. Generate random initial population and initial parameters (initialization of individuals). 2 While not (The population converges towards the desired and optimum solution or the ultimate iteration obtained). 3 For each dimension in the particle 4 Update particle velocities using ( 31) 5 Update particles positions using ( 32 ) 6 Evaluate fitness function ( Χ i,g ( ) ) 7 If function( Χ i,g (k) ) < function(Pbest i,g ) then (Pbest i,g ) ← Χ i,g If function( Χ i,g (k) ) < function(Gbest i,g )) then function(Gbest i,g ) ← Χ i,g (k) 10 End If 11 End If and Loop (Next generation)

Social spider optimization (SSO)
The SSO algorithm recognizes two search agents, or two genders of male and female in spider's webs. Each entity is accomplished with a different set of evolutionary operators, based on the gender, which simulate different cooperative activities normally seen in the colony. It is observed that, within a certain range of distance, dominant males mate with their female neighbors and non-dominant males remain in a position close to other network males and rely on nutrients for the latter. In addition to mating, spiders communicate with each other by vibrations and the frequency of the vibrations depends on two important factors: the heaviness of the spider and the distance between the spiders that communicate [26]. The male and female spiders are the search agents whose population can be determined as: where: , , denote the total population of all spiders in the communal web, reflecting the number of female spiders and male spiders respectively. The weight that represent the heaviness of each spider in the population is found is being as: where: : represent the population of the web. : The iteration in the total population. , and are objective function values. In the common popular web, the spiders connect with each other's by using the vibrations that calculated is being as: where: : is related to the heaviness of the spider that transmits the vibration. , : is considered as the Euclidean distance computed between the two interacting spiders. The vibrations between spiders in the web may be classified depending on the transmitting spider as shown in:  The situation where the transmitting spider, is more heavier than the perceiving spider, , ( > ) contributing to vibration , .  The situation where the transmitting spider, is the best heaviest one in the web which contributing in vibration , , ( = max ( )).  The situation where the transmitting spider, is a female neighbor contributing in vibration , . The location of the female and male spiders is modified at each iteration of the optimization algorithm using the formula is being as [27]: where: , , , are consider as random numbers, that are between [0 or 1]. is regarded as the threshold of probability factor that is matched with all the randomly produced numbers while the spiders will travelled in the space. So, the transition is randomly regulated by the factor of likelihood and the motion is generated in relation with the other spiders depending on their vibration through the space of search. In the optimization procedure the male spider +1 , will operated is being as [26]: ) is considered as the weighted average of the male spider in the web population. The dominant males, as described earlier, will mate with the females in the mating range, which is given is being as: where: ℎ ℎ are assumed to be as the higher and lower initial limits. Table 2 illustrates the pseudo code for SSO algorithm: Table 2. The pseudo code for SSO algorithm Step No. Description 1 Assign the initial parameters value for the SSO algorithm 2 Create the population of spiders and assign memory for them 3 Initial the first position for both male spider and female spider 4 Counting the k iterations in the population ( ) 5 While ≤ 6 Calculate the mating radius for both female and male spiders as in (39)  7 Calculating the spiders' weight as in (35)  8 Calculate the passage of female and male spider's dependent on mutual female and male operators as shown in (37) and (38) 9 Conduct mating between dominant males and females 10 Update solutions if there are heavier spider progenies 11 End the loop

RESULTS AND DISCUSSION
In this work, the Matlab/ Simulink structure version R2019b and M-File were used to apply the design strategy of the controller in order to evaluate the performance of the proposed controller design. The sampling time fixed on ∆t = 0.001 s. PSO and SSO algorithms are used to inspect and refine the parameters of the controller (K, μ). The algorithms will take the (Χ ) as a reference and check each particle in (Χ ) by using the mean square error between them until it reaches the best fitness function with smallest mean square error, is being as: where: N: is number of random samples that were used : is for desire position. : is for actual position. PSO algorithm is initialized with the following parameters: N=20 birds, Iteration=100, 1 = 2 =2, Φ=0.5, and the k (dimension vector) for SMC and ISMC=2 parameters. For SSO algorithm the initialized is with the following parameters: Spider=20, Iteration=100, all the random number [ , , , ] = 1. The upper female percent=0.9, lower female percent=0.65. The total time for implementation is 100 Sec. Only the first three links of PUMA robot were being considered in this work. Figure 5 shows the step response for the first, second and third links for the robot, from which it can be seen that ISMC/SSO has the best response with nearly zero maximum overshoot and stable steady state, minimum settling time, and near zero mean square error comparing with the ISMC/PSO. Figure 6 shows the final torque in the third links with ISMC/SSO, and ISMC/PSO techniques, it can be noticed that the torque response becomes more stable besides eliminating the chattering phenomena. Table 3 shows the configuration of the range for the initial values of the parameters (K, μ) for ISMC, the values after optimization with PSO, and the values after optimization with SSO.

Robustness test
In order to test the robustness of the proposed techniques, a white Gaussian noise predefined of 40% power from the input signal was introduced to the system between 5 s to 10 s. Figure 7 shows the effect of the disturbance noise on the response signal for the three links, we can notice that a slight oscillations occur in the trajectory response of the links. Figure 8 shows the iteration of SSO and PSO algorithms with mean square error and objective function, from which it can be seen that SSO successively iterates until it reaches the optimal value for parameters, with best fitness=4.4876 −6 . Besides PSO has best fitness=3.4948 −4 . In order to evaluate the performance of the proposed techniques, a comparison were made with some existing methods. Table 4 shows a comparison with existing approaches specifically used to operate with robot manipulator in order to verify the validation of the proposed controller techniques in terms of robustness and stability, these techniques are shown in [11], [12], [17].

Discussion
The results demonstrate significant response with almost zero maximum overshoot and stable steady state with the ISMC and SSO optimization algorithm compared with the ISMC/PSO, the oscillations are dampened faster, besides reduce the chattering phenomenon. The torque reaction becomes more stable. The comparison with the existing techniques shows that ISMC/SSO has the best fitness.

CONCLUSION
This work introduces an optimal technique and robust control strategy based on conventional SMC, and integral sliding mode control (ISMC) with two novel swarm intelligent algorithms, SSO and PSO, to control the first three links of PUMA robot manipulators. Therefore, the evolutionary algorithms SSO and PSO are used to determine the optimal values for the parameters of the proposed controllers such that the suggested techniques trajectory response is ensure the stability and robustness for variable conditions that affect the end effector of the robot manipulator. Thus, the developed method effectiveness was observed by simulations, where a comparison with the conventional SMC has been done. The simulation results demonstrated that the proposed ISMC/SSO offering high performance in term of step response, stability, and smoothness of control signal despite disturbance noise, with minimum mean square error and best fitness compared to the other existing techniques.