A New Approach for Control of Two-wheeled Mobile Robot

In this paper, a study of the GBOT1001 two wheeled mobile robot is presented. Linearized dynamic equations are used to design a controller for the inherently unstable mobile robot. A Fuzzy controller is designed for the robot to direct the orientation of the chassis. Then linear quadratic regulator is also incorporated into the closed-loop system. The parameters of the LQR controller are computed first with the trial and error methods then, with the aid of the Genetic Algorithm. The resulting controller is referred to as the Fuzzy-TE-LQR and Fuzzy-GA-LQR controller respectively. The closed-loop responses for both controllers are obtained via computer simulations. Simulation results show that the Fuzzy-GA-LQR controller exhibits a less oscillatory closed-loop response that is achieved with a reasonable control effort.


Introduction
Two-wheeled mobile robots are characterized by two driving wheels connected to an intermediate body carrying actuation, transmission, sensor, control, and communication subsystems [1]. With a center of mass above the wheel axles, these robots must actively stabilize themselves to prevent toppling. Their wheel configuration makes them highly maneuverable due to their ability to turn on the spot; however, they are more difficult to control than statically stable wheeled robots [2]. While the inherent unstable dynamics of the system has made two-wheeled mobile robots an appealing subject for laboratory research, the high maneuverability has justified their use in industry where easy navigation in various terrains is of interest. Numerous control methods have been introduced to deal with the instability of two-wheeled mobile robots.
Combination of a robust pole-placement design and a linear quadratic regulator [3], a linear quadratic regulator optimized by a particle swarm algorithm [4], a Fuzzy Immune PD controller and robust sliding mode controllers for accurate tracking and disturbance rejection [5,6]. Are some examples.
In this paper, a study of the GBOT1001 two wheeled mobile robot manufactured by Googol Technology Ltd 1 , is presented. The control objective of the Two-wheeled mobile robots is to perform motion and speed control of the wheels while stabilizing the pendulum around the upright position (unstable equilibrium point). This type of systems that have less numbers of actuators than the degrees of freedom to be controlled, are called "under-actuated systems [5]. In studies carried out by Wu, Zhang and Wang on this robot [7,8,9]. a linear model for the robot is derived and a variety of controllers such as Pole Placement and the LQR controller [7], fuzzy controller [8] and Fuzzy-PD controller [9] are designed for the linearized model. The present paper intends to introduce a modified fuzzy controller that serves as a variation on the previously introduced fuzzy controller [8,9] for the GBOT1001 two-wheeled mobile robot. The proposed fuzzy controller is then combined with a linear quadratic regulator, the parameters of which are tuned with the aid of a Genetic Algorithm. The designed fuzzy controller is also combined with the LQR of previous papers [7,8]. so that the effectiveness of the tuning can be observed in computer simulations.
In section IIA of the present paper, a brief description of the robot is provided and the derivation of a linearized mathematical model for the system is revisited in section IIB. This model is controlled with an LQR controller (TE and GA). In section IIIA, with establishing the model of system, suing fuzzy logic control theory to control the orientation of the robot, is introduced. A linear quadratic regulator that is based on a trial and error approach [7,8,9]. is reviewed in section IIIB. A new LQR controller based on Genetic Algorithm is also proposed. Genetic Algorithm mimics the process of evaluation and can be applied to optimize the process of controllers using natural operators. The concept and design procedure of Genetic Algorithm as an optimization tool is discussed in section IIIC [10]. Additionally Fuzzy control is implemented. The designed fuzzy controller is combined with both LQR controllers in sections IIB and IIC, resulting in a Fuzzy-TE-LQR controller and a Fuzzy-GA-LQR controller respectively. Simulation results for both controllers are presented in section IV and the effectiveness of the later controller is observed. The paper finally concludes in section V. The GBOT1001 two wheeled mobile robot studied in this paper (Fig. 1) is composed of a chassis, a vertical bar, a DC motor for each wheel, planetary gearboxes coupled to the wheels, a DSP board 2 implementing the controller, power amplifiers for the DC motors, odometry sensors and a receiver for the radio control unit [7,8,9].

Mathematical Model of the System
In order to derive a linear model for the robot, it is assumed that the robot is a rigid body with completely analogous wheels. It is also assumed that the cornering forces, friction and the motor dynamics are negligible. The two-wheeled mobile robot is therefore reduced to a mobile The DSP board consists of a floating-point DSP from Analog Devices, an FPGA, three 10-bit D/A converters, and four 12-bit A/D converters.
inverted pendulum system. Figure 2 shows the free body diagram of the robot.
The linear movement of the chassis is characterized by the position and the linear speed ̇. Rotations about and axes are described by and , respectively, and the corresponding angular velocities are denoted by ̇ and ̇. In addition, is the mass of each wheel and is the mass of the chassis. Moreover, is the radius of the wheels; is the distance between axis and the center of gravity of the chassis and is the distance between the centers of the wheels. For convenience, will be referred to as orientation throughout the paper. The nonlinear dynamic equations governing the wheels and the chassis are linearized about the operating point = 0 . The resulting sets of linear state space equations are derived, after some calculations, as follows [7,8,9].
where It can be seen from Eq. 1 and Eq. 2 that the state space equations for the two-wheeled mobile robot are written as two decoupled systems. Equation 1 describes the rotation of the two-wheeled mobile robot about the axis and Eq. 2 describes a rotation about the axis. is the sum of the left and right wheels' torques ( . . + ) and is their difference ( . . − ). It should be noted that the controllers designed in section III of the present paper, will make use of Eq. 1 and not Eq. 2. The following numerical values are provided for GBOT1001 by the manufacturer [7,8,9]. = , = . , = . , Incorporating the above values into Eq. 1 and Eq. 2, gives the final equations for the mathematical model of the system.

Controller Design
The controller design and stabilization are based on the accurate mathematical model without considering any uncertainties. However, uncertainties and model mismatch between the nominal model and the real plant is inevitable [5]. A variation on the fuzzy controller introduced in previous papers [8,9]. is proposed. In section IIIA, unlike previous papers, in which position ( ) and its derivative () were the sole inputs to the fuzzy controller, the present paper incorporates orientation ( ) into the fuzzy controller to restrain the robot from falling down successfully. Section IIIB reviews the design procedure of the LQR controller that had been designed for the two-wheeled mobile robot of Eq. [7,9]. In order to obtain optimal values for the weighing matrices of the linear quadratic regulator in section IIIB, a Genetic Algorithm approach is introduced in section IIIC.

Fuzzy Logic Controller
Fuzzy logic is the logic on which fuzzy control is defined. It is much similar in spirit to human thinking and natural language speaking than the traditional logical systems. Essentially, it provides an efficient means of capturing the approximate, inexact nature of the real world. Viewed in this perspective, the indispensable part of the fuzzy logic controller is a set of linguistic control rules linked by the dual concepts of fuzzy implication and the compositional rule of inference. In essence, fuzzy logic controller provides an algorithm which can transform the linguistic control strategy based on expert knowledge into an automatic control strategy [11].
The self-balancing robot control system which is based on the fuzzy control can overcome the instability and nonlinear nature of the system, but the fuzzy rules are too many, increasing difficulty of the reasoning. Therefore, the fuzzy control and LQR controller will be combined in this paper. It improves the performance of the controller greatly and it can be seen that this method reveals the best static and dynamic performance through the simulation tests and comparisons [12].   In deriving the fuzzy rules, the orientation is dealt with first; that is, the position error is compensated only after the orientation error approaches zero (ZE). In order for the orientation error to approach zero, it is assumed that the torque applied to the wheels must act in the same direction that the chassis deflects. Figure 3 illustrates one of the assigned rules to the orientation and position. If the chassis (i.e. the inverted pendulum of Fig. 3) deviates from the desired ZE orientation toward, say NL, the wheels must move to the left thereby justifying the use of NL as the output value for the wheels' torque regardless of the position of the robot. Now with the orientation error having approached zero, the position error (i.e. NM in Fig.  3) is gently compensated. The resulting fuzzy rules are shown in Table 1.

Trial and Error LQR (TE-LQR)
In the optimal control problem for a linear system with the state-space equation ̇( ) = ( ) + ( ) , it is desired that the performance index given by is the state feedback gain matrix of this optimal control law and and are weighing matrices.
is a positive definite (or positive semi-definite) Hermitian or real symmetric matrix; is a positive definite Hermitian or real symmetric matrix [13].
As for the two-wheeled mobile robot represented by Eq. 3, the proper state feedback gain matrix is found by MATLAB ® command ( , , , ) to be Furthermore, the weighing matrices and have been chosen with trial and error to be [7,9].
Due to the trial and error nature of the selection of the weighing matrices and , the resulting regulator will be referred to as the Trial and Error LQR and is abbreviated to TE-LQR.

Genetic Algorithm Tuned LQR (GA-LQR)
Invented in the early 1970s, Genetic Algorithms have gained considerable popularity as general-purpose robust optimization and search techniques. Genetic Algorithms are particularly attractive because instead of a naïve "search and select" mechanism, they use crossover to exchange information among existing solutions to locate better solutions [14]. The feasibility of Genetic Algorithms (GAs) is based on Darwinian's theory of survival of the fittest. Genetic Algorithms start with a set of solutions represented by chromosomes, called population. Solutions from one population are taken and used to form a new population, which is motivated by the possibility that the new population will be better than the old one. Furthermore, solutions are selected based on their fitness to form new solutions. This process is repeated until a certain condition is satisfied. Genetic Algorithms can be applied when there is insufficient knowledge of the system or high complexity is there. It can find optimal solutions in the search space with special operators like crossover and mutation [10].
In the case of the LQR controller in section IIIA, the performance index of = ∫ [ ( ) ( ) + ( ) ( )] ∞ needs to be minimized in the optimization process of the Genetic Algorithm and the corresponding Q and R matrices are going to be obtained. Global Optimization Toolbox of MATLAB® is utilized for this purpose; the command 'gaoptimset' customizes the parameters of the Genetic Algorithm and the command 'ga' executes the algorithm. Q is assumed to be a diagonal matrix and R a scalar. The arrays of the Q matrix and the scalar R are taken to be greater than 0. 001. The number of 'generations' is assumed to be 10. Some other parameters also need to be adjusted: The function that creates the initial population for the Genetic Algorithm (i.e. 'Creation function') is chosen to be a Feasible one (i.e. @gacreationlinearfeasible ). The mutation option that specifies how the Genetic Algorithm makes small random changes to the individuals in the population and enables the Genetic Algorithm to search a broader space is chosen to be Adaptive Feasible (i.e. @mutationadaptfeasible). The crossover option that specifies how the Genetic Algorithm combines two individuals or parents to form a crossover child for the next generation is chosen to be the weighted arithmetic mean of two parents (i.e. @crossoverarithmetic ). The @fmincon option of the Hybrid function group is also utilized to perform constrained minimization after the Genetic Algorithm terminates. The remaining parameters for the Genetic Algorithm are the default values implemented by the Toolbox and are pointed out in MATLAB® Product Help as well as the product's website 3 . Applying the algorithm, yields a minimum of = .
− for the performance index thus resulting in the following weighing matrices, The state feedback gain matrix is therefore found to be The resulting regulator will be referred to as the Genetic Algorithm Tuned LQR and is abbreviated to GA-LQR in the remainder of the paper.

Simulations
In this section, the simulation results for the Fuzzy TE-LQR and Fuzzy GA-LQR controllers will be presented. Figure 4 shows the Simulink ® block diagram of the system. As it can be seen from the figure, Eq. 3 governing the dynamics of the two-wheeled mobile robot is embedded in a subsystem with the wheels' torque as its input and the state vector of [̇̇] as its output. In addition, position and orientation are fed as the inputs to the fuzzy controller and the linear quadratic regulator is incorporated to the closed-loop system as a state feedback torque controller. A square pulse disturbance torque with amplitude of 0.1 N.m. and duration of 0.1 second is applied 3 www.mathworks.com and the response of the closed loop system is observed. Simulation results for position, orientation, linear speed and angular velocity for both Fuzzy TE-LQR and Fuzzy GA-LQR controllers with zero initial conditions are shown in Fig. 5. It can be seen from the figure that both controllers exhibit robustness in the presence of the disturbance torque. However, the Fuzzy TE-LQR controller proves to be a more oscillatory response as expected. Figure 6 shows the control signal for both controllers. As it can be seen, the Fuzzy GA-LQR proves to be more energy efficient compared to the Fuzzy TE-LQR controller.

76
A New Approach for Control of Two-wheeled Mobile Robot  The proposed controllers are also evaluated with nonzero initial conditions for position and orientation. An initial value of 0.01 m for position and 0.00 008 rad. for orientation are considered. The resulting simulation results for position, orientation, linear speed and angular velocity as well as the control signals are depicted in Fig.7 and Fig.8.
As it can be seen from Fig. 7, the robustness of both controllers is reconfirmed with Fuzzy GA-LQR controller's response being less oscillatory. Similarly, in terms of energy consumption, the Fuzzy GA-LQR controller of Fig.  8 once again proves to be more efficient.

Conclusions
The simulation results present that the self-balancing robot system has the characteristics of fast response speed, fewer oscillation times and small overshoot in the best performance. The Fuzzy-GA-LQR controller designed in this paper for the GBOT1001 mobile robot showed these capabilities. In designing the Fuzzy controller, the priority was given to the adjustment of the orientation and exhibited robustness in the presence of the disturbance.
Advantages of optimal control are obvious from simulation results using Linear Quadratic Regulator method. Genetic Algorithms are effective techniques of swiftly exploring a reasonable solution for an intricate problem. The oscillations in the closed-loop response fade in the presence of the Genetic Algorithm. Combination of Fuzzy Controller, Genetic Algorithms and Linear Quadratic Regulator is a highly reliable controller to unstable nonlinear systems and guarantees closed loop stability and robustness. The controller is confined to gentle alterations in position and orientation of GBOT1001 mobile robot. The utilization of nonlinear dynamic equations in the design procedure of the controller can therefore be a subject for future research.