OPTIMAL SLIDING MODE CONTROLLER DESIGN BASED ON WHALE OPTIMIZATION ALGORITHM FOR LOWER LIMB REHABILITATION ROBOT

The Sliding Mode Controllers (SMCs) are considered among the most common stabilizer and controllers used with robotic systems due to their robust nonlinear scheme designed to control nonlinear systems. SMCs are insensitive to external disturbance and system parameters variations. Although the SMC is an adaptive and model-based controller, some of its values need to be determined precisely. In this paper, an Optimal Sliding Mode Controller (OSMC) is suggested based on Whale Optimization Algorithm (WOA) to control a two-link lower limb rehabilitation robot. This controller has two parts, the equivalent part, and the supervisory controller part. The stability assurance of the controlled rehabilitation robot is analyzed based on Lyapunov stability. The WO algorithm is used to determine optimal parameters for the suggested SMC. Simulation results of two tested trajectories (linear step signal and nonlinear sine signal) demon-strate the effectiveness of the suggested OSMC with fast response, very small overshoot, and minimum steady-state error.


INTRODUCTION
Spinal cord injury, accidents, and stroke are the significant sources of disability for the athletics, drivers, and elderly persons that create troubles in their lifes (Furlan et al., 2021;Rodrigues & Rodrigues, 2018). Rehabilitation tools were focused on recovering full/partial functionality by enhancing their motion capabilities using different techniques. Recently, wearable robots of lower-limb exoskeletons have been employed for helping disabled people with mobility issues (Rupal et al., 2017).
A rehabilitation robot is a robot that helps patients recuperate from strokes or other types of extremity injuries. The goal of developing a rehabilitation robot is to assist individuals with daily living problems. Since robots are suited to provide a precise and reproducible physiotherapy, they are excellent tools for providing high-quality treatment at a low cost with minimal intervention (Saryanto & Cahyadi, 2016).
The preferred path of robot joints needs a strong controller to reduce a steady-state error to minimize disturbances and the variation of system parameters. Different controller strategies with parameter optimization techniques are developed to guarantee asymptotic stability and to estimate the uncertainty aspects of adaptive controlled lower-limb systems. The Sliding Mode Controller (SMC) is often considered one of the most effective methods used to control robotic systems, including rehabilitation robots. Babaiasl et al. (2015) proposed a sliding mode controller for upper limb rehabilitation robots to track desired trajectories and reject system uncertainties and disturbances. (Zhou, Zhou & Ai, 2016) proposed an impedance control strategy for rehabilitation robots based on nonsingular terminal sliding mode control to ensure precision in trajectory tracking and improve the stability of the system. (Liu et al., 2018) proposed Adaptive Sliding Mode Control (ASMC) for a lower limb exoskeleton rehabilitation robot to achieve improved performance in terms of jitter elimination and trajectory tracking. For alternative control methods in lower limb rehabilitation robots, (Yang & Gao, 2020) suggested the Adaptive Neural Sliding Mode Controller. The authors proposed a control strategy that dynamically switches between assistance and challenge modes depending on the user's performance by amplifying or decreasing the deviation between the user and the rehabilitation robot in their analysis. A multisensor fusion system was proposed for a seamless cognitive and physical interaction between the robot and the patient. The system uses radial basis function (RBF) to provide reliable activity and motor capability recognition, fall detection, and physical fitness assessment in the rehabilitation training process. (Abbasimoshaei & Mohammadimoghaddam, 2020) designed Adaptive Fuzzy Sliding Mode Controller (AFSMC) for a hand rehabilitation robot to overcome uncertainties and disturbances, reduce chattering effects, and compensate the varying forces of the patients. (Almaghout et al., 2020) proposed super-twisting nonsingular terminal sliding mode control for design and control of a lower limb rehabilitation robot, taking into account negative torques of the patient's limb to obtain the desired training missions; their results are comparable to those of adaptive sliding mode control. A Fuzzy Sliding Mode Controller (FSMC) was also proposed by (Maalej et al., 2020) for minimizing torques applied to a rehabilitation robot to help children, suffering from several diseases, to walk compared to the use of wheelchairs. Their simulation results show that the proposed controller is effective, moreover, it has been shown that the fuzzy sliding mode controllers are robust against parametric variations such as masses and lengths of kid's legs.
This research focuses on designing an Optimal Sliding Mode Controller (OSMC) based on Whale Optimization Algorithm (WOA) for tracking the trajectory of a two-link lowerlimb rehabilitation robot by using dynamic equation for a human two-joint during-walk lower-limb model. WOA is used to tune the parameters of the suggested controller. The dynamic model of this robot is was derived by (Rezage & Tokhi, 2016) depended on anthropometric data (described by Winter (2009)). The stability analyses of both joints of a closed-loop controlled system based on the dynamic robot equations are explained by Lyapunov stability.
The rest of this paper is organized as follows, the dynamic mathematical model of the two-link lower-limb rehabilitation robot is given in section 2, the suggested controller is detailed in section 3, the WOA is illustrated in section 4, simulation results are presented in section 5; finally, the conclusions are provided in section 6.

LOWER LIMB REHABILITATION ROBOT DYNAMIC MODEL
The structure of a two degree of freedom (2-DOF) rehabilitation robot is shown in Figure (1), this robot consists from two link with two joints of the lower limb: a joint at the hip and a joint at the knee, link1 assists the rehabilitation of the hip and link2 for the knee. The dynamic model of this robot is was derived by (Rezage & Tokhi, 2016) depended on anthropometric data (described by Winter (2009)) for person with 74 kg in weight and 1.69 m in height (Alshatti, 2019;Winter, 2009).

OPTIMAL SLIDING MODE CONTROLLER DESIGN
Sliding mode control has two significant advantages. The first advantage is that the system's dynamic behavior can be tailored by selecting a specific sliding function, the second advantage is that it is able to treat any uncertainties that affect the control system. The SMC can be used to control nonlinear processes that are subject to external disturbances and large model uncertainties in practice. Usually, the SMC is composed of two parts. The first part involves designing a sliding surface that satisfies design requirements for sliding motion. The second concern is with selecting a control law that will make the switching surface appealing to the system state (DeCarlo, Zak & Matthews, 1988;Hung, Gao and Hung, 1993).
The designed Optimal Sliding Mode Controller (OSMC) that is suggested in this paper for the two-link rehabilitation robot is shown in Figure (2).

Fig. 2. The block diagram of the suggested OSMC
In order to design this controller, Eq. (1) is rewritten to the following form: or ̈= ( ,) + ( ) ( ) where and One of the important steps in designing the SMC is the selection of the sliding surface. Here in this paper, we assume the sliding surface (sliding function s(t)) for each link i ( i= 1, and 2) is given by: where = ( 1 , 2 ), = ( 1 , 2 ), and = ( 1 , 2 ) are proportional, derivative, and integral gains in respectively of link i (i=1, 2), while e(t)=[ 1 ( ) 1 ( )] and ( ) = [̇1( ) ̇1( )] are the tracking error and the derivative of the tracking error in respectively. The tracking errors will aim to zero asymptotically ∀ ≥ 0 if system states remain on the sliding surfaces chosen. The system state trajectories are then guided to the sliding surfaces using the control law ( ). The main challenge is to select a Lyapunov function of the form = 0.5 . < 0 and choose such a control law (Nguyen, Ha & Nguyen, 1989): or: The scalar is positive and sgn(.) is signum function. The designed control law ( )= [ u1(t) u2(t)] is selected as: where ( ) = [ 1 ( ) 2 ( )] is the equivalent control part and ( ) = [ 1 ( ) 2 ( )] is supervisory control part. The ( ) is given by: The ̈ = [̈1 ̈2 ] is the desired acceleration of link i (i=1, 2), 1 = ( 11 , 12 ) and 2 = ( 21 , 22 ), where the parameters of C1 and C2 are positive optimal values of link i (i=1, 2) obtained by WOA.

WHALE OPTIMIZATION ALGORITHM (WOA)
WOA is a modern meta-heuristic algorithm; WOA simulates the humpback whale population bubble-net as they hunt their prey. Whales are considered the world's largest mammals. Because of the spindle cells in their brain, they are intelligent. The humpback whale has a unique hunting mechanism as follows: Bubble-net feeding, this hunting activity is achieved by blowing special bubbles in a spiral or nine-shaped path. Humpback whales (search agents) are aware of their prey's position and surround them. They believe the current optimal solution is an ideal solution and similar to the desired solution (Mohammed Umar & Rashid, 2019). Following the optimal candidate solution assignment, the other agents attempt to update their positions to align with the best search agent, this is given by Eq. 15 and Eq. 16 below which are the basic principles of the Whale optimization algorithm: where t indicates the current iteration, and indicate the vectors of coefficient, ( * ⃗⃗⃗⃗ ) denotes the optimal solution's position vector, and indicated the position vector of a solution, and | | indicates the absolute value. The and vectors are determined as in Eq. 17 and Eq. 18 respectively: Over the course of iterations, the components of are linearly decreased from 2 to 0, and ( ) is a random vector whose value is between [0,1]. The bubble-net mechanism is mathematically formulated as follow: 1. Shrinking encircling mechanism: the value of ⃗⃗⃗ in Eq. 17 is a random value in the interval [-a, a], and the value of a is reduced from 2 to 0 over iterations. 2. Spiral updating position mechanism: this mechanism calculates the distance between the whale's position and the prey's position, and the humpback's helix-shaped movement is formed as given by Eq. 19: ( + 1) = . cos(2 ) . ′ ⃗⃗⃗⃗ + * ⃗⃗⃗⃗ ( ) where ′ ⃗⃗⃗⃗ = | * ⃗⃗⃗⃗ ( ) − ( ) ⃗⃗⃗⃗⃗⃗⃗⃗ | is the distance between the optimal solutions (prey) and the i th whale, b is a constant, and l is a random number in the range [-1,1].
When humpback whales swim around their prey, they implement the two mechanisms described by the mathematical model above. It is assumed that there is a 50% reasonable probability to update Whales' position as given by Eq. 20: where is a random number in [0,1]. During the search phase, search agents scan for best solution at random and adjust their positions in response to other agents' movements. We use the ( ) ⃗⃗⃗⃗⃗⃗⃗ with values > 1 or <1 to push the search agent to travel further away from the reference agent. The search phase has the following mathematical model: where ( ⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗⃗ ) is a randomly selected position vector from of the current population (Mirjalili & Lewis, 2016). Figure (3) below illustrates the whale optimization algorithm flowchart.

SIMULATION RESULTS
With the facility included in the version of the MATLAB software (R2019b), various simulation scenarios of lower limb rehabilitation robot are executed for both linear (step) and nonlinear paths with 10% uncertainties in parameters of the ( ,) are considered to illustrate the efficiency of the suggested controller. The parameters of the suggested controller are tuned based on the whale optimization algorithm. WOA parameters are given in Table 2, the WOA fitness function ITAE (Integral Time Absolute Errors) is given by Eq. 23: The optimal suggested controller parameters tuned by WOA are given in Table 3.

Linear path with 10% uncertainties
The step response (positive unity step for link1, and negative unity step for link2) of the controlled lower limb rehabilitation robot (position and control signal) with 10% uncertainty in the parameters of the ( ,) function are shown in Fig.(4) and Fig.(5). These results show that the performance of the robot with the suggested controller is more efficient, where the robot flows the desired path very fast (ts=1.605 sec. for link1 and ts=1.468 sec. for link2) very small overshoot and zero steady-state error, with a smooth control signal. the evaluation parameters of simulation results for the suggested controller are given in Table 4.

Nonlinear path with 10% uncertainties
The simulation results of the lower limb rehabilitation robot with the suggested OSMC tested by the desired nonlinear input signal ( 1 = 4 ⁄ + (1 − 3 ) for link1 and 1 = 6 ⁄ + (1 − 5 ) for link2) with 10% uncertainty in the parameters of the ( ,) function are illustrated in Fig. 6 and Fig.7; these results show that despite the nonlinearity of the input signal, the WOA optimized controller converges with precise control over the plant. It achieves very good performance parameters and zero error.

CONCLUSIONS
The main aim of this work was to design an Optimal Sliding Mode Controller (OSMC) for tracking the desired trajectory and improve the performance of a two-link lower limb rehabilitation robot. The parameters of the SMC were optimized by using a Whale Optimization Algorithm (WOA). The transient parameters of the obtained results show the effectiveness of the suggested controller achieving zero steady-state error in two scenarios, the linear with 10% uncertainty and the nonlinear with 10% uncertainty in parameters of the ( ,) function. The controlled output settled within the vicinity of the desired value after 1.605 sec. and 1.468 sec. for the linear case. These results show reliability of the proposed approach and suggests investigating their capabilities in more complex scenarios as well as physical implementation.