You are on page 1of 6

2015 International Conference on Computational Intelligence & Networks

Nonlinear autonomous control of a Two-wheeled


inverted pendulum mobile robot based on sliding
mode
Abhinav Sinha† , 1 Pikesh Prasoon∗ , 2 Prashant Kumar Bharadwaj∗ and Anuradha C. Ranasinghe§ , Member, IEEE
† AssistantSystem Engineer- Trainee, Engineering and Industrial Services, Tata Consultancy Services, India
Email: abhinavsinha876@gmail.com
∗ Final year undergraduate, School of Electronics Engineering, KIIT University, Bhubaneswar, Odisha, India
Email: 1 pikeshmn@gmail.com, 2 pkb149@hotmail.com
§ Sri Lanka Institute of Information Technology, Sri Lanka
Email: rnsburg@gmail.com

Abstract—Mobile wheeled inverted pendulum mechanical system are very common in fields involving robotics, marine
models are benchmark underactuated dynamical systems with engineering, aerospace applications, etc.
inherently unstable dynamics and pose a difficult challenge to Several researchers have carried out research in this field and
control with desired accuracy. This paper seeks to achieve an
efficient control scheme based on the notion of sliding modes to early works can be seen in the development of a simple one
achieve the desired response under perturbations. In this work, degree of freedom robot (Yamafuji and Kawamura) [11] that
a mathematical model of a two wheeled inverted pendulum consisted of a single motor for both wheels and the robot
mobile robot is considered and controller design is carried was connected to a computer by wires, thus hindering free
out without linearizing the model to ensure efficiency in large movement. A research in self-contained mobile balancing
operating region. The development of the robust controller is
carried out by selecting the crucial sliding parameters by mini- robot was carried out by Ha and Yuta [11]. This robot was
mizing the quadratic index and regular form design approach. capable of navigating autonomously in a plane and at the
The undesirable phenomenon of chattering in the control law same time it maintained its balance even at high speed. In
has been eliminated by making smooth approximations using 2001, SegwayTM was invented by Dean Kamen that used
sigmoid function. self balancing techniques. Joe was developed by Grasser et
Keywords—Sliding mode control, nonlinear model, mobile al in 2002 and thereafter other similar systems have been
robot, second order sufficiency, eigenstructure assignment, per- developed.
formance integral, chattering, sigmoid functions. Thus, there is a significant need to develop a controller that
makes the system stable under varying disturbances. Over
I. I NTRODUCTION time, various methods have been proposed like adaptive and
controlled Langrangian, passivity based, etc. Many works
Mobile wheeled inverted pendulum models are underactu- focused on linearizing the highly nonlinear, coupled and
ated mechanical models [1] with less number of controls than underactuated model to achieve control scheme. However,
configuration variables, and find applications in autonomous a linear approximation is not always feasible for a nonlinear
robotics, intelligent vehicles, etc. Mobility and dexterity are model [12], [13] and it limits the practical operating range.
two main advantages of mobile manipulation [2]. Mobile Sliding mode control for underactuated multibody system
robots based on the concept of inverted pendulum are also [14] has also been presented in literature. Many a times
known as self balancing robots and they are useful in external disturbances were the prime concern as varying
industries as well as for other purposes like service robots, uncertainties. We present a sliding mode control approach
human transportation [3] and baggage transportation [4], to achieve a control scheme that accounts for model un-
sports [5], etc. This kind of robot has the capability to stand certainties as well as external disurbances that are matched
firm with its two wheels (balancing) and make a sharp on- [15]. The advantage of using this type of control is that the
spot U-turn (spinning). This provides an added advantage of the dynamic behaviour of the system may be tailored by a
traversing terrains and sharp corners as well as small steps. particular choice of sliding function. The components used
With increasing research, several mobile robot prototypes in realizing this controller introduce an undesirable effect of
have been developed over time such as JOE [6], Nbot [7], chattering and the can lead to reduced control accuracy [12].
Legway [8], B2 [9], SegwayTM [10], etc. Underactuated Thus, efforts have been made to make the control smooth
by making the continuous approximation of discontinuous
† Corresponding author. switching functions.

2375-5822/15 $31.00 © 2015 IEEE 50


52
DOI 10.1109/CINE.2015.20
II. S YSTEM D ESCRIPTION the controller development has been carried out considering
The development of mathematical model in literature the nonlinear model intact in its original form, the complexity
has been done using different appoaches. A majority of of design has to be taken care of so as to match the theoretical
researchers have used either Newton- Euler approach [16], aspects [22].
[17] or Langrangian approach [18], [19] to construct the
governing mathematics of the system. Newton- Euler
method requires calculation of unwanted forces making
it less efficient in computation and Langrange method
requires Langrange multiplier to be solved which makes
the computation complicated. An efficient method has been
presented by Kane, known as Kane’s method of dynamic
modelling of multibody systems based on partial velocities.
The advantage of using this method is that there is no need
to calculate unwanted force or multipliers. This method is
known to introduce nonholonomic constraints [20] that tend
to make the calculation simpler. The dynamics of the two
wheeled inverted pendulum mobile robot has been presented
here using Kane’s method [21].
α3 + β3
3(mc +ms )ẍ−ms dφ̈cosφ+(φ̇2 + ψ̇ 2 )ms dsinφ = − Fig. 1. Schematic of a two wheeled mobile robot
R
(1)
1
{(3L2 + )mc + ms d2 sin2 φ + I}ψ̈ In this work, we have not considered the spinning motion,
2R2
L and so the dynamic model for the robot traversing a flat
+ ms d2 ψ̇ φ̇(sinφ)(cosφ) = (α3 − β3 ) (2) surface can be rewritten as follows.
R

ms d(cosφ)ẍ − (ms d2 + I3 )φ̈ + ms d2 (sinφ)(cosφ)φ˙2


α3 + β3
+ ms gdsinφ = α3 + β3 (3) 3(mc + ms )ẍ − ms dφ̈cosφ + φ̇2 ms dsinφ = − (5)
R
The mechanical parameters under consideration are as fol-
lows:
d : distance from C to C. G.
ms : mass of the body ms d(cosφ)ẍ − (ms d2 + I3 )φ̈ + ms gdsinφ = α3 + β3 (6)
I2 : n2 - directional rotational inertia of the body
I3 : n3 - directional rotational inertia of the body
L : half distance between wheels For the motion of the robot on the incilnation, the equations
R : radius of the wheel are presented below.
mc : mass of the wheel
x : positon of the robot
φ : tilt angle of the robot
3(mc + ms )ẍ − ms dφ̈cos(φ − ξ) + φ̇2 ms dsin(φ − ξ)
ψ : heading angle of the robot
α3 + β3
α, β : input torques on wheels + (mc + ms )gsinξ = − (7)
G is the gravitational force acting on the centre of gravity. R
The parameters x, φ and ψ are taken to be states of the
system. Thus, the nonlinear state space formulation of this
MIMO system is given by
ms d(cos(φ−ξ))ẍ−(ms d2 +I3 )φ̈+ms gdsin(φ−ξ) = α3 +β3
Ẋ = f (X) + b(X)u + ρd (4)
(8)
where ρd denotes the disturbance vector that includes both Longitudinal and lateral postures are possible once the incline
parameter variations and external disturbances, and Ẋ = motion is considered. The constraint on the incline angle [21]
f (X, u) is the general form of any multivariable nonlinear is given by
dynamical system represented in state space and f (.) is
a vector of function satsfying mathematical conditons that L
guarantees existence and uniqueness of the soluton. Although ξ ≤ tan−1 (9)
d+R

53
51
this task, hence we transform our multi-degree of freedom
system into suitable regular form.
The system in regular form can be written as
     
0 I 0 0
Ż = Z+ u+ (18)
0 g b̄ ρ¯d
where Z = Tr X = [z1 z2 ]T , b̄ = Tr b and ρ¯d = Tr ρd , with
Tr being the transformation matrix.
The surface variable can be rewritten as
σ(Z) = p1 z1 + p2 z2 = pT Z (19)
with p = [p1 p2 ] .T

Considering the integral describing performance index of the


Fig. 2. Lateral posture on incline [21] system, we have
 t
The model can also be represented as J= Z(t)T QZ(t) dZ (20)
ts
Ẋ1 = f1 (X) (10) with ts denoting the start time of the sliding motion and Q is
Ẋ2 = f2 (X) + b1 u1 + ρd1 (11) a positive definite symmetrical matrix satisfying the
 relations

q q
Ẋ3 = f3 (X) (12) q12 − q21 > 0 and q11 q22 − q12 > 0, where Q = 11 12 .
2
q21 q22
Ẋ4 = f4 (X) + b2 u2 + ρd2 (13) An auxiliary variable v has been inserted [12] to satisfy
and X is given as q11
v = z2 (t) + z1 (t) (21)
q22
X = [x ẋ φ φ̇]T = [X1 X2 X3 X4 ]T (14)
Rewriting the performance integral with auxiliary variable,
III. P ROBLEM F ORMULATION  t

The control objective here is to control both driving and J= q11 z1 (t) + q22 v 2 (t) (22)
ts
posture on the inclination with desired accuracy. The errors
∗ 2
are given by with q11= q11 − q12 /q22 ,
and by the definition of v, we have
e1 = X1 − X1ref (15) z˙1 = −a∗1 z1 + v where a∗1 = q12 /q22 .
The optimal control law for the above dynamic equation
and
described by the performance integral is
e3 = X3 − X3ref (16)
−r
The origin is always a stable equilibrium and the coordi- v= z1 (t) (23)
q22
nate axes can always be translated to suit the requirements
whenever this is not the case [12]. The errors require to be where r is the positive root of the polynomial r2 +2a∗1 q22 r −
∗ √
stabilized to the origin for accurate tracking, or the error q22 q11 = 0, i.e, r = −q12 + q11 q22 . Optimal solutions yield
variable should tend to small vicinity of zero [23] after a optimal sliding coefficients as
transient of acceptable duration.
p1 = −r + q12 (24)
IV. C ONTROLLER D ESIGN
and
A control u(t) should be chosen in such a way to ensure p2 = q22 (25)
sliding motion. The sliding surface has been chosen as
It should be noted that any possible choice of Q can be taken,

n
σ(X) = c i X i = cT X (17) for only the relative weights matter and not the actual weight.
i=1 From equation (18), we have
ci are the weighting parameters that have to be chosen wisely Ż = f ∗ + b∗ u + ρ∗d (26)
since they are responsible for the performance of the system
and affect the state trajectory. For this purpose, a quadratic The design of control law requires σ̇(Z) = 0 . We propose
cost function is minimized to yield the desired parameters a control law of the form
based on optimal integral rule; although other algorithms −pT f ∗ pT ρ∗d max + μ|σ|α
like robust and direct eigenstructure assignment [24], model u= − sgn(σ(Z)) (27)
pT b∗ pT b∗
reference approach, integral action approach, etc are available
in literature. A second order sufficiency is required to achieve μ is a design parameter in the above law and α ∈ (0, 1) .

54
52
V. S TABILITY A NALYSIS list of sigmoid functions that can be used to approximate
Stability is a very important notion in any design. To check signum function can be found in [22]. Here we have used
for the stability of the law given by equation (27), a Lyapunov sigm1 (σ) from [22] to make our law a continuous one.
candidate of 12 σ 2 (Z) has been proposed which represents the 2
distance of point from sliding mode. Stability in Lyapunov sigm1 (σ) = σ − 1 (32)
1 + e− 
sense can be achieved only when the negative definiteness of
The modified control law can be given as
the derivative of Lyapunov candidate is ensured.
−pT f ∗ pT ρ∗d max + μ|σ|α 2
V̇ (Z) = σ σ̇ u= − ( σ − 1) (33)
pT b ∗ pT b ∗ 1 + e− 
= σp Ż
T

is the boundary layer thickness parameter and it is this
= σ(pT f ∗ + pT b∗ u + pT ρ∗d ) parameter that should be selectvely tuned to adjust the
−pT f ∗ pT ρ∗d max + μ|σ|α accuracy of the approximation in order to yield a good
= σ(pT f ∗ + pT b∗ [ − sgn(σ)] response.
pT b∗ pT b∗
+ pT ρ∗d ) Using the law described as in equation (33), the numerical
simulations have been carried out in Mathworks MATLABTM
= σ(pT ρ∗d − (pT ρ∗d max + μ|σ|α )sgn(σ))
and SimulinkTM to track a distance of 3 metres on the
= σpT ρ∗d − |σ|(pT ρ∗d max + μ|σ|α ) incline of 3 degrees with very good upright balancing. The
= −pT (|σ|ρ∗d max − σρ∗d ) − μ|σ|α+1 parameters used in the simulation are given below.
(28)
d = 0.045 m
∵ |ρ∗d |≤ ρ∗d max ms = 5.16 kg
⇒ |σ|ρ∗d max ≥ σρ∗d for any value of σ I2 = 0.052675 kg m2
⇒ V̇ (Z) < 0 for all μ > 0
I3 = 0.003483 kg m2
It is evident from the above derivation that finite time reach-
ability and stability in Lyaounov sense has been guaranteed. L = 0.175 m
The weighting parameters govern the dynamics of the system R = 0.065 m
during sliding. From equations (18) and (19), we have mc = 0.3 kg
σ(Z) = p1 z1 + p2 z2 = pT Z g = 9.81 m/s2
(29)
⇒ σ(Z) = p1 z1 + p2 z˙1 Tilt angle is the most important parameter under this circum-
The solution for this differential equation in z1 (t) yields the stance and thus it should be assigned more weight. Tilt or
following solutions upright balancing is more fundamental as no other motion
is possible without ensuring accurate balancing. It is this
p1
z1 (t) = exp (− )z1 (0) (30) upright balancing that makes the robot traverse a prescribed
p2
distance accurately, otherwise it would fall to the base. The
p1 p1 plot for accurate position tracking is shown here.
and z2 (t) = − exp (− )z1 (0) (31)
p2 p2
As long as p1 p2 > 0, the state Z will show exponential
convergence to zero, whatever initial conditions Z(0) may
be. Alternatively we may say that exponential convergence
to zero will occur in finite time when all the roots of the
polynomial γ(s) = p1 + p2 s are essentially present in the
negative half plane.
VI. S IMULATION R ESULTS
The control law given by equation (27) is known to suffer
from slight chattering due to the hardware implementations
and as well as due to the numerical quantization errors of
a digital signal processor. This robot may use a gyro type
sensor and other actuators that are essentially nonlinear.
These imperfections, either present or added intentionally
can also lead to this phenomenon of chattering. Hence,
we have modified the law by replacing the discontinuous
switching function, i.e., signum function by a smooth
approximation made by a sigmoid function. A complete Fig. 3. Position tracking on the incline

55
53
After a short duration of time, the system is found to Error in the tilt variable is nullified in the steady state. This
achieve steady state, as evident from figure 3. enables the robot to maintain the reference position. Angular
From the physical understanding of the robot, it is easy to velocity is depicted in figure 6 which is in accordance with
understand that the velocity of the robot should be zero the the physical intuition.
moment the robot tracks the desired position. Velocity of
the robot is shown in figure 4. Although, the weight on this
state need not to be given very high, it is important to have
some weight with significant magnitude in accordance with
the dynamics of the robot. The error in tilt angle is shown
in figure 5. This is the most important variable and should
have the maximum weight.
Increasing the weight on any state does minimize the tracking
error but then it requires a stronger control effort and greater
control effort may increase the cost of the system (cost of
the hardware and complexity of embedded software). Hence,
the weights should be chosen with proper care so as to
achieve maximum efficiency and at the same time ensuring
reasonable cost.

Fig. 6. Angular velocity of the robot

From the plots, it is clear that the response is very quick


with this control.

VII. C ONCLUSIONS
Control of a two- wheeled inverted pendulum mobile robot
that is underactuated with highly nonlinear and coupled
mathematical model is a challenging task as two fundamental
motions- upright balancing and driving have to be controlled
Fig. 4. Velocity of the robot simultaneously with high accuracy. Thus, we developed a
Clearly, velocity becomes zero at the time the robot tracks robust controller based on sliding mode that provides full
the desired position. disturbance rejection for bounded disturbances and accurate
tracking under varying conditions. The controller was imple-
mented using power rate reaching law and the control was
smoothened by approximating the discontinuous function by
a continuous one. All the design parameters were selectively
tuned to yield a good response. The advantage of dealing
with this model without linearizing is to make the safe
and controlled operation of the robot outside its limited
range. Efficiency of the controller was proved by numerical
simulations.

ACKNOWLEDGMENTS
The corresponding author is grateful to Anamika for
always being supportive, motivating, a constant source of
inspiration and a blessing in disguise; and would like to thank
Mr. Rajiv Kumar Mishra for his support and guidance. The
authors would also like to express their gratitude towards
family and friends and would also thank for the help and
assistance they got from other persons directly or indirectly,
Fig. 5. Error in the tilt angle no matter how small, in completion of this work.

56
54
R EFERENCES Foundatons and Frontiers in Computer, Communication and Electrical
Engineering(C2E2 ’15), Mankundu, India, Jan. 2015.
[1] J. Huang, H. Wang, T. Matsuno, T. Fukuda and K. Sekiyama, “Robust [23] “A quick introduction to sliding mode control and its applications,”
velocity sliding mode control of mobile wheeled inverted pendulum Universita’ Degli Studi Di Cagliari, Tech. Rep.
systems,” in Proc. IEEE International Conference on Robotics and [24] C. Edwards and S. K. Spurgeon, Sliding mode control: Theory and
Automation, Kobe, Japan, May 2009. applications. CRC Press, 1998.
[2] P. K. W. Abeygunawardhana, Michael Defoort and Toshiyuki Mu-
rakami, “Self-sustaining control of two-wheel mobile manipulator us-
ing sliding mode control,” in Proc. 11th IEEE International Workshop
on Advanced Motion Control, Nagoka, Japan, 2010.
[3] C. Tsai, H. Huang and S. Lin, “Adaptive neural network control of
self-balancing two-wheeled scooter,” IEEE Transactions on Industrial
Electronics, vol. 57, no. 4, pp. 1420–1428, April 2010.
[4] T. Takei, R. Imamura and S. Yuta, “Baggage transportation and
navigation by a wheeled inverted pendulum robot,” IEEE Transactions
on Industrial Electronics, vol. 56, no. 10, pp. 3985–3994, Oct 2009.
[5] B. Browning, P. E. Rybski, J. Searok and M. M. Veloso, “Development
of a soccer-playing dynamically-balancing mobile robot,” in Proc.
IEEE International Conference on Robotics and Automation, New
Orleans, LA, April 2004, pp. 1752–1757.
[6] F. Grasser, A. D’ Arrigo, S. Colombi and A. Rufer, “Joe: A mobile
inverted penduluml,” IEEE Transactions on Industrial Electronics,
vol. 49, no. 1, pp. 107–114, 2002.
[7] Nbot. [Online]. Available: http://www.geology.smu.edu/˜dpa-
www/robo/nbot/
[8] Legway. [Online]. Available:
http://www.teamhassenplug.org/robots/legway
[9] H. Tirmant, M. Baloh, L. Vermeiren, T. M. Guerra and M. Parent,
“B2, an alternative two wheeled vehicle for an automated urban
transportation system,” in Proc. IEEE Intelligent Vehicle Symposium,
Paris, France, 2002, pp. 594–603.
[10] Segway. [Online]. Available: http://www.segway.com
[11] Y. Ha and S. Yuta, “Trajectory tracking control for navigation of
the inverse pendulum type self-contained mobile robot,” Robotics and
Autonomous systems, vol. 17, pp. 65–80, 1996.
[12] Abhinav Sinha and Rajiv Kumar Mishra, “Smooth sliding mode con-
troller design for robotic arm,” in Proc. IEEE International Conference
on Control, Automation, Robotics and Embedded Systems(CARE ’13),
Jabalpur, India, Dec. 2013.
[13] J. E. Slotine and W. Li, Applied Nonlinear Control. Prentice Hall,
1991.
[14] H. Ashrafiuon and R. S. Erwin, “Sliding mode control approach to
underactuated multibody systems,” in Proc. American Control Confer-
ence, Boston, MA, 2004, pp. 1283–1288.
[15] S. H. Żak, Systems and Control. 198 Madison Avenue, New York,
New York, 10016: Oxford University Press, 2003.
[16] J. Li, X. Gao, Q. Huang, Q. Du and X. Duan, “Mechanical design
and dynamical modelling of a two-wheeled inverted pendulum mobile
robot,” in Proc. IEEE International Conference on Automation and
Logistics, Jinan, China, 2007.
[17] S. Y. Seo, S. H. Kim, S. Lee, S. H. Han and H. S. Kim, “Simulation
of altitude control of a wheeled inverted pendulum,” in Proc. IEEE
International Conference on Control, Automation and Systems, Seoul,
Korea, Oct. 2007, pp. 2264–2269.
[18] K. Pathak, J. Franch and S. K. Agrawal, “Velocity and position control
of a wheeled inverted pendulum by partial feedback linearization,”
IEEE Transactions on Robotics, vol. 21, no. 3, pp. 505–513, June
2005.
[19] Z. Li and J. Luo, “Adaptive robust dynamic balance and motion
controls of mobile wheeled inverted pendulum,” IEEE Transactions
on Control Systems Technology, vol. 17, no. 1, Jan 2009.
[20] M. Muhammad, S. Buyamin, M. N. Ahmad and S. W. Nawawi,
“Dynamical modelling and analysis of a two-wheeled inverted pen-
dulum mobile robot,” in Proc. 3rd IEEE International Conference
on Computational Intelligence, Modelling and Simulation, Langkawi,
2011, pp. 159–164.
[21] Yeonhoon Kim, Soo Hyun Kim and Yoon Keun Kwak, “Dynamic
analysis of a nonholonomic two-wheeled inverted pendulum robot,”
Journal of Intelligent and Robotic Systems, vol. 44, pp. 25–46, April
2005.
[22] Abhinav Sinha and Rajiv Kumar Mishra, “Nonlinear Autonomous
Altitude Control of a Miniature Helicopter UAV based on Sliding
Mode Methodology,” in Proc. IEEE International Conference on

57
55

You might also like