Вы находитесь на странице: 1из 77

Geometric Techniques for Control of a 2-DOF

Spherical Inverted Pendulum

A thesis submitted to
The Hong Kong University of Science and Technology
in partial ful llment of the requirements for
the Degree of Master of Philosophy in
Electrical and Electronic Engineering

by
Miss. Yang Rong

Department of Electrical and Electronic Engineering

BEng. in Electronic Engineering

HKUST
2000
June 29, 2000
Geometric Techniques for Control of a 2-DOF Spherical Inverted
Pendulum

by

Yang Rong

Approved by:

Dr. Zexiang Li
Thesis Supervisor

Dr. Li Qiu
Thesis Examination Committee Member (Chairman)

Dr. Pengcheng Shi


Thesis Examination Committee Member

Prof. Philip C. H. Chan


Head of Department

Department of Electrical and Electronic Engineering


The Hong Kong University of Science and Technology
June, 2000

i
Contents
Abstract ix
Acknowledgment x
1 Introduction 1
1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Research Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Outline of the Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

2 Model of a Spherical Inverted Pendulum 6


2.1 Lagrange's Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Projection of a Spherical Inverted Pendulum . . . . . . . . . . . . . . . 7
2.3 Dynamics Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3 System Description 14
3.1 Structure of X-Y Table . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2 Performance of the multi-axis motion controller . . . . . . . . . . . . . . 15
3.3 Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.3.1 Magneto-resistive sensor . . . . . . . . . . . . . . . . . . . . . . . 17
3.3.2 Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.4 A/D-D/A converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

4 System Parameters Identi cation 19


4.1 Method of Second-order System Response . . . . . . . . . . . . . . . . . 19

ii
4.1.1 Parameters M and cM . . . . . . . . . . . . . . . . . . . . . . . . 21
4.1.2 Parameters Jm and cm . . . . . . . . . . . . . . . . . . . . . . . 22
4.2 Recursive Least Squares Method . . . . . . . . . . . . . . . . . . . . . 23
4.2.1 Recursive least-squares Estimation (RLS) . . . . . . . . . . . . . 23
4.2.2 Experimental Result . . . . . . . . . . . . . . . . . . . . . . . . 25
4.2.3 Disadvantages of RLS . . . . . . . . . . . . . . . . . . . . . . . 27

5 Nonlinear Control via Lie Theoretic Approach 28


5.1 Mathematical Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . 28
5.1.1 Basic Concepts of Lie Theory . . . . . . . . . . . . . . . . . . . 29
5.1.2 Input-Output Linearization . . . . . . . . . . . . . . . . . . . . 30
5.2 Application on the Model of Inverted Pendulum . . . . . . . . . . . . . 32
5.2.1 Equation of Motion . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.2.2 Lie Theoretic Approach . . . . . . . . . . . . . . . . . . . . . . 34
5.2.3 Linearization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.2.4 Solving for v0 (t) by Riccati Function . . . . . . . . . . . . . . . 37
5.3 Experimental Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.3.1 Control Procedure . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.3.2 Experimental Con guration . . . . . . . . . . . . . . . . . . . . 38
5.3.3 Experimental Results . . . . . . . . . . . . . . . . . . . . . . . . 39
5.3.4 Comments on Practical Experiments . . . . . . . . . . . . . . . 39

6 Simpler Method for Stabilization of Spherical Pendulum 42


6.1 Control Strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.1.1 Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6.1.2 Control Strategy . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6.2 Experimental Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6.3 Comments on the Simpler Control Method . . . . . . . . . . . . . . . . 45

7 Swing Up a Planar Pendulum 49


7.1 System Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

iii
7.2 Regulation of a Swinging Pendulum . . . . . . . . . . . . . . . . . . . . 51
7.3 Swing up Strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
7.4 Stabilizing Strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
7.5 Experimental Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

8 Conclusion and Further Development 60


8.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
8.2 Further Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

Publications 63
Bibliography 64

iv
List of Figures
1.1 A spherical inverted pendulum on X-Y table . . . . . . . . . . . . . . . 4

2.1 Projections of spherical pendulum onto x-z and y-z planes . . . . . . . . 7


2.2 Typical model of a planar inverted pendulum . . . . . . . . . . . . . . . 10

3.1 Traditional X-Y table . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15


3.2 Practical X-Y table system for experiments of spherical inverted pendulum 16
3.3 Measurement system of sensor . . . . . . . . . . . . . . . . . . . . . . . 18

4.1 System response for identifying M and cM . . . . . . . . . . . . . . . . . 22


4.2 System response for identifying Jm and cm . . . . . . . . . . . . . . . . . 23
4.3 The input signal of recursive least squares method . . . . . . . . . . . . 26
4.4 The estimation result for recursive least squares method . . . . . . . . . 26

5.1 Experimental con guration for the planar inverted pendulum system on
one projection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.2 Inclination angles on two projections . . . . . . . . . . . . . . . . . . . . 40
5.3 Response of motion of X-Y table . . . . . . . . . . . . . . . . . . . . . . 40
5.4 An overview of dynamics motion for a balanced spherical pendulum in
3-D view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

6.1 Inclination angles on two projections . . . . . . . . . . . . . . . . . . . . 46


6.2 Response of motion of X-Y table . . . . . . . . . . . . . . . . . . . . . . 46
6.3 An overview of dynamics motion for a balanced inverted pendulum in
3-D view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

v
6.4 Picture of a working 2-D inverted pendulum . . . . . . . . . . . . . . . . 48

7.1 An cart and pendulum system . . . . . . . . . . . . . . . . . . . . . . . 50


7.2 Case description for swing-up strategy . . . . . . . . . . . . . . . . . . . 53
7.3 Simulation results for stabilizing strategy by LQR . . . . . . . . . . . . 56
7.4 Kinetic Energy alteration of the pendulum . . . . . . . . . . . . . . . . . 57
7.5 Position of pivot in the process of swinging-up of a pendulum . . . . . . 58
7.6 Rotatory angle in the process of ] swinging-up of a pendulum . . . . . . 58
7.7 An overview of dynamics motion for swinging-up and stabilization of an
inverted pendulum in 3-D view . . . . . . . . . . . . . . . . . . . . . . . 59

vi
List of Tables
6.1 The controller gains in experiments . . . . . . . . . . . . . . . . . . . . . 45

7.1 The experiments' parameters . . . . . . . . . . . . . . . . . . . . . . . . 56


7.2 Feedback gains of the controller . . . . . . . . . . . . . . . . . . . . . . . 57

vii
Geometric Techniques for Control of a 2-DOF Spherical Inverted
Pendulum
by
Miss. Yang Rong
for the degree of
the Master of Philosophy in Electrical and Electronic Engineering
at The Hong Kong University of Science and Technology
in June, 2000

Abstract

The problem of balancing a two degree of freedom (DOF) pendulum has been a bench-
mark problem in demonstrating and motivating various control design techniques. From
a control design perspective, a challenging and dicult problem is presented as the sys-
tem is nonlinear and the open-loop is unstable. In addition, need for a sensor system
to measure the inclination angles of the pendulum contributes to the complexity of the
balancing problem.

In this project, a series of problems about inverted pendulum were studied. First, a
spherical pendulum system based on a X-Y table was designed and constructed. Then,
a control model was developed by projecting the system onto the x-z and y-z planes
of the inertial coordinate system. These projections were treated independently and
were controlled individually by the x- axis and y- axis, respectively. Two stabilization
controllers were designed for each planar inverted pendulum; one based on the state
viii
space approach using Lie theoretic tools, and the other via a simple nonlinear feedback
controller. A special sensor system was developed for the contact-less measurement
of the inclination angles of the pendulum. The system consists of a small magnet
placed at the bottom of the pendulum, and a magneto-resistive sensor on the surface of
experimental platform. Experimental results showed the feasibility of the whole system
and the advantages and disadvantages of these two control strategies are provided.

The second part of this research project involved the building of a swinging up and
then stabilization system for a 1-DOF inverted pendulum. An energy feedback control
strategy was developed to regulate the swinging energy of the pendulum. The resulting
closed-loop system converged to the reference energy which is needed for bringing the
pendulum from its dangling position to an upright position. The swinging up strategy
was switched to a LQR control when inclination angle of the pendulum reached a
feasible range near the upright position and then the pendulum was maintained at its
steady balanced state.

The hardware and software packages developed in this research project were avail-
able for engineering graduate students who wish to establish and compare the practical
advantages and limitations of various design methodologies.

ix
Acknowledgments
First of all I wish to thank Dr. Zexiang Li, my thesis supervisor, for his help in enriching
and improving my mathematical background, giving me the freedom to explore new
ideas, and for his in nite patience. I would also like to thank him for his encouragement
in this research.

I would also like to thank Dr. Li Qiu and Dr. Pengcheng Shi for serving on my
thesis committee. Special thanks must go to Dr. Li Qiu for his encouragement and
solicitude during my two years' research period.

I thank everyone who has encouraged, supported, and assisted me in my studies


and research, especially Yiu-kuen Yiu and Wai-chuen Gan for their technical support
and valuable suggestions. I would like to thank my groupmates Jiang Shilong, Liu
Guanfeng, Xiong Zhenhua and Cheng Hui for the happy times I have shared with them
during these two years.

Last, but perhaps most importantly, I wish to take this opportunity to give my
hearty gratitude as well as love to my whole family, to my mother and to my two
sisters, for their understanding and support during my studies.

x
Chapter 1

Introduction
1.1 Motivation
The problem of balancing an inverted pendulum has been a benchmark problem in
demonstrating and motivating various control design techniques. The principal reasons
for its popularity are its nonlinear and unstable characteristics, uncertainty in friction
terms, lack of state variable measurements, and the easy way disturbances are intro-
duced in the process. In addition, the problem is also representative of some other
well-known control problems, such as that of rockets taking o , and cranes with hang-
ing loads, etc [1]. The apparatus also has the attraction of inexperienced people who
attempt to control using hand motion.

In recent research, the balancing of an inverted pendulum has often been studied in
modern control design strategies such as fuzzy control [2], high-and-low gain approach
[3], nonlinear control [4] and neural networks [5]. In addition to various control methods
implemented for the pendulum problem, di erent system structures have been devel-
oped for studying such a system. The following inverted pendulum balancing problems,
with increasing requirements for the controller performance, have been published in the
literature.
 A 1-DOF pendulum mounted on a base that is free to rotate about a vertical axis
[6].
1
1.1. MOTIVATION 2

 A planar pendulum actuated by a linear slide [3] [4] [7]. This is the classical
con guration with a well-known mechanical model.

 A 2-DOF pendulum mounted on a robot with decoupled or weakly coupled links


[8], [9]. At least one link can be moved without a ecting the position of other
links. As a result, the separation of balancing planes can be performed easily.

In these papers, almost all the work employed direct or indirect approximation to the
nonlinear terms based on the state space approach. Each nonlinear term appearing in
the mathematics model was approximated or neglected during the design of controllers
in order to simplify design process.

Since the early 1970s, considerable e ort has been devoted to the development
of a state space theory for a nonlinear system [10]. The study of modern geometric
theory of nonlinear control began with attempts to extend results, such as results on
controllability and observability, from linear control theory to nonlinear cases. Through
years of research, it has been shown that not only could the results on controllability and
observability be extended but that large amounts of the linear geometric control theory
had a nonlinear counterpart. As one of the typical nonlinear systems, the inverted
pendulum system has been the focus of much attention by control engineers who have
studied the problem of its stabilization using this new view of nonlinear control. Via
the Lie theoretic approach, an inverted pendulum system can be established without
resorting to any approximation of each nonlinear term appearing in the mathematical
models. However, most former research mainly focused on theory. So, in order to
appreciate the e ectiveness of these theoretical results, more application researches
and evaluations of the nonlinear control scheme by experiments, rather than simple
demonstrations by simulation, are needed.

Swinging up an inverted pendulum is another classic experiment which is used in


many laboratories in control engineering for investigating the advanced control theory.
In contrast to usual inverted balancing objective, the swinging strategy cannot be
1.2. RESEARCH OBJECTIVE 3

regulated by a simple linear time-invariant controller. In fact, many standard nonlinear


techniques of nonlinear control are ine ective. For this reason, many researchers used
the controller based on trajectory planned beforehand by numerical simulation [12] [13]
for swinging-up ; or the controller utilizing small back-and-forth motion of the cart [4];
or a neural-controller.

Compared to those methods, a nonlinear controller to regulate the swinging energy


of a cart and pendulum system is more feasible, e ective, and is becoming more and
more popular. In actual fact, many aspects which in uence the e ectiveness of such a
control strategy exist. For instance, the system is not input-output linearizable since
t he relative degree [10] of the system is not constant (when the output is chosen as
the swinging energy of the pendulum). On the other hand, the system is not feedback
linearizable because certain system distributions are not involutive. Furthermore, when
the desired swing energy requires the pendulum to swing past the horizontal ( 21 ),
the controllability distribution of the system does not even have a constant rank. All
these reasons make the task to build a practical swinging-up and stabilization system
for inverted pendulum both challenging and interesting.

1.2 Research Objective


Several research topics in regard to inverted pendulum were explored in this project.

First, a spherical pendulum system was built and balanced on an X-Y table, Fig.
1.2. The pendulum was projected onto the x-z and y-z planes which were parallel to
the two motion directions of the X-Y table. These projections were treated separately
as two planar inverted pendulums, and were controlled separately. The stabilization
control for one planar pendulum system we proposed was based on the state space
approach and the Lie theoretic tools without resorting to any direct approximation to
each nonlinear term. As a comparison to this control strategy, a simpler method with
nonlinear feedback was also implemented. Both the advantages and disadvantages of
1.2. RESEARCH OBJECTIVE 4

x
y

Figure 1.1: A spherical inverted pendulum on X-Y table

these two control strategies were given in this thesis. A specially developed sensor
system allowed the contact-less measurement of inclination angle of the pendulum.
This system consisted of a small magnet mounted at the vertex of the pendulum, and
a special magneto-resistive sensor placed on the surface of the mounting plane.

The second part of this project involved building a swinging-up and then stabiliza-
tion system for a planar pendulum. An energy feedback control strategy was developed
to regulate the swinging energy of the pendulum. The regulator for the swinging energy
was designed using the approach of [18]. The resulting closed-loop system will converge
to the reference energy which is needed for bringing up the pendulum from its dangling
position to an upright position. Since both the acceleration and the stage of the cart
are limited in practical experimental equipments, suitable junctures for applying the
feedback law had to be chosen in order to guarantee the feasibility of the experiments.
The swinging up strategy is switched to a LQR control strategy when the inclination
angle of the pendulum reaches a feasible range near the position and then the pendulum
is kept at its steady balanced state.

The third objective of this project was to build a set of feasible experiments to allow
engineering students to establish and compare the practical advantages and limitations
1.3. OUTLINE OF THE THESIS 5

of various design methods using the same process in future.

1.3 Outline of the Thesis


The thesis is organized as follows. In Chapter 1, a brief introduction of the research
project including the motivations and objectives are given.

The model of a spherical pendulum system is introduced in Chapter 2. The projec-


tions which were developed to separate a spherical pendulum into two decoupled planar
inverted pendulum systems, and the dynamics equations derived, are presented.

In Chapter 3, the experimental setup is described, including the X-Y table, the
motion controller, and the magneto-resistive sensor, etc. After that, in Chapter 4, two
traditional model identi cation methods are presented in order to explain how to obtain
the mass of the carriage, and the di erent viscous friction terms, of our experimental
structure.

The control strategy for the spherical pendulum using Lie theoretic approach with-
out resorting to any nonlinear term is illustrated in Chapter 5. In comparison with
this, a much simpler nonlinear feedback controller is given in Chapter 6 for the same
problem of balancing a spherical inverted pendulum on the X-Y table. The experimen-
tal results of these two strategies are given, and their advantages and disadvantages are
compared.

Another main focus of the research is presented in Chapter 7. Here, an energy


feedback controller, designed to bring up a planar inverted pendulum from its dangling
position to upright position, is discussed. The experimental results are also given.

Finally, the conclusion and further developments are given in Chapter 8.


Chapter 2

Model of a Spherical Inverted


Pendulum
The motion equations of a typical pendulum and cart system can been obtained from
literatures which discusses the stabilizing control of inverted pendulum systems. A
spherical inverted pendulum has a special structure since it has two degrees of freedom
of rotary motion. In Section 2.1, we will show that, under reasonable assumptions,
a spherical inverted pendulum can be separated into two typical planar inverted pen-
dulum systems, which can be controlled individually. Lagrange's Equation will be
reviewed in Section 2.2, and dynamics equations of the projected planar pendulum
will be derived from Lagrangian analysis. At the end of this chapter, explicit motion
equations of a spherical inverted pendulum were given.

2.1 Lagrange's Equations


There are many methods for generating the dynamics equations of mechanical systems.
All methods generate equivalent sets of equations, but di erent forms of equations have
their advantages and disadvantages regarding computation or analysis. In this chapter,
we use the Lagrangian analysis, which relies on energy properties of mechanical systems
to compute the equations of motion for our derivation. The resulting equations can be
computed in a closed form, allowing a detailed analysis of the properties of the system.

6
2.2. PROJECTION OF A SPHERICAL INVERTED PENDULUM 7
z

l
θ x

α
l yz
l xz
y β

Figure 2.1: Projections of spherical pendulum onto x-z and y-z planes

De nition 2.1 We de ne the Lagrangian L, as the di erence between the kinetic and
potential energy of the system. Thus,

L(q; q_) = T (q; q_) ; V (q); (2.1)

where, qi is a set of generalized coordinates for the system, T is the kinetic energy and
V is the potential energy of the system, both written in generalized coordinates.

Theorem 2.1 (Lagrange's equation) The equations of motion for a mechanical


system with generalized coordinates q 2 <m and Lagrange L are given by:
d @ L ; @ L =  ; i = 1; : : : ; m; (2.2)
dt @ q_i @qi i

where i is the external force acting on the ith generalized coordinate.

2.2 Projection of a Spherical Inverted Pendulum


In Cartesian Space, a spherical inverted pendulum can be projected onto two orthogonal
planes, x-z and y-z plane, which are parallel to two motion directions of X-Y the table,
as shown in Fig. 2.1.
2.2. PROJECTION OF A SPHERICAL INVERTED PENDULUM 8

These projections are considered as coupled one dimensional inverted pendulums


inside two orthogonal planes. The inclination angle  is the function of and in
two projection planes. Under the assumption that  is very small in the process of
stabilization, we claim its proof as follows.

Axiom 2.1 Near steady balanced position, a 2-DOF spherical pendulum can be
treated separately as two de-coupled 1-DOF planar pendulums and can be controlled
individually after it is projected onto two orthogonal planes.

p roof: From the view of energy, we will prove that the dynamics model of a spher-
ical pendulum can be separated into two de-coupled dynamics models, which are the
presented dynamics motion of two planar pendulum systems on the projection planes.
De ne q = [ ; x; ; y]T as the generalized coordinate for a spherical pendulum sys-
tem. The kinetic energy of the system can be separated into two parts, Txz in x-z plane
and Tyz in y-z plane.

T = Txz + Tyz
_ lxz ) + Tyz (y; y;_ ; ;_ lyz )
= Txz (x; x;_ ; ;

The system's potential energy, which cannot be projected onto two planes, is a function
of ,

V = V (; l)

Here, lxz and lyz denote the length of the pendulum on two projections, respectively.
Obviously, they are the functions of their inclination angles , with respect to the
origin.

lxz = 1 l (2.3)
cos2
1+ cos2 sin2

Jyz = 1 (2.4)
cos2
1+ cos2 sin2
2.3. DYNAMICS MODEL 9

Assuming that the range of and is 100 near the steady balanced position, a
simpli cation can be made: cos = cos = 1, and sin = sin = 0, then,
lxz  lyz  l:
V (; l)  Vxz ( ; lxz )  Vyz ( ; lyz )
where, Vxz , Vyz are the assumed potential energy of the planar pendulum systems on
two projections, respectively. After such a simpli cation, the kinetic and potential
energy of a spherical inverted pendulum are separated into two orthogonal planes. The
dynamic models for both projections are easily derived using Lagrange Equations. On
x-z plane,
Lxz = Txz (x; x;_ ; ;_ lxz ) ; Vxz ( ; lxz )
d @ Lxz @ Lxz
dt @ _ ; @ = 0
d @ Lxz ; @ Lxz = 
dt @ x_ @x xz

and on y-z plane,


Lyz = Tyz (y; y;_ ; ;_ lyz ) ; Vyz ( ; lyz )
d @ Lyz @ Lyz
dt @ _ ; @ = 0
d @ Lyz ; @ Lyz = 
dt @ y_ @y yz

Through the information given above, the claim has been veri ed that a spherical pen-
dulum can be considered as two de-coupled pendulum systems in two orthogonal planes,
which can be controlled individually. Actually, each system is a typical pendulum with
its pivot attached with a carriage, which is, in turn, driven by a horizontal force.

2.3 Dynamics Model


After projection onto two orthogonal planes, a spherical pendulum can be thought of
as two de-coupled planar pendulum systems. Each system is considered as an inverted
pendulum with its pivot attached with a carriage, which is, in turn, driven by a horizon-
tal force. To simplify the statement, we will illustrate the model and control strategy
2.3. DYNAMICS MODEL 10
z

ds

α
r s

M
0
x x

Figure 2.2: Typical model of a planar inverted pendulum

approach for one projection. For another projection, it is obvious that the dynamics
model and control strategy are same as the former one apart from some di erenct
parameters.

Consider a typical planar inverted pendulum system as shown in Fig. 2.2. The
system consists of a pendulum with mass m and length l, and with its pivot attached
to a carriage M . We parameterize the con guration of the pendulum using two scalars,
x and , which measure linear displacement from the origin, and angular displacement
from the vertical position, respectively.

We begin by deriving the Lagrangian for the system. Taking an arbitrary very short
section ds in the pendulum, the position of ds, relative to the origin, is given by:
2 3
x + s sin
r(x; ) = 4 5 (2.5)
s cos
The kinetic energy of ds is:

dT = 21 dmkr_ k2
= 12 ds(x_ 2 + 2s cos _ x_ + s2 _ 2 )

where dm = ds  ,  is considered as a constant to describe the mass distribution


respective to the length of the rigid pendulum.
2.3. DYNAMICS MODEL 11

The potential energy of ds is:

dV =   ds  g  s  cos

Then, the kinetic energy and the potential energy for the whole pendulum are
integrals of those of the short section ds.
Zl
1
T = 2 M x_ + dT = 12 M x_ 2 + 21 mx_ 2 + 12 ml _ x_ cos + 61 ml2 _ 2
2

Zl 1
0

V = dV = 2 mgl cos
0

The Lagrangian L is de ned as the di erence between the kinetic energy and po-
tential energy of the system. Thus

L(q; q_) = T ; V
= 21 (M + m)x_ 2 + 21 ml _ x_ cos + 16 ml2 _ 2 ; 12 mgl cos

where q is the generalized coordinate for the system, de ned as q = (x; )T . Sub-
stituting L into Lagrange's equation
d @ L ; @ L =  ; i = 1; : : : ; m;
dt @ q_i @qi i

where i is the external force acting on the i ; th generalized coordinate, gives


d @L = (M + m)x + 12 ml( cos ; _ 2 sin )
dt @ x_
@L = 0
@x
d @L = 21 ml(x cos ; x_ _ sin ) + 13 ml2 
dt @ _
@L = ; 21 ml _ x_ + 12 mgl sin
@
Then the overall dynamics satis es:

(M + m)x + 21 ml  cos ; 21 ml _ 2 sin =  (2.6)

1 mlx cos + 1 ml2  ; 1 mgl sin = 0 (2.7)


2 3 2
2.3. DYNAMICS MODEL 12

where  is the force provided by the motor which implements the linear motion of
carriage M .

Actually, di erent friction terms should be added into the dynamics model in a
practical implementation. Two friction terms are considered in our model, one is the
viscous friction when carriage M performs its linear motion on the ball screw; the other
is the viscous friction when the pendulum rotates around its pivot. Let the modi ed
dynamics model of a spherical inverted pendulum as following:
(Mx + m)x + 21 ml  cos ; 12 ml _ 2 sin + cMx x_ = x (2.8)
1 mlx cos + 1 ml2  + c _ ; 1 mgl sin = 0 (2.9)
2 3 mx 2
(My + m)y + 12 ml  cos ; 21 ml _ 2 sin + cMy y_ = y (2.10)
1 mly cos + 1 ml2  + c _ ; 1 mgl sin = 0 (2.11)
2 3 my 2
where,
Mx: mass of carriage respective to x-axis;
My : mass of carriage respective to y-axis;
m: mass of pendulum;
l: length of pendulum;
x: linear displacement of carriage in x direction;
y: linear displacement of carriage in y direction;
: inclination angle of pendulum on xz projection;
: inclination angle of pendulum on yz projection;
cMx, cMy : viscous friction coecient for motion of carriage in x and y
directions, respectively;
cmx , cmy : viscous friction coecient for rotary motion of pendulum
on xz and yz projections, respectively;
x, y : force provided by the motors to implement linear motion
in x and y direction, respectively.
2.3. DYNAMICS MODEL 13

Equations (2.8) to (2.11) describe the motion model for a spherical inverted pen-
dulum. However, the expressions are not in a general case appearance because of so
many fraction coecients in them. To make the expressions tidy enough, ~l = l=2 are
substituted into those equations, and derive the expressions into

(Mx + m)x + m~l  cos ; m~l _ 2 sin + cMx x_ = x (2.12)

m~lx cos + 34 m~l2  + cmx _ ; mg~l sin = 0 (2.13)

(My + m)y + m~l  cos ; m~l _ 2 sin + cMy y_ = y (2.14)

m~ly cos + 34 m~l2  + cmy _ ; mg~l sin = 0 (2.15)

The denotation

M0x = Mx + m
M0y = My + m
J0 = 34 m~l2

invokes to make the expressions more compatible

M0xx + m~l  cos ; m~l _ 2 sin + cMxx_ = x (2.16)

m~lx cos + J0  + cmx _ ; mg~l sin = 0 (2.17)

M0y y + m~l  cos ; m~l _ 2 sin + cMy y_ = y (2.18)

m~ly cos + J0  + cmy _ ; mg~l sin = 0 (2.19)

%
Chapter 3

System Description
The performance of the experimental hardware played very important part in this
project. The exible motion of the X-Y table, and the reliability of the sensor system
were the decisive factors in the success of the whole system. An objective of this project
was to build an experimental bed for di erent kinds of inverted pendulums so as to
allow students to obtain practical and interesting experiences when they perform and
compare di erent control algorithms on it. It is therefore necessary to describe the
hardware system. In Section 3.1, the structure of the X-Y table will be introduced,
and the performance of the multi-axis motion controller which can achieve di erent
motion modes will be illustrated in Section 3.2. The magneto-resistive sensor for the
spherical inverted pendulum and the incremental encoder for the swinging-up project
are discussed in Section 3.3 and Section 3.4, respectively.

3.1 Structure of X-Y Table


An X-Y table is widely used in machining processes involving lathes, milling machines,
and SMD mounters in the manufacturing eld. Traditional X-Y tables commonly used
as motion platforms are designed on the basis of Linear Motion (LM) guides, ball screws
and driving motors, as shown in Fig. 3.1.

The table has 2 degrees of freedom in the movement, i.e., X-axis and Y-axis and the

14
3.2. PERFORMANCE OF THE MULTI-AXIS MOTION CONTROLLER 15

Figure 3.1: Traditional X-Y table

Y-axis is placed on the X-axis. The X-Y table used in our practical experiments was an
obsolete pick and place machine for IC manufacturing, the structure of which is shown
in Fig. 3.2. Strokes of X and Y-axes are 90cm and 65cm, respectively. The actuators
of the X-Y table are the two AC servo motors and their power ampli ers. Each motor
is controlled independently by a multi-axis motion controller, which transfer the con-
troller's signals and motion data of the X-Y table to the actuators and host processor.
Ball screws are connected to the motors and allow the table to move. The lead pitch
of the screws is 2cm. The resolution of position measurement is 2:5m(10;6 m).

3.2 Performance of the multi-axis motion controller


To control the motion of the X-Y table conveniently and precisely, an advanced multi-
axis motion controller is necessary. MC1401 A is a 2-IC general purpose motion control
chip set available in one, two, or four axis con gurations. It provides closed-loop digital
servo control for a large variety of servo motors. It uses incremental or absolute encoder
position feedback signals, and a DAC or PWM compatible output drive. Axes can be
programmed either independently or in synchrony to allow advanced multi-axis motion
such as circular and continuous path pro les. Software and architectural compatibility
are provided with this chip set, and miscellaneous control commands support advanced
3.3. SENSORS 16

linear motion guide stage ball screw

111
000 000
111
000
111
000
111 11111
00000
000
111
000
111
000
111
000
111
000
111
00
11
11
000
111
000
111
00111
000
000
111
000
111
000
111
000
111
000
111
00
11
11
000
111
000
111
00111
000
000
111
000
111
000
111 00111
11000
000
111
11111111
00000000 11111111
00000000
000
111
000
111 00
11000
111
000
111
Y-axis motor 11
00
000
111 000
111
000
111 000
111
000
111
000
111
000
111
000
111
platform
00
11
00
11
000
111
000
111
000
111
000
111
multi-axis
000
111
000
111
000
111
000
111
00
11
00
11
000
111
000
111
000
111
000
111
motion 000
111
000
111
000
111
000
111
00
11
00
11
000
111
000
111
000
111
000
111
00
11
personal computer controller
000
111
000
111 000
111
000
111
000
111
000
111 000
111
000
111
111
000 000
111
motion control 000
111 000
111
000
111 coupler 1 111
0 000
0
1
data input 000
111
0000
1111
000
111 0 111
1 000
0
1
000
111
0000
1111
000
111
0000 0
1 0
1
000
111
1111
000
111
0000 X-axis motor 0 111
1 0
1
000
1111
control signals
servo
amplifiers position signals from encoders

Figure 3.2: Practical X-Y table system for experiments of spherical inverted
pendulum

features such as S-curve pro le generation, separate home and index position capture
signals.

When power ampli ers of AC motors are working in a velocity mode, the velocity
and acceleration of the motor can be set directly using the commands \SET VEL" and
\SET ACC" provided by the motion controller. Such an advantage makes the control
of pendulum systems convenient. If teh acceleration of the driving motors, instead
of their torque, is considered as system input, the motion equations of the inverted
pendulum are easy to implement.

3.3 Sensors
Sensors play very important role in all kinds of inverted pendulum systems. For the
spherical pendulum, a magneto-resistive sensor is used to measure the inclination angles
of two projections. An incremental encoder is used to obtain the current rotary angle
in the swinging-up and stabilization project.
3.3. SENSORS 17

3.3.1 Magneto-resistive sensor


The magneto-resistive sensor is a simple resistive bridge device which is made of a
nickel-iron thin lm deposited on a silicon wafer and patterned as a resistive strip. In
the presence of an applied magnetic eld, a change in the bridge resistance causes a
corresponding change in voltage output. A Set/Reset strap is applied to the magneto-
resistive sensor to restore the sensor to its low noise and high sensitivity state for
measuring magnetic elds. A sensitivity of up to 1:0mV=V=gauss can be achieved.

The inclination angles in two projections of pendulum are measured by a 2-axes


magneto-resistive sensor which o ers non-contact measurement of spherical pendulum's
inclination angles. The measurement system is shown in Fig. 3.3. A permanent magnet,
placed inside pendulum, generate a static magnetic eld. In the case of static elds,
all aluminum materials behave non-magnetically, as does air. The alteration of ux
lines going through the sensor and permanent magnet produce the change in bridge
resistance, and, in turn, the change of the output electrical signal of the sensor. The
output of the 2-axes magneto-resistive sensor gives two sets of signals proportional to
the inclination angles in two projections of the pendulum.

Absolute measurement of angle is desirable. Since there is normally no reference


to calibrate the sensor, the pendulum needs to be placed in the vertical direction rst,
the present output of sensors need to be considered as a reference position at the
beginning of every experiment. Another aspect where attention is needed is the sensor
which must have acceptable resolution because the design of the controller needs a
derivative of the sensor's output as the angular velocity of the pendulum. With a
low resolution of angular measurement, resolution of the velocity deteriorates, and the
designed controller will not be able to stabilize the pendulum. For this reason, a digital
low pass lter is used in sensor systems to reject bad signals and get rid of noise.
3.4. A/D-D/A CONVERTER 18
α

2
3

5
4
6

Figure 3.3: Measurement system of sensor : 1{pendulum(aluminum); 2{


permanent magnet; 3{magnetic ux; 4{mounting plate(plastic); 5{a piece
of rubber to prevent pendulum sliding on mounting plate; 6{magneto-
resistive sensor; {inclination angle for one direction

3.3.2 Encoder
A single-ended incremental encoder is mounted at the pivot of the pendulum in experi-
ments of swinging-up in order to obtain rotary angle of the pendulum. The signal from
the encoder is read via one axis channel of the multi-axis motion controller after it is
converted to a di erential-ended signal by a conversion circuit.

Technical speci cations of the incremental encoder are as follows:

 resolution: 2000pulse=rev.
 slewing speed: 6000rpm.

3.4 A/D-D/A converter


A 12-bits A/D-D/A card converts the analog signals from a magneto-resistive sensor
to digital signals for programming.
Chapter 4

System Parameters Identi cation


In Chapter 2, the dynamics model of a spherical pendulum is presented as equations
(2.16), (2.17), (2.18), and (2.19). The physical parameters, Mx , My , m, l, cMx , cMy ,
cmx , cmy in the system model should be determined before experiments. Among them,
m and l are directly measured; however, the mass Mx , My of carriage and the frictions
coecients cMx , cMy , cmx , cmy can not be measured component-wise because experi-
mental equipments have been already set up. These physical parameters, determined
indirectly from dynamic motion of carriage using di erent identi cation procedures,
will be illustrated in this chapter. The motion of the carriage and pendulum are de-
scribed as a simple second-order system, and the parameters system are identi ed by
properties of the second-order system response in Section 4.1. In the next section, a
Recursive Least Square Method is applied to achieve the system identi cation in real
time.

4.1 Method of Second-order System Response


Without loss generality, let denote M as mass of carriage, cM and cm as correspond-
ing friction coecients, and Jm as the moment of inertia of pendulum about its one
terminal.

To identify mass M and friction coecient cM of the system, we consider the

19
4.1. METHOD OF SECOND-ORDER SYSTEM RESPONSE 20

dynamics motion of the carriage subject to a voltage u(t) and viscous friction:
M x(t) + cM x_ (t) = a0 u(t) (4.1)
where a0 is a constant described as transforming coecient from voltage to force which
can be calculated from the parameters of the driving motor. Conceivably, if u(t) is
constant, the position x(t) will diverge, so we adopt position feedback control: u(t) =
k(xd ; x(t)), where k is a feedback gain, and xd is the desired value. Hence, (4.1) is
given by
M x(t) + cM x_ (t) + a0kx(t) = a0 kxd : (4.2)

On the other hand, to identify the moment of inertia Jm and friction coecient cm ,
let us consider a pendulum dangling downward and subject to the friction depending
linearly on the angular velocity. Let (t) be the angle between the pendulum and the
vertical. Then its motion is described approximately by
(Jm + ml2 )(t) + cm _(t) + mgl(t) = 0: (4.3)

These two equations (4.2) and (4.3) can be expressed in standard second-order form:
q(t) + 2!n q_(t) + !n2 q(t) = !n2 qd : (4.4)
where  , !n, qd are constant. In case of soft-damping (i.e., 0 <  < 1) and initial
conditions, q(0) = q0 (6= 0), q_(0) = 0, its solution is given by
q(t) = p 1 2 (q0 ; qd)exp(;!n t)
1;
p
cos( 1 ; 2!nt ; ) + qd: (4.5)
p
where  = tan;1 (= 1 ;  2 ).

Let tm be the time-to-peak. Then, making derivative of q(t), the condition q_(tm ) = 0
gives after some calculations
tm = p : (4.6)
!n 1 ; 2
4.1. METHOD OF SECOND-ORDER SYSTEM RESPONSE 21
p
hence this condition with relation cos  = 1 ;  2 gives the peak value qm := q(tm )

qm = ;(q0 ; qd )exp(;!n tm) + qd : (4.7)

From (4.7) we have

!n = ; t1 ln(; qqm ;; qqd ) (4.8)


m 0 d
Combining this with 2 =t2m = (1 ;  2 )!n2 , which is obtained from (4.6), we get

!n2 = t12 (2 + [ln(; qqm ;; qqd )]2 ): (4.9)


m 0 d
Thus, by measuring the pair (tm ; qm ) from the experimental data, we can determine
the parameters of !n and  in the standard second-order model (4.4) from (4.8) and
(4.9).

4.1.1 Parameters M and cM


By comparing (4.2) with (4.4), we have the relations,

!n = cM =2M;
!n2 = a0k=M;
qd = xd :
Regarding as q0 = x(0); qm = xm and letting x_ (0) = 0, we can determine M and cM
from (4.8) and (4.9) as follows
a0 kt2m
M = 2 + [ln( xm ; 1)]2 :
xd
(4.10)

cM = ; 2tM ln( xxm ; 1): (4.11)


m d
With this methodology, we get system response from the experiments, see Fig. 4.1.
After some calculations, the parameters M and cM are obtained as

M = 44:52kg;
cM = 397:53N=(m=s):
4.1. METHOD OF SECOND-ORDER SYSTEM RESPONSE 22
Response
0.035

0.03

0.025

0.02

Position(m)
0.015

0.01

0.005

−0.005
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Figure 4.1: System response for identifying M and cM

4.1.2 Parameters Jm and cm


Comparing (4.3) with (4.4) and regarding as q0 = 0 (6= 0) and qm = m , we get

!n = cm =2(Jm + ml2 );


!n2 = mgl=(Jm + ml2 );
qd = 0:

Hence, we can determine Jm and cm as follows:

Jm = mglt2m ; ml2 (4.12)


2 + [ln(; m0 ]2

cm = ; t2 (Jm + ml2)ln(; m ) (4.13)


m 0

The response of the pendulum after it has been released from an initial angle 0 can
be seen in Fig. 4.2, and parameters Jm and cm can then be calculated from the gure.
They are

Jm = 0:0184(kg  m2 );
cm = 3:4  10;3 (kg  s;1):
4.2. RECURSIVE LEAST SQUARES METHOD 23
Response
1

0.8

0.6

0.4

0.2

Angle(rad)
0

−0.2

−0.4

−0.6

−0.8

−1
0 0.5 1 1.5 2 2.5 3 3.5

Figure 4.2: System response for identifying Jm and cm

4.2 Recursive Least Squares Method


The Recursive Least Squares method is a basic technique for on-line parameter esti-
mation [11]. This method is particularly simple if a system model has the property
of being linear in the parameter. However, the property of the input data used in ex-
periments are crucial for the quality of estimation. For example, it is obvious that no
useful parameter estimation can be obtained if all signals are identically zero. In this
section, a square waveform with its period changed along a sinusoidal waveform is used
as input signal to get parameter estimation for M and cM .

4.2.1 Recursive least-squares Estimation (RLS)


The least-squares method can be applied to a large variety of problems. It is partic-
ularly simple for a mathematical model which has the property of being linear in the
parameters, and can be written in the form

y(i) = '1 (i)10 + '2 (i)20 +    'n (i)n0 = 'T (i)0 (4.14)

where y is the observed variable, 10 , 20 ,    , n0 are parameters of the model to be
determined, and '1 , '2 ,    , 'n are known functions that may depend on other known
4.2. RECURSIVE LEAST SQUARES METHOD 24

variables. De ne vectors as
 
'T (i) = '1(i) '2 (i)    'n (i)
 T
0 = 10 20    n0

The parameter  should be chosen to minimize the least-squares loss function


X
T
V (; t) = 12 (y(i) ; 't (i))2 (4.15)
i=1
Since the measured variable y is linear in parameters 0 and the least-squares criterion
is quadratic, the problem admits an analytical solution. Introduce the notations
 T
Y (t) = y(1) y(2)    y(t)
 T
E = "(1) "(2)    "(n)
0 1
'T (1)
B
B C
 = B
B .. C
. C
@ T C A
' (t)
Xt
P (t) = (T (t)(t));1 =( '(i)'T (i));1
i=1

In the RLS scheme, new input/output data become available at each interval. The
model based on past information (summarized in ^(t;1)) is used to obtain an estimation
y^(t) of current output. This is then compared with the observed output y(t) to generate
error "(t), which, in turn, generates an update to the model's parameters which correct
^(t ; 1) to new value ^(t). The recursive calculations are summarized in the following
theorem.

Theorem 4.1 (Recursive least-squares estimation (RLS)) Assume that the


matrix (t) has full rank, that is, T (t)(t) is nonsingular, for all t  t0 . Given (t0 )
4.2. RECURSIVE LEAST SQUARES METHOD 25

and P (t0 ) = (T (t0 )(t0 ));1 , the least-squares estimate ^(t) then satis es the recursive
equations

^(t) = ^(t ; 1) + K (t)(y(t) ; 'T (t)^(t ; 1)) (4.16)

K (t) = P (t)'(t) = P (t ; 1)'(t)(I + 'T (t)P (t ; 1)'(t));1 (4.17)

P (t) = P (t ; 1) ; P (t ; 1)'(t)(I + 'T (t)P (t ; 1)'(t));1 'T (t)P (t ; 1)


= (I ; K (t)'T (t))P (t ; 1) (4.18)

In summary, the full recursive least squares (RLS) algorithm in a practical program
for updating ^(t) is as follows: At time step t + 1:
1. Form '(t + 1) with the new data;
2. Form "(t) using "(t) = y(t + 1) ; 'T (t + 1)  ^(t);
3. Form P (t + 1) using
T
P (t + 1) = P (t)[I ; 1 +'('t T+(t1)+'1)(Pt + 1)P (t)
(t)'(t + 1) ];
4. Update ^(t) with ^(t + 1) = ^(t) + P (t + 1)'(t)"(t + 1);
5. Wait for the next step to elapse and come back to step 1.

4.2.2 Experimental Result


Practical experiments have been implemented to realize the recursive least squares
algorithm into an estimation of mass M and viscous friction coecient cM .

Let us describe mathematical model of carriage M 's motion as (4.1). If we consider


x_ (t) and a0u(t) as the output and input of this system respectively, the model can be
rewritten as

x_ (t) = ; cM x + ac0 u
M M
4.2. RECURSIVE LEAST SQUARES METHOD 26
the input signal
15

10

u
−5

−10

−15
0 1000 2000 3000 4000 5000 6000 7000 8000 9000
time steps

Figure 4.3: The input signal of recursive least squares method

estimated parameters
0.12

0.1

0.08

0.06
M/cM

0.04

0.02

−0.02
0 1000 2000 3000 4000 5000 6000 7000 8000

−3
x 10
3

2.5

2
1/cM

1.5

0.5

0
0 1000 2000 3000 4000 5000 6000 7000 8000
time steps

Figure 4.4: The estimation result for recursive least squares method

Let
h iT
 = M=cM 1=cM
h iT
' = ;x c0 u
Using C programs to get a series of input/output pairs from the practical experiments.
Here the input signal is programmed as a square waveform with the amplitude as 2000 
0:3  10;3  200:12(N ) and the period changed along a sinusoidal waveform.The reason
to choose such a input signal is because that it has much more broader power spectrum
comparing to other experimental signals. see Fig. 4.3. The estimated parameter results
are shown in Fig. 4.4.
4.2. RECURSIVE LEAST SQUARES METHOD 27

From the gure, we get


1 = 0:0026 ) cM = 384:6(N=(m=s))
cM

M ) M = 0:13  384:6 = 49:9(kg)


cM = 0:13

It can be seen that the estimated parameters are consistent with those obtained
from the method of second-order system response in the above subsection.

4.2.3 Disadvantages of RLS


Although the RLS algorithm has its advantages such as implementing real-time identi-
cation systems which makes it become a key element in adaptive control, it has some
disadvantages or limitations in practical implementations:

1. If the system is unstable or if the testing signal is not persistently exciting enough,
the estimated parameters will diverge and the estimation will be invalid.

2. The accuracy of the estimated model is subject to initial model selection and the
input exciting signal.

3. The sampling frequency can a ect the estimated model.

4. Drift, trend, o set and seasonal variations cause harmful in uences.


Chapter 5

Nonlinear Control via Lie


Theoretic Approach
In this chapter, an e ective control method of stabilizing a spherical pendulum system
without resorting to any approximation of each nonlinear terms appearing in mathe-
matical models is presented. The key idea was to derive a partially linearized system
using the coordinate change and input transformation via the Lie theoretic approach,
and to apply a kind of equivalent linearization to the resulting linear system with non-
linear output injection. Based on the linearized system, the control law was established
to perform stabilization of the pendulum. The e ectiveness of the proposed control
method was tested by experiments. Necessary mathematical concepts which were ap-
plied are reviewed in Section 5.1. The case of the inverted pendulum system via the
theoretic approach is depicted in Section 5.2, where, a nonlinear controller is designed
to balance a spherical pendulum on an X-Y table. The experimental results are shown
in Section 5.3.

5.1 Mathematical Preliminaries


Study of the modern geometric theory of nonlinear control began with early attempts
to extend results from linear control theory to nonlinear cases. In recent years, the
di erential geometrics for nonlinear control theory has developed remarkably. In this

28
5.1. MATHEMATICAL PRELIMINARIES 29

section, we look at elementary di erential geometry in order to provide a necessary


background for the study of nonlinear control, such as the tangent space, vector eld,
and Lie derivative. In the second part of this section, It is shown that a normal
SISO (Single-Input Single-Output) nonlinear system can be made to have linear input-
output behavior through a choice of nonlinear state feedback law using the concept of
Lie derivative.

5.1.1 Basic Concepts of Lie Theory


Some basic concepts of Lie theory will be reviewed in this subsection. We rst give
an intuitive de nition of a tangent space: Let us denote by C 1 (p) the set of smooth
real-valued functions de ned in a neighborhood of a point p in <n on the manifold.

The tangent space to a manifold M at point p, denoted by Tp M , is to be the vector


space of mapping: Xp : C 1(p) 7! < that satis es the following two properties for all
f; g 2 C 1(p):
 Linearity for , 2 <.
Xp ( f + g) = Xp (f ) + Xp(g):

 Derivation
Xp(fg) = Xp (f )g(p) + f (p)Xp(g):

with the vector space operations in TpM de ned by

(Xp + Yp )(f ) = Xp (f ) + Yp(f ):


( Xp )(f ) = Xp (f ) 2 <:

A smooth vector eld X on a smooth manifold M is de ned as a map X : M 7! TM .


with the restriction that   X is the identity on M . Here  is the natural projection
5.1. MATHEMATICAL PRELIMINARIES 30

from TM onto M , and X is referred to as a smooth section of the tangent bundle TM .


Such a de nition guarantees that there is exactly one tangent vector at each point
p 2 M , and the tangent vectors Xp 2 TpM vary with respect to p in a smooth fashion.

Based on the concepts provided above, one operation between a vector eld and a
smooth function will be de ned as follow:

De nition 5.1 (Lie Derivative of a Function) Given a smooth vector eld X : M


7! TM and a smooth function h: M 7! < the Lie derivative of h with respect to the
vector eld X is a new function LX h: M 7! < given by

LX h(p) = X (h)(p)
P X @ , then we have
In local coordinates, if X is of the form X = m
i=1 i @xi
X
m
@h
LX h(p) = @xi (x1(p);    ; xm (p))Xi (x1 (p);    ; xm (p)):
i=1

The Lie derivative of a function h with respect to a vector eld X is the rate of
change of h in the direction of X .

5.1.2 Input-Output Linearization


A large class of SISO nonlinear systems can be made to have linear input-output behav-
ior through a choice of nonlinear state feedback control law. Let consider a single-input
single-output system rst

x_ = f (x) + g(x)u:
y = h(x): (5.1)

with x 2 <n , f , g smooth vector elds on <n and h a smooth nonlinear function. The
following calculations will be made for x 2 U , an open subset of <n . Typically U is
an open set containing an equilibrium point x0 of undriven system, that is a point at
5.1. MATHEMATICAL PRELIMINARIES 31

which f (x0 ) = 0. Di erentiating y with respect to time, we obtain


y_ = @h
@x f (x ) + @h g(x)u
@x
:= Lf h(x) + Lg h(x)u: (5.2)
Here, Lf h(x) : <n 7! < and Lg h(x) : <n 7! < stand for the Lie derivatives of h with
respect to f and g respectively. Thus, Lf h(x) is a function giving the rate of change
of h along the ow of vector eld f ; similarly for Lg h(x). If Lg h(x) is bounded away
from zero for all x 2 U , the state feedback law given by
u = L h1(x) (;Lf h(x) + v) (5.3)
g
yields the rst-order linear system from (new) input v to output y:
y_ = v (5.4)
Thus, it can be seen that there exist functions (x), (x) such that the state feedback
law u = (x) + (x)v renders system input-output linear.

In the instance that Lg h(x)  0, meaning that Lg h(x) = 0 8x 2 U , we di erentiate


(5.2) to get
y = @ L@xf h f (x) + @ L@xf h g(x)u;
:= L2f h(x) + Lg Lf h(x)u: (5.5)
In (5.5) above, L2f h(x) stands for Lf (Lf h)(x) and Lg Lf h(x) = Lg (Lf h(x)). Now, if
Lg Lf h(x) is bounded away from zero for all x 2 U , the control law given by
u = L L1h(x) (;L2f h(x) + v) (5.6)
g f
yields linear second-order system from input v to output y:
y = v: (5.7)
More generally, if is the smallest integer for which Lg Lif  0 on U for i = 0;    ; ; 2
and Lg L f ;1 h(x) is bounded away from zero on U , then the control law given by
u= 1 (;L f h(x) + v) (5.8)
;
Lg Lf h(x)
1
5.2. APPLICATION ON THE MODEL OF INVERTED PENDULUM 32

yields the ; th order linear system from input v to output y:

y = v (5.9)

The procedure described above terminates at some nite , under some speci c con-
ditions to be given shortly. The theory is considerly more complicated if Lg Lif h(x) is
not identically zero on U , but zero for some values of x 2 U . To set the preceding
discussions on a rm analytical footing, we will make the following de nition of strict
relative degree of a nonlinear system:

De nition 5.2 (Strict Relative Degree) The SISO nonlinear (5.1) is said to have
strict relative degree at x0 2 U if

Lg Lif h(x)  0 8x 2 U; i = 0;    ; ; 2:
Lg L f ;1h(x0 ) 6= 0:

5.2 Application on the Model of Inverted Pendulum


Di erent control methods, such as LQR regulator, H1 controller, or by Lyaponuv
methods, have been applied to the stabilization of inverted pendulum by former re-
searches. However, almost all of these works employ an approximation of nonlinear
terms to invoke a linear model. In this section, a newly-proposed method of stabil-
lization control for a spherical inverted pendulum system based on the state space
approach and Lie theoretic tools, introduced in last section without resorting to any
direct approximation to each nonlinear term, is presented.

5.2.1 Equation of Motion


It is known that a spherical pendulum can be separated into two uncoupled pendu-
lums using projection, and that each projection can be controlled independently. Since
control strategy for each projection should be the same, except for some di erentpa-
rameters, to simplify our description, from now on, let us derive the control strategy
for only one of these two projections.
5.2. APPLICATION ON THE MODEL OF INVERTED PENDULUM 33

The motion equations for one projection, i.e., on the x ; z plane, are expressed as
(2.16) and (2.17). For convenience, they are rewritten as:
Mx0 x + m~l  cos ; m~l _ 2 sin + cMx x_ = x (5.10)

m~lx cos + (J0 + m~l2 ) + cmx _ ; mg~l sin = 0 (5.11)


Solving them with respect to x and  , we obtain
x = ;ml cos (mgl sin ; cm _ ) + J0 (ml _ 2 sin ; cM x_ )
Mx0 J0 ; m2 l2 cos2
+ M J ; Jm0 2 l2 cos2 x  f3 ( ; x;_ _ ) + g3 ( )u: (5.12)
x0 0

 = J1 [;ml cos f3 ( ; x;_ _ ) + mgl sin ; cm _ ]


0
1
; J ml cos g3 ( )x  f4( ; x;_ _ ) + g4 ( )u: (5.13)
0

where u = x .

Let q1 (t) = x(t), q2 (t) = (t), q3 (t) = x_ (t), q4 (t) = _ (t), and let q := [q1 ; q2 ; q3 ; q4 ]T ,
then equation (5.12) and (5.13) can be expressed as follows:
2 3 2 3 2 3
66 q_1 77 66 q3 77 66 0 77
66 q_2 77 66 q4 77 66 0 77
66 77 = 66 77 + 66 77 u: (5.14)
64 3 75 64 3 2 3 4 75 64 3 2 75
q_ f ( q ; q ; q ) g (q )
q_4 f4(q2 ; q3 ; q4) g4 (q2)
or in a vector form,
q_ = f (q) + g(q)u: (5.15)
where the de nitions of vector-valued nonlinear functions f (q) and g(q) are clear.

As fo for observations, recall that only two quantities, the position of carriage
x(t)(= q1 ) and the inclination angle of pendulum (t)(= q2), can be measured directly.
Di erence equations are invoked to obtain such derivatives as the velocity x_ of carriage,
or the angular velocity _ of the pendulum according to the sampling period T in
practical programming.
5.2. APPLICATION ON THE MODEL OF INVERTED PENDULUM 34

5.2.2 Lie Theoretic Approach


Let us examine the relative degree of a nonlinear system (5.15). To do this, let h(q)
be a scalar smooth function of vector q, and de ne operator Lf () as the Lie derivative
along vector eld f (q), i.e.,
X
4
@h(q) @h(q) )T f (q):
Lf h(q) := @qi fi (q ) = ( @q (5.16)
i=1
The vector nonlinear system (5.15) is said to have relative degree at a point qo if
Lg Lf h(q) = 0; Lg L f ;1h(qo ) 6= 0 (5.17)
for all k = 0; 1; 2;    ; ; 2 and for all q in a neighborhood of qo , where Lkf h(q) =
Lf (Lkf ;1h(q)) with L0f h(q) = h(q).

Now, for k = 0
Lg L0f h(q) = Lg h(q) = ( @h@q(q) )T g(q)
= @h@q(q) g3 (q2 ) + @h@q(q) g4 (q2 ): (5.18)
3 4

Here, note that the scalar function h(q) has not speci ed yet. So, by choosing it
independent of q3 and q4 , Lg L0f h(q) for k = 0 becomes identically zero no matter what
nonlinear functions g3 (q2 ) and g4 (q2 ) are. Then, for k = 1.
Lg L1f h(q) = Lg (Lf h(q))
= Lg ( @h@q(q) q3 + @h@q(q) q4 )
1 2

= @h@q(q) g3 (q2 ) + @h@q(q) g4 (q2 ) (5.19)


1 2

which is not equal to zero as far as h(q) is the function of q1 and/or q2 . Therefore, we
may conclude that the relative degree is 2.

According to the theory of nonlinear control systems, by taking state feedback


control
L2f h(q)
u = ; L L h(q) + L L1h(q) v: (5.20)
g f g f
5.2. APPLICATION ON THE MODEL OF INVERTED PENDULUM 35

the nonlinear system (5.15) is partially linearized, where v(t) is an external input to be
designed as control signal.

As stated above, in choosing function h(q) there are three possibilities such that
h(q) = q1, h(q) = q2 , or h(q) = h(q1 ; q2). For constructive simplicity, let us consider
the case of h(q) = q1 rst. In this case, (5.20) yields

u = ; f3(qg2 ;(qq3); q4 ) + g (1q ) v: (5.21)


3 2 3 2

Therefore, with (5.21) the system dynamics (5.15) becomes


2 3 2 3 2 3
66 q_1 77 66 q3 77 66 0 77
66 q_2 77 66 q4 77 66 0 77
66 77 = 66 77 + 66 77 v: (5.22)
64 q_3 75 64 0 75 64 1 75
q_4 ; J10 (cm q4 ; mgl sin q2) ; J10 ml cos q2
with

u = J1 ml cos q2 ( mgl sin q2 ; cm q4 ) ; mlq42 sin q2 + cM q3


0

+ (M0 ; J1 m2 l2 cos2 q2 )v (5.23)


0

In terms of x(t) and (t) the transformed system (5.22) with (5.23) is expressed as

x = v(t) (5.24)

J0  + cm _ ; mgl sin (t) = ;ml cos (t)v(t): (5.25)

On the other hand, in case of h(q) = q2 the system dynamics corresponding to


(5.24) and (5.25) becomes after same procedure
J0 v(t):
x ; ml cos1 (t) cm _ ; g tan (t) = ml cos (5.26)
(t)

 = v(t): (5.27)
5.2. APPLICATION ON THE MODEL OF INVERTED PENDULUM 36

which is rather more complicated than (5.24) and (5.25). Furthermore, if we choose,
for instance, as h(q) = h(q1 ; q2 ) = q1 + q2 , then two degrees of freedom are lost by
introducing h(q1 ; q2 ) and Lf h(q1 ; q2 ) as new state variables. Hence, we investigate only
the case of h(q) = q1 in the sequel.

5.2.3 Linearization
Here, let

v0 := v ; q2 (5.28)

then, (5.22) can be expressed as


2 3 2 32 3 2 3
66 q_1 77 66 0 0 1 0 77 66 q1 77 66 0 77
66 q_2 77 66 0 0 0 1 77 66 q2 77 66 0 77
66 77 = 66 77 66 77 + 66 77
64 q_3 75 64 01 0 0 75 64 q3 75 64 0 75
q_4 0 0 0 ; J10 cm q4 ; J1 ml(q2 cos q2 ; g sin q2)
2 0
3
66 0 77
66 0 77
+ 66 77 v0 : (5.29)
64 1 75
; J0 ml cos q2
1

Vectors in the second and third terms of right-hand-side are functions of the measurable
variable q2 (= ). Since the inclination angle is very small near the steady balanced
position, assumption q  0 can be made, then the second term vanishes, and the third
term becomes a constant vector. Equation (5.29) is turned to be a linear system

q_ = Aq + bv0 : (5.30)

In this case the pair (A; b) is controllable.


5.3. EXPERIMENTAL RESULT 37

5.2.4 Solving for v0(t) by Riccati Function


Now, we wish to nd a feedback control v0 that will balance the inverted pendulum.
To do this, we set the following cost function.
1 Z tf
J (q(t); v~(t)) = 2 fq (t)Qq(t) + v~(t)Rv~(t)gdt:
0
(5.31)
0

where Q is a 4  4 positive semi-de nite matrix; and R is a positive scalar constant.


We are seeking a optimal control law that yields the smallest possible cost. Clearly, it
is a standard LQR problem, and the optimal control is found from

v~(t) = ;R;1 b P (t)q(t):


0
(5.32)

Then the solution of optimal control problem can be reduced to nding the matrix
P (t), which is the solution of Riccati equation
P_ (t) = ;P (t)A ; A P (t) ; Q + p(t)bR;1 b P (t);
0 0
(5.33)

and can be solved by MATLAB commands.

5.3 Experimental Result


5.3.1 Control Procedure
The control procedure established in the previous section is stated as follows:

1. Determination of each physical parameter. These are given by applying either


identi cation procedure illustrated in the previous chapter.
2. Observation data. It should be emphasized that the state q(t) is partially observ-
able, that is, only q1 (= x) and q2 (= ) are directly obtainable. To recover the
unobserved states q3 (= x_ ) and q4 (= _ ), we use di erence equations to approx-
imate these two derivatives with the time step as sampling period of practical
programming.
3. Control. The weight matrix Q and R in cost function (5.31) were set as: Q =
diag(100; 10; 200; 20), R = 0:05. So, the poles of controller are: ;21:4170,
5.3. EXPERIMENTAL RESULT 38

AC servo motor
sensor
signals
12 bit
AD/DA
power
amplifier

Pentium-116
PMD
personal computer MC 1401

Figure 5.1: Experimental con guration for the planar inverted pendulum
system on one projection

;1:1313, ;0:0611  0:1937j . The control signal v0 (t) is obtained by replacing


the state q(t) with the estimation in above step 2. Consequently, v(t) and then
u(t) are obtained successively from (5.28), and (5.23).

5.3.2 Experimental Con guration


A Pentium-166 personal computer is used as the host processor. The X-Y table is driven
by two 400W AC servo motors and their power ampli ers. The motion control chip set
MC 1401A is a 2-IC general purpose Performance Motion Device (PMD) available in
one, two, or four axes con guration. Here, it plays the role of interface between motor
ampli ers and host processor. A 12-bit AD=DA converter is in charge of resetting the
sensor and transferring the data of the sensor to the host processor. The experimental
con guration of a planar pendulum system in one projection is shown in Fig. 5.3.2.
For the other projection system, the con guration is exactly the same.

The data of the inclination angles of the pendulum are taken by the magneto-
resistive sensor. The control input is the acceleration of motors. The algorithm for the
controller is implemented on the Pentium-166 personal computer which receives the
data from the AD=DA converter and sends control signals to the AC servo motors for
5.3. EXPERIMENTAL RESULT 39

every 10ms. The software package for the controller, which is able to perform all the
calculations in real time, is programmed in C language.

5.3.3 Experimental Results


There were many practical problems in real-time experiments because of the limited
length of the stage, limited acceleration of motors, inevitable noise caused by the pulley-
belt, and the noise created by the magneto-resistive sensor. Thus, the motion of the
pendulum become very sensitive.

For designing the controller, trials and errors were used to de ned the pair of
weighting matrices Q and R of cost function (5.31). The nal selection of weight-
ing matrices come from such procedures: selected values for unspeci ed parameters,
generated the feedback gains, and implemented the controller on the actual system
to evaluate the performance. To balance the pendulum in the x-direction, we set
Q = diag(100; 10; 200; 20), R = 0:05, Then, the poles of the controller were: ;21:4170,
;1:1313, ;0:0611  0:1937j . Fig. 5.2 depicts the inclination angles of two axes when
the inverted pendulum were balancing successfully on the X-Y table. Fig. 5.3 shows
the responses of the positions on x- and y-directions at the same time. Fig. 5.4 shows
an overview of the dynamics motion for a balanced inverted pendulum in 3-D view.

5.3.4 Comments on Practical Experiments


Things always became dramatic when we tries to put theoretical methods into practical
implementation. We found that the process did not always go as what we want it to.
Some happiness and pains in practical experiments come as following comments:

1. As we mentioned before, one advantage of advanced multi-axis motion controller


MC 1401A is the property of setting acceleration directly. Such a property will
simplify the control process. For this point, let us review the dynamics equation
(5.24) and (5.25) derived by Lie Theoretic approach. Here, x = v(t) means that
it is feasible to look v(t) as the system input instead of u(t). This is to say,
5.3. EXPERIMENTAL RESULT 40

0.03

0.02

0.01

ch2th
0

−0.01

−0.02
0 10 20 30 40 50 60 70 80

0.03

0.02

0.01
ch4th

−0.01

−0.02

−0.03
0 10 20 30 40 50 60 70 80

Figure 5.2: Inclination angles on two projections

motion of x−y table


0.1

0.05

−0.05
x (m)

−0.1

−0.15

−0.2

−0.25
0 10 20 30 40 50 60 70 80

0.1

0.05

−0.05
y (m)

−0.1

−0.15

−0.2

−0.25
0 10 20 30 40 50 60 70 80
time (s)

Figure 5.3: Response of motion of X-Y table


5.3. EXPERIMENTAL RESULT 41
dynamics motion

0.7

0.6

0.5

elevation (m)
0.4

0.3

0.2

0.1

0
0.1

0 0.05
0
−0.1 −0.05
−0.1
−0.15
−0.2 −0.2
−0.25
−0.3 −0.3
position y(t)(m)
position x(t)(m)

Figure 5.4: An overview of dynamics motion for a balanced spherical pen-


dulum in 3-D view

when v(t) is obtained from (5.28), it can be directly set to motion controller as
acceleration of motor rather than further calculation for u(t).

2. It can be seen noise and drift exist in the experimental results shown in Fig. 5.2
and Fig. 5.3. One reasons for such non-perfect phenomena come from intrinsic
noise of the magneto-resistive sensor and non-absolute symmetry of the magnet
eld. We added a digital low pass lter in the program to get rid of noise and fatal
error data. But, for the second reason, what depends on mechanical scrabbling
skill and machines, which not available in the laboratory. Fortunately, the system
can work very well after it obtains a reasonable reference value (the output value
from sensor when the pendulum is in its vertical position) at the beginning of
every experiment. After a little bit of drift, the system will reach its steady state,
and the spherical pendulum will stand steadily vertically as long as is needed.
Suitable disturbance is also a ordable, and the system can recover its steady
state automatically after several seconds' swings.
Chapter 6

Simpler Method for Stabilization


of Spherical Pendulum
The control method based on the Lie theoretical approach illustrated in last the chapter
is feasible and e ective. The experimental results are satisfactory, but the theoretical
analysis looks extremely complicated. Actually, in practical engineering, many di erent
methods exist for solving the same problem. This raises the idea that another, much
simpler method, should exist for balancing the spherical pendulum.

In this chapter, a very simple stabilization controller will be designed for the spher-
ical inverted pendulum. A nonlinear feedback controller is proposed to balance the
pendulum at its steady vertical position. Since the dynamics model which we are going
to utilize has no term on the parameters of the X-Y table, the complicated and time-
consuming process for estimation will be saved. The control strategy is introduced in
Section 6.1, while the experimental results are shown in Section 6.2. Finally, in Sec-
tion 6.3, some comments about the advantages and disadvantages of compared to Lie
theoretic approach are provided.

42
6.1. CONTROL STRATEGY 43

6.1 Control Strategy


6.1.1 Analysis
As for the analysis in the Lie theoretical approach, we only derive the control strategy of
the planar inverted pendulum in one projection in this chapter since the two projections
have the same structure.

The magneto-resistive sensor realizes the non-contact measurement of the inclina-


tion angles of two projections of the pendulum. The pendulum has a vertex terminal
as shown in Fig. 3.3, which achieves point-to-point contact between the pendulum and
the experimental platform, so the viscous friction cmx is negligible. Motion dynamics
for the projection on the x-z plane can be rewritten as follows:

Mx0 x + m~l  cos ; m~l _ 2 sin + cMx x_ = x (6.1)

m~lx cos + J0  ; mg~l sin = 0 (6.2)

In (6.1),  is the force provided by the motor which drives the linear motion of carriage

M with a set of pulleys and belt. Since the AC servo motor is driven in the velocity
mode, and its output torque cannot be controlled directly as in a general DC motor,
(6.1) is not available in our experimental system unless some transformation is derived
for it as illustrated in the Lie theoretical approach.

On the other hand, (6.2) presents the planar pendulum as a very simple nonlinear
system if we consider x as the system input. The property of the motion controller
MC 1401A allows us to put this idea into reality. Since cos (t) will never go to zero, un-
less the pendulum has fallen down, we can obtain the formula of the input acceleration
x as
~
x = ;J0  +~ mgl sin (6.3)
ml cos
6.1. CONTROL STRATEGY 44

6.1.2 Control Strategy


A nonlinear feedback controller is designed from (6.3):
~
x = ;J0 ( d + kv ( _ d ; _ ) +
~
kp ( d ; )) + mgl sin (6.4)
ml cos
where  d , _ d , d are the reference angular acceleration, the reference angular velocity,
and the reference angle of the pendulum, respectively.

If we substitute (6.4) into (6.3), the whole system is linearized as a simple PD


control model
d ( de ) + k de + k e = 0
dt dt v dt p

where, e = ( d ; ) is the error between the reference value and the actual value. Then
the characteristic equation is given by

2 + kv  + kp = 0 (6.5)

If all eigenvalues lie in the left half complex plane, the system is asymptotically stable,
that is, will approach to d as t goes to in nity.

Notice that we have not considered the position of carriage M as system state in
the above control law. In practical experiments, such a control strategy will cause
some kind of drift in the linear motion of carriage M . Furthermore, it will destroy the
stabilization of the spherical pendulum. So, let us improve our algorithm by taking the
position and velocity of carriage M into account. These two terms will be considered
as auxiliary feedback states in order to keep the carriage at the reference position while
the pendulum is balanced at its steady vertical con guration. The improved control
law is described as follows:

x(t) = a1 ( d + kv ( _ d ; _ ) + kp ( d ; a) + k1 (x_ d ; x_ ) + k2 (xd ; x)) + a2 : (6.6)


3

where, a1 = ;J0 , a2 = mg~l sin , a3 = m~l cos . xd is the reference position of carriage
M , and k1 , k2 are the feedback gains for position and velocity feedback, respectively.
6.2. EXPERIMENTAL RESULTS 45

There are four control parameters in the control strategy for one projection of the
spherical pendulum. Therefore for whole system, eight controller gains need to be
determined. In the practical experiments, several trial-and-error attempts were made
to seek the pair of these gains in order to achieve stabilization of the pendulum. The
experimental results will be shown in the next section.

6.2 Experimental Results


To design the controller, trial-and-error attempts were used to de ne the pair of eight
controller gains kdx , kvx , k1x , k2x for x ; z projection, and kdy , kvy , k1y , k2y for y ; z
projection. To balance the spherical pendulum on the X-Y table, a feasible pair of
those eight parameters are set as shown in Table 6.1.

Table 6.1: The controller gains in experiments

kpx 1000 kpy 800


kvx 90 kvy 65
k1x 40 k1y 35
k2x 20 k2y 22

Fig. 6.1 depicts the inclination angles of two axes when the inverted pendulum is
balanced successfully on the X-Y table. Fig. 6.2 shows that the responses of positions
on x and y directions at the same time. Fig. 6.3 gives an overview of the dynamics
motion for a balanced spherical inverted pendulum in a 3-D view.

6.3 Comments on the Simpler Control Method


Obviously, the simpler method which we illustrate in this chapter is much easier to un-
derstand, and easier to implement than that derived via the Lie Theoretical approach.
The strategy balances the spherical pendulum well at its steady vertical position, and
6.3. COMMENTS ON THE SIMPLER CONTROL METHOD 46

0.02

0.015

0.01

0.005

ch2th
0

−0.005

−0.01

−0.015
0 10 20 30 40 50 60 70

0.015

0.01

0.005
ch4th

−0.005

−0.01
0 10 20 30 40 50 60 70

Figure 6.1: Inclination angles on two projections

motion of x−y table


0.1

0.05

−0.05
x (m)

−0.1

−0.15

−0.2

−0.25
0 10 20 30 40 50 60 70

0.05

0
y (m)

−0.05

−0.1

−0.15
0 10 20 30 40 50 60 70
time (s)

Figure 6.2: Response of motion of X-Y table


6.3. COMMENTS ON THE SIMPLER CONTROL METHOD 47
dynamics motion

0.7

0.6

0.5

elevation (m)
0.4

0.3

0.2

0.1

0
0.05

0 0.1
0.05
−0.05 0
−0.05
−0.1
−0.1 −0.15
−0.2
−0.15 −0.25
position y(t)(m)
position x(t)(m)

Figure 6.3: An overview of dynamics motion for a balanced inverted pen-


dulum in 3-D view

can a ord suitable external disturbance. As shown in Fig. 6.2 and Fig. 6.2, at time
t = 40s, an external disturbance has been exerted on pendulum. The system recovers
its steady states after several swings, and the pendulum is back to its steady verti-
cal position. The experimental results show that the simpler method with nonlinear
feedback is also feasible and e ective.

Compared to the Lie theoretical approach, this strategy has its own advantages and
disadvantages:

 It is known that some parameters of the X-Y table, such as Mx, My , cMx, cMy ,
cannot be measured directly since the experimental equipment has already been
built. To estimate those parameters, several experiments should been done before
putting the control strategy into practice. Obviously, this would be a complicated
and time-consuming procedure, and the results maybe not as accurate as those
of the true model. However, in this simpler strategy, terms including X-Y table's
parameters have been considered into two auxiliary feedback states for every
projection model. The procedure has been simpli ed. This is one advantage for
this control law over that derived from Lie theoretical approach.
6.3. COMMENTS ON THE SIMPLER CONTROL METHOD 48

Figure 6.4: Picture of a working 2-D inverted pendulum

 Since the position and velocity of the carriage have been appended into control law
as auxiliary feedback states, the stabilization of the carriage staying at a reference
position is not guaranteed as well as it is in the Lie theoretic approach, as shown
in the experimental results. Though some unstable vibration and drift exist in the
motion of the X-Y table, the pendulum is still balanced at its target position, and
never falls down until the program is stopped. A working experimental spherical
inverted pendulum is realized steadily in Fig. 6.4.
Chapter 7

Swing Up a Planar Pendulum


Swinging up an inverted pendulum is another classic experiment used in control labo-
ratories. In fact, it is dicult to apply many of the standard nonlinear control design
techniques [10], since the relative degree of the system is not constant (when the out-
put is chosen to be the swinging energy of the pendulum), and the system is not
input-output linearizable. In this chapter, we propose an autonomous nonlinear state
feedback control law to regulate the swinging energy of the pendulum for a cart and
pendulum system. The resulting closed-loop system possesses a stable periodic orbit;
initial conditions near the orbit will converge to some periodic trajectory on the orbit.

The pendulum is controlled in such a way that its energy is driven towards a value
equal to the steady state upright position. The pendulum then approaches the upright
position where it can be caught with a stabilizing strategy and stays rmly at its
upright position. The system dynamics of a cart and pendulum system is described in
section 7.1, and the regulator of swinging energy is designed in section 7.2. In section
7.3, special junctures are chosen for applying the control law to the system in order to
guarantee the feasibility of the experiment. A simple LQR is designed in section 7.4 to
stabilize the pendulum at its upright position after the control strategy is switched to
the stabilizing strategy. The experimental results are shown in Section 7.5.

49
7.1. SYSTEM DYNAMICS 50
upright position
y

x(t)

x
M

θ (t)

θ=0

Figure 7.1: An cart and pendulum system

7.1 System Dynamics


Consider a cart and pendulum system as shown in Fig. 7.1. Let the pendulum be of
mass m and let its moment of inertia with respect to pivot point be Jp . Furthermore, let
l be the distance from pivot to the center of mass. The angle between the vertical and
pendulum is denoted as , where  is positive in clockwise direction. The acceleration
of gravity is g and linear acceleration of the pivot is u. The equation of motion for the
pendulum have rather simple form as

Jp  ; mgl sin  + ml cos   u = 0: (7.1)

The model given by (7.1) is based on several assumptions. All friction terms are

neglected and it is assumed that the pendulum is a rigid body. It is also assumed that
there is no limitation on velocity of pivot.

The system has two state variables, the angle  and angular velocity _. It is natural
to let the state space be a cylinder. In this state space the system has two equilibrium
points corresponding to  = 0, _ = 0, and  = , _ = 0.
7.2. REGULATION OF A SWINGING PENDULUM 51

7.2 Regulation of a Swinging Pendulum


In this section, we report on the development of a control law to regulate the swinging
energy of pendulum. The resulting control system is such that the swinging energy will
converge to the desired energy from almost all initial conditions.

Consider the control system.


_ = ! (7.2)
!_ = mglJsin  ; mlJcos  u: (7.3)
p p
de ned on cylindrical phase (; !) 2 S 1  <. The undriven system (u = 0) has equilib-
rium points (with ! = 0) at  = 0 and  =  = ; (we identify + and ; to get the
circle group S 1 ).

It is natural to choose the energy so that it is zero in the downward position and to
normalize it by 2mgl, the energy required for raising the pendulum from the downward
to the upright position. A feedback control u was designed so that the swing energy
H (; !) := 12 Jp!2 + mgl(1 ; cos )
is regulated to the desired swing energy H^ = 2mgl.

De ne
^
E (; !) := H (; !) ; H;
and note that
E_ = Jp _ ; mgl_ sin  = ;ml_ cos   u: (7.4)
Choosing the feedback control law
u = ke  !  cos   E; (7.5)
where ke > 0 is a design parameter, results in
E_ = ;mlke!2 cos2   E;
7.2. REGULATION OF A SWINGING PENDULUM 52

so that
Zt
E (t) = E (0)  exp[;mlke !2 (s) cos2 (s)ds]: (7.6)
0

In particular, if
Zt
!2 (s) cos2 (s)ds ! 1 as t ! 1
0

along the trajectories of the closed-loop system (7.4), (7.5), then

E (t) ! 0
Note that (7.6) implies that jE (t)j is non-increasing. We can use LaSalle's theorem to
show that E (t) does in fact converge to zero for almost all initial conditions.

Indeed, setting

V (; !) = E 2 (; !);


it can be seen that

V_ (; !) = ;2mlke!2 cos2   E 2 (; !)  0;


so that

f(; !) : j V (; !)  V (0; !0 )g;


where (0 ; !0 ) = ((0); !(0)), is compact. Therefore, all trajectories of the system will
converge to the largest invariant set where V_ = 0, namely,

f(; !) : fE (; !) = 0g [ f(0; 0); (; 0)gg:

In particular, since V is non-increasing, it is obvious that the only trajectories


which do not converge to the periodic orbit E (; !) = 0 are the trivial trajectory
and the trajectories that lie on the stable manifold of saddle equilibrium point (; 0).
Therefore, the periodic orbit with energy H^ is locally asymptotically stable.
7.3. SWING UP STRATEGY 53

horizontal

θ (t) θ (t)
case(3)
case(1)
case(4)
case(2) θ=0 θ=0

Figure 7.2: Case description for swing-up strategy

7.3 Swing up Strategy


We will now discuss the strategies for bringing the pendulum to the upright position.
It was assumed that the pendulum starts at rest in a stable downward position. The
energy of the pendulum was de ned to be zero initially. In the steady state upright
position the energy is 2mgl. It is very convenient to use arguments based on the
control of energy. Using the regulation discussed in the former section, the energy of
the pendulum is increased from zero to 2mgl, and the pendulum swings towards upright
position where it can be captured by a stabilizing strategy.

Since the acceleration of the pivot is limited, and the stage of the X-Y table is also
limited, to make experiments feasible on practical equipment, suitable junctures will be
chosen to give pendulum the energy. It is reasonable and e ective to supply the control
input u to the system when the pendulum is passing through the stable downward
position ( = 0). Around this juncture, there are four cases (also see Fig. 7.2):

1. case(1) where (t) > 0 and _(t) > 0, the pendulum is swinging upward in a
clockwise direction from the initial position.
2. case(2) where (t) > 0 and _(t) < 0, the pendulum is swinging downward in a
counterclockwise direction to the initial position.
3. case(3) where (t) < 0 and _(t) > 0, the pendulum is swinging downward in a
7.4. STABILIZING STRATEGY 54

clockwise direction to the initial position.


4. case(4) where (t) < 0 and _(t) < 0, the pendulum is swinging upward in a
counterclockwise direction from the initial position.
To make the control strategy convenient to implement in experiments, we supply
the energy feedback law to the system only at case(1) and case(4). At case(1), since
cos   1, the acceleration given to the pivot is then u = ke !  E , the cart will move in a
negative direction. Conversely, at case(4), we supply energy to allow the pivot to move
in the positive direction. Thus, the pendulum will obtain its energy when it is passes
through the dangling position every time until, ultimately, it reaches the destination
(the upright position). Once the pendulum had been swung up, the control strategy
was switched to stabilizing strategy which will be discussed in the next section.

7.4 Stabilizing Strategy


The stabilization of the pendulum can be achieved using any of the two control strate-
gies presented for the spherical pendulum in previous chapters. Here, a linear quadratic
regulator (LQR) was designed by principle of optimal control.

Assuming that inclination angle  of pendulum is very small, the state space rep-
resentation of (7.1) is as follows:
X_ = A  X + B  u: (7.7)
where
2 3 2 3 2 3
66 0 1 0 07
77 66 0 77 66  77
6mgl 0 0 66 ; mlJp 77 6 _ 7
A = 666
07
Jp 7 ; B = 66 77 ; X = 666 777
640 0 0 1 77 64 0 75 64 x 75
5
0 0 0 0 1 x_
The controller is realized as a state space controller

u = ;K T  X (7.8)
7.5. EXPERIMENTAL RESULTS 55

with the feedback gain vector K 2 <4 . The LQR design method is used for determining
the feedback gain, and the design criteria is:
 The pendulum should not move more than 5o away from the vertical;
 The pendulum should not move more than 20cm away from the origin.

To nd vector K , two parameters, R and Q, which balance the relative importance


of input and state in LQR cost function, were chosen as follows:
2 3
66 !1 0 0 0 77
66 0 !2 0 0 77
R = 3; Q = 66 77 :
64 0 0 !3 0 75
0 0 0 !4
where, !1 , !2 , !3 , !4 , were used to weight pendulum's angle , pendulum's angular
velocity _, pivot's displacement x, and pivot's velocity x_ , respectively. The controller
needed to be designed in such a way that the time response of  has high dynamics
than that of x.

Using numerical simulations, the weights were determined as follows:


!1 = 100; !2 = 5; !3 = 1; !4 = 1:
The simulation begins with the pendulum's angle  being 3o away from the vertical.
The maximum displacement of the pivot's position is 15cm away from the origin. The
setting time for both states is less than 10sec, see Fig. 7.3.

Note that, in the simulation, it is assumed that the pivot can be arbitrarily accel-
erated.

7.5 Experimental Results


The experiment was implemented on the same platform as that need for the experiments
of the spherical inverted pendulum. One axis of the X-Y table was driven to achieve
7.5. EXPERIMENTAL RESULTS 56
the response for inclination angle
1

−1

theta (degree)
−2

−3

−4

−5
0 5 10 15 20 25 30
time (s)
the response of pivot displacement
0.02

−0.02

−0.04

−0.06
x(m)

−0.08

−0.1

−0.12

−0.14

−0.16
0 5 10 15 20 25 30
time(s)

Figure 7.3: Simulation results for stabilizing strategy by LQR

linear motion of the pivot. A single-ended incremental encoder was mounted at the
pivot to obtain the inclination angle of the pendulum. The signals from encoder were
read via one channel of the multi-axis motion controller after being converted into
di erential-ended signals.
The parameters of the system are summarized in Table 7.1.

Table 7.1: The experiments' parameters

m 0:53kg
l 0:6cm
Jp 0:0159kg  m2
g 9:82kg=m2

The behavior of swinging up critically depended on the maximum acceleration of


motor which drives the pivot. If the feedback gain ke in (7.5) is suciently large the
7.5. EXPERIMENTAL RESULTS 57
1.5

momenton(J)
0.5

0
0 5 10 15 20 25
time (s)

Figure 7.4: Kinetic Energy alteration of the pendulum

required energy will be obtained very quickly, and pendulum can be brought up in
one or two swings. Actually, since the maximum acceleration of experimental motor is
limited, we had to choose a smaller feedback gain to bring up the pendulum. The value
of the energy feedback gain ke and feedback gain vector K in the stabilizing strategy
were ultimately obtained from trials in practical experiments, see in Table 7.2.

Table 7.2: Feedback gains of the controller

ke 4:1
k1 45
K k2 10
k3 4
k4 8

With the designed controller, the pendulum started its swings from the natural
dangling position. Every time it passed through the junctures which were consistent
with the suitable cases, the current energy of the pendulum was calculated, see Fig.
7.4. The swing up control law (7.5) regulated the motion of the pivot, see Fig. 7.5,
7.5. EXPERIMENTAL RESULTS 58
0.15

0.1

0.05

Position(m)
−0.05

−0.1

−0.15

−0.2
0 5 10 15 20 25
time (s)

Figure 7.5: Position of pivot in the process of swinging-up of a pendulum

1
Rotatory Angle(rad)

−1

−2

−3

−4
0 5 10 15 20 25
time (s)

Figure 7.6: Rotatory angle in the process of ] swinging-up of a pendulum

to bring the pendulum up to the upright position, see Fig. 7.6. After the pendulum
reached the feasible range near the steady-state upright position, the control strategy
were switched into the stabilizing control algorithm designed by LQR. Fig. 7.7 shows
the whole process of swinging up a planar inverted pendulum and then balancing it in
a 3-D view.
7.5. EXPERIMENTAL RESULTS 59

dynamics motion

0.5
elevation (m)

−0.5

−1
25
20 1.5
15 1
10 0.5
0
5
−0.5
0 −1
time t(s)
position x(t)(m)

Figure 7.7: An overview of dynamics motion for swinging-up and stabiliza-


tion of an inverted pendulum in 3-D view
Chapter 8

Conclusion and Further


Development
8.1 Conclusion
In our research, we studied two popular aspects of the inverted pendulum in demon-
strating and motivating various control design techniques. The major accomplishment
of this project are that a set of experiments were built with a hardware platform and
a software package. These were introduced in Chapter 3. Using these equipments,
the stabilization and swinging up problems for an inverted pendulum were explored.
The hardware and software packages will allow graduate engineering students using
the same process in further research to establish and compare the practical advantages,
and limitations, of various design methods .

A 2-DOF spherical inverted pendulum was separated into two decoupled planar in-
verted pendulums by projected onto two orthogonal planes. A special magneto-resistive
sensor system was developed to allow contact-less measurement of the inclination angles
of the pendulum. In Chapter 5, we discussed the nonlinear theory for the stalibiza-
tion strategy of the spherical pendulum based on di erential geometry. Via the Lie
theoretic approach, the system model was established without resorting to any ap-
proximation of each nonlinear term. Experimental results showed that the pendulum
60
8.2. FURTHER DEVELOPMENT 61

can be balanced steadily on the X-Y table with endurance to disturbance. Another
control strategy, simpler than the former one, was also implemented into the spherical
pendulum through practical experiments. However, it was demonstrated that the ex-
perimental results of simpler method were not as satisfactory as those obtained from
the Lie theoretic approach because of inevitable drifts in the linear motion of the car-
riage. Such a phenomenon indicated the advantages and disadvantages of these two
methods.

An energy feedback controller was developed to regulate the swinging energy of


a pendulum in the process of being swung up. The resulting closed-loop system was
proved to converge to the reference energy which was needed to bring up the pendulum
from a dangling position to an upright position. Suitable junctures were selected for
applying the control input to the system so as to guarantee the feasibility of the swinging
up and stabilization experiments.

8.2 Further Development


As stated in the previous section, the hardware (including the X-Y table and the
sensor system) and software packages are available and function properly. Furthermore,
several controllers were designed to study and test the performance of the Lie theoretic
nonlinear algorithm and the outcome was satisfactory in general. In next paragraph
we discuss possible future research.

The lack of an appropriate friction nonlinear model for the pendulum makes the
task of designing a robust controller interesting. Therefore, the inverted pendulum
could be considered as a suitable test-case for controller design methods. The four
aspects that would be further researched, and which would make use of the tools we
developed are.

 Adaptive control
8.2. FURTHER DEVELOPMENT 62

Since the X-Y table is already built, the measurement of the mass of carriage is very
dicult. On the other hand, the error in the mechanical structure makes the friction
term changed in di erent parts of the X-Y table, and the model will deviate. Therefore,
some adaptive scheme combining parameters identi cation should be used to identify
the model parameters in a real time fashion. However, the host processor needs to be
replaced by a more powerful one to perform more intensive computation.

 Visual sensor system


A CCD camera could also be used as a sensor system to achieve contact-less mea-
surement of the inclination angle for a spherical pendulum. The inclination angle can
be derived using simple relations from the alteration of images from a xed point on
the pendulum. A mechanical structure should be developed to reduce the noise caused
by the motion of the X-Y table as this in uences the performance of the camera.

 Regulation of the carriage and swinging pendulum


A new nonlinear controller that regulates the position of the cart as well as the
swinging energy of pendulum should be developed. This could be accomplished by
adding low-band-width linear position and velocity terms to stabilize the carriage po-
sition in such a way that not destroy the regulation of the swinging energy.

 Robust control design and analysis


Since friction variations and disturbance are introduced during operation, model
uncertainty plays an important role in the deterioratations of the system performance.
The LMI-based theory provides an e ective method for solving such a multi-objective
robust control problem. A good trade-o between the optimal H1 and H2 control
should be found via simulation results, and be implemented through practical experi-
ments.
Publication
Some preliminary results and parts of this thesis are to be appearred in conference
proceeding while some submitted papers are still under review.

1. Rong Yang, Li Chai, XiaoDong Zhao, Zexiang LiControl of Swing-up and Sta-
bilization for an Inverted Pendulum, to be appeared in the proceeding of 9-th
Internation Conference on Power Electronics and Motion Control (EPE-PEMC).

2. Rong Yang, Yiu-yiu Kuen, Zexiang LiStabilization of a 2-D Inverted Pendulum


on X-Y table, accepted by 2000 IEEE International Conference on Control Appli-
cation and IEEE International Symposium on Computer-Aided Control Systems
Design.

63
Bibliography
[1] Frankin G. F., Powell J. D. and Emani-Naeiri A, Feedback Control of Dynamics
Systems, Addison Wesley, 1991, USA.

[2] S. Yurkovich, M. Widjaja, Fuzzy controller synthesis for an inverted pendulum


system, Control Eng. Practice, vol. 4, no. 4, pp.445-469, 1996.

[3] Z. Lin, A. Saberi, M. Gutmann, and Y. Shamash, Linear Controller for an Inverted
Pendulum Having Restricted Travel { A High-and-low Gain Approach, Automat-
ica, vol. 32, no. 6, June 1996, pp.933-7. Elsevier, UK.

[4] Q. Wei, W. P. Dayawansa, and W. S. Lavine, Nonlinear Controller for an Inverted


Pendulum Having Restricted Travel, Autimatica, vol. 31, no. 6, June 1995, pp.841-
50. UK.

[5] J. Nelson, L. G. Kraft, Real-time control of an inverted pendulum system using


complementary neural-network and optimal techniques, Proc. American Control
Conference, pp.2553-4, 1994.

[6] Sugie T, Fujimoto K, Control of Inverted Pendulum Systems based on Approximate


Linearization: Design and Experiment, Proc. 33rd IEEE Confer. Decision and
Control. IEEE. Part vol. 2, 1994, pp.1647-1648. New York, NY, USA.

[7] C. C. Chung and J. Hauser, Nonlinear Control of a Swinging Pendulum, Auto-


matica, vol. 31, no. 6, June 1995, pp.851-62. UK.

64
BIBLIOGRAPHY 65

[8] Sprenger B, Kucera L, Mourad S, Balancing of an Inverted Pendulum with a


SCARA Robot, IEEE/ASME Trans. Machatronics, Vol. 3, no. 2, June 1998, pp.
91-7. USA.

[9] Y. C. Chi, M. L. Sang, W. L. Jin and H. L. Beom, Balancing of an Inverted


Pendulum with a Kinematically Redundant Robot, Proc. 1999 IEEE/RSJ Inter.
Confer. Intelligent Robots and Systems, pp. 191-196.

[10] A. Isidori, Nonlinear control systems, 2nd ed., Berlin: Springer-Verlag, 1989.

[11] K. J. Astrom, B. Wittenmark, Adaptive control, 2nd ed., Addison Welsey, 1995,
USA

[12] H. Kojima, et al., Swing-up Control of a Pendulum by a One-link Robot; Trajectory


Planning by Numerical Simulation and Experiment, Trans. Japan Soc. Mech. Eng.,
Ser. C, Vol. 57, no. 536, pp. 854-859, 1991.

[13] M. Nishida, et al., Control System of Nonlinear Process to Swing up and Stabilize
Inverted Pendulum, Trans. SICE, Vol. 31, no. 9, 1995.

[14] M. Green, David J. N. Limebeer, Linear Robust Control, Prentice-Hall, 1995, New
Jersey.

[15] C. L. Phillips, R. D. Harbor, Feedback Control systems, 4th ed. Upper saddle,
River, NJ: Prentice Hall, 2000.

[16] S. M. Shinners, Modern Control System Theory and Design, 2nd ed., New York:
John Wiley and Sons, 1998.

[17] G. A. Medrano-Cerda, Robust Computer Control of an Inverted Pendulum, IEEE


Control Systems Magazine, vol. 19, no. 3, June 1999, pp.58-67.

[18] K. J. Astrom, K. Furuta, Swinging up a Pendulum by Energy Control, Automatica,


vol. 36, no. 2, Feb. 2000, pp.287-95.
BIBLIOGRAPHY 66

[19] Dussy S, Ghaoui LE, Multiobjective bounded control of uncertain nonlinear sys-
tems: an inverted pendulum example, [book chapter] Control of uncertain systems
with bounded inputs. Berlin: Springer-Verlag, 1997, pp.55-73.

[20] Ohsumi A, Izumikawa T, Nonlinear control of swing-up ans stabilization of an


inverted pendulum, Proc. 34th IEEE confer. Decision and Control. IEEE. Part vol.
4, 1995, pp.3873-80 vol. 4. NewYork, NY, USA.

[21] Verde C, Ramos J, Barrera R, Experiments for analysis and design of robust con-
trollers: the inverted pendulum case, Proc. 13th World Congress, IFAC, Vol. G.
1997, pp.53-8. Oxford, UK.

[22] Eker J, Astrom KJ, A nonlinear observer for the inverted pendulum, Proc. 1996
IEEE Inter. Confer. Control Applications, etc., IEEE. 1996, pp.332-7, New York,
NY, USA.

[23] Tomizuka M, On the design of digital tracking controllers, Dynamic Systems Mea-
surement and Control-Trans. of ASME, vol. 115, no. 2B, June 1993, pp.412-18.
USA.

[24] Ho Seong Lee, Tomizuka M, Robust motion controller design for high- accuracy
positioning systems, IEEE Trans. Industrial Electronics, vol. 43, no. 1, Feb. 1996,
pp.48-55.

[25] Woo, Kam Tim, Intelligent Motion Compensation, Thesis ELEC 1996, Woo c.2,
HKUST.

[26] Cheung, Kai-Pong, Fuzzy and Conventional Control of Drum-boiler Systems, The-
sis ELEC 1998, CheungK c.2. HKUST.

Вам также может понравиться