Design a New Hybrid Controller Based on an Improvement Version of Grey Wolf Optimization for Trajectory Tracking of Wheeled Mobile Robot

Nonholonomic wheeled mobile robots are considered to be multi-input multi-output systems that are performed in varying environments. This work presents the trajectory tracking control of a nonholonomic wheeled mobile robot (WMR). The Kinematic and the dynamic models of the robot were derived. A new hybrid controller was designed, which consisted of two controllers based on an optimization algorithm to solve the trajectory tracking problem. The first controller is the Fractional order PID controller, which is based on the kinematic model and has been applied to control the linear and the angular robot velocities, while the second controller is a linear quadratic regulator (LQR) and is based on the dynamic model used to control the motors' torques. A new, improved version of grey wolf optimization wasadopted to tune the parameters of the hybrid controller. The main goals of this improvement are rapid convergence towards a solution, reducing the effect of the wolves' random motion, andbalancing exploitation and exploration processes. MATLAB software was used to simulate the results under an S-shape trajectory and to evaluate the robustness and performance of the proposed control unit. The simulation results demonstrated the adopted control system's activity and efficiency based on the mean square error (MSE) between the desired and actual trajectory. The values of MSE of trajectory in the X and Y directions and the orientation are [6.589*10 -4 (m) 8.421*10 -5 (m) 0.00401(rad)] T . Also, the adopted control system can generate smooth values of the control input signals without sharp spikes. The performance of the presented control system has been verified and compared with the results obtained from the other two control systems, and the simulation results have offered the superiority and effectiveness of the hybrid controller of this work


INTRODUCTION
In recent years, the research about the wheeled mobile robot (WMR) increased excitingly because of their theoretically regaled characteristics [1].WMR is considered the most widely utilized mobile robot type [2].WMR is utilized in many fields or applications, from dangerous environments, such as mining and the nuclear industry, to daily life applications, such as household work and autopilot robots for cars.Also, WMR is successfully applied in hazardous environments where human life can be endangered, such as in explosive detection operations [3].Trajectory tracking control means the ability of the robot to track a desired path or trajectory [4].Many studies solve the problem of trajectory tracking by using various approaches.In [5], a hybrid controller was used to solve the motion control of a WMR.The hybrid controller consisted of a backstepping controller (BSC) based on the kinematic model and fractional order PID (FOPID) controller based on the dynamic model.The gains' parameters of both BSC and FOPID were tuned using a modified version of a beetle swarm optimization.In [6], a nonlinear model predictive controller (NMPC) was presented to solve the trajectory tracking problem of a continuum robot.A particle swarm optimization (PSO) algorithm was proposed to solve the limited computational burden of the NMPC.A circular trajectory was chosen to test the efficiency of the adopted controller.In [7], a neural network with a PID controller was used to solve the trajectory tracking of a mecanum WMR.The kinematic and dynamic models of the robot were derived.An adopted control system was applied to control the robot's velocities.The stability of the control system was tested by using the Lyapunov method.In [8], an adaptive fractional order parallel fuzzy PID control was adopted for the tracking control of a WMR.The effect of uncertainty, noise, and time delay was considered in the robot's dynamic model.The gains' parameters of the control system were evaluated and tuned using Grey Wolf Optimization (GWO).In [9], a multi-objective Grey Wolf Optimization (MOGWO) was adopted to schedule the material transport systems relying on a single WMR.The mathematical model of the MOGWO included 13 fitness functions combined to perform an optimal solution for the scheduling problem.In [10], combined controllers consisting of BSC and Fuzzy-PID were applied.BSC was used based on the kinematic model of the WMR, while the Fuzzy-PID was utilized based on the dynamic model.Infinity trajectory was selected to test the performance of the combined controller.In [11], the trajectory tracking problem of a WMR was solved by using recursive integral BSC.The stability of the control system was checked by using the Lyapunov method.Two trajectories were chosen, circular and lemniscate, to test the performance of the control system.In [12], the trajectory tracking problem of a WMR with the presence of slipping and skidding phenomena was investigated.A nonlinear disturbance observer was used to estimate the disturbance effect.An integral sliding mode control was employed as a control system.In [13], two robotic arms were developed and designed to sort and classify objects.The vision system conducted the classification process based on size and shape.The experimental control system contained one master and two slave microcontrollers.Two Arduino microcontrollers were enslaved to control the speed of the stepper motors, while Raspberry pi4 was employed as a master to receive the commands from the vision system.In [14], the scheduling problem of a WMR was analyzed.The whale optimization approach (WOA) was used to select an optimum path in order to carry goods, materials, and parts in an industrial environment.A modified mathematical model based on the WOA in order was suggested to make a minimization to seven fitness functions.In [15], a new NMPC was investigated as a control system for the trajectory tracking of a WMR.A set of enhancements in the cost function and optimizer was applied to reduce posture errors.In [16], a hybrid control system comprising BSC and fuzzy sliding mode control was proposed.BSC was used based on the robot's kinematic model, while fuzzy sliding mode control was utilized based on the dynamic model.The fuzzy logic system tuned the gains' parameters of the sliding mode control.A circular trajectory was adopted to test the performance of the WMR control system.In [17], a fractional order state feedback controller was applied for the trajectory tracking of a nonholonomic WMR.The proposed control system was considered based on the kinematic and dynamic models of the robot.The stability of the system was checked by using the Lyapunov method.In [18], time-varying BSC was used based on the kinematic model of the WMR.The Lyapunov stability criteria were utilized to test the stability of the control system.A circular trajectory was chosen to check the performance of the adopted controller.In [19], an integral BSC was applied theoretically and experimentally to solve the trajectory-tracking problem of a WMR.A circular trajectory was selected to test the control system's performance, and the results indicated that the integral BSC's performance was better than the conventional BSC's.
In this work, a hybrid controller is applied based on the kinematic and dynamic models in order to solve the trajectory tracking problem of a nonholonomic WMR.FOPID controller is applied based on the kinematic model to control the robot's linear and angular velocities, while the magnitudes of the motor torques are controlled by using a linear quadratic regulator (LQR) controller.An improved version of the gray wolf optimization (IGWO) algorithm is adopted to tune the gains parameters of the FOPID controller as well as the parameters of the weighted matrices of the LQR controller instead of selecting the parameters rapidly.

MATHEMATICAL MODEL OF THE WMR
This section presents the kinematic and dynamic models of a nonholonomic WMR.It is supposed that the WMR moves on a flat surface (without considering the effect of the slipping).The robot consists of two driving wheels fixed on the same axis and one caster wheel.The basic schematic of the WMR is shown in figure (1).The Kinematic of the mobile robots describes the relation between the robot's (body) velocities and the wheel's angular velocities [2].The motion of the WMR is controlled by the angular speed of the right wheel (ω R ) and the angular speed of the left wheel (ω L ).The translation velocities of both the left and the right wheels are evaluated as [2]: where (r) represents the wheel's radius.The linear and the angular velocities of the robot body (V and ω) are obtained as [3]: where (D) is the distance between the two wheels.The posture of the WMR with respect to the global coordinate system is represented by a state vector q=[X G , Y G , θ] T , and the posture vector with respect to the local coordinate system is q=[x L , y L , θ] T .Point (C) represents the center mass of the robot.The kinematic equation of the robot with respect to the local coordinates can be represented as: while the kinematic equation of the robot with respect to the global coordinates can be represented as: where (R) is the matrix rotation matrix.

Dynamic model
The dynamic model of the robot describes the motion of the robot, taking into account the effect of the system inertia and the external forces.The dynamic model equations are described according to that depicted in figure (2) below.
where (m) is the robot mass, (F R ) and (F L ) are the forces applied to the right and the left wheels, respectively, (I) is the mass moment of inertia, and (α) is the angular acceleration.Now, the state space model of the robot can be represented according to the kinematic and dynamic models.The variables of inputs, outputs, and states are chosen as follows: where (τ L ) and (τ R ) are the left and the right motor torques, respectively.From ( 9), one can obtain: By taking the derivation of both sides of ( 12), the following relation is obtained: According to the relation in ( 10), ( 13) can be represented as: Also, from (9), x 2 = ω and its derivation are: The following relation can describe the motor's torques: where (F) is the friction force, and (α L ) and (α R ) are the wheel's angular acceleration.The equations of ( 3 x ) and ( 4x ) are obtained as below: ( ) ( ) ( ) ( ) The general form of the state space equations is: The ( 14),( 15), (18), and ( 19) can be written in a matrix form as: ( ) ( ) ( )

TRAJECTORY TRACKING CONTROL DESIGN
This section has discussed the trajectory tracking control of a WMR.A new hybrid controller is implemented based on the kinematic and dynamic models of a nonholonomic WMR.The new hybrid controller consists of two controllers.The first controller is the Fractional order PID (FOPID) controller, which is applied to control the linear and the angular robot velocities, while the second controller is a linear quadratic regulator (LQR) and is used to design the motors torques (τ R ) and (τ L ).

Fractional order PID (FOPID) controller:
' A fractional order PID (FOPID) controller is a nonlinear tuneable feedback control system [20].The structure of the FOPID controller contains five parameters which are proportional gain (k p ), integral gain (k i ), derivative gain (k d ), integral order (α), and the derivative order (β).
(α) and (β) may not be integers.The basic equation of the FOPID controller in the time domain is [20]: where u(t) is the controlled signal, and e(t) is the error signal.When WMR tracks a desired trajectory, some tracking errors appear in X, Y, and θ directions.The mathematical model of the tracking errors is presented as follows: The general ranges of each FOPID control parameter are: In this work, the FOPID controller is adopted to control the magnitudes of the linear and the angular robot velocities`, so two FOPID controllers are used.The optimum magnitudes of the five FOPID parameters are computed from the optimization algorithm in the next section.

Linear quadratic regulator (LQR) controller
LQR control is considered an optimal and modern control method [21].LQR is utilized to minimize the WMR tracking position errors according to the integral of the quadratic performance index (J) that is written as [21]: where u(t) is the controlled torque signal, (Q) is a positive semi-definite symmetric matrix, (R) is a positive definite matrix, and (K) is the optimal gain matrix that is evaluated as below [21]: where (P) is a positive definite matrix which is obtained from the Riccati equation as below [21]: where (A) and (B) are the state and the input matrices that are described in (22).
The (R) and (Q) matrices are represented as: In this work, the main purpose of using LQR control is to design the left and right motion torque.
Selecting the best or optimum parameters of matrices (Q) and (R) is very important because it reflects on the performance of the LQR controller.In the present work, the parameters of matrices (Q) and (R) are not selected arbitrarily, but instead of that, they are chosen optimally by using the optimization algorithm that is discussed in the next section.

IMPROVED GREY WOLF OPTIMIZATION (IGWO) ALGORITHM
The grey wolf optimization (GWO) algorithm is a metaheuristic algorithm that emulates the gray wolf's behavior.It was introduced in 2014 by Mirjalili and Lewis in order to solve optimization problems [22].It is iterative and population based on other meta-heuristic algorithms, like particle swarm optimization (PSO), artificial bee colony (ABC), ant colony optimization (ACO), etc.The mathematical model of the GWO consists of four basic parts: social hierarchy, encircling prey, and hunting and attacking prey.The social hie-rarchy of the GWO contains four wolves' leadership kinds which are alpha (α), beta (β), delta (δ), and omega (ω) [22].Alpha (α) kind is considered the strongest type, which is responsible for the decision-maker in the group, while the beta (β) kind is the advisor of alpha.Delta (δ), as well as omega (ω), is placed in the third and fourth positions in the hierarchy of the wolf, as illustrated in figure (3).GWO is considered a population-based inspired algorithm because it builds an initial random population.During the iterative procedure, the positions of the search agents are changed to obtain better solutions.The operation of the wolf (α), wolf (β), and wolf (δ) changed by their positions continuously at the iteration, and the equations that represent the encircling phase are [23]: where A and C are the coefficient vectors, P X is the position vector of the prey, X is the grey wolf position vector, (t) is the current iteration, (t+1) is the next iteration, and D is the distance between the grey wolf and the prey.The coefficients A and C have depicted as [23]: where 1 r and 2 r are random vectors within the range [0,1], and a represents a convergence factor that decreases from 2 to 0 through the iterations, and its equation can be defined as [23]: where T max is the maximum number of iterations.
The hunting behavior mechanism in GWO is guided by (α,β,δ) grey wolves.First, the prey's location is unknown, but an assumption has been made that makes the wolves know the location of the prey.The mathematical model of the hunting process is defined as [23]: where D α , D β and D δ represent the distance between the wolves α, β, and δ and the pack wolf, respectively.
The main outcome of the GWO is the solutions that avoid trapping in the local minima.But, the problem of balancing exploitation and exploration and making the wolves' location as close as possible to the prey needs to be enhanced.In the classical GWO, the updating position of the grey wolf is defined by Eq.(31).Therefore, a new, improved algorithm, i.e., Improved Grey Wolf Optimization (IGWO), is adopted.The parameters 1 r and 2 r in the classical GWO are random vectors within the range [0,1] whose magnitudes are considered to be decisive in adducing the balance between the exploitation and exploration processes; in addition, it is included in the account of the A vector which enters into account of Eq. (31).So, a new mathematical model for representing 1 r and 2 r parameters is expressed as below: ( ) where (t) is the current iteration, and (N) is the number of optimized parameters, equal to 11 parameters.From Eq.
(36), it can be seen that the 1 r and 2 r vectors are not entirely random values such as in the classical GWO optimization, i.e.,(Eqs.32 and 33) but it contains a part 0.365 (which is considered to be an adaptive part) that is changed with each iteration.This modified equation, i.e., (Eq.36), achieves a sufficient balance between the exploitation and exploration processes and increases the chance of making the wolf close to the prey.
In the current work, IGWO is applied to compute the optimum values of the (Q) and (R) matrices' elements of the LQR controller as well as the optimum magnitudes of the FOPID controller parameters.

RESULTS AND DISCUSSIONS
This section verifies the adopted hybrid controller by simulation work with MATLAB software.The physical parameters of the WMR are selected based on the real magnitudes found in [9] and summarized in Table ( The simulation is carried out by tracking WMR with an S-shape trajectory.The trajectory consists of nine segments (S 1 →S 9 ).Five of the nine segments are line segments with a desired angular velocity ω d =0 and a desired linear velocity V d =0.15 (m/s).The other four segments are arc segments with a desired linear velocity V d =0.15 (m/s) and a desired angular velocity ω d =0.6 (rad/s).The following equations represent the S-shape trajectory below: 1-For horizontal segments, the trajectory equations are: 2-For vertical segments, the trajectory equations are: 3-For arc segments: ( ) ( )  The robot starts its movement from an initial position which is represented by q=[0 0 0] T , and figure (4) manifests the tracking performance of the adopted controller.The above figure reveals that all errors go to a zero value after about three seconds.The maximum tracking error in the (X) and (Y) directions at the beginning of the simulation are 0.008 (m) and 7*10 -4 (m), respectively, and these values after three seconds are decreased to zero value.At the same time, the maximum orientation error is about -0.025 (rad), which is decreased to zero after about two seconds.Also, the values of the mean square error (MSE) of trajectory in the X and Y directions as well as the orientation, are [6.589*10-4(m) and 8.421*10-5 (m) 0.00401(rad)] T , respectively.The linear velocity of the robot is with the red color, while the angular velocity is with the green color.It can be observed from the above figure that the WMR takes a short time (about two seconds) to reach the desired velocities (V=0.15m/s and ω=0.6 rad/s) at each trajectory segment.Figure (7) evinces the controlled torque's behavior.The simulation results from figures (4) to figure (7) demonstrate the activity and the efficiency of the adopted control system by showing the ability of the control system to generate the smooth values of the control input signals (V, ω, τ) without any presence of sharp spikes.
To test the performance of the hybrid controller, that is adopted in this work, a comparison study has been done with the work of [11] that used recursive integral backstepping control during the circular trajectory.Figures (8)    From figure (8) that is shown above, it can be noticed that the desired trajectory is with the blue color, while the robot trajectory is with the red color.Accor-ding to this figure, a very good tracking performance is obtained from the adopted controller of this work and the controller proposed in [11] because the simulation tracking followed by WMR is considered almost coin-ciding.Figure (9) elucidates the tracking errors from both controllers.
Figure (9a) depicts a very good trajectory response, where all the errors go after about one second to a zero value, while in figure (9b), the tracking errors in the (X) and (Y) coordinates are not convergent to a zero value.Still, instead of that, they fluctuate between zero and (-0.01 m).This matter indicates that the controller's performance adopted in the present work is better and more robust than the controller proposed in [11].
The performance of the proposed hybrid controller of this work is further tested with the hybrid controller comprising backstepping and fractional-order PID controller adopted in [5] during the 8-shape trajectory.Figure (10) reveals the comparison study's simulation results and trajectory performance.Table (3) evinces the comparison results of the mean square error (MSE) for the state error components (eX, eY, eθ) obtained from the hybrid controller of this work (LQR-FOPID-IGwo) and the hybrid controller of the work [5].Figure (10a) illustrates a very good matching between the desired and actual tracking, while there are some small deviations between the reference and the actual trajectory in figure (10b).Figure (10) exhibits the hybrid controller methodology of the current work having an effective performance and is better than the hybrid controller in [5].The results that are tabulated in the above table indicate that the magnitudes of the MSE of the hybrid controller methodology of the present work (LQR-FOPID based on IGWO) are less than those of the hybrid controller methodology adopted in [5] (BSC-FOPID).This matter indicates that the performance of the controller methodology of this work is better than the hybrid controller [5].

CONCLUSIONS
In the current work, based on the kinematic and dynamic models of the WMR, a new hybrid controller consisting of LQR and FOPID based on an optimization algorithm is proposed to solve the trajectory tracking problem.The new hybrid controller is utilized to find the best control actions (robot velocity and the generated torques) with more stability and without any oscillation in the output response.A new modified version of the GWO is adopted to tune and select the optimum values of the control system parameters with a minimum time.The main goals of this improvement are rapid convergence toward a solution, reducing the effect of the wolves' random motion, and balancing the exploitation and exploration processes.The S-shape trajectory is selected to present the robustness of the adopted control system.The simulation results elucidated that the proposed hybrid controller can generate smooth robot velocities (V=0.15m/s and ω=0.6 rad/s) and smooth motors torques which are not exceeded 0.2 (N.m) without any sharp spikes, as well asall position and orientation errors go to a zero value after about three seconds.The values of the MSE of S-trajectory in the X and Y directions and the orientation are [6.589*10-4(m) and 8.421*10-5 (m) 0.00401(rad)] T , respectively.The robustness of the adopted hybrid controller is verified and compared with two cases or works, and all the comparisons are developed in MATLAB software.In the first case, a comparison is conducted with a work that used recursive integral backstepping control during a circular trajectory.The simulation results showed that the performance of the new hybrid controller of this work is better than that of the recursive integral backstepping control through a circular trajectory in terms of the position and the orientation errors' values.The errors' values obtained from the present new hybrid controller are convergent to a zero value after 1 second, while the errors' values obtained from the recursive integral backstepping control fluctuate between (0 and -0.01 m) during all the simulations.While in the second case, a comparison is carried out with combined backstepping and FOPID controllers during an 8-shape trajectory.The MSE magnitudes obtained from backstepping and FOPID controllers of all errors are [1.642e-03 (m), 5.087 e-03(m), and 4.051 e-03 (rad)] T , whereas the MSE magnitudes obtained from the new hybrid controller of this work, i.e., (LQR-FOPID-IGWO) are [6.225e-04 (m), 8.157 e-04 (m) and 6.041 e-04] T .This matter indicates that the performance of the controller methodology of this work (FOPID-LQR-IGWO) is better and more robust than that of the controller systems adopted in the previous works.Future work will focus on other interesting problems, such as avoiding static and dynamic obstacles in a complex environment and the trajectory tracking of a holonomic WMR.

Symbols ω R
The angular speed of the right wheel (rad/s) ω L The angular speed of the left wheel (rad/s) V R

Figure 2 .
Figure 2. Dynamic force representation of the WMR

Figure 4 .
Figure 4. S-shape trajectory tracking performance The above figure shows that the desired trajectory is within the blue color, and the actual or robot trajectory is within the red color.Also, it is clear from the above figure that the WMR can achieve a very good matching with the desired trajectory.The optimum values of the FOPID controller and the elements of R and Q matrices are: 0.8215, 0.09875, 0.3265, 0.02267 12.5569 0 0 0 0 11.2897 0 0 , 0 0 3.6584 0 0 0 0 7.5619 2.895 0 0 0 0 5.1181 0 0 0 0 1.1147 0 0 0 0 4.6028

Figure 5 .
Figure 5.Tracking errors behavior of the trajectory

Figure ( 6 )
Figure(6) illustrates the variation of the robot velocities with the simulation time.

Figure 6 .
Figure 6.Linear and angular velocities of WMR

Figure 7 :
Figure 7: The generated controlled torques behavior and (9) portray the simulation results of the comparison study.

Figure 8 .
Figure 8. Trajectory tracking performance (a) by the proposed controller of this work(b) by the controller that was adopted in [11].

Figure 9 .
Figure 9. Trajectory errors (a) by the proposed hybrid controller of this work (b) by the controller that was adopted in [11].

Figure10.
Figure10.Trajectory tracking performance (a) by the proposed hybrid controller of this work and (b) by the hybrid controller that was adopted in[5]

Table 1 . Physical Parameters of the WMR
(2)where (t) is the simulation time.Different initial conditions for [x d , y d , θ d ] T are required to generate the desired trajectory.The values of the initial conditions are listed in Table(2).