Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Feedback Control of a Balancing Robot

Jan Kȩdzierski ∗ Krzysztof Tchoń ∗



Institute of Computer Engineering, Control and Robotics,
WrocÃlaw University of Technology, ul. Janiszewskiego 11/17, 50-372
WrocÃlaw, Poland, (e-mail: jan.kedzierski|krzysztof.tchon@pwr.wroc.pl)

Abstract: A major objective of FP7 LIREC project (Living with Robots and Interactive
Companions) lies in designing a robotic companion that humans would accept and co-exist
with over a longer period of time. A tentative construction of such a companion has been a
robot mounted on board of a balancing mobile platform. In this paper we describe a prototype
design of the balancing robot, derive a mathematical model of its kinematics and dynamics,
and develop a robot controller. The controller synthesis is based on feedback decoupling and
linearization of the robot dynamics. Performance of the controller has been tested by computer
simulations of example problems of position and orientation tracking.

1. INTRODUCTION

A major objective of FP 7 LIREC project (Living with


Robots and Interactive Companions) is to design a robotic
companion that would be attractive to humans in a long
time perspective. A thorough examination of the existing
designs of social robots made in Arent et al. [2008] has
revealed that mobility of many contemporary social robots
is provided by a balancing mobile platform. A balancing
platform serves as a mobile basis not only in human
transporters like Segway [2009] or Winglet [2009], but also
in research robots Segbot [2009], Joey [2009] and Ubot-
4 [2009] as well as in humanoid robots Toyota [2009],
EMIEW2 [2009], MDS [2009], and in a robotic servant
MONTY [2009].
On account of an analysis of the state of the art in social
robotics, and the authors own experience of an apparent
approval of a balancing robot by humans, a decision has
been made to install a robotic companion constructed
at the Wroclaw University of Technology on a balancing
platform. This platform shall be referred to as the WRUT
balancing robot. The robot, portrayed in figure 1, has the
form of a 2 wheel, differential drive mobile platform whose
body can swing like the inverted pendulum.
The aluminum robot chassis carries the onboard equip-
ment: sensors, actuators, processors, controllers, user in- Fig. 1. WRUT balancing robot
terfaces, and the power supply system. The sensory equip-
ment includes an ADXRS150 Analog Devices digital rate
gyroscope and an MMA7260 Freescale digital 3-axis ac-
celerometer installed to measure the tilt angle of the robot is an advanced microcontroller with 64-bit float point unit,
body as well as the platform angular velocity. A signal- 2 channels QSPI interface, 2 SCI interfaces, 2 TPU3 and
level sensor fusion technique has been used, based on the MIOS1 timers/counters blocks. This substantial computa-
the Kalman filter, to cope with noisy gyroscope signals. tional power allows to efficiently execute relatively large
Two magnetic encoders measure the angular position of and computationally demanding programs. The controller
each wheel. The actuation of the robot is provided by two is programmed in C. A user interface is realized via a
Graupner 500E DC motors with gear reduction of 36:1 and touchscreen. In the existing design, the onboard robot
a torque constant of 0.07 Nm/A. A PHYTEC phyCORE- controller provides a PID velocity regulation of the wheels,
MPC555 module constitutes the robot brain. The module and a local tilt angle stabilization, based on a linear ap-
consists of a 32-Bit microcontroller PowerPC Freescale proximation of the robot dynamics. A functional diagram
MPC555 running at 40MHz, there is 1MB ROM and 1MB of the WRUT balancing robot is shown in figure 2. A side
RAM on board. The MPC555 used in phyCORE-MPC555 and front view of the robot has been displayed in figure 3.
Fig. 2. Functional diagram of WRUT balancing robot

A typical controller of the balancing robot provides a local


stabilization of the robot tilt angle around the unstable
equilibrium point of the robot body. The objective of this
paper is to develop a more advanced, feedback controller of
the balancing robot, utilizing the full model of its kinemat-
ics and dynamics. Our main result consists of derivation of
two feedback tracking controllers for the balancing robot,
that are based on the dynamic or static feedback input-
output decoupling and linearization. Performance of these
controllers has been tested by computer simulations.
The composition of this paper is the following. Section 2
is devoted to the kinematics and dynamics modeling.
Section 3 introduces the feedback controllers. Section 4
provides a performance assessment of these controllers.
Section 5 presents conclusions.

2. BALANCING ROBOT MODELING

For modeling purposes, it has been assumed that the robot


swinging body and the wheel axle are thin, rigid rods, and
that the wheels are represented by a pair of identical thin
Fig. 3. Side and front view of the robot
discs. Mechanical components of the robot are displayed
in figure 4. The robot wheels roll without longitudinal et al. [2009]), that the kinematics model of the balancing
robot is differentially flat. We recall that a control system
is differentially flat, if there exist functions called flat
outputs, such that every state variable and control of the
system can be expressed as a function of the flat outputs
and their time derivatives, perhaps outside certain singular
configurations (Fliess et al. [1995]). A differentially flat sys-
tem is feedback linearizable, what, in principle, facilitates
considerably the synthesis of control algorithms. In the
case of WRUT balancing robot kinematics, there are 3 flat
outputs, and a dynamic feedback linearization results in
a 9-dimensional linear system with controllability indices
(3, 3, 3), of the following form
żj 1 = zj 2 , żj 2 = zj 3 , żj 3 = vj , (2)

for j = 1, 2, 3. It turns out that the linearized model is well


defined on condition that the robot orientation varies, q̇3 6=
0, which excludes the platform motion along a straight
line. This restriction may severely impair the synthesis of
any control law using the linearized model (2). Further
details concerned with the derivation of the flat outputs
and of the linearizing dynamic feedback that transforms
Fig. 4. Mechanical components of the robot the balancing robot kinematics into (2) will be provided
in Respondek et al. [2009].
and lateral slip. The robot dynamics are determined by
the dynamics of its body, its wheels, and the wheel axle.
By design, the balancing robot belongs to the class of 2.2 Dynamics
underactuated nonholonomic mechanical systems (Bullo
and Lewis [2004]). In the further developments we shall
follow a mobile robot modeling methodology established In order to obtain a complete model of the robot dynamics,
by de Wit et al. [1996]. it is necessary to compute the kinetic energy K of robot
wheels, axle and body, and the potential energy V of
the body. These energies define the Lagrangian of the
2.1 Kinematics
unconstrained system
The robot can be described by generalized coordinates L = K − V. (3)
q = (x, y, θ, ϕ1 , ϕ2 , α) ∈ R6 , where (x, y) denote the
Cartesian coordinates of the center of the wheel axle, θ
The kinetic energy as a quadratic form
is the orientation angle, ϕ1 and ϕ2 denote rotation angles
of the wheels, and α is the tilt angle of the robot body. 1 T
The meaning of geometric parameters of the robot has K= q̇ Q(q)q̇. (4)
2
been explained in figure 4. Because the robot wheels are
not permitted to slip either laterally or lingitudinally, the Given the matrix of inertia Q(q), we can compute the
robot motion is subject to nonholonomic constraints that Christoffel symbols resulting in centrifugal and Coriolis
result in the following model of its kinematics forces. The resulting unconstraints dynamics are described
q̇ = G(q)η, (1) as

where Q(q)q̈ + C(q, q̇)q̇ + D(q) = F, (5)


 
cos q3 cos q3 cos q3
 sin q3 sin q3 sin q3  where F stands for generalized traction forces and control
 1 1 
  forces. Because of the nonholonomic character of the
 − 0 
 b b  constraints, the robot dynamics equations need to be
 2  derived by applying to (5) the d’Alembert Principle. In
G(q) =  0 0  .
 R  consequence, after elimination of Lagrange multipliers, the
 2 
 0
 0   model of dynamics of the balancing robot assumes the
R form
 1 
0 0
R M (q)η̇ + N (q, η) = Bu, (6)
3
The variable η = (η1 , η2 , η3 ) ∈ R is regarded as a control.
where M (q) = GT (q)Q(q)G(q) denotes a reduced iner-
R
Since the robot orientation is computed as θ = 2b (ϕ2 −ϕ1 ), tia matrix, and the vector N (q, η) represents jointly cen-
the variable θ may be eliminated from the system (1). trifugal, Coriolis and gravity forces. The inertia matrix
Recently, it has been shown by Respondek (Respondek M (q) = [Mij ] contains the following entries
4 The procedure relies on successive differentiation of the
M11 = M22 = mw + 8mk + mo + outputs (8) with respect to time along a solution of the
3
1 2 2 2 system (7), until the controls appear explicitly (Tchoń
(m w l sin α + m k R ),
b2 et al. [2004]). This happens in the second order derivatives
2 1 ÿ1 (t), ÿ2 (t), however, both these quantities depend on the
M12 = mw + mo − 2 (mw l2 sin2 α + mk R2 ),
3 b sum u1 (t)+ u2 (t), and we still do not have enough controls
l to decouple and linearize the input-output equations. This
M13 = M23 = mw + 4mk + mo + mw cos α,
R being so, we define a new state variable v = u1 + u2 ,
2l l2 and make a dynamic extension of the system (7) with an
M33 = mw + 4mk + mo + mw cos α + 2 mw .
R R equation v̇ = w1 , where w1 denotes a new control. Then,
we differentiate the outputs for the third time and obtain
Elements of N (q, η) = (N1 , N2 , N3 ) are equal to the following input-output dependence
l
N1 = − 2 mw sin α(2η2 + η3 )(η2 − η1 ) y (3) (t) = f (q, v, η) + F (q, η)w, (9)
b
2l2 l
− 2 mw sin α cos α (η2 − η1 )η3 − 2 mw sin α η32 , where w = (w1 , w2 ), and the control w2 = u2 − u1 . Now,
b R R a feedback of the form
l
N2 = 2 mw sin α(2η1 + η3 )(η2 − η1 ) w = F −1 (q, η)(s − f (q, v, η)),
b
2l2 l
+ 2 mw sin α cos α (η2 − η1 )η3 − 2 mw sin α η32 , where s denotes new input, transforms the input-output
b R R map of the extended system (7) to the linear form
l
N3 = − 2 mw sin α(η2 − η1 )2 (R + l cos α)
b R y (3) (t) = s.
l l
− 2 mw sin α η32 − mw g sin α.
R R Finally, given a desirable taskspace trajectory yd (t), we
design a linear controller
Finally, the control matrix
· ¸ (3)
s(t) = yd − K2 (ÿ(t) − ÿd (t)) − K1 (ẏ(t) − ẏd (t))−
2km I2 (10)
B= . K0 (y(t) − yd (t))
R 0

The coefficient km is an actuator constant, the meaning of with diagonal gain matrices guaranteeing stability of the
remaining robot parameters has already been explained in tracking error. The controller synthesis procedure is based
figure 4. A complete mathematical description of the robot on a dynamic feedback, for we use a dynamic extension of
kinematics and dynamics comprises the equations (1) and the original system, similarly as in Tchoń et al. [2004].
(6), equipped with an output map representing the robot It can be shown that the decoupling matrix F (q, η) is
motion in a taskspace, i.e. invertible provided that the the robot is in motion (i.e.
q̇ = G(q)η, M (q)η̇ + N (q, η) = Bu, y = h(q). (7) η1 + η2 + η3 6= 0). Notice that this requirement can
be circumvented by a proper ”robustification” of the
We shall assume that the number of the output map algorithm against singularities, for example in the way
components coincides with the number of controls. proposed by KabaÃla et al. [2003].

3. FEEDBACK CONTROL 3.2 Orientation and tilt angle tracking

Taking into account the purpose the balancing robot Now we consider second pair of linearizing outputs,
serves, its control algorithm should be able to solve the y1 = θ, y2 = α. (11)
following trajectory tracking problem: given a desirable
taskspace trajectory yd (t) of the robot, find a control Having differentiated these outputs twice along the solu-
law guaranteeing an asymptotic convergence of the robot tion of (7), we derive the following input-output depen-
trajectory to the desirable one. Our design strategy of the dence
tracking controller involves a choice of linearizing outputs,
a feedback input-output decoupling and linearization of ÿ(t) = f (q, η) + F (q, η)w, (12)
the balancing robot, and the implementation of a linear where w = (w1 , w2 ) and w1 = u1 + u2 , w2 = u2 − u1 . The
controller (Isidori [1995]). The resulting controller has decoupling matrix F (q, η) remains nonsingular as long as
been shown schematically in figure 5. M13 6= 0, a condition that can always be guaranteed by a
More specifically, we have chosen two pairs of linearizing suitable mechanical design of the robot.
outputs: the position coordinates of the mid point of the As in the previous case, away of singularities the feedback
wheel axle, and the pair: orientation and tilt angle of the
robot. Some details of the synthesis procedure of the robot w = F −1 (q, η)(s − f (q, η))
controller are presented below.
transforms the system (7) to the linear form
3.1 Position tracking ÿ(t) = s.

As has been mentioned, the position coordinates will serve Given a desirable taskspace trajectory yd (t), a linear PD
as the linearizing outputs, controller
y1 = x, y2 = y. (8) s(t) = ÿd (t) − K1 (ẏ(t) − ẏd (t)) − K0 (y(t) − yd (t)) (13)
Fig. 5. Feedback controller

25 25

20 20

15 15

10 10
y
y

5 5

0 0

−5 −5
−15 −10 −5 0 5 10 15 20 −15 −10 −5 0 5 10 15
x

Fig. 6. Circle tracking from outside Fig. 7. Circle tracking from inside

whose diagonal gain matrices have positive entries provides algorithms show very fast convergence along with control-
a solution to the orientation and tilt angle tracking prob- lable transient error dynamics and final tracking accuracy.
lem. Differently to the position tracking, now the controller
is based on static feedback only. 5. CONCLUSION

Using the methods of geometric control theory we have


4. COMPUTER SIMULATIONS devised two trajectory tracking controllers for WRUT
balancing robot. Performance of these controllers has been
In simulations we have used the following physical values favorable, however, the zero dynamics are an issue that
of parameters of the balancing robot (see figure 4): mk = needs a further examination. Taking into account specific
0.179, mw = 3, mo = 0.902, R = 0.062, l = 0.6, b = 0.155, tasks that a robotic companion accomplishes in various
km = 0.0725 (all physical units in SI system). Results of companionship scenarios, we expect that a hybrid onboard
computer simulations of the position trajectory tracking controller may have to be implemented, able to track
algorithm applied to a circle trajectory xd (t) = 10 sin 0.5t, alternately the position and the orientation trajectory.
yd (t) = 10 cos 0.5t are displayed in figures 6 and 7.
ACKNOWLEDGEMENTS
Performance of the orientation θd (t) = π, and tilt angle
αd (t) = 0.1 sin 0.5t tracking controller has been illustrated This work was partially supported by the European Com-
in figures 8 and 9. It turns out that both these tracking munity (EC) and is currently funded by the FP7 ICT-
0.25
α
d
3.2
0.2 α

3
0.15
2.8

2.6 0.1

α
θ

2.4
0.05
2.2
0
2

1.8 −0.05

1.6
−0.1
0 5 10 15 20 25 0 5 10 15 20 25 30
t t

Fig. 8. Orientation angle tracking Fig. 9. Tilt angle tracking

215554 project LIREC (Living with Robots and Interac- M. KabaÃla, R. Muszyński, and M. Wnuk. Singularity
tive Companions). The authors are solely responsible for robust, dynamic linearization control algorithm for MK
the content of this publication. It does not represent the mobile robot. In J. Z. Sasiadek and I. Duleba, editors,
opinion of the EC, and the EC is not responsible for any Robot Control 2003, volume 2, pages 467–472. Elsevier,
use that might be made of data appearing therein. Oxford, 2003.
MDS. http://robotic.media.mit.edu/projects/robots/mds/
overview/overview.html, accessed 30.05., 2009.
REFERENCES MONTY. http://anybots.com, accessed 30.05., 2009.
W. Respondek, K. Tchoń, and J. Kȩdzierski. Differential
K. Arent, M. Janiak, J. Kȩdzierski, B. Kreczmer, L
à . MaÃlek, flatness of balancing robot kinematics. in preparation,
R. Muszyński, A. Oleksy, K. Tchoń, and M. Wnuk. 2009.
Toward a robotic companion design. Technical report, Segbot. http://coecsl.ece.uiuc.edu/ge423/spring04/group9,
WrocÃlaw University of Technology, WrocÃlaw, 2008. accessed 30.05., 2009.
F. Bullo and A. D. Lewis. Geometric control of mechanical Segway. http://www.segway.com/police-government/
systems. Springer-Verlag, Berlin, 2004. products-solutions, accessed 30.05, 2009.
C. Canudas de Wit, B. Siciliano, and G. Bastinr. Theory K. Tchoń, M. KabaÃla, and M. Wnuk. Trajectory tracking
of Robot Control. Springer-Verlag, London, 1996. algorithm for MK mobile robot. In Proc. XIV Nat. Conf.
EMIEW2. http://www.hitachi.com/rd/research/robotics/ on Automation, Zielona Góra, Poland, volume 2, pages
emiew2 01.html, accessed 30.05., 2009. 663–668, 2004. in Polish.
M. Fliess, J. Levine, P. Martin, and P. Rouchon. Flatness Toyota. http://www.toyota.co.jp/en/special/robot, ac-
and defect in non-linear systems: Introductory theory cessed 30.05., 2009.
and examples. Int. J. Control, 61:1327–136, 1995. Ubot-4. http://www-robotics.cs.umass.edu/Robots/UBot-
A. Isidori. Nonlinear Control Systems. Springer-Verlag, 4, accessed 30.05., 2009.
London, 1995. Toyota Winglet. http://www.toyota.co.jp/en/news/08/
Joey. http://leiwww.epfl.ch/joe, accessed 30.05., 2009. 0801 1.html, accessed 30.05., 2009.

You might also like