Research article
Kinematic Modeling and Simulation of Inverted Pendulum for Balancing a TwoWheeled Robot
Kathryn Remell, Kenneth Mordi, and Uchechukwu C Wejinya*
Department of Mechanical Engineering, University of Arkansas β Fayetteville, Member, IEEE, USA.
Uchechukwu C Wejinya, Department of Mechanical Engineering, University of Arkansas β Fayetteville, USA.
Received Date: February 13, 2023; Published Date: February 23, 2023
Abstract
Two wheeled robots are highly maneuverable and capable of handling large shifts in their center of gravity through dynamic stabilization making them more versatile than fourwheeled robots and ideal for extraterrestrial exploration. The purpose of this paper is to develop a controller for a two wheeled robot for extraterrestrial exploration. This work develops the controller for a two wheeled robot to achieve the desired control parameters to facilitate autonomous extraterrestrial exploration. Two leadlag compensators were developed utilizing analytical methods combined with iteration and simulation. The analytically developed leadlag compensator failed to meet transient design requirements, but the compensator developed using Matlabβs Control System Designer met all desired specifications.
Introduction
Benefits of twowheeled robots
Several two wheeled robots have been designed and a variety of control methods have been proven successful at stabilizing and controlling a two wheeled pendulum base. These methods include Sliding Mode [1,2], PID [3], Linear Quadratic Gaussian [4,3], and Evolutionary Fuzzy Control through βan adaptive fusion of continuous ant colony optimization and particle swarm optimizationβ [5]. While all the control systems have been tested using software simulation, most have not been subjected to real world evaluation.
However, those that have been tested in the real world have demonstrated several unique capabilities and functional areas where the two wheeled mobile robot design excels: dynamic stabilization and maneuverability.
Dynamic stabilization increases a robotβs ability to handle large shifts in the center of gravity [4]. This has been demonstrat ed to lead to robots that are better at handling heavy objects with a smaller support base than a robot dependent on static stability, such as a stationary arm or a three or more wheeled robot [6]. This alsoimproves impulse response during navigation and allows for endeffectors attached to twowheeled robots to have a wider range of motion than endeffectors attached to fourwheeled robots of the same size. Maneuverability results from the narrower ground footprint and allows for greater performance on uneven surfaces in confined spaces [3] when compared to fourwheeled robots. Combined with dynamic stabilization, a twowheeled robot is a robust mobile design that has the potential to be more versatile than a fourwheeled robot in most situations.
Mathematical model of two wheeled robot
As discussed in [7], a robotβs physical parameters, such as the wheel diameter, the mass of the platform and wheels, and the distance between the center of rotation and the center of gravity, have a strong influence on the robotβs controllability. Therefore, the development of a two wheeled robot must begin with the mathematical model for a generic two wheeled robot. Such a model will allow combinations of parameters to be tested to inform the physical design of the robot. This will also allow the effect of a controller to be tested on various physical configurations and ideal physical ratios to be extracted.
The two major components of motion for a twowheeled robot are navigation and balance. The mathematical model required for navigation is the kinematic model of a two wheeled robot. The mathematical model for balance is an inverted pendulum as found in [7]. This paper will focus on developing a controller to stabilize the robotβs balance.
1. Nomenclature
A. Variables
β’ πΆ Center
β’ π Vertical distance from the point of rotation to the platformβs center of gravity (m)
β’ π·(π ) System controller in π domain
β’ ππ π Steady state error
β’ πβ Gravity (ππ 2)
β’ πΊ(π ) System plant in π domain
β’ πΌ Moment of inertia (ππ π2)
β’ π ββ1, Imaginary number
β’ πΎ Proportional gain
β’ πΎπ Proportional error constant in step response steady state error
β’ π Mass (ππ)
β’ π Pole of a transfer function, root of the characteristic equation
β’ ππ Percent overshoot (%)
β’ π Simplifying variable
β’ π(π ) Characteristic equation, which is the denominator of a transfer function
β’ π Radius of the wheel (π)
β’ π (π ) System input in s domain
β’ π Complex frequency, π π, generally associated with the Laplace transformation
β’ ππ Settling time (to within 2% of the final value)
β’ π xaxis (parallel to the ground, forms a horizontal plane with the yaxis)
β’ π(π ) System output in s domain
β’ π§ Zero of a transfer function, the root of the functionβs numerator
β’ π zaxis (vertical axis, defined as perpendicular to the ground and increasing upward)
B. Subscripts
β’ 1,2,β¦ 1st, 2nd, etc. of the attached variable
β’ πβ Gravity (ππ 2)
β’ π Platform reference frame
β’ π Robot baseβs reference frame
β’ π π‘ππ Step Input
C. Greek Variables
β’ π A very small number greater than zero which replaces a 0 in the first column of a Routh Array.
β’ π Angle from vertical (angle between the robotβs zaxis and the platformβs zaxis)
β’ π Torque
β’ π Damping ratio of the system
β’ ππ Natural frequency of the system (Hz)
System Definition
(Figure 1) The controller and twowheeled robot system was defined as shown in Figure 1, with the plant, πΊ(π ), describing the relationship between the motor torque and the system angle from vertical (π in Figure 2), the controller, π·(π ), to be developed in this research, and the feedback, π»(π )=1, to be integrated in future work. The plant transfer function was developed using the small angle approximation for linearization with zero initial conditions during the Laplace transformation [7] (Figure 2).
Plant transfer function
As shown in [7], the plant, defined by an analysis of the system starting from first principles, is
which had roots at π =0 Β± π2.85, as shown in the Root Locus of the uncompensated system (Figure 3), and the system response to step input shown in Figure 4 (Figure 3).
Uncompensated system stability
As defined in [8], the RouthHurwitz Criteria states that there will be sign changes in the first column of the Routh array if a systemβs characteristic equation has roots with positive real parts and that the number of such roots will equal the number of sign changes in the first column of the array. The characteristic equation for the uncompensated system is π(π )= 1+π·(π )πΊ(π ), where π·(π )=πΎ and πΊ(π ) is the plant transfer function defined in Error! Reference source not found. [8]. Therefore, the characteristic equation of the uncompensated system is π(π )=0.04189π ^{2}+0.3411+0.3127πΎ, which has the Routh array:
The π is necessary to replace the 0 resulting from the lack of a first order term in the characteristic equation. The array demonstrates that the system is only marginally stable for any π>0 and πΎ>β0.3411/0.3127=β1.09.
Controller Development
The system response to step input was examined since this most closely resembles the input likely to be experienced by the system. The desired system response should exhibit no more than 16% overshoot (ππ_{π π‘ππ}β€16%), have a settling time of no more than 2 seconds to reach 2% of the final value (π_{π ,π π‘ππ}β€2π ), and the final value should be no more than 5% from the desired final value (_{ππ π ,π π‘ππ}β€0.05).
Desired root location
The uncompensated system requires shifting to the left to achieve stability, so a lead compensator was developed. The minimum values of the system damping ratio and natural frequency were calculated from the design specifications. In [8], percent overshoot is defined as
Analytical development of a lead compensator
A lead compensator has the form
Usually, π§_{1} is chosen to be coinsident with a plant pole to cancel the pole, which will shift the root locus left. Then π1 is either chosen to create a more stable system or defined using the phase angle criterion if the plant has multiple poles. However, since the plant has complex roots, a value for π§_{1} cannot be chosen to cancel out existing poles in the plant. Therefore, π§_{1}=1 and π1=10 were selected through trial and error, which meant that πΎ= 6.54, using magnitude criterion, and the controller had the form
A Matlab script was used for iteration and the best step response that could be achieved utilizing only a lead compensator is shown in Figure 5.
Steady state analysis
To meet the steady state requirement the desired error constant (ππ) was defined by considering the steady state error equation from [8]
D. Analytical Development of Lag Compensator
To apply the gain a lag compensator was developed. A lag compensator has the form
where π§/π <1, π +π§=π, and the error constant, ππ, increases by a ratio of π§/π,. Keeping the previously determined gain, the lag compensator zero is defined [8] as π§=πΌ/10 where πΌ is the centroid of the uncompensated system. For the lead compensated plant πΌ=β9 (πΌ=0 for the uncompensated plant), so π§ =β0.9. The pole is defined as being significantly less than the ratio of the zero to the desired gain, so
Choosing π=0.02 results in the lag compensator.
which, when applied to the lead compensated system, resulted in the step response shown in Figure 6 and the Root Locus shown in Figure 7 (Figure 6).
Simulation development of leadlag compensator
Matlabβs built in Control System Designer Optimization function was also used to generate a controller. Starting with the analytically derived gain, poles, and zeros as initial values, the optimization function was set to optimize each to achieve a settling time of less than 2 seconds and no more than 16% overshoot. The resulting leadlag compensator was
which had the step response shown in Figure 10. The fully compensated system had the Root Locus shown in Figure 8 and the Bode Plots shown in Figure 9 (Figure 8,9 & 10).
Conclusions and Discussion
Subjecting the system to step input illustrates the system response to external stimuli, such as gravity in the twowheeled robotβs case. The analytically developed leadlag compensator resulted in a percent overshoot of πππ π‘ππ=32% and a settling time of ππ =2.89π which did not meet the transient design requirements. The leadlag compensator developed using Matlabβs Control System Designer did meet the desired design parameters with a percent overshoot of πππ π‘ππ=9.96%, a settling time of ππ =0.43π , and a steady state error of ππ π ,π π‘ππ=0.03 in response to step input. Comparing the analytically developed leadlag compensator to the one developed using Matlabβs Control System Designer illustrates the challenges involved in analytically developing system controllers as well as the importance of understanding controller development methods. Due to the nonlinear nature of the plant equation more advanced controller development methods, such as sliding mode control as discussed in [1] [2], are more commonly applied to balancing a two wheeled robot than leadlag compensators.
Future Work
Future work should focus on implementing disturbance rejection to compensate for unexpected bumps or inputs as well as integrating a sensor feedback mechanism to develop a more robust controller. It should be incorporated with a navigation system to provide balance during transit as well as while the robot is stationary. Finally, it should also include experimental testing of the simulation developed controller on a physical system to fully evaluate its ability to stabilize a twowheeled robot.
Acknowledgement
None.
Conflict of Interest
None.
References
 Y Zhou, Z Wang (2016) Robust motion control of a twowheeled inverted pendulum with an input delay based on optimal integral sliding mode manifold. Nonlinear Dynamics 85(3): 20652074.
 N Esmaeili, A Alfi, H Khosravi (2017) Balancing and Trajectory Tracking of TwoWheeled Mobile Robot Using Backstepping Sliding Mode Control: Design and Experiments. Journal of Intelligent & Robotic Systems; Dordrecht 87(34): 601613.
 Onkol, C Kasnakoglu (2015) Modeling and Control of a Robot Arm on a Two Wheeled Moving Platform. Applied Mechanics and Materials 789790: 735741.
 C KasnakoΔlu, M Önkol (2018) Adaptive Model Predictive Control of a Twowheeled Robot Manipulator with Varying Mass," Measurement and Control 51(12): 3856.
 CF Juang, MG Lai, WT Zeng (2015) Evolutionary Fuzzy Control and Navigation for Two Wheeled Robots Cooperatively Carrying an Object in Unknown Environments. IEEE Transactions on Cybernetics 45(9): 17311743.
 M Stillman, J Olson, W Gloss (2010) Golem Krang: Dynamically stable humanoid robot for mobile manipulation," in IEEE International Conference on Robotics and Automation (ICRA), Anchorage, AK, USA.
 K Remell (2021) Mathematical Modeling of a Two Wheeled Robotic Base (Mechanical Engineering Undergraduate Honors Theses)," 26 May 2021. [Online]. Available: https://scholarworks.uark.edu/meeguht/96/. [Accessed 8 July 2020].
 R C Dorf, R H Bishop (2011) Modern Control Systms, 12 ed., Upper Saddle River, New Jersey: Pearson Education.
 MM Rahman, AshikERasul, H Nowab Md Aminul, M Hassan, I M Hasib, et al. (2011) Development of a two wheeled self balancing robot with speech recognition and navigation algorithm in International Conference on Mechanical Engineering, BUET, Dhaka, 2016.

Kathryn Remell, Kenneth Mordi, and Uchechukwu C Wejinya*. Kinematic Modeling and Simulation of Inverted Pendulum for Balancing a TwoWheeled Robot. On Journ of Robotics & Autom. 1(5): 2023. OJRAT.MS.ID.000523.
Kinematic, Robot, Pendulum, Control System, Mass (ππ), Gravity, Root Locus, Compensator, Matlabβs Control System.

This work is licensed under a Creative Commons AttributionNonCommercial 4.0 International License.