Optimization of Fuzzy Logic Controller Used for a Differential Drive Wheeled Mobile Robot

: The energy-efﬁcient motion control of a mobile robot fueled by batteries is an especially important and difﬁcult problem, which needs to be continually addressed in order to prolong the robot’s independent operation time. Thus, in this article, a full optimization process for a fuzzy logic controller (FLC) is proposed. The optimization process employs a genetic algorithm (GA) to minimize the energy consumption of a differential drive wheeled mobile robot (DDWMR) and still ensure its other performances of the motion control. The earlier approaches mainly focused on energy reduction by planning the shortest path whereas this approach aims to optimize the controller for minimizing acceleration of the robot during point-to-point movement and thus minimize the energy consumption. The proposed optimized controller is based on fuzzy logic systems. At ﬁrst, an FLC has been designed based on the experiment and as well as an experience to navigate the DDWMR to a known destination by following the given path. Next, a full optimization process by using the GA is operated to automatically generate the best parameters of all membership functions for the FLC. To evaluate its effectiveness, a set of other well-known controllers have been implemented in Google Colab ® and Jupyter platforms in Python language to compare them with each other. The simulation results have shown that about 110% reduction of the energy consumption was achieved using the proposed method compared to the best of six alternative controllers. Also, this simulation program has been published as an open-source code for all readers who want to continue in the research.


Introduction
The Differential Drive Wheeled Mobile Robot (DDWMR) can perform many different tasks in many fields. To fulfill its series of tasks in different places, the robot has to move from one place to another place in a known or an unknown environment. Therefore, motion control problems such as path tracking, "go-to-goal", "point-to-point", waypoints tracking, pose tracking, etc. of a mobile robot are still the crucial and fundamental problems for the robot operation. These control problems have been widely researched and published, such as the obstacle avoidance with minimum travel time [1], the go-to-goal control without obstacle avoidance [2,3], the leader following control [4], the trajectory tracking control [5][6][7], the wall-following control [8], the obstacle avoidance [9][10][11]. For the robot motion control, both conventional control methods and modern control methods have been applied. Several well-known controllers such as the controller proposed by Kanayama and Robins Mathew, the feedback-based controller for the circular path, the Lyapunov-based controller, the clever trigonometry-based controller, and the Dubins path-based controller, have been discussed in [12]. In Figure 1, the differential drive wheeled mobile robot tracks the optimal path connecting the waypoints from the starting point (x0, y0) to the goal G(xg, yg) through several waypoints Wk(xwk, ywk), k = 2, 3, …, n − 1. (n is the total number of waypoints). The waypoints are determined by the planning layer of the robot (using the supervisory controller).
Navigating the DDWMR to the goal can be done with help of many different motion control algorithms. A general motion control system of the differential drive wheeled mobile robot is depicted in Figure 2. This scheme can be applied to most motion control algorithms to navigate the DDWMR to a given destination. At first, an FLC is designed to navigate the DDWMR to the goal through all the waypoints sequentially. Then, a GA-based method is used to optimize the input and output membership functions for the FLC. To execute the optimization process of the FLC using In Figure 1, the differential drive wheeled mobile robot tracks the optimal path connecting the waypoints from the starting point (x 0 , y 0 ) to the goal G(x g , y g ) through several waypoints W k (x wk , y wk ), k = 2, 3, . . . , n − 1. (n is the total number of waypoints). The waypoints are determined by the planning layer of the robot (using the supervisory controller).
Navigating the DDWMR to the goal can be done with help of many different motion control algorithms. A general motion control system of the differential drive wheeled mobile robot is depicted in Figure 2. This scheme can be applied to most motion control algorithms to navigate the DDWMR to a given destination. Jupyter platforms using Python language in order to execute the full optimization process for the Fuzzy Logic Controller (FLC); (3) To publish this software as an open-source code for all the users who want to use and improve it. The rest of this paper is organized as follows. The problem is described in Section 2. The optimization of the FLC is introduced in Section 3. Result collection and final discussion are presented in Section 4. The conclusion is stated in Section 5.

Problem Description
Without loss of generality, let us assume that the optimal path has been planned (in this case, the optimal path is optimized based on the A* algorithm with several waypoints [22], which is depicted in Figure 1); therefore the energy-efficient motion control problem of the DDWMR becomes the problem of designing an energy-efficient motion controller so that the robot can go to the goal through all waypoints efficiently. In Figure 1, the differential drive wheeled mobile robot tracks the optimal path connecting the waypoints from the starting point (x0, y0) to the goal G(xg, yg) through several waypoints Wk(xwk, ywk), k = 2, 3, …, n − 1. (n is the total number of waypoints). The waypoints are determined by the planning layer of the robot (using the supervisory controller).
Navigating the DDWMR to the goal can be done with help of many different motion control algorithms. A general motion control system of the differential drive wheeled mobile robot is depicted in Figure 2. This scheme can be applied to most motion control algorithms to navigate the DDWMR to a given destination. At first, an FLC is designed to navigate the DDWMR to the goal through all the waypoints sequentially. Then, a GA-based method is used to optimize the input and output membership functions for the FLC. To execute the optimization process of the FLC using At first, an FLC is designed to navigate the DDWMR to the goal through all the waypoints sequentially. Then, a GA-based method is used to optimize the input and output membership functions for the FLC. To execute the optimization process of the FLC using the GA, as an optimizer of created Fitness Function (FF) based on simulated FLC performance, the "pymoo" library is employed. A kinematic model and an energy model of the DDWMR are needed to design the optimal FLC. Thus, the following subsections will present them.

Kinematic Model of the Differential Drive Wheeled Mobile Robot
The geometry and kinematic parameters of the DDWMR are shown in Figure 3 [12].
the GA, as an optimizer of created Fitness Function (FF) based on simulated F mance, the "pymoo" library is employed.
A kinematic model and an energy model of the DDWMR are needed to optimal FLC. Thus, the following subsections will present them.

Kinematic Model of the Differential Drive Wheeled Mobile Robot
The geometry and kinematic parameters of the DDWMR are shown in Fig   Figure 3. Geometry of a differential drive wheeled mobile robot.
In Figure 3, the DDWMR has the important parameters as follows: v is the ear velocity (m/s); θ is the robot orientation (rad); ωr is the angular velocity o wheel (rad/s); ωl is the angular velocity of the left wheel (rad/s); vr is the linear the right wheel (m/s); vl is the linear velocity of the left wheel (m/s); r is the ra right and the left wheels (m); b is the distance between the right and the left w Q is the center of the axis between the right and the left wheels; G is the center of the DDWMR; a is the distance between Q and G (m).
Assuming that [12,29]: -The wheels are rolling without slipping, - The center of gravity G coincides with the point Q, - The guidance axis is perpendicular to the robot plane.
Based on Figure 3 and refer to [12,29], it is easy to get the kinematic mo DDWMR as follows: cos sin

Energy Model of the Differential Drive Wheeled Mobile Robot
The main energy losses of the DDWMR consist of the losses inside the m kinetic energy losses, the losses due to friction, and the losses in the electron The energy consumed by motors consists of two main parts, which are the ene formed into robot kinetic energy and the energy to overcome traction resistanc In Figure 3, the DDWMR has the important parameters as follows: v is the robot linear velocity (m/s); θ is the robot orientation (rad); ω r is the angular velocity of the right wheel (rad/s); ω l is the angular velocity of the left wheel (rad/s); v r is the linear velocity of the right wheel (m/s); v l is the linear velocity of the left wheel (m/s); r is the radius of the right and the left wheels (m); b is the distance between the right and the left wheels (m); Q is the center of the axis between the right and the left wheels; G is the center of gravity of the DDWMR; a is the distance between Q and G (m).
Assuming that [12,29]: -The wheels are rolling without slipping, - The center of gravity G coincides with the point Q, - The guidance axis is perpendicular to the robot plane.
Based on Figure 3 and refer to [12,29], it is easy to get the kinematic model of the DDWMR as follows:

Energy Model of the Differential Drive Wheeled Mobile Robot
The main energy losses of the DDWMR consist of the losses inside the motors, the kinetic energy losses, the losses due to friction, and the losses in the electronics [22,28]. The energy consumed by motors consists of two main parts, which are the energy transformed into robot kinetic energy and the energy to overcome traction resistance. In practice, the energy consumption is mainly transformed into robot kinetic energy.
For the design of an energy-efficient controller, it is necessary to have an appropriate energy model. To simplify the energy consumption model, only the kinetic energy losses of the robot have been considered. This simplification is based on the hypothesis that Appl. Sci. 2021, 11, 6023 5 of 23 accelerations and decelerations change the kinetic energy of the robot body. The kinetic energy of the robot at any time is [12,22,28] where m and I denote the mass and the moment of inertia of the differential drive wheeled mobile robot respectively; v and ω are the linear velocity and the angular velocity of the robot at time t. When implementing movement of the DDWMR in the software, the discrete time is used. Thus, the kinetic energy of the robot at time t i is calculated by Equation (3). The difference in kinetic energy between the two states is calculated by Equation (4).
where: i = 1, 2, 3, . . . , m (m is the number of sampling times). The robot motion may include acceleration, deceleration, and moving with constant velocity. It is assumed that kinetic energy is not recuperated and stored in the battery; thus, every acceleration followed by deceleration leads to energy loss. To sum up all those energy differences, the state of the robot is inspected and the total energy consumption is calculated. Therefore, in the simulation, the total energy consumption of the DDWMR is calculated based on Equations (3) and (4), the kinetic energy changes in the deceleration phase are considered as a loss.

The Optimization of the Fuzzy Logic Controller Used for the Differential Drive Wheeled Mobile Robot
To carry out the full optimization process for the FLC, first, the initial FLC is created to navigate the DDWMR to the reference point. Then, the initial FLC will be optimized based on the GA to automatically tuning the parameters of the Membership Functions (MFs) for the FLC so that the energy consumption of the robot is minimum.

Design of the Initail Fuzzy Logic Controller
The movement of the differential drive wheeled mobile robot heading to the waypoint (W) is depicted in Figure 4.
where m and I denote the mass and the moment of inertia of the differential driv mobile robot respectively; v and ω are the linear velocity and the angular velo robot at time t. When implementing movement of the DDWMR in the software, the discr used. Thus, the kinetic energy of the robot at time ti is calculated by Equatio difference in kinetic energy between the two states is calculated by Equation (4 2 2 kinetic( ) where: i = 1, 2, 3, …, m (m is the number of sampling times). The robot motion may include acceleration, deceleration, and moving with velocity. It is assumed that kinetic energy is not recuperated and stored in th thus, every acceleration followed by deceleration leads to energy loss. To sum u energy differences, the state of the robot is inspected and the total energy consu calculated. Therefore, in the simulation, the total energy consumption of the D calculated based on Equations (3) and (4), the kinetic energy changes in the de phase are considered as a loss.

The Optimization of the Fuzzy Logic Controller Used for the Differential D Wheeled Mobile Robot
To carry out the full optimization process for the FLC, first, the initial FLC to navigate the DDWMR to the reference point. Then, the initial FLC will be based on the GA to automatically tuning the parameters of the Membership (MFs) for the FLC so that the energy consumption of the robot is minimum.

Design of the Initail Fuzzy Logic Controller
The movement of the differential drive wheeled mobile robot heading to point (W) is depicted in Figure 4.
The ∆D is the distance and the ∆θ is the angle that is the difference between the current robot's position and the waypoint's position.
An FLC will be designed to guide the DDWMR from the current robot's position Q(x Q , y Q ) to the waypoint W(x W , y W ). The general structure of a fuzzy logic controller is shown in Figure 5 [30][31][32]. , x FOR PEER REVIEW 6 of 23 The ΔD is the distance and the Δθ is the angle that is the difference between the current robot's position and the waypoint's position.
An FLC will be designed to guide the DDWMR from the current robot's position Q(xQ, yQ) to the waypoint W(xW, yW). The general structure of a fuzzy logic controller is shown in Figure 5 [30][31][32]. The block diagram of the FLC used for the DDWMR is shown in Figure 6. For this FLC, two inputs (ΔD and Δθ) are used. Outputs of this FLC are the angular velocity of the left and the right wheels (ωl, ωr). These outputs are transformed into DDWMR inputs according to Equations (8) and (9). Figure 6. The block diagram of the fuzzy logic controller used for the differential drive wheeled mobile robot.
The FLC used for the DDWMR in this study is constructed as follows: The block diagram of the FLC used for the DDWMR is shown in Figure 6. For this FLC, two inputs (∆D and ∆θ) are used. Outputs of this FLC are the angular velocity of the left and the right wheels (ω l , ω r ). These outputs are transformed into DDWMR inputs according to Equations (8) and (9). .
The ΔD is the distance and the Δθ is the angle that is the difference between the current robot's position and the waypoint's position.
An FLC will be designed to guide the DDWMR from the current robot's position Q(xQ, yQ) to the waypoint W(xW, yW). The general structure of a fuzzy logic controller is shown in Figure 5 [30][31][32]. The block diagram of the FLC used for the DDWMR is shown in Figure 6. For this FLC, two inputs (ΔD and Δθ) are used. Outputs of this FLC are the angular velocity of the left and the right wheels (ωl, ωr). These outputs are transformed into DDWMR inputs according to Equations (8) and (9). Figure 6. The block diagram of the fuzzy logic controller used for the differential drive wheeled mobile robot.
The FLC used for the DDWMR in this study is constructed as follows: Figure 6. The block diagram of the fuzzy logic controller used for the differential drive wheeled mobile robot.
The FLC used for the DDWMR in this study is constructed as follows:

Selecting the Universes of Discourse
The universes of discourse are selected based on the robot parameters, the given path, the environment, etc. So, based on the parameters of the DDWMR and the given paths used in the experiments of this study, the authors have selected the universes of discourse as below: The universe of discourse for input_1: ∆D (m) is 0 ≤ ∆D ≤ 10. The universe of discourse for input_2: ∆θ (rad) is -π ≤ ∆θ ≤ π.
The universe of discourse for output_1: The universe of discourse for output_2: ω l (rad/s) is 0 ≤ ω l ≤ 30.

Constructing the Membership Functions and Rules
The  Tables 1 and 2, and depicted in Figure 7.  Based on heuristics, the rules are selected for the FLC to generate each output (ω l , ω r ) of the DDWMR in order to control the DDWMR to move to the waypoint. These rules are listed in Tables 3 and 4.      This FLC is used to control the DDWMR to move to the goal through all the waypoints sequentially. The next subsection will present the optimization process using the GA for this FLC to minimize the energy consumption of the robot.

Optimization of the Fuzzy Logic Controller Based on the Genetic Algorithm
The FLC design, the shape of the MFs, and the fuzzy rules are built entirely on heuristic definitions. Such the FLC design is complex, time-consuming, and its performances could be still poor. This section presents an optimization process defining the optimal parameters of the MFs for the FLC.
Currently, many researchers are using different heuristic algorithms that are not just bio-inspired but also based on physical laws [14], or using method cooperation in optimization process [33]. The computational methods inspired by biology are being used increasingly to deal with complex problems in robotics, engineering, computer science, etc. Among them, bio-inspired optimization is a term which covers a wide variety of optimization approaches. These methods are based on the principles of biological systems, such as bee colony optimization, bat algorithms, ant colony optimization, etc. Some other classes of optimization techniques are simulated annealing, neural network methods, and evolutionary algorithms including the GA [34]. As a method for the FLC optimization, the GA has been selected.
A typical GA cycle is shown in Figure 8. The GA is based on following operations: selection, genetic operations (crossover, mutation), and replacement [20,32,34,35].

Parameterization of the Membership Functions
Many types of the MFs have been used in fuzzy logic control system angular function, a trapezoidal function, a Gaussian function, etc. In the triangular and trapezoidal functions are applied more often than others [3 study, the triangular function is selected to represent the MFs of the FLC angular function is determined by just three parameters. Also, its eval cheap, and the main advantage of the triangular function is the possibility by just three parameters. Such a low number of parameters helps to lower ality of the optimization problem.
The triangular functions can be represented in different ways. A se defining these MFs is depicted in Figure 9. In Figure 9, the (min, base1) is the set of parameters defining the 1 Function (MF), the (base2, A1, base3) is the set of parameters defining t (base4, A2, base5) is the set of parameters defining the 3rd MF, the (base the set of parameters defining the 4th MF, and the (base8, max) is the se defining the 5th MF. Thus, there is a total 11 parameters (base1, base2, A1

Parameterization of the Membership Functions
Many types of the MFs have been used in fuzzy logic control systems, such as a triangular function, a trapezoidal function, a Gaussian function, etc. In the WMR field, the triangular and trapezoidal functions are applied more often than others [36]. Thus, in this study, the triangular function is selected to represent the MFs of the FLC because the triangular function is determined by just three parameters. Also, its evaluation is quite cheap, and the main advantage of the triangular function is the possibility to define it fully by just three parameters. Such a low number of parameters helps to lower the dimensionality of the optimization problem.
The triangular functions can be represented in different ways. A set of parameters defining these MFs is depicted in Figure 9.

Parameterization of the Membership Functions
Many types of the MFs have been used in fuzzy logic control systems, such as a triangular function, a trapezoidal function, a Gaussian function, etc. In the WMR field, the triangular and trapezoidal functions are applied more often than others [36]. Thus, in this study, the triangular function is selected to represent the MFs of the FLC because the triangular function is determined by just three parameters. Also, its evaluation is quite cheap, and the main advantage of the triangular function is the possibility to define it fully by just three parameters. Such a low number of parameters helps to lower the dimensionality of the optimization problem.
The triangular functions can be represented in different ways. A set of parameters defining these MFs is depicted in Figure 9. In Figure 9, the (min, base1) is the set of parameters defining the 1st Membership Function (MF), the (base2, A1, base3) is the set of parameters defining the 2nd MF, the (base4, A2, base5) is the set of parameters defining the 3rd MF, the (base6, A3, base7) is the set of parameters defining the 4th MF, and the (base8, max) is the set of parameters defining the 5th MF. Thus, there is a total 11 parameters (base1, base2, A1, base3, …, A3, base7, base8). Here, min and max are the minimum and the maximum of the universe of discourse, respectively. A1-A3 and base1-base8 can take any value in the range [min; max] with the constraint (min < A1 < A2 < A3 < max).
The FLC has two inputs and two outputs as mentioned in the Section 3.1. Each input and output has five MFs described by 11 parameters, thus there is a total of 44 parameters for all inputs and outputs of the FLC. Here, the parameters of input_1 are (base1, base2, In Figure 9, the (min, base1) is the set of parameters defining the 1st Membership Function (MF), the (base2, A1, base3) is the set of parameters defining the 2nd MF, the (base4, A2, base5) is the set of parameters defining the 3rd MF, the (base6, A3, base7) is the set of parameters defining the 4th MF, and the (base8, max) is the set of parameters defining the 5th MF. Thus, there is a total 11 parameters (base1, base2, A1, base3, . . . , A3, base7, base8). Here, min and max are the minimum and the maximum of the universe of discourse, respectively. A1-A3 and base1-base8 can take any value in the range [min; max] with the constraint (min < A1 < A2 < A3 < max).

Fitness Functions Used for the Genetic Algorithm
In the GA, the FF is defined to obtain the FF value for each chromosome and to determine which one will be reproduced and taken into the next generation. So, with a particular chromosome, the FF returns a single numerical score, which is proportional to the ability of the chromosome (in this study, the score is a value of the energy consumption of the robot). The Equation (2) is used as the FF for the optimization process of the FLC based on the GA to minimize the energy consumption of the DDWMR.
To design an optimal FLC, first, an initial FLC is designed to navigate the DDWMR to the goal. Then, a GA process is executed in the Google Colab ® by using the Python language with the help of "pymoo" library to find the optimal parameters of the MFs.
It must be noticed that a single FF evaluation asks for running a complex simulation. Thus, running a full optimization process could need thousands of simulations. For such an extensive task, a quite powerful computer is needed. As FF evaluation could be done independently several FF computations can be run simultaneously. In this case, a computer cluster supporting distributed computation could help [37]. However, some kind of benchmarking and selection of several algorithms which promise effectiveness should be done [38].
The optimization process of the FLC with the help of the genetic algorithm is depicted in Figure 10.

Fitness Functions Used for the Genetic Algorithm
In the GA, the FF is defined to obtain the FF value for each chromosome and to determine which one will be reproduced and taken into the next generation. So, with a particular chromosome, the FF returns a single numerical score, which is proportional to the ability of the chromosome (in this study, the score is a value of the energy consumption of the robot). The Equation (2) is used as the FF for the optimization process of the FLC based on the GA to minimize the energy consumption of the DDWMR.
To design an optimal FLC, first, an initial FLC is designed to navigate the DDWMR to the goal. Then, a GA process is executed in the Google Colab ® by using the Python language with the help of "pymoo" library to find the optimal parameters of the MFs.
It must be noticed that a single FF evaluation asks for running a complex simulation. Thus, running a full optimization process could need thousands of simulations. For such an extensive task, a quite powerful computer is needed. As FF evaluation could be done independently several FF computations can be run simultaneously. In this case, a computer cluster supporting distributed computation could help [37]. However, some kind of benchmarking and selection of several algorithms which promise effectiveness should be done [38].
The optimization process of the FLC with the help of the genetic algorithm is depicted in Figure 10. The FLC is created according to the chromosome, which represents all parameters of the MFs, and consequently, its behavior is tested by a simulation process. Results of such simulation are transformed into fitness function value. Such a process of mapping from the proposed solution to the fitness function result allows the use of optimization methods. It is expected that the same mapping applied to the suboptimal solution gives the wanted FLC.
The "Tuning process (Genetic Algorithm)" block in Figure 10 are executed by the The FLC is created according to the chromosome, which represents all parameters of the MFs, and consequently, its behavior is tested by a simulation process. Results of such simulation are transformed into fitness function value. Such a process of mapping from the proposed solution to the fitness function result allows the use of optimization methods. It is expected that the same mapping applied to the suboptimal solution gives the wanted FLC.
The "Tuning process (Genetic Algorithm)" block in Figure 10 are executed by the flow chart of the genetic algorithm depicted in Figure 11 as follows.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 11 of 23 Figure 11. The flow chart of the used genetic algorithm.

Simulation Parameters
The parameters of the DDWMR used for the simulation in this study are taken from [12] that is shown in Table 5. Table 5. Parameters of the differential drive wheeled mobile robot.

Parameters
Value Wheel's radius

Simulation Parameters
The parameters of the DDWMR used for the simulation in this study are taken from [12] that is shown in Table 5. Table 5. Parameters of the differential drive wheeled mobile robot.

Parameters Value
Wheel's radius Several well-known effective motion controllers used to compare with the GA_FLC are the expert-based FLC [1], the Thoa-based FLC [6], the Circular-based controller [39], the energy-saving based algorithm introduced by Manas Chaudhari et al. [22,23], and the Mohammadian-based FLC_GA [40], the Robins Mathew-based controller [41,42]. Their coefficients are given in Table 6. Some given paths used for testing the robot motion control in this simulation are a zigzag path, a square path, a sharp turn path, a straightforward path, and a diamondshaped path. These given paths are defined by several given points in a unit of a meter as in Table 7. In addition, a number eight-shaped path created by (x = 2 + 10 sin(πt/30) and y = 1 + 5 sin(2πt/30)), and a circle path created by (x = −8 + 8 cos(πt/30) and y = 4 + 8 sin(πt/30)) are also used to test the ability tracking of the DDWMR when using the GA_FLC.   Tables 1 and 2.
For the expert-based FLC: the rules are shown in Table 1 of [1]. The parameters of the MFs are shown in Tables 8 and 9.   30 30] For the Thoa-based FLC: the rules are shown in Tables 2 and 3 of [6]. The parameters of the MFs are used the same as the MFs of the initial FLC shown in Tables 1 and 2.
For the Mohammadian-based FLC_GA controller: based on the Mohammadian method [40], the input MFs and the rules can be used the same as the initial FLC. Mohammadian et al. have only optimized output MFs. According to them, for optimization of the MFs it only need to optimize the overlaps between the output MFs [40]. The output MFs used for the Mohammadian-based FLC_GA controller are represented in Figure 12. In Figure 12, B1-B4 are overlaps between the output MFs which need to tune. The values of these overlaps are selected in the range [0 to 7.5].  30 30] For the Thoa-based FLC: the rules are shown in Tables 2 and 3 of [6]. The parameters of the MFs are used the same as the MFs of the initial FLC shown in Tables 1 and 2.

PEER
For the Mohammadian-based FLC_GA controller: based on the Mohammadian method [40], the input MFs and the rules can be used the same as the initial FLC. Mohammadian et al. have only optimized output MFs. According to them, for optimization of the MFs it only need to optimize the overlaps between the output MFs [40]. The output MFs used for the Mohammadian-based FLC_GA controller are represented in Figure 12. In Figure 12, B1-B4 are overlaps between the output MFs which need to tune. The values of these overlaps are selected in the range [0 to 7.5]. For all used controllers here, based on the parameters of the DDWMR and parameters of the given paths, the linear velocity (v) is limited to the range [0 m/s to 2.0 m/s], and the angular velocity (ω) is limited to the range [-0.75 rad/s to 0.75 rad/s] because the movement of a mobile robot will be directly affected by the speed that its actuator can provide. If the provided velocity is too large, it will cause some difficulty in tracking, a high energy loss, and a big tracking error. Conversely, if the provided velocity is too small, the robot will move too slowly, which may affect its performances.

Simulation Open-Course Code
The simulation program of this experiment is published as an open-source code for all readers. This simulation has been developed by employing of the Google Colab ® and the Python language. The open-source code has been published on Code Ocean (https://doi.org/10.24433/CO.1867832.v1) (accessed on 2 March 2021) [43], it also has been stored in Colaboratory (https://colab.research.google.com/drive/17FUnDR7XNjMsDOFrXfnBNWffqXYntEjF?usp=sharing) (accessed on 3 May 2021), and in GitHub ® (https://github.com/vanthuanhvhq/GA_FLC) (accessed on 4 May 2021) so that readers can browse, view, run and experiment with the codes. However, to run this simulation program faster, users should setup their own cluster then replace the URL address with theirs. Otherwise they will experience a long run. This pro- For all used controllers here, based on the parameters of the DDWMR and parameters of the given paths, the linear velocity (v) is limited to the range [0 m/s to 2.0 m/s], and the angular velocity (ω) is limited to the range [-0.75 rad/s to 0.75 rad/s] because the movement of a mobile robot will be directly affected by the speed that its actuator can provide. If the provided velocity is too large, it will cause some difficulty in tracking, a high energy loss, and a big tracking error. Conversely, if the provided velocity is too small, the robot will move too slowly, which may affect its performances.

Simulation Open-Course Code
The simulation program of this experiment is published as an open-source code for all readers. This simulation has been developed by employing of the Google Colab ® and the Python language. The open-source code has been published on Code Ocean (https://doi.org/ 10.24433/CO.1867832.v1) (accessed on 2 March 2021) [43], it also has been stored in Colaboratory (https://colab.research.google.com/drive/17FUnDR7XNjMsDOFrXfnBNWffqXYntEjF? usp=sharing) (accessed on 3 May 2021), and in GitHub ® (https://github.com/vanthuanhvhq/ GA_FLC) (accessed on 4 May 2021) so that readers can browse, view, run and experiment with the codes. However, to run this simulation program faster, users should setup their own cluster then replace the URL address with theirs. Otherwise they will experience a long run. This program consists of several sections, which have been explained in the simulation program.

Collecting Results
Firstly, the zigzag path will be used to optimize the FLC by using the GA. Running the simulation with its default configuration and setting up the population size at 50, all the results of these experiments in 200th generation for the zigzag path are shown in Figures 13 and 14 and Tables 10 and 11. Then this GA_FLC will be used to evaluate its control performance when the differential wheeled mobile robot tracks the other paths. The results are shown in Figure 15 and in Tables 12-15. The convergence of the FF value is shown in Figure 16.

When the Robot Tracks the Zigzag Path
For the optimization of the FLC with the use of the GA, the population size is set to 50 and the number of generations to 200. Those parameters have been found as a good trade-off between the fast optimization process and behavior of the resulted FLC. Experiments show that a smaller population leads to a worse FLC. Specifically, when using the population size is 10 and 45, the energy consumption increases 257.6% and 19.5%, respectively in comparison with the case of using the population size is 50. These are quite high energy consumptions. In contrast, when using the population size is greater than 50, that leads to a slower optimization process, and the energy consumption also increases in comparison with the case of using the population size 50. For example, the processing time increases 21.1% and the energy consumption also increases 15.6% when using the population size is 55 in comparison with the case of using the population size is 50. Figure 16 and the simulation results clearly indicate that the value of the fitness function is rapidly reduced during the optimization process (from the 1st generation to the 40th generation). Then the value of this fitness function is slightly decreased from the 41st generation to the 53rd generation. From the 54th generation onwards the value of the fitness function converges to E = 8.47 J and remains at this value. As this experiment is based on random behavior and it has been executed repeatedly, it can be concluded that the fitness function has converged and reached a stable suboptimal value. Table 10 shows the values of the energy consumption and the travel distance collected after the different generations (30th, 50th, 100th, 150th, 200th), when the optimization of the FLC using the genetic algorithm to track the zigzag path with the size of the initial population is 50. Table 10 shows that the minimum value of the energy consumption has been obtained at the 200th generation (E = 8.47 J), and the smallest value of the travel distance has been obtained at the 150th generation (s = 46.07 m). However, this study mainly aims to minimize the energy consumption. Thus, the best results (in terms of fitness function value) which have been obtained are (E = 8.47 J) and (s = 46.10 m) at the 200th generation. Figure 13 and Table 11 serve as the base for a comparison between the proposed controller (GA_FLC) with other previous published controllers. When the differential drive wheeled mobile robot is controlled by the GA_FLC to track the zigzag path, the energy consumption of the robot is much lower than the energy consumption of the robot controlled by any other used controller. In this case, the GA_FLC has saved more than 110.1% energy in comparison with the other controllers.
In addition, Figure 13c,d also show that the linear velocity and the angular velocity of the robot controlled by the Circle-based controller, the Mathew-based controller, the Chaudhari-based controller, the Thoa-based controller, the Expert-based controller, and the Mohammadian-FLC have oscillated over time, which has led to the vibrations and jerks of the robot. However, this problem has been fixed quite well when the GA_FLC is used. Figure 13c shows that when the GA_FLC is used, the linear velocity is almost not changed, i.e., the linear velocity of the robot is almost constant during the movement, even when the robot moves through the corner. Moreover, Figure 13d also shows that the angular velocity of the robot controlled by the GA_FLC only changes the value at the time when the robot turns at each corner of the path, i.e., the robot only changes its orientation at the corner of the path. Therefore, the issues about the robot vibration and the robot jerk have been solved quite well by the GA_FLC.
Besides, Figure 13a and Table 11 show that when controlling the differential drive wheeled mobile robot by the GA_FLC, the tracking error is quite small. This error is the smallest in all, except the error tracking of the robot when it is controlled by the Mathew_based controller. Furthermore, Figure 13e,f also indicate that the energy consumption of the DDWMR when it is controlled by GA_FLC is the smallest and it increases insignificantly from about 2 s to 40 s.
As mentioned previously, the optimization of the FLC using the GA based on minimizing energy consumption criterion would be the prime objective of this study, thus from the analyses above, it can be concluded that the proposed controller (GA_FLC) is the best one. In other words, the GA_FLC is much better than others in terms of energy-saving and the other performances of motion control are still good.

When the Robot Tracks the Other Different Paths
In order to investigate operating ability of the GA_FLC, it has been used to control the DDWMR to move in several typical different paths. In this case, the DDWMR is controlled by the GA_FLC (optimized and taken from the previous experiment) to track the square path, the sharp turn path, the straightforward path, and the diamond-shaped path sequentially. Figure 15a-d and Tables 12-15 indicate that the performance of the motion control is still good when the robot is controlled by the GA_FLC compared to the others in all given paths. Specifically, 110.2%, 109.7%, 110.3%, and 107.9% reduction of the energy consumption was achieved using the proposed method compared to the best of six alternatives studied when the robot tracks the square path, the sharp turn path, the straightforward path, and the diamond shaped path, respectively. Especially, the limitations of the other controllers such as the vibration and the jerk have been solved by the GA_FLC. So, it can be also concluded that the GA_FLC is the best controller for the differential drive wheeled mobile robot on the different given paths.
In addition, Figure 15e,f indicate that the robot still tracks the number eight-shaped path and the circle path tightly. In these cases, the energy consumption of the differential drive wheeled mobile robot is also quite low (E = 8.73 J for the number eight-shaped path, and E = 8.75 J for the circle path).

Future Work
In a future research, the work will be focused on: (1) both the energy consumption and the travel distance will be taken into account when optimizing the FLC. (2) both the parameters of all MFs and the rule base will be considered to optimize the FLC.
(3) robustness of the proposed GA_FLC will be analyzed to clarify the control performance of the robot. The robustness of the GA_FLC is a complex and difficult issue, which needs to be thoroughly addressed. So, this issue will be comprehensively presented in our future work. For more detail about the robustness of an FLC, refer to [44][45][46].

Conclusions
In this paper, the FLC has been introduced and successfully applied for the DDWMR control for robot movement on the given path. However, it is too complex and timeconsuming to manually search for the proper parameters of the MFs, and its performances of motion control are still poor. To tackle such problems, an optimal FLC (GA_FLC) has been found with the use of the GA and the minimum energy consumption criterion. In many studies, scientists have only optimized the output MFs. However, in this study, the GA automatically tunes all the parameters of input/output MFs of the FLC. Such an approach leads to fast and effective tuning. For the optimal parameters' identification of the MFs for the FLC, the zigzag path has been used in the optimization process at first. The fitness function has been derived from the energy consumption and after that minimized. Also, the length of the traveled path has been considered. Finally, the performance of suboptimal FLC has been tested on the benchmark paths and its results have been compared to the results of several controllers based on another approaches. The comparisons have shown that the GA_FLC is much better than all used well-known controllers in terms of energy consumption while the other performances of the motion parameters are still good.
To keep all experiments reproducible, the GA_FLC and several well-known controllers including the Circle-based controller, the Mathew-based controller, the Chaudhari-based controller, the Thoa-based controller, the Expert-based controller, and the Mohammadibased FLC controllers have been successfully implemented in the Google Colab ® by using the Python language and made freely available for all the readers who are interested in them.