Social spider optimization algorithm for tuning parameters in PD-like Interval Type-2 Fuzzy Logic Controller applied to a parallel robot

This paper presents control design based on an Interval Type-2 Fuzzy Logic (IT2FL) for the trajectory tracking of 3-RRR (3-Revolute-Revolute-Revolute) planar parallel robot. The design of Type-1 Fuzzy Logic Controller (T1FLC) is also considered for the purpose of comparison with the IT2FLC in terms of robustness and trajectory tracking characteristics. The scaling factors in the output and input of T1FL and IT2FL controllers play a vital role in improving the performance of the closed-loop system. However, using trial-and-error procedure for tuning these design parameters is exhaustive and hence an optimization technique is applied to achieve their optimal values and to reach an improved performance. In this study, Social Spider Optimization (SSO) algorithm is proposed as a useful tool to tune the parameters of proportional-derivative (PD) versions of both IT2FLC and T1FLC. Two scenarios, based on two square desired trajectories (with and without disturbance), have been tested to evaluate the tracking performance and robustness characteristics of proposed controllers. The effectiveness of controllers have been verified via numerical simulations based on MATLAB/SIMULINK programming software, which showed the superior of IT2FLC in terms of robustness and tracking errors.


Introduction
The parallel robots are mechanisms with two or more kinematic chains linked to their end-effectors. They are better known because of the good performance when it takes care of acceleration, precision, stiffness, and capacity to carry heavy loads. The parallel robots are adequate instruments for applications in different fields such as in machining, welding, handling, flight simulators, and telescopes pointing. They have also advantages related to their sensitivity, which make them very suitable for applications in medicine, like endoscopy and other procedures that should be minimum invasive. [1][2][3] The parallel manipulators have many positive features. Their actuators are fixed to the base, which decreases the mass and allows high acceleration; due to the parallel action, these actuators provide high stiffness and efficient load capacity. Theoretically, when compared to serial manipulators, their accuracy is better. The good precision is a result of the fact that parallel manipulators have errors in the position given by average errors of individual chains. Their repeatability is also high, which is due to kinematic chains that are closed. However, the parallel manipulators have some drawbacks: the workspace is limited and the behavior of singularities is more complicated than in serial manipulators. [1][2][3][4][5][6] Parallel mechanisms can be used in humanoid robots in order to improve their structure and operation performance as inspired by human anatomy. In recent years significant advances have been made in Human-Robot Interaction (HRI). 7 Hand gestures have been investigated as the most natural tools of interaction for human beings, and particularly for disabled persons. 8 Some parallel mechanisms are utilized to mimicking human neck, 9 others are used to improve the imitation skill and children with autism. 10 Other parallel mechanisms are utilized for manufacturing anthropomorphic exoskeletons which matching and mimicking the real motions of some body parts, such as lower and upper limb exoskeletons, to be worn by elderly and disable persons. 11 The redundant manipulators offer a safe physical collaborative flexible workspace for nurse or surgeon (assisting physicians, patient support) undergoing surgery. During the past decades, the development of surgical robot systems and teleoperated surgery, which mostly involve articulated (serial and parallel) robot configurations, has witnessed rapid growth due to the advancements in computing and sensor technologies. 12,13 In the tele-operated surgery, the surgical robots have to show both safe and flexible manipulation. On the contrary of serial robot manipulator, which are featured by flexible motion, the parallel robots suffers from limitation in workspace. However, the surgical parallel robots are characterized by higher accuracy and less vibration than serial counterparts. This makes them candidates for such medical applications that require high precision and safe operation. 14,15 In this study, a planar parallel robot of the kind 3-Revolute-Revolute-Revolute (3-RRR) with 2-Degrees-Of-Freedom (DOF) will be considered. Many researchers have conducted their control design for tracking control of 2-DOF planar redundant parallel robot. Zhang et al. proposed an augmented PD controller with forward dynamic compensation for a redundant planar 2-DOF parallel manipulator. Better Accuracy has been achieved with the compensation of active joint friction and the proposed controller is easy to implement and it requires shorter sampling period and it shows better performance than simple PD controller. 16 Chen et al. proposed a simple scheme for computing the inverse dynamics of 2-DOF planar redundant parallel manipulator. The study developed four control algorithms, represented by two PD controls, an augmented PD control, and a computed-torque control scheme for control purpose. The experimental results showed that the model-based controllers have better than PD controllers. 17 Yu et al. have presented a novel Udwadia-Kalaba approach or 2-degrees of freedom redundant parallel manipulator. This approach can represent the direct and inverse dynamical models of the robot precisely and explicitly. 18 Sariyildiz et al. 19 applied a new Artificial Intelligent-based inverse kinematic solution method for the planar redundant robot manipulator using support vector machine method (SVM). Al-Mayyahi proposed fractional order proportional integral derivative (FOPID) controller for the path tracking control of the center of the 3-RRR planar parallel robot. The design parameters FOPID controller is optimized using the bat optimization algorithm for better improvement of controller's performance. 20 Liu focused on the solution of the singularity problem in Redundant Parallel Manipulator. Three kinds of redundant methods are developed and discussed. The kinematic and dynamic control methods are applied for trajectory tracking of redundantly actuated parallel mechanisms. 21 Shang and Cong applied a new robust nonlinear controller to a planar 2-DOF parallel manipulator. The controller combines nonlinear PD control with the robust dynamic compensation. The NPD control is used to compensate disturbances, unmodeled dynamics, and friction, while the robust control part is used to compensate the model uncertainties of the robot. The proposed controller showed better trajectory tracking accuracy as compared to augmented PD controller. 22 Sheng and Li have proposed optimized PID control design for trajectory tracking control of 3-RRR parallel robot. The Genetic Algorithm (GA) is applied for tuning the design parameters of PID controller in order to improve the robustness of controller and precision of trajectory tracking. 23 Moezi et al. presented robust optimal fuzzy logic controller for trajectory tracking of 3-RRR parallel robot based on PWM technique. The modified Cuckoo Optimization Technique has been applied for tuning the parameters of FL controller. The proposed control scheme showed better robustness characteristics and tracking performance when compared to optimal PID controller. 24 Noshadi et al. presented active force control (AFC) for 3-RRR planar parallel manipulator. The AFC has showed better robustness characteristics and better disturbance rejection capability as compared to conventional PID controller. 25 Taking advantage of the fact that, compared with conventional controllers, the Fuzzy Logic Controllers (FLC) can be considered to be more robust and less sensitive to variations in parameters. 26 There are many researchers who have used and proved the efficacy of FLC in various applications like cruise control systems, cyber defense mechanism, and parallel robots. [27][28][29] In the past few years, fuzzy control has been a topic of great interest in the area of robot control. In Moezi et al., 24 the Cuckoo Optimization Technique has been used for tuning the design parameters of FLC to improve its tracking performance and robustness against variation of parameters. A fuzzy-based controller was proposed by Stanet et al. for an application in medicine with a 3-DOF parallel robot. 28 The fuzzy controller provided more accurate results than a classical proportional-integral-derivative controller. In Noshadi et al., 30 Noshadi et al. designed two level fuzzy tuning resolved acceleration control (FLRAC) for trajectory tracking of 3-RRR planar parallel robot. The first level of FLC is used for acquiring the gains of PD controller. The second level is used for tuning the parameters of fuzzy controller to improve the performance. The FLRAC is combined with AFC to enhance the robustness and accuracy. Lu et al. have proposed an optimization procedure to design and tune Interval Type-2 Fuzzy Logic Controller (IT2FLC) and PID IT2FLC for the tracking control of Delta parallel robot. 31,32 The aim was to improve the robot control accuracy; however, it was also considered that a good control program must-have characteristic such as simplicity, applicability, robustness, and stability.
The theory of fuzzy sets, proposed by Lotfi Zadeh in 1965, originated the Type-1 FLC (T1FLC), which was extended by Zadeh in 1975, originating the Type-2 FLC (T2FLC). 33,34 In T1FLC, the uncertainties related to the membership functions can be described in just two dimensions, whilst T2FLC can properly deal with them in three dimensions, which make it able to handle numerical uncertainties and also nonlinearities. So, T2FLC can replace T1FLC in problems with complex nonlinear systems. [35][36][37] To improve the dynamic response of the closed-loop system, FLCs must have PI-type or PD-type control structures. Here in this work, a PD-like FLC structure is considered. Although, as in the classical PID controllers, the selection of the PD gain parameters using a trial and error procedure does not give an optimal solution. So, optimization techniques can be applied to tune these parameters. [38][39][40][41] In the present work, the Social Spider Optimization (SSO) algorithm is applied to tune the scaling factors in the output and input of an Interval Type-2 PD-Like Fuzzy Logic Controller (IT2PDFLC) for the position control of parallel manipulator. So, the goal is to obtain optimal values toward the minimum value of the cost function and hence to improve the closed-loop system dynamics. It is also presented in this paper the design of a Type-1 PD-Like Fuzzy Logic Controller (T2PDFLC) for the position control of the 3-RRR parallel robot, was the SSO algorithm is also used to tune the design parameters. Therefore, the scope of this work can be summarized by: u Design of IT2PDFLC for a 2-DOF planar 3-RRR parallel robot. u Dynamic performance improvement of T1PDFLC and IT2PDFLC using SSO. u Comparative analysis between T1PDFLC and IT2PDFLC controllers in terms of dynamic performance and robustness.

The model of planar 3-RRR parallel robot
In this section, the mathematical model of the planar 3-RRR parallel manipulator will be analyzed.

Forward kinematic of (planar 3-RRR) parallel robot
The setup of 3-RRR parallel robot consists of three actuators (redundantly actuated) with tip point connected to three identical branches, being each branch planar with 2-DOF (translation along x-y) as shown in Figure 1. In such a system, the acceleration of the endeffector ranges between (7.2-15) m=s 2 and the velocity ranges between (0.216-0.3) m=s. 7,8 The general scheme of a redundant 2-DOF 3-RRR parallel robot is presented as shown in Figure 2. This parallel robot has three active links (L a1 , L a2 , L a3 ), three passive links (L b1 , L b2 , L b3 ), three active joints (A1, A2, A3), and three passive joints (B 1 , B 2 , B 3 ). The end-effector is positioned at O. As shown Figure 2, it is defined as the reference frame for the workspace of the manipulator. The desired trajectories for parallel robots should be described by the coordinates of the end-effector. The problem of forward kinematic is related to the computation of the position in the Cartesian frame of  the end point C, regarding the joint angles u a1 , u a2 , and u a3 as depicted in Figure 2. The index A i is related to the ith actuated joint in the vector of coordinates where i = 1, 2, 3, The B i represents the ith passive joint vector with coordinates The point C describes the position of the end-effector, which is determined by: From Figure 2, one can have Equation (2) can be written as Taking equations (3) and (5) and finding a solution for x C and y C leads to equations of the forward kinematics Using equation (5), the norm of X Bi is given by The substitution of equation (7) into equation (6) provides the equations of links (1), (2), and (3); x C 2 + y C 2 À 2x C x B2 À 2y C y B2 + X B2 k k 2 = L 2 ð9Þ Taking equation (8) and subtracting equations (9) and (10), respectively, gives: Using a matrix notation, equations (11) and (12) can be written together as: It can be easy shown that x C can be calculated by Using equation (13) and follow the same analysis as above, one can find the y C It is worthy to note that without the third leg, it is possible to find solutions to any two-leg planar manipulator considering the forward kinematic. These constraints lead to a unique solution of the forward kinematic problem.

Inverse kinematic
The problem of the inverse kinematic can be characterized by the computation of the actuator joint angles u a1 , u a2 , u a3 as a function of a given position in Cartesian space of the end-effector C. Taking any triangle in Figure 2 gives: where, Hence u ai can be solved as follows: There are two solutions related to equation (18), which result from the ''arc cos'' function. As there are two solutions for each leg, it means that the manipulator has eight solutions. It is also important to notice that the actuated joints are placed on the vertices of a triangle.

Direct dynamic model
In this work, the Euler-Lagrange equation is considered for the development of the dynamic model of the 3-RRR parallel manipulator. The general motion of the 3-RRR manipulator may be represented by the serial kinematics chains subjected to constraints in the closed loop. Also, the parallel manipulator dynamics can be given by the combination of the dynamics of the serial kinematic chains with their related force constraints.
Dynamic model of serial kinematic chain. The 3-RRR parallel robot can be divided in three serial kinematic chains based on its cutting at the end-effector O, being each chain a planar 2-DOF serial robot with two links and two joints. A scheme for the serial kinematic chain is presented as shown in Figure 3. L a , L b denote the links and u a , u b denote the joint angles. A is the base of the kinematic chain and O is the position of the end-effector. The two links have the same length L and are considered to be ideal rigid bodies.
As the motion of the kinematic chain is performed in the horizontal plane, it is possible to ignore the gravity effect. Thus, the links have kinetic energy KE a and KE b given by: where m a and m b represent masses of the links, J a and J b denote the inertia moments of the links with respect the centers of masses, and (x ca , y ca ) and (x cb , x cb ) represent the coordinates of the centers of mass. The symbols r a and r b represent the distances from the joints to the centers of mass. Moreover, the coordinates of the centers of mass can be expressed by: x ca = r a cosu a , y ca = r a sin u a , x cb = lcosu a + r b cosu b , Taking the derivative of equation (21) and substituting into equations (19) and (20) give The kinematic chain kinetic energy is derived from equations (22) and (23): where the symbols a, b, g are defined as follows: ½ T be a vector containing the joint angles, t = t a t b ½ T the vector with the torques of the joints. So, the Euler-Lagrange formulation for the equation of the kinematic chain is given by: Expanding equation (25), the kinematic chain has a dynamic that can be expressed by: where the matrices M and C are given by; 0 " # Dynamic model of parallel manipulator. The 3-RRR parallel manipulator has a dynamic model derived from the serial manipulator dynamic model. As such, the parameters of the serial kinematic chains are where i = 1, 2, 3, m ai and m bi refer to the masses of links, J ai and J bi represent the links' inertia moments with respect to the center of mass, r ai and r bi denote the distances from the joints to the centers of mass, and L is the links' length. The combination of the three serial chains dynamics, taking into consideration their force constraints, leads to the formulation of the parallel manipulator dynamic model represented by: ½ T denote the vector of joint positions and input torques, respectively. M is the matrix of inertia and C is the matrix of Coriolis, which are given by In equations (28) and (29), the symbol C abi denotes cos(u a À u b ), i = 1, 2, 3, while S abi defines cos(u a À u b ), i = 1, 2, 3. Therefore, equations (27)-(29) describe the dynamic model of 3-RRR planar parallel robot represented by Figure 2 and they will be used as the robotic system dynamic to be controlled by both IT2FLC and T1FL controllers.

Type-2 Fuzzy Logic Control
Type-2 fuzzy logic theory The membership function in the fuzzy sets represents the degree of membership of an element. The Type-1 Fuzzy Set (T1 FS) named A comprises the domain of real numbers U (which is the universe of discourse) and also the membership A type-2 fuzzy set (T2 FS)Ã is the extension of the concept of T1 FS. It introduces the concept of uncertainty in membership grades of T1 FSs. Mathematically, a type-2 fuzzy set denoted asÃ, is characterized by a type-2 membership function mÃ x, u ð Þ, where x 2 X and u 2 J x 0:1 ½ , that is, where X is the universe of discourse (UOD) and 04uÃ41.Ã can also be expressed as: where Ð Ð represents the union overall admissible u and x. The J x is referred to as primary membership of x. Figure 4 shows the membership function (MF) of Type-2 Fuzzy Logic set. A vertical slice of the T2 MF at x = x 0 defines the secondary membership function at that point given by The secondary membership function associated with x = x 0 , for a given x 2 X, is the type-1 membership function defined by mÃ x = x 0 , u À Á , u 2 J x . The Type-2 Fuzzy Set has an uncertainty areaÃ that is bounded that is known as footprint of uncertainty (FOU). This area characterizes the union of all the primary membership functions, which are given by 42 : The lower and upper MF ofÃ are two T1 FS, while the FOUÃ À Á has boundaries for T2 FSÃ that are the lower and upper bounds of T1 FS. The lower MF is represented bymÃ x ð Þx 2 X, and the upper MF is defined bỹ mÃ x ð Þx 2 X, which means Structure of IT2FL control The IT2FLC has a structure that is almost the same of the T1FLC, but the membership functions are different. This structure can be seen in Figure 5. The fundamental form of the IT2FLC are Fuzzifier, Rule base, Inference engine, Type-reduction, and Defuzzification. 26,37 Rule base. In Type-2 FLSs the Rule-Base is also synthesized in a set of If-Then rules, which establish the relationship between the input and output of the system. The Type-2 FLS rule can be represented as follows 37 : where R i denotes the ith fuzzy rule,F i j andG i are linguistical terms described by Interval T2FLS, i = 1, Á Á Á , M f g , being M the amount of rules, J = 1, Á Á Á , N f g , being N the amount of antecedents, x j representing the inputs of the FLS and y i the output of the rule.
Inference engine. Fuzzy inputs are assigned to fuzzy outputs by the Inference Engine (IE), which is performed using the operators and base rules, including union and intersection operators. The IE is the essential difference between T2 and T1 FLS. In IT2FS, the resultant operation is described as an interval depicted bym i where x j is the jth FLS system input. Taking the lower and upper bounds of the IT2FS, the intersection is obtained adopting the t-norm and considering the antecedent FS, begin represented by: being T a t-norm (product or minimum). Taking the minimum t-norm, the result for input and antecedent operations can be seen in Figure 6. In this work, IT2FLS applies the Mamdani minimum implication method, as the t-norm operator, to the rule's firing levelf i and the consequentG i taking into account the upper and lower bounds off i andG i separately. This minimum t-norm can be described in Figure 7.
Type reduction. In this operation, all the fired FS must be combined in order to find the crisp value. With this  aim, the centroid of a T2 FS must be described as an interval that is a type-reduced set. This work adopts an extension of Type-1 defuzzification method called Karnik-Mendel (KM) algorithm. 37 It has been shown that this iterative algorithm is a TR method with a great accuracy. The TR Centroid begins by the definition of K samples from a T2 FS. The TR method has firstly to obtain two Type-1 FS whose centroid best approximates the upper and lower bounds of the Type-2 FS centroid. Considering the switching points (L, R), Figure 7 illustrates the procedure to find the optimal values.
The candidate points are obtained as follows: where k is an integer in ½1, K À 1 interval, and K represents the number of discretization points. Then, the optimal bounds can be getting by y l and y r , where R and L are switch points satisfying y L 4y l 4y L + 1 , y R 4y r 4y R + 1 Since the approach of the search for centroid candidates (y l , y r ) is computationally ineffective, an iterative method is to detect the optimal switching points as illustrated in Figure 8.
Defuzzification. After applying the TR method, the obtained IFS needs to be converted into a crisp number. However, this step is fairly straightforward, in which the defuzzified value can simply be obtained by calculating the average of the intervals left and right endpoints as follows:

SSO-based IT2FL control of 3-RRR planar Robot
The SSO algorithm takes the assumption that the search space is considered a communal web, the place for the communication of the social spiders. Each solution inside the search space express the position of the spider inside the communal web. A weight, compatible with the fitness value of the solution, is attributed to each spider. There are two variance search spiders in the algorithm: males and females. It starts defining the number of female and male spiders inside the search space. The number N f of females is selected randomly inside the domain of 65%-90% of the whole society Ns in chosen ancient times. Therefore, N f can measure using the following [43][44][45][46][47][48] : where floor(:) maps a real number to an integer number, whereas rand is a random number lies between (0, 1). The number of male spiders N m is calculated based on N f and N s as follows 48 :

Assignation of fitness
Each spider in the population S is quantified based on its fitness value and weight. The weight w i assigned to each spider qualifies the spider i of the population. The weight of every spider is assessed based on the following equation 48 :

Modeling of the vibrations
In the colony, the information among members is encoded based on small vibrations. Such vibrations are employed to initiate the spider and they are related to spider weight and the distance between spiders. The model of the vibration process can be described by; Vb i, j = w j e Àd 2 i, j where i and j denote the indices of spider individuals, d i, j is the Euclidian distance between the spiders j and i defined by 48 :

Initialization of population
The SSO algorithm is iterative and the complete population (females and males) should be initialized randomly. The procedure is started with the initialization of the position of the N spiders and the set S. The position f i of each female spider (or male m i ) is represented by an n-dimensional vector, with parameters values that must be optimized. This value is randomly and uniformly distributed by initial parameters between predefined upper (PjHIGH) and lower (PJLOW) bounds, as represented by 43,48 : where i = 1, 2, . . . , N f , j = 1, 2, . . . , n, k = 1, 2, . . . , N m , and f i, j (m i, j ) represents the j th parameter of the i th female (male) spider position.

Cooperative operator
Female cooperative operator. Female spiders are attracted or repulsed by other spiders, it doesn't matter their gender, which is generally defined by their vibrations transmitted on the communal net and elements like cycle of reproduction, curiosity, and random phenomena.
The attraction movement is activated if a uniform random number r m , generated within (0, 1), is smaller than a threshold PF. If this is satisfied, the attraction movement is produced based on the following formula 48 : Otherwise, a repulsion movement is generated as where b, a, d, and rand(:) are randomly generated within the interval ½0, 1, being t the number of the iteration. s b represent the individual that is the nearest to the member i that has the uppermost weight and s c is the best one in the population S.
Male cooperative operator. The social cooperation has biological features that allows the classification of the spider's male population into Dominant (D) or nondominant (ND), which is performed in terms of the position of the median member. When it comes to weight and size, the D male spiders have fitness characteristics that are better than ND ones. Moreover, within the communal web, the closest female spider attracts the D males. A dominant (D) individual male is defined as a member with weight value that is higher than the male population median weight. On the other side, a non-dominant (ND) individual male is that one with weight above the median value. The position change of male spider can be modeled using the following formula [43][44][45][46][47][48] :

Mating operator
Mating in a social spider colony is done through dominant female male members. If the dominant male m g spider (g 2D) locates a set E g of female members within a specific range re (range of mating), it mates, forming a new brood s new which is generated taking into account all the elements of the set T g ; that is, a new brood is generated by the union E g [ m g . The search area is limited by a radius re, which can be calculated according to 48 : One aspect in the mating operation is that each spider involved in the process (elements inside T g ) has a weight defining the probability of impact of every individual on the created brood. Spiders with smaller weights have lower probability to affect the new product. The probability of influence P si of each individual can be assigned by the roulette method 45 : where i 2 T g . After the shaping of the new spider, it can be performed a comparison between the worst spider s wo and the novel candidate s new in the community, considering their weights w wo = min l2(1, 2, ...N) (w l ). When the new spider is considered to be better than the worst one, it replaces the worst spider. If not, the new spider is discarded the society remains without changes. When there is a replacement, the new spider assumes the index and the gender of the replaced one. This ensure that the population S continues with the same original rate between female and male members. The SSO algorithm is described in the flowchart presented in Figure 9.

Design of optimal IT2FLC of planar 3-RRR parallel robot
When it comes to the Interval Type-2 PD-Like Fuzzy Logic Controller, it is considered the Mamdani system. So on, it will require seven input-output membership functions of triangular type, as presented in Figure 10. The universe of discourse should be inside the range (21, 1) for both input and output. The chosen procedure for defuzzification is the Centroid. A rule-base for the proposed IT2FLC is presented in Table 1. A reduction method for the IT2FLC is implemented by the KM algorithm shown in Figure 8.
The SSO algorithm for the optimal tuning of the IT2FLC applied to the 3-RRR parallel manipulator was shown in Figure 11. This algorithm is responsible to tune and optimize nine gains (six inputs and three outputs) of the IT2FLC and also for the T1FLC. The desired positions (x d , y d ) in the workspace are converted to the joint space (u d1 , u d2 , u d3 ), that can be compared to the current angular positions (u 1 , u 2 , u 3 ) in order to find the joint errors.

Computer simulation
Each controller structure has design parameters related to the SSO algorithm that should be defined by a trialand-error procedure. However, the tuning criteria is based on the minimization of the tracking error. The MATLAB/Simulink (R2015b) environment was used for the simulations that allowed the examination of the controllers' effectiveness. These simulations were performed considering a sampling period of 0.5 ms. The SSO algorithm is dedicated to optimization of the output and input gains of FLC. As it was defined one single fuzzy logic structure for each active joint, the 3-RRR parallel manipulator has three fuzzy logic structures. Each FLC has three gains, which are the Proportional and Derivative input gains and the output gain. So, there are nine gains that the SSO algorithm is responsible to tune, which are the proportional gains (K Pi1 , K Pi2 , and K Pi3 ), the derivative gains (K di1 , K di2 , and K di3 ), and the output gains (K o1 , K o2 , and K o3 ). The parameters settled for the SSO algorithm can be found on Table 2. Tables 3 and 4 list the optimal values of total gains for T1FL and IT2FL controllers, which are tuned based on SSO algorithm. Two scenarios are presented; one for the case of square trajectory without load application and the other with the applied load.

Case I: A square trajectory without disturbance
The steps of robot movement is performed in the following sequence: The position of the robot gripper has to move from (0.1, 0.27) to (0.17, 0.27) m, and the end-effector goes from (0.17, 0.27) to (0.17, 0.33) m. So, the center of the gripper goes from (0.17, 0.33) m to (0.1, 0.33) m. Then, the end-effector goes from (0.1, 0.33) m to the initial  Figure 10. Input/output MFs.  Figure 11. SSO based IT2FLC of planar 3-RRR parallel robot.
position (0.1, 0.27) m. However, the initial conditions begins at x(0) = y(0) = 0:125m. Such a trajectory is suitable for high-velocity and high-acceleration robots. It is commonly adopted in applications in industry, like the assembly of electronic components, cutting by laser, and food packing. With this algorithm, continuity in acceleration is assured when dealing with robots of high-speed. Figure 12 illustrates the desired and actual trajectories along x, y axes, with both IT2FL and T1FL controllers. Figure  13 shows the tracking response of the end-effector in Cartesian coordinates, represented by x(t) and y t ð Þ. The Cartesian errors e x , and e y based on T1FLC and Type-2 FLC are illustrated in Figure 14.
The performance in Cartesian space of T1FL and IT2FL controllers can be evaluated by the Root Mean Square Error (RMSE). The controller with the smaller RMSE value is considered the best one. The calculation of the RMSE in Cartesian space is given by: This RMSE value can be rewritten as: being k the discrete-time sample related to the actual and desired trajectories, N the total number of samples, e x and e y the errors of tracking in both x and y axes.
The RMSE values in Cartesian space computed considering the controllers T1FL and IT2FL are presented in Table 5.
The resulting RMSE values along the x and y axes are much better for the IT2FL controller when it is compared with the T1FL controller, as it is presented in Table 5. On the x axis, there is an improvement of 97.571%, while on the y axis the improvement is of 94.3227%.
The errors e u 1 , e u 2 , and e u 3 of the active joints, considering both T1FL and IT2FL controllers, are presented in Figure 15. The RMSE value can be used again for the performance evaluation of these errors, being the best controller the one with the smaller RMSE value. The formula for the RMSE computation in joint space is: This RMSE value in joint space can be rewritten as: being k the discrete-time sample related to the actual and desired trajectories, N the total number of samples, e u 1 , e u 2 , and e u 3 the tracking errors along each joint. The    RMSE values in joint space computed considering the controllers T1FL and IT2FL are presented in Table 6.
In joint space, the IT2FL controller provided better performance in terms of RMSE values, as it can be clearly seen in Table 6. The RMSE values for the T1FL controller are high and there is a significant improvement when the IT2FL controller is considered. So, in both joint and Cartesian spaces, it can be concluded that the tracking performance is better for the IT2FL controller than for the T1FL controller.
The control signals, represented by the torques of the three actuator motors, are presented in Figure 16.  Considering the same task for the system, first with the T1FL controller and then with the IT2FL controller, it can be clearly seen in Figure 16 that the IT2FL controller required a smaller torque than the T1FL controller. This means that the control effort provided by the IT2FL controller was smaller for a same task.

Case II: A square trajectory with disturbance
The steps of robot movement is performed in the following sequence: The position of the robot gripper has to move from     For this case, the robustness to external disturbances will be considered in the performance evaluation. So, a harmonic torque disturbance given by 0:5sin(10t) N:m will be applied in each actuated joint. The robustness is quantitatively evaluated by the calculated variance between the nominal response and the deviated one that arises from the application of the external disturbance. For the purpose of comparison, a controller providing a response with smaller variance can be  considered more robust than the others. The tracking of a square trajectory, considering the harmonic disturbance, is shown in Figure 17. The actual and desired trajectories in a square are presented in Figure 18, for the system with both T1FL and IT2FL joint controllers under effect of external harmonic disturbances. It can be seen that, under disturbances, the IT2FL controller provided a transient response that remains relatively smooth and unchanged in terms of tracking, whereas the transient response with the T1FL controller is highly rippled and distorted. This primary analysis indicates a more robust IT2FL controller than the T1FL controller.
The position errors in Cartesian space, e x and e y , are shown in Figure 19 for the T1FL and IT2FL controllers. It can be seen that the tracking performance with the IT2FL controller is better, in terms of robustness, when the external harmonic disturbance is applied. The RMSE value can be used to evaluate the tracking performance of the system with this trajectory, that is different from the previous one, and under disturbances. The calculated RMSE values are presented in Table 7, showing that there is an improvement in the tracking performance with the IT2FL controller over the T1FL controller.
The errors e u 1 , e u 2 , and e u 3 relative to the active joints, considering external harmonic disturbances and both IT2FL and T1FL controllers, are presented in Figure 20. It can be visually seen that the IT2FL controller provided smaller errors, in transient and also steady-state response. In order to properly quantify the performance in joint space, the RMSE values are presented in Table 8. The IT2FL controller provided an improved performance in terms of RMSE, when compared with the T1FL controller. So, it can be said that the IT2FL controller outperformed the T1FL controller in both Cartesian and joint spaces.
The control signals, represented by the torques of the three actuator motors, are presented in Figure 21. Considering the same task for the system, first with the T1FL controller and then with the IT2FL controller, it can be clearly seen in Figure 21 that the IT2FL controller required a smaller torque than the T1FL controller. This means that the control effort provided by the IT2FL controller was smaller for a same task.

Conclusions
It has been shown that the SSO algorithm is a viable alternative for the optimal tuning of PD design parameters in both T1FL and IT2FL controllers, avoiding traditional time consuming and tedious trial-and-error procedures. Moreover, it was verified that this optimization strategy confirms that, in general, the IT2FL controller provides better results than the T1FL controller.
Considering no exogenous disturbance, it was achieved a better performance, in both joint and Cartesian spaces, with the IT2FL controller when compared with the T1FL controller. Moreover, the control efforts, in terms of torque, are smaller for the IT2FL controller in comparison with the T1FL controller.
When exogenous disturbances are considered, the simulations presented that a better tracking behavior was achieved, in terms of RMSE, with the IT2FL controller when compared with the T1FL controller. Also, the IT2FL controller provided lower control effort and presented more robust characteristics than the T1FL controller.
This study can be implemented in real-time to verify experimentally the effectiveness of proposed controller. In addition, other extension of the work can be made by including other optimization techniques for the sake of comparison. [49][50][51][52][53][54][55] Cooperative control can be developed for this type of 3-RRR planar parallel robot for the surgical application. 12,14,56