Aukmaria,
Pergamoa
Vol. 32, No. 6, pp. 933-937, 19% Elswier Science Ltd Printed in Great Britain. All rights reserved ems-1098/% $15.00 + 0.00
Copyright0 19%
PII: sooo5-lo!M(%pooo6-4
Technical Communique
Linear Controller for an Inverted Pendulum Having Restricted Travel: A High-and-Low Gain Approach* ZONGLI LIN,t AL1 SABERI,$ MICHAEL GUTMANNS Key Words-High-and-low
and YACOV A. SHAMASH
gain feedback; inverted pendulum; singular perturbation.
system was derived follows:
Abstract-The problem of balancing an inverted pendulum has been a benchmark example in demonstrating and motivating various control design techniques. In this paper, we provide a linear state feedback design technique for balancing an inverted pendulum. The pivot of this pendulum is mounted on a carriage that has limited horizontal travel. For any given (arbitrarily small) allowable travel of the carriage, our design yields a linear state feedback controller that balances the pendulum with an infinite amount of gain margin in the sense that, if the feedback gain is perturbed by any multiplying factor greater than one, the controller will still balance the pendulum without requiring greater traveling distance than the maximum allowable. Copyright 0 1996 Elsevier Science Ltd.
in Kwakemaak
and Sivan (1972) as
MI = u - Fi,
(I)
Selecting the state variables xi = s, x2 = S, xs = s + L0 and xq = S + L8, the state-space representation of (1) is P, =x*, &=
-~X&l, M M
.t3 =x4,
I. Introduction and problem statement Balancing an inverted pendulum has been a benchmark example in demonstrating and motivating various control design techniques. For example, much of the material presented in Kwakernaak and Sivan (1972) was illustrated by an inverted pendulum with its pivot mounted on a carriage, which is in turn driven by a horizontal force (Fig. 1). Recently, this same example was again examined in Wei ef al. (1995), where the physical limitations impose a constraint on the maximum allowable motion of the carriage. As a result, nonlinear controllers were constructed that successfully balance the inverted pendulum under the maximum allowable motion constraint. The purpose of this paper is to provide robust linear controllers that balance the pendulum without violating the maximum allowable motion constraint. To facilitate our presentation, we denote the displacement of the carriage at time t by s(r) and the angular rotation of the pendulum at time t by 0(r). The pendulum consists of a weightless rod of length L with a mass m attached to its tip. The moment of inertia with respect to the center of gravity (the tip) is J. The carriage has a mass M. The friction coefficient between the carriage and the floor is F. The horizontal force exerted on the carriage at time t is u(f). We also assume that m is small with respect to M and that J is small with respect to mLZ. Under these assumptions, a nonlinear model for this inverted pendulum on a carriage
(2)
F I_,_
x3-x1
& = g sin --M
L
x2 >
Linearizing (2) at the origin of the state space yields i, =x*,
f,=
-‘;x,++., M M
(3)
fg =x4, g &=-x3--x,.
L
‘L
g
L
Assuming that the pendulum and the carriage are not in motion before the driving force is exerted, the initial conditions for the system (3) are then given by xi(O) = s(O), x*(O) = 0, x3(O) = s(0) + LB(O) and x4(O) = 0. The design objective is to stabilize the system by means of linear state feedback under the constraints that the carriage remains within a certain maximum allowable distance from the origin (s = 0). Moreover, the feedback controllers thus obtained should possess a certain degree of robustness. More specifically, our design objectives can be precisely stated as follows.
*Received 7 November 1994; revised 31 October 1995; revised 4 December 1995; received in final form 11 December 1995. This paper was not presented at any IFAC meeting. This paper was recommended for publication in revised form by Editor Peter Dorato. Corresponding author Zongli Lin. Tel. +l 516 632 9344; Fax +l 516 632-8490; E-mail
[email protected]. t Department of Applied Mathematics and Statistics, SUNY at Stony Brook, Stony Brook, NY 11794-3600, U.S.A. $ School of Electrical Engineering and Computer Sciences, Washington State University, Pullman, WA 99164-2752, U.S.A. 9 College of Engineering and Applied Science, SUNY at Stony Brook, Stony Brook, NY 11794-2200, U.S.A.
1. For any a priori given (arbitrarily small) numbers 7, and nr, find a linear state feedback law that stabilizes the system subject to the restriction that o~~,(r)~(l
+ Q,&(O)
+ Le(o)] + v2
if e(o)so,
S(O) + LB(o) 2 0, 0 s x,(t) 2 (1 + 7j,)[s(o) + Le(o)] - q2
if e(o) 5 0,
~(0) + LB(o) 5 0. (4) 933
Technical Communiques
934
Srep 2. With 2, as the new output, we rewrite the system (3) as
where 1
P, =x2 + -x, FO
and where
L + -u,> FOR
L + -tit,, g
~
Fig. 1. Inverted pendulum on a carriage. Step 3. Choose the linear state feedback law as
2. The closed-loop system has an infinite amount of gain margin in the sense that if the feedback gain is perturbed by any multiplying factor greater than one then the controller will still balance the pendulum without requiring greater traveling distance than the maximum allowable. We note that s(O) + LB(O) is a linearized approximation of the projection of the pendulum tip on the floor at time t = 0 and .r,(t) is the displacement of the carriage at time f. Hence (4) in the first design objective sets the maximum allowable travel for the carriage, which becomes the initial projection of the pendulum tip on the floor as both n, and nz approach zero. We also note that the gain margin in the second design objective is different from the traditional notion of stability gain margin in that here not only stability but also performance are maintained as the gain is increased. Our design algorithm utilizes both low gain state feedback and high gain state feedback. The mixture of low gain and high gain feedbacks has proved to be a powerful design technique (see e.g. Lin, 1994: Lin and Saberi, 1995).
M u = - -52. P
where p is a positive scalar whose value is to be chosen later. The following theorem shows that the linear feedback law as given by (6) indeed achieves our design objectives. Theorem 2.1. Consider the closed-loop system consisting of the system (3) and the linear state feedback law (6). Then there exists a CL*>O such that for each p E (0, k*], the closed-loop system is stable with (4) satisfied. This, in turn, also shows that the linear state feedback law (6) also possesses an infinite gain margin in the sense that, if the feedback gain is perturbed by a multiplying factor greater than one, the controller still stabilizes the system without requiring greater traveling distance than the maximum allowable. Proof. With the state feedback system can be written as
law (6). the closed-loop
2. Design algorithm: linear high-and-low gain approach In this section, we first present a design algorithm that leads to a linear high-and-low gain state feedback law. and then show that such a linear high-and-low gain state feedback law would indeed achieve our design objectives. The design algorithm is given in the following three steps. Step 1. Taking y =x, as the output. the system has two invariant zeros at {m, -m}, and has the following zero dynamics (the dynamics of (3) when the output y =x1 is set to zero by state feedback and appropriate choice of initial conditions):
&_Rx L
3
xx(O) = s(0) + LB(O),
By choosing
x.$(O) = 0.
Clearly, the closed-loop system is in the standard singular perturbation form with %z as the fast variable and the rest as the slow ones. Letting p = 0, we find Pz = 0 and hence the stable reduced system 1 f,,= --P,,, a,,(o)=r,(o), co
and renaming the output as L 5 =.f, =x, +--u,,. g
we place the poles of the zero dynamics at (-Ed,. -- flgz), where e, is a positive scalar satisfying c,,5mm
with initial conditions given by
1 1
13%= x‘h. .&,=
171
-, 2 2+3m’~L(2m+l)
%
x3.(0) =x40),
-c,,~x,,-(~+EI))X~~-~i,r, (9)
X&(O) =x4(0) = 0.
Technical Communiques From the first equation of the reduced system (9) we have a,,(t) = f,(O)e-““0
which, together with (11) shows that us(t)=
(10)
+ xqS= &xJ(0)eCQ’
- &fZ,(0)(e-C+
ec)[ &xs(O)e-‘0’
- $~X,(O)(e-““‘+ O(P)&
- e-r’eo). (11)
-(&+%)(&+.‘J
= - (&+
Viewing Xl, as an output signal to the dynamics of xX, and x4,, we solve the last two equations of the reduced system (9) and obtain &.r3S
935
e -I%)]
+ O(P)&(O) + %)x3(0).
(14)
Hence, from (13) and (14), we have x1(t)
Now standard singular perturbation arguments show that there exists a ~L:>O such that for each p E (0, rf], the closed-loop system is stable and
d
g -x3+x.$=
L
J:x3,+.%+O(P)fl(O) +
O(P)f,K9
I, = .z,, + o(P)a,(o) + O(cLM2(0)
+
W)X3W~
+
O(PL)X3&9r
+
(12)
(13)
(15)
O(P).
In the case that e(O) 2 0 and s(0) + LB(O) 2 0, we observe that n,(O) 5 0 and x3(O) 2 0. Hence, assuming that e(O)5 in,
0.3
-----_--______
0.25 0.2 0.15 0.1 L 0
5
10
5 b
-“.lo+o
d
Fig. 2. /.L= 0.2. Left column: linear model. Right column: nonlinear model. (a) x,(r); (b) x2(t); (c) x3(t); (d) x,(t).
936
Technical Communiques that e(O) 2 - &~r,it follows from (15) that
it follows from (15) and (8) that x,(~~~(l+E~(l+~~)+O(ll~][S(0)+Ir~(o~]
~r,(r)~~l+s,jl+~~)+o(~)]C(o~+Le(O~]
-XL 5
1 + 37, + O(P) [s(O) + Le(o)l+
$112+ O(p).
1
x,(r)>
-[LB(O)
+ &(s(O)
+ LB(O))]e
(16)
( J) 1 2
-+
;
eo+W)
z [l + 477,+ O(co][s(O) + L@(O)1- $112+ O(F).
(19)
x,(r) 5 -s(O)ee’()’ + O(P)).
(20)
“*(,
Again. it is clear that there exists a g: E (0, CL:]such that for all CLE (0. CL.:],
x [s(O)+ Le(o)l+
02x,(t)
O(F)
zs(O)e mt”’ + O(p). (17) Noting that x,(r) decays exponentially with a slowest term e-Q’, it is now clear that there exists a & E (0, PT] such that for all p E (0, CL:],
+ T&(O)
05X,(f)((l
+ Le(o)] +
72
(18)
2
(1
+
t)l)[@)
+
LWI
-
772,
which is the second equation of (4). Finally, taking p* = min {$, CL_:}, the proof is complete. 0 3. Simulations
To demonstrate our design algorithm, we take numerical values for the system parameters as
which is the first equation of (4). Similarly, in the case that e(O) 5 0 and s(O) + LB(O) 5 0, we observe that a,(O) 2 0 and x?(O) 5 0. Hence, assuming
b=lkgg,
;=
16~~‘,
L = 0.613 m.
0.3 0.25 0.2
5 b
5 b
0.17
0.17
0.16
0.16
0.15
0 15
0.14
0.14
0.13 r 0
5 c
10
5 d
10
0.13’
0
I
5 c
10
0.06 0.04 0.02 0 -0.02
b 0
(21)
-o.0201r------3 d
10
Fig. 3. p = 0.1. Left column: linear model. Right column: nonlinear model. (a) x,(r); (b) x,(t); (c) x,(t); (d) x4(r),
the
Technical Communiques
937
u = - 1(37.36x, + x2 - 37.56x3 - 9.39x4). CL
4. c0nc1usion.r We have presented a linear state feedback law that successfullv balances an inverted nendulum on a carriage that has limited travel. The design demonstrates the usef&ess of the technique of combining low gain and high gain state feedback.
We simulate the above control law with both the nonlinear model (2) and the linearized model (3). Extensive simulation shows that the feedback law designed on the basis of the linearized model works satisfactorily when applied to the original nonlinear model. In fact, simulation shows that the performance difference between the linearized model and the nonlinear model is almost unnoticeable. We believe that this is due to the two-timescale nature of our control law. Figures 2 and 3 are simulation results for the initial conditions s(O) = 0.1 and 6(O) = 0.1. In the figures, we have plotted only the first 10s of the state transients for better visualiiation of the early fast responses due to the high-gain action. Plots for a longer time period show the slow convergence due to the low-gain action. We also note that, with these initial conditions, (1 + q&(O) + M(O)] + q2 = 0.28.
References Kwakemaak, H. and Sivan, R. (1972). Linear Optimal Control Systems. Wiley, New York. Lin, Z. (1994). Global and semi-global control problems for linear systems subject to input saturation and minimumphase input-output linearixable systems. PhD dissertation, Washington State University. Lin, Z. and Saber& A. (1995). Robust semi-global stabilization of minimum-phase input-output lmearixable systems via partial state and output feedback. IEEE Trans. Autom. Control, AC-M,. 1029-1041. Wei, Q. F., Dayawansa, W. P. and Levine, W. S. (1995). Nonlinear controller for an inverted pendulum having restricted travel, Automatica, 31,841-850.
Let ~7,= 0.1 and n2 = 0.1 m, we choose sr, = 0.03. With these numerical values, the linear feedback law (6) is given by