The Effect of Terrain Inclination on Performance and the Stability Region of Two-Wheeled Mobile Robots

Two-wheeled mobile robots (TWMRs) have a capability of avoiding the tip-over problem on inclined terrain by adjusting the centre of mass position of the robot body. The effects of terrain inclination on the robot performance are studied to exploit this capability. Prior to the real-time implementation of position control, an estimation of the stability region of the TWMR is essential for safe operation. A numerical method to estimate the stability region is applied and the effects of inclined surfaces on the performance and stability region of the robot are investigated. The dynamics of a TWMR is modelled on a general uneven terrain and reduced for cases of inclined and horizontal flat terrain. A full state feedback (FSFB) controller is designed based on optimal gains with speed tracking on a horizontal flat terrain. The performance and stability regions are simulated for the robot on a horizontal flat and inclined terrain with the same controller. The results endorse a variation in equilibrium points and a reduction in stability region for robot motion on inclined terrain.


Introduction
Two-wheeled mobile robots (TWMRs) have gained popularity in the last decade due to their significant advantages over multi-wheeled robots. They are good at tight turns and have a small footprint with high manoeuvrability. The physical system of TWMRs consists of two wheels joined through an axle. The robot body, named the intermediate body (IB), is placed on or around the axle. There are two configurations of TWMRs: statically stable [1] and statically unstable [2]. The TWMRs have been termed as statically unstable if the centre of mass of the body lies above the axle line. TWMRs have been characterized as multi degree of freedom, coupled and open-loop unstable nonlinear systems [3]. The stability of IB is one of the important control issues of statically unstable TWMRs.
The stability problem has been addressed in the literature for robot motion on a horizontal terrain. Most researchers designed controllers for IB position control keeping the robot stationary. The algorithms applied to control the equilibrium position of IB keeping the robot stationary on horizontal flat terrain include Proportional Integral Derivative (PID) [2,[4][5], full state feedback [5][6], Fuzzy logic [7], Reinforcement and Supervised Learning [8], Neural Network [9][10][11], back stepping [12] and H∞ controller [13]. However, the stability control with the desired speed of the robot is also required because the TWMRs might be used in the field of service, transport, surveillance and care robotics [6] due to the short footprint and zero radius turning capability. These applications demand the robot to move as well as balance the IB. The velocity control of wheeled inverted pendulum has been presented in [14][15][16] for horizontal flat terrain.
Moreover, for outdoor applications the robot should also be able to stabilize on inclined or uneven terrain. This invites researchers to design controllers for the control of the stability of TWMRs on inclined terrain at the desired speeds and implemented in real time. This paper is a stepping stone to achieve this objective. Segway [17] and Emiew [18] are commercially available examples of statically unstable TWMRs. They are used for transportation and as service robots, but they are not capable of traversing on inclined or uneven terrain. When the wheeled mobile robots traverse on an inclined/uneven terrain, certain dynamic disturbance forces are expected at the wheel-terrain contact point due to a change in contact force, caused by a variation in the wheel-terrain contact angle [19]. Consequently, the disturbance forces affect operations performed by the mobile robot. It is important, therefore, to quantify the effects of terrain inclination on the performance of the statically unstable wheeled mobile robots. The idea of this paper was to quantify these effects. A suitable control design to overcome these effects, in future, might be helpful in the enhancement of a range of applications of TWMRs.
For implementation of the robot in simulation a set of the equations of motion is required that consider the inclination of terrain. In the previous research [20][21][22] the dynamic models used for TWMR do not consider the inclination or accelerations produced due to nonhorizontal terrain. This paper proposes a multi objective dynamic model that takes into account the robot motion on inclined as well as on uneven terrain. On a horizontal flat surface, the dynamic model relies on the robot design parameters. However, on a rough surface the characteristics of the surface play an imperative role on robot dynamics [23]. For a realization of the effect of surface inclination on robot dynamics, the identification of a variation in performance and the stability region of the robot is proposed in this study. The stability region is the range of initial conditions of different states of TWMR for which the IB returns back to its equilibrium position. The stability region was obtained from the analysis of system stability at the given initial condition of system states. The maximum values of initial conditions of the states where the system remains stable show the range of stability of the system. A decrease in such a stability range indicates the effect of uncontrolled dynamics or environment [24].
The present paper aims at controlling the stability of closed-loop TWMR at the desired speed on a horizontal flat terrain and at evaluating the performance as well as stability region on both horizontal flat and inclined terrain. The objective was to identify the effects of terrain inclination on performance and stability regions. The use of the numerical approach to evaluate the stability region, using computer simulation of the nonlinear dynamics of a system, has been seen in the literature [25][26][27]and was adopted for the present study. The Dormand and Prince method for numerical solution of the differential equations was used. The paper is organized such that in Section 2 we present a dynamic model for a statically unstable two-wheeled mobile robot. In Section 3, a controller is designed for TWMR with the objective of stabilizing the upright position of IB on a horizontal flat surface and the controller's performance is evaluated for dynamic balancing and for surface inclination. In Section 4, the stability regions for the respective states of interest are presented before concluding the work.
The contributions of this paper include: proposing a dynamics model for motion of TWMRs on inclined terrain, a procedure to study the effect of terrain inclination on performance and the stability regions, and recommendations for determining the stability region for two-wheeled mobile robots.

System Description
The physical system of a TWMR consists of two components: two identical wheels joined together, each driven by a motor separately, and the robot IB placed on/around the axle joining the wheels. The two-wheeled mobile platform can move along a horizontal track and the IB may rotate freely with respect to the vertical plane. There is no direct control applied to the IB, however, the two wheels allow the robot to traverse and recover balanced posture of the IB. To study the effect of longitudinal disturbances induced by the inclined or uneven terrain (horizontal, inclined, uneven terrain are elaborated in Figure 1), a two dimensional dynamic model is presented in this section. The motion is restricted along the longitudinal (x-axis) and rotational (about z-axis) planes for simplicity. The lateral motion might be included in the model in future studies.

Assumptions
In the present study, the IB was modelled as an inverted pendulum attached to a two-wheeled platform. The centre of mass of each wheel was assumed to be at the centre of the wheel, while the centre of mass of the IB was assumed to be above the axle joining the two wheel centres. Each wheel was assumed to have a single contact point with the ground and not to have slip. It is further assumed that there is no contact loss of the wheels with the ground. A torque applied by each of the wheels is denoted as �, the mass of the IB is represented by M and the mass of each wheel by m. The mass, M is located at a distance � from the wheel axel and the wheel mass, m, is located at the centre of the wheel, as shown in Figure 1. � � and �are assumed to be the moment of inertia of the IB and each wheel. These moments of inertias are about the respective centres of masses. The radius of each wheel is �. In addition, the wheel terrain contact angle��� has been used to define the characteristic of uneven terrain. Pitch ���is the angle of intermediate body with the vertical axis changing at an angular rate, �� � �. The linear displacement of the wheel-ground contact point along x-axis is x.

Equations of Motion
The dynamic equations of motion developed for twowheeled mobile robots on uneven terrain, using the Newton-Euler method, are given as: where � � � � � � and �� represents the vertical acceleration due to changes in the terrain elevation. It is assumed that � is known as a function of � and the linear and angular velocities of the wheel are equal due to the no slip assumption. The variables �� and � � ��� could be computed analytically from these assumptions. Substituting �� and � � ��� in the above expressions and manipulating the resulting expressions for �� and � � , we get h, h1, h2, h3, h4, h5, h6, h7, h8, h9, h10, h11, h12 are given in appendix 8.1.
On a horizontal flat terrain (see Figure 1) there is no slope and terrain angle, therefore α and associated parameters are substituted as zero in (5) and (6). The resulting simplified equations of motion for two-wheeled robot moving on horizontal flat terrain are given as (5) and (6), but with different coefficients. The new coefficients for equations of motion on horizontal flat surface are given below as a set of equations (7):   The proposed nonlinear models would be used for simulations in later cases. The dynamic model proposed in the set of equations 3-4 is for uneven terrain, reduced model equations 5-6 are for inclined terrain, while the set of equations 7 is for horizontal flat terrain.

State Space Model
The model is linearized for the controller design purpose. The controller is designed for the stability control of a two-wheeled robot on horizontal flat terrain. The same controller is later implemented on inclined terrain to determine the effect of terrain inclination on performance and the stability region of the robot. The models used for simulation in the next sections are nonlinear proposed models. The dynamic model proposed in the set of equations 3-4 is for uneven terrain, reduced model equations 5-6 are for inclined terrain, while the set of equations 7 is for horizontal flat terrain.
The dynamic model for the two-wheeled robot motion is linearized to understand the dynamic properties of the system about an equilibrium point, using Taylor expansion at the equilibrium neighbourhood. The upright position of the IB is selected as the equilibrium point. At equilibrium point, � � � � � 0. The terrain was assumed to be a horizontal flat surface, i.e.,� � �� � �� � 0. The linearized model written in state space form of �� � �� � �� is given as : The states of a TWMR system consist of robot position (�), linear speed (�� � , IB tilt angle (�) and the angular speed (� � ).
Noting that the linear position of the robot along x-axis relative to its starting point was not important from the prospective of the control objective, this was omitted. The linearized state space model is expressed with The state space model was written in numerical form for a two-wheeled robotic platform. The parameters of the platform and their numerical values are listed in Table 1.
This simplifies the state space model. All the system states were assumed to be measured. An augmented state space was formulated with an addition of a state of reference speed tracking. This new state was added to control the stability at the desired speed.

Parameter
Value Parameter Value Table 1. Physical parameters of a two-wheeled robot 3. Controller

Controller Design
The objective of controller design in the present study was to control the stability of the IB of the TWMR when traversing at the desired speed on a horizontal flat terrain. A Full State Feed Back (FSFB) controller based on LQR is selected for this study due to its performance and guaranteed stability for linear systems [5]. The system states vector considered for the controller design was: In the state vector � ��� is the desired speed of the TWMR.A block diagram of the closed-loop system is shown in Figure  2. The overall control law implemented was: The state weighting matrix, Q and input weighting matrix, R were adjusted in simulation on nonlinear dynamics of TWMR such that it fulfils the control objective. The gains were optimized for minimum steady state error in pitch (θ) and a rapid response with less overshoot of pitch from the equilibrium position. The resulting controller gains matrix is K=[-316 -374 -1033 -512].

Controller Performance
The controller was implemented in simulations, using MATLAB/SIMULINK software, on the nonlinear dynamic model of the TWMR, the parameters of which The initial conditions for linear speed of the robot and pitch rate of IB were assumed to be zero in the first case and the IB was set to be disturbed by an angle of 5 degrees. The initial values of pitch and pitch rate were assumed zero in the second case and the system was run at three desired speeds. These desired speeds were set to be 0.5, 1 and 2 m/s. The speeds were selected to represent the slow walk, the brisk walk and the running speed of a human. In the third case the response was simulated for balancing of IB on inclined surfaces. The wheel-terrain contact angles selected were 10 o and 20 o , whereas initial values of speed and pitch were assumed to be zero.
The system response to the speed control in all of the above cases and scenarios is shown in Figure 3. It demonstrates that the system is stabilized within 4 seconds in all the conditions, but an overshoot in speed is increased with an increase in the desired speed. The same trend is observed with an increase in the wheel-terrain contact angle. These results indicate that the increase in speed and terrain inclination unfavourably affects the performance of the speed control. The system response to the pitch in respective cases is shown in Figure 4. The results point out that the system is stabilized within 4 seconds, the designed performance criterion, only up to 10 degrees of terrain inclination and at a desired speed of less than 0.5 m/s. The percentage overshoot is also increased with the increase of both the desired speed and terrain inclination angle. The results suggest that with the change of wheel-terrain contact angle, the IB of the robot is balanced at an angle other than zero.
This relationship between equilibrium pitch and terrain inclination angle (11) was developed for the steady state operating condition, using the equations of motions (1) and (2).
After looking at the performance of the system in different scenarios it seems worth knowing the stability region. The stability region tells us about the range of initial values of different states of the system from where the IB comes back to its equilibrium position. This is discussed in the following section.

Stability Region
Stability analysis of linear dynamic systems is a wellstudied subject [28] in comparison to the stability analysis of nonlinear systems [29][30]. We therefore adopted the former approach for stability analysis. The robot's nonlinear system was linearized about the upright equilibrium position and we analysed the eigenvalues of control matrix of the robot system to determine the stability of the two-wheeled mobile robot. A necessary and sufficient condition for a feedback system to be stable was verified as the closed-loop system matrix is Hurwitz and all the poles of the transfer function of system have negative real parts. Once it was determined that the system is asymptotically stable at the equilibrium point, the stability region for the closed-loop TWMR system on horizontal flat and inclined surfaces was estimated. The stability region is a subset of ), from which the system stability can always be maintained. As the real system of the two-wheeled mobile robot is nonlinear so it is expected that there exist certain states of the physical system from which the intermediate body cannot return back to the upright position or the system becomes unstable. In other words, a closed/confined stability region is expected due to nonlinearities.
The system has four states (integrated speed error, speed, pitch and pitch rate) and a disturbance (terrain angle). Since, it would be difficult to visualize the variation of all the states and disturbances in one plot, so the SR for pairs of state variables was estimated. The procedure used to estimate the boundary of the stability region numerically is described as follows: 1. Fix the initial condition value of one state variable from a selected pair of states.

Evaluate the maximum and minimum initial values
of other state variable of the pair. These would be the values beyond which the system becomes unstable. 3. Repeat step 2 for different initial values of first state variable. 4. The initial conditions of remaining state variables of the system would be assumed zero.

Simulations
Experiments in simulation were performed for a twowheeled robotic platform traversing on two types of terrains, horizontal flat and inclined. Initially it was evaluated for the motion of the robot on horizontal flat terrain where no disturbance due to terrain inclination is considered. Later the motion on inclined terrain was considered and the effects of the terrain disturbance were included in the model. These experiments were conducted at different sets of initial conditions of the system states. The simulations were terminated when a set of initial state values approach where the robot could not show the desired performance.

Stability Region on Horizontal Flat Terrain
In this section the stability regions for the robot system states are presented for robot motion on a horizontal flat surface. The state variables are divided into three pairs, .
The pitch range for stability appraised at different reference speeds and no disturbance is shown in Figure 5. The initial speed was selected from zero to 4m/s with an increment of 0.01 m/s for each simulation. The initial pitch was selected every 5 o from -90 o to 90 o . The initial conditions for all other state variables and disturbance were fixed to zero, i.e., . For such a selected reference speed, the maximum pitch angle that could be stabilized within 4seconds was evaluated and plotted. Figure 5 shows that there exists a region of stability for the upright position in the (speed, pitch)plane at zero initial displacement and zero initial pitch rates. In addition, the stability region of the pitch angle and reference speed of the two-wheeled robot exists for which the proposed controller can stabilize the system. Here, the horizontal axis and vertical axis stand separately for the initial values of reference speed in m/s and pitch in degrees respectively.  For the second pair, the pitch range for stability is evaluated at different angular speeds of IB and no disturbance is shown in Figure 7. The initial angular speeds of IB were selected every 10 degrees/s. The initial pitch was selected every 5 o from -100 o to 100 o . The initial conditions for all other state variables and disturbance were fixed to zero, i.e., . For the selected angular speed, the maximum pitch angle that could be stabilized within 4 seconds was evaluated and plotted. Figure 7 shows the stability region of the pitch angle and angular speed of the IB of the two-wheeled robot for which the proposed controller can stabilize the  The pitch rate range for stability evaluated at different reference speeds and no disturbance is shown in Figure 8. The initial speed was selected every 1 m/s. The initial pitch rate was selected every 15 degrees/s from -500 to 500 degrees/s . The initial conditions for all other state variables and disturbance were fixed to zero, i.e.,� � �� ����� � �� ���� � ������ � ��. For such a selected reference speed, the maximum pitch rate that could be stabilized within 4seconds was estimated and plotted. Figure 8 shows the stability region of the pitch rate and reference speed of the two-wheeled robot for which the proposed controller can stabilize the system. Here, the horizontal axis and vertical axis stand separately for the initial values of reference speed in m/s and pitch rate in degrees/s respectively.

Stability Region on Inclined Terrain
The full state feedback reference tracking controller was designed in the earlier section for horizontal flat surfaces, surfaces with zero wheel terrain contact angle. A wheelterrain contact angle is a parameter used to define the terrain inclination and this is defined as an angle of inclination of an inclined surface with the horizontal plane. To see how robust the controller is if the TWMR moves on an inclined surface or an uneven surface, the experiments were performed for the motion of the robotic platform on terrains of different inclination. Before experimentation, we would like to clarify that on an inclined surface the wheel-terrain contact angle was assumed to remain constant and the terms of inclination rate, �, � and acceleration, �� , would therefore become zero and omitted from the equations of motion of the robot.
Secondly, the equilibrium points on inclined surfaces vary and depend upon the wheel terrain contact angle. The individual equilibrium pitch with respect to the wheel terrain contact angle could be determined using (11). Thirdly, the performance was evaluated for static stability. Static stability means the initial and steady state speed of the robot is assumed to be zero. Initial conditions are selected to be the steady state conditions for pitch, pitch rate, robot displacement, speed and reference speed. The steady state conditions for pitch is a pitch equilibrium point and for speed error is computed from the control input demand by reference tracking controller at equilibrium point.
In order to estimate the steady state condition of speed error, the simulation is run with the controller gains which stabilize the system at the required equilibrium angle. We recorded the output from reference tracking controller. Dividing the controller output by the controller gain gives the initial condition of error integrator. All these initial conditions are set as the initial value of the respective integrators.
The approach used to find the stability region was to fix the wheel-terrain contact angle and increased/decreased the initial conditions of pitch from equilibrium pitch angle until the system became unstable. We repeated the same procedure by decreasing the initial condition of pitch from equilibrium pitch angle until the system became unstable. Then we changed the disturbance or wheel-terrain contact angle and repeated the above procedure. The simulation results are plotted as shown in Figure 9. Here, the horizontal axis stands for the value of wheel-terrain contact angle, in degrees, and vertical axis stands for the initial values of pitch of IB, in degrees. The equilibrium position of IB corresponding to each wheel-terrain contact angle is plotted as a red line in Figure 9. The performance criterion selected for the stability control included a settling time of 4 seconds with no steady state error and minimum percentage overshoot in pitch. The results shown in Figure 3 and Figure 4 demonstrate that the settling time of the pitch of IB of the robot is increased from 4 seconds as the speed and wheelterrain contact angle increases. This increase is more significant at or above 20 degrees of terrain inclination. Similarly an overshoot in speed is increased with an increase in desired speed. The same trend is observed with an increase in the wheel-terrain contact angle. These results indicate that the increase in speed and terrain inclination unfavourably affects the performance as the robot performs well to the designed criterion only up to 10 degrees of terrain inclination and at a desired speed of less than 0.5 m/s. A plot of stability regions of pitch for a speed range from -1 to +1 m/s is shown in Figure 6. The speed limit selected is a speed close to the brisk walk speed of a human. If the initial speed is chosen from -0.01 to 0.01 m/s and initial angle of the IB is selected in a range of about 40 o around its upright position, the system can be stabilized with the proposed LQR-based FSFB controller. For the initial speed beyond ±0.01 m/s, the stability region varies with the change of initial condition of speed. A stability region around the upright equilibrium point of the IB is decreased by 10-14 degrees in backward movements, but increased by 10 degrees in forward movements of the IB with an increase in the speed of 1m/s. It is worth noting that the total pitch range around the upright equilibrium position of the IB did not change more than 3 o within a speed variation of ±1 m/s. This suggests that the equilibrium point at stationary condition may be different from the equilibrium point at dynamic condition.
A stability region for a static equilibrium of the system on a horizontal flat terrain surface was found in previous section to be ±40 degrees. Figure 9 shows the same results for a wheel-terrain angle from 0 to ±20 degree. If the wheel-terrain angle was chosen from ±20 degree to ±35 degrees, the stability region for the pitch angle of the IB appeared to be a tool edged shape as shown in Figure 9. Since the controller was designed for a linear system but simulations were implemented on a nonlinear system, so this shape deterioration indicates the effect of nonlinearities in the system or environment. Beyond ±35 degrees of wheel-terrain contact angle the system becomes unstable. On the safe side, therefore, we may say that the controller stabilizes the IB at its equilibrium positions for a terrain with an inclination angle of up to ±20 degrees. In other words, terrain inclination from 0-±20 degrees has no effect on the stability region of IB equilibrium.
Although the system becomes stable on an inclined surface with a wheel terrain angle up to 30 degrees but the response has oscillations and delay, the controller does not help to stabilize the system on an inclined surface beyond a wheel terrain angle value of 30 degrees. The probable reason for why it does not stabilize beyond 30 degrees is the change of dynamics of the system with the terrain angle variation. Closed loop poles were determined at different terrain angles without changing controller gains. A variation in the closed-loop poles of the system was observed. The dominant closed-loop pole was getting closer to the imaginary axis and had become complex. The other poles were moving far away which indicates that the system was moving towards instability.

Conclusion
This paper dealt with a nonlinear dynamic model of a statically unstable two-wheeled mobile robot to analyse the response of the body pitch to disturbances. A multipurpose robot dynamics model has been presented for motion on uneven, inclined and horizontal flat terrain. A FSFB controller based on LQR showed promising results for the stable motion of the robot on horizontal flat terrain. Speed tracking controller results showed that the controller performed well up to 1m/s (4km/h), human walking speed. The boundaries of the stability regions of different states of the system, for traversal of the robot on a horizontal flat surface, were found in closed shape.
The performance and the stability region of the pitch on smooth inclined surfaces were observed to be reduced, indicating that the terrain inclination has dynamic effects on the stability of two-wheeled mobile robots. The stability region for pitch decreased sharply by 20-25 degrees with an increase in terrain angle beyond 20 degrees and decreased by 15 degrees with an increase of speed to 0.5 m/s. The equilibrium point for pitch at a stationary condition was also observed to be affected by the speed of the robot. This varied by 3 degrees at a speed of 1 m/s. The performance was also reduced with an increase of terrain angle. The steady state error was increased by 2 degrees, overshoot was increased by 20 degrees and settling time was increased significantly beyond 20 degrees of terrain angle. It is concluded, therefore, that the control of TWMR must take into account the terrain inclination, in particular when they navigate at high inclination paths.
Future work includes a verification of the presented effects of terrain inclination in real experiments and design of a robust controller to stabilize TWMRs on inclined terrain.