You are on page 1of 22

190

Control and Stabilization of the Inverted Pendulum via Vertical Forces


D. Maravall Department of Artificial Intelligence Faculty of Computer Science, Universidad Politcnica de Madrid Campus de Montegancedo, 28660 Madrid, Spain dmaravall@fi.upm.es Abstract. In this chapter, we present a detailed analysis of the possibilities of controlling and stabilizing the inverted pendulum (IP) by means of a vertical force. First, we establish the dynamic equations of the IP under the action of a generic vertical force and then we analyze its control and stabilization. The main conclusion is that the vertical force has an excellent stabilization effect, although it requires a permanent fall of the IP support base when it is the only applied force. Therefore, we investigate the combination of the vertical force with the customary horizontal force, arriving at the stabilization conditions for different formal representations of the system: ordinary differential equations, state variable representation and Liapunovs direct and indirect methods.

1 Introduction
The inverted pendulum (IP) is a widely studied dynamic system, which has received considerable attention in many fields, such as physics, mechanics, applied mathematics, control theory, and the emergent computational techniques known as soft computing [1]-[3]. There are several reasons behind such interest, in particular the importance and ubiquity of the IP in many mechanisms, including robots. Furthermore, its intrinsic theoretical interest and the strong challenges posed by its stabilization and control have made the IP a sort of benchmark, in particular for the comparison of soft computing (artificial neural networks, fuzzy logic, genetic algorithms) and hard computing (ordinary differential equations, input-output control, state variable techniques, like optimal control or Liapunovs stability). Apart from being a benchmark in control engineering, the IP problem has always been a testbed for computational intelligence theories and models, as it embraces the customary sense-reason-action cycle, typical of intelligent systems [4] and [5]. Furthermore, controlling a pendulum in its unstable top position is not only an interesting physico-mathematical problem with a difficult engineering implementation, as it involves high nonlinearities and fast sensory information procT.-J. Tarn et al. (Eds.): Robotic Welding, Intelligence and Automation, LNCIS 299, pp. 190211, 2004. Springer-Verlag Berlin Heidelberg 2004

Control and Stabilization of the Inverted Pendulum

191 191

essing, but it also, and very importantly, poses a strong challenge to any intelligent artificial agent, as it demands the coordination of perception and action and, even, some degree of reasoning. Thus, it is no wonder that IP stabilization has been attempted by means of robotic manipulators and specialized sensors, [6]- [9]. The bibliography on IP is literally overwhelming. However, it is rather surprising that virtually all the technical literature refers to the planar pendulum with one degree of freedom. Only very recently have a few references dealing with the spherical pendulum with two degrees of freedom appeared [9]-[11]. Due to the complex control problems involved, [9] addresses the stabilization of the spherical IP by simultaneously controlling two uncoupled planar pendula (the respective projections on the two orthogonal planes of the intertial coordinate system). References [10] and [11] apply the method of controlled Lagrangians to get theoretical stability conditions for the spherical IP. In practice, the only control action used in the technical literature for IP stabilization is a horizontal force, which is almost universally materialized by means of an electrical cart, i.e., the popular cart-pole system shown in Figure 1.

Fig. 1. The customary cart-pole system.

Note, in Figure 1, that the pendulum is constrained to move within the XOY plane. As mentioned above, the control action is based on the horizontal displacements of the electrical cart. Exceptionally, some authors have considered an alternative control action consisting of an oscillatory vertical force applied to the pendulum pivot. The stabilizing effect of a fast vertical oscillation applied to the pendulum base is known from the early work of Stephenson in 1908 [12] . The Russian physicist Kapitsa was the first, in the fifties, to produce a rigorous demonstration of the stability conditions

192 192 D. Maravall of the IP when its suspension base oscillates at a high frequency [13] and, therefore, some authors use the expression Kapitsa pendulum to refer to this stabilization technique [14]. Another control alternative is based on the application of a rotational torque to the pendulum base, as proposed by Furuta and co-workers [15]. In fact, this arrangement leads to a different kind of planar IP, known as the rotational IP [16] or, simply, the Furuta pendulum [17]. With the exception of vibrational control i.e., based on oscillatory control signals- which is a well-known technique for controlling mechanical systems [18][20], including, as mentioned above, the IP [21]-[23], the only previous work, to our knowledge, that considers the application of vertical forces to stabilize the IP was recently performed by Wu et al. [24] and [25], who employ the IP as a basic element to analyze the postural stability and locomotion of multi-link bipeds. In particular, Wu et al. model the IP base point according to cartilage and ligament behavior in natural joints and they apply horizontal and vertical forces and, also, a rotational torque to the base pivot. Using a very simplified linear model, the resulting overactuated control system is designed by means of Liapunovs direct method to obtain a desired trajectory of the IPs center of gravity. In this chapter, we conduct a detailed analysis of the possibilities of controlling and stabilizing the IP by means of a vertical force. The chapter is organized as follows. First, we establish the dynamic equations of the IP under the action of a generic vertical force and then we analyze its control and stabilization. The main conclusion is that the vertical force has an excellent stabilization effect, although it requires a permanent fall of the IP support base when it is the only applied force, which is, obviously, an unfeasible control policy. Therefore, we investigate the combination of the vertical force with the customary horizontal force, arriving at the stabilization conditions for different formal representations of the system: ordinary differential equations, state variable representation and Liapunovs direct and indirect methods. In particular, we obtain the stability conditions of the IP for a PD control algorithm. An appendix discusses some experimental results, including notable improvements in IP stabilization achieved when combining the customary horizontal force with a vertical force.

2 Stabilization of the Inverted Pendulum with a Vertical Force


In Figure 2 we have substituted the customary electrical cart by a platform of mass M, on which the pendulum pivot is mounted. The pendulum has a total mass m and length 2l. Apart from the gravitational force, the only existing external force is purely vertical, Fy The dynamic equations of the system can be straightforwardly obtained by applying Lagranges equations

Control and Stabilization of the Inverted Pendulum

193 193

Fig. 2. Planar inverted pendulum supported by a platform subject to a pure vertical force Fy

d L L = F i; dt qi qi L=KP

i = 1,2

(1)

where L is the Lagrangian, K is the kinetic energy and P the potential energy of the system. Fi stands for the generalized applied forces and qi are the generalized coordinates, which in this case are y and , respectively. As mentioned above, the only existing force is F1 = Fy. The kinetic energy is

K = 1 m ( xp2 + y p2 ) + 1 I 2 + 1 M y2 2 2 2

(2)

where I is the inertia of the pendulum, which we will assume to be negligible from now on. The coordinates of the pendulums center of mass are

x p = l sin ; y p = y + l cos

(3)

where y is the vertical coordinate of the platforms center of gravity, which we assume to coincide with the pendulum hinge. As a consequence, we can also assume that the pendulum mass is virtually concentrated at its top. The potential energy is

P = M g y + m g y p = ( M + m) g y + m g l cos
After some operation, the Lagrangian turns out to be

(4)

L = 1 m l 2 2 + 1 ( M + m ) y 2 m l sin y ( M + m) g y m g l cos 2 2

(5)

194 194 D. Maravall By substituting into the Lagranges equations, we finally get the equations of the system dynamics

( M + m) y m l sin m l cos 2 = Fy ( M + m) g
m l sin y + m l m g l sin = 0
2

(6)

which can be expressed in the standard compact form

M (q) q + C (q,q ) q + G (q ) =

(7)

where M(q) is the symmetric, definite positive inertia matrix, C(q,q) is the Coriolis/centripetal matrix and G(q) is the gravity vector

(M + m) m l sin M (q ) = m l2 m l sin 0 m l cos (M + m) g C (q,q) = ; G (q ) = 0 m g l sin 0 F = y 0 y q= ;

(8)

It is interesting to compare these equations with the equations for the usual case in which a pure horizontal force, Fx , is applied, as illustrated in Figure 1

( M + m) x + m l cos m l sin 2 = Fx
m l cos x + m l 2 m g l sin = 0

(9)

In spite of the apparent similarity of formulae (6) and (9), the stabilization of the IP in each case is totally different, as shown in the sequel. As a first step in the analysis of this nonlinear system, let us focus on the situation of practical interest, namely, small IP movements around the unstable openloop position = 0, where we can introduce the following approximations
sin

cos 1 2 / 2

(10)

which, substituted into the Lagrangian function (4), yields

Control and Stabilization of the Inverted Pendulum

195 195 (11)

L = 1 m l 2 2 + 1 ( M + m ) y 2 m l y ( M + m) g y m g l (1 2 /2) 2 2
Then, from the Lagranges equations, we get the equation of small movements

( M + m) y m l m l cos 2 = Fy ( M + m) g
y + l g = 0
Similarly, for the horizontal force, we get

(12)

( M + m) x + m l

= Fx

(13)

x+l g = 0
Unlike the dynamic equations of the horizontal case, which are totally linear, the equations of the small IP movements are still nonlinear in the vertical case, making the stability analysis and the control comparatively more difficult. By solving the simultaneous differential equations of the horizontal force in , we get

F M +mg = x Ml

Ml

(14)

The respective characteristic equation yields hyperbolic sines and cosines and, therefore, the pendulum dynamics is unstable. However, the horizontal closed-loop dynamics can be straightforwardly stabilized [26] by introducing a feedback control law, such as a conventional PD algorithm

Fx = k p + k d

(15)

Unfortunately, this is not the case for the vertical force, as we then have an autonomous, unforced pendulum dynamics

l ( g + y) = 0

(16)

unless we consider vertical acceleration as an external control action. Specifically, we observe that this equation is unstable if the following condition holds

196 196 D. Maravall

(g + y ) > 0

(17)

as unbounded hyperbolic solutions are obtained in . On the contrary, if (g+) < 0, then stable oscillating solutions are obtained, as the characteristic equation has the following roots
r2 + g+y = 0 r1,2 = j l g+ y l

(18)

so that

(t) = A cos [(t) t + ]

(19)

where the angular frequency (t) is time dependent, due to the variable vertical force. Therefore, when the stable oscillatory condition ( g + ) < 0 holds, the pendulum oscillates with a constant amplitude and a slowly varying frequency given by

A = 2 (0) +

2 (0) 2 (0)

f (t ) = 1 2

The greater the vertical acceleration, the higher the frequency of oscillation. As for the oscillation amplitude, given the usual condition (0) / (0) << (0) , it is virtually equal to the initial deviation (0). As a first conclusion regarding the pure vertical force, we can guarantee a stable oscillating behavior of the IP, if and only if the applied vertical force, Fy, produces a negative vertical acceleration such that y < g . As the stability of the IP depends on the vertical acceleration, we must proceed with the analysis of the vertical dynamics, which for small deviation angles of the IP turns out to be

( M + m) y m l

By substituting the vertical acceleration given by (21) into the pendulum dynamics, one obtains

= tan 1
g+y l

(0) (0) (0)

(20)

= Fy ( M + m ) g

(21)

Control and Stabilization of the Inverted Pendulum

197 197 (22)

( M + m )l

Fy

m = 0 M +m

Then, the vertical force that guarantees oscillatory stability of the IP is

Fy < m l

(23)

Assuming that the deviation angle has been stabilized by a vertical force satisfying condition (23), then and its second derivative are sinusoids of opposite sign, so that the upper limit of the stabilizing vertical force is always positive

Fy < m l

(24)

Now, let us suppose, conservatively, that Fy = 0, i.e., the platform-pendulum pair is left in free-fall. In this case, the stability condition holds

( g + y) =

ml <0 M +m

(25)

and the respective small oscillations of will be of very low frequency

f (t) = 1 2
with an amplitude given by (20).

M +m

(26)

Summarizing, the IP can be stabilized by means of the free-fall of the platformpendulum pair, which is obviously an impractical control strategy. For such reason, we need to investigate whether it is possible, at some point after the stabilization of the IP, to stop the platform falling and, even, to raise it to its original position. More specifically, let us introduce a positive vertical force, Fy = (M + m) g, just to balance the force of gravity, in which case the platform stops falling. Thus, the dynamics of the vertical force is now

y=

ml M +m

(27)

which, substituted into the pendulum dynamics given by (16), yields the following condition for maintaining the small oscillations of around the vertical position

ml >g M +m

(28)

198 198 D. Maravall Condition (28) is obviously violated for realistic values of the parameters M, m and l and provided that we are, precisely, hypothesizing small values of the pendulums deviation angle and its successive derivatives,. Consequently, the platformpendulum pair would have to remain in free-fall in order to maintain the stable initial oscillations. Our preceding discussion of the IP stability conditions has been based on rather qualitative reasoning. So, let us now take a more rigorous approach by analyzing the Mathieu equation that determines the pendulum dynamics see expression (16)-. Thus, once the inverted pendulum has been stabilized by applying a negative vertical force, the deviation angle of the pendulum and its two first derivatives are

(t ) = A cos( t + ) ; (t) = A sin( t + )

(29)

(t) = A cos( t + )
2

which, substituted into the vertical dynamics, yields the vertical acceleration

y=

m l 2 A2 sin 2 ( t + ) cos2 ( t + ) + Fy g M +m M +m

(30)

whence the pendulum dynamics turns out to be

y 2 2 m + ( M + m ) l + M + m A cos2( t + ) = 0
which is, as mentioned above, the well-known Mathieu equation x + ( + cos( t ) ) x = 0

(31)

(32)

The Mathieu equation, in particular its stability conditions, has been extensively analyzed [1] and [27]. The analytical stability conditions of the Mathieu equation confirm the conclusions that we drew from our qualitative discussion, namely, that the IP stabilization with a vertical force i.e., Fy > 0 and < 0 is impossible, as virtually all the corresponding negative half-plane encompasses instability regions of the Mathieu equation. Another interesting result derived from the analytical study of equation (32), not directly observed in the qualitative discussion, is that, even for negative vertical forces i.e., Fy < 0 and > 0 -, there are instability regions that depend on the physical parameters Fy, M, m, l, (t) and (0) that must be carefully analyzed. Given the complex interactions of these parameters and their influence on the instability regions, the most advisable design strategy is to choose as high as possible a and, afterwards, check an that does not drive the system to an instability region.

Control and Stabilization of the Inverted Pendulum

199 199

As a general conclusion, the application of a single, sustained vertical force to stabilize and control the IP is unfeasible, although its excellent and, in particular, its fast stabilization effect makes the combination of the vertical force with the customary horizontal force looks very attractive. Therefore, our next and central topic is the stabilization of the IP via the combination of the vertical force with the customary horizontal force.

3 Combination of Horizontal and Vertical Forces


After having investigated the stabilization of the IP by means of a vertical force, we are now going to explore its combination with the usual horizontal force. The mechanism for implementing the vertical force, Fy, is a platform of mass m, mounted on the customary electrical cart, which, as usual, produces the horizontal force, Fx. The total kinetic energy of the cart-platform-pendulum ensemble is

K = 1 M x 2 + 1 m( x 2 + y 2 ) + 1 m ( x p 2 + y p 2 ) 2 2 2
and the potential energy

(33)

P = m g y + m g y p
By applying Lagranges equations

(34)

q1 = x, F1 = Fx ; q2 = y , F2 = Fy ; q3 = , F3 = 0
we get the global system dynamics

d L L = Fi dt qi qi

(35)

( M + m + m ) x + m l cos m l sin 2 = Fx ( m + m) y m l sin m l cos 2 = Fy ( m + m) g


cos x sin y + l g sin = 0

(36)

To analyze this highly nonlinear system, let us first make the following qualitative remarks.

200 200 D. Maravall 1. From the study of the pure vertical force case, we know that the only exogenous control action is vertical acceleration, which leads to the unfeasible stabilization strategy of maintaining the platform in free-fall. 2. On the contrary, the pure horizontal force can be used as a feedback control action that straightforwardly stabilizes the IP. 3. Due to the equivalence of the joint (x, ) dynamics of the combined case given by (36) and the pure horizontal case, equation (9), we can, in principle, exploit the feedback stabilization capacity of force Fx by focusing on the joint (x, ) dynamics of the horizontal plus the vertical case and considering vertical acceleration as an external control action. Thus, let us rewrite the joint (x, ) dynamics of the combined case

( M + m + m ) x + m l cos m l sin 2 = Fx
cos x + l ( g + y ) sin = 0

(37)

which is equivalent to the pure horizontal case see equations (9)-, except that the gravity dynamics is perturbed by the term sin . Remember that this perturbation is generated by the vertical dynamics, given by the second equation of (36). Thus, by considering vertical acceleration as an exogenous element in the pendulum dynamics, the combined forces case turns out to have the same formal structure as the horizontal force case. Therefore, we can tackle the combined case as an ordinary differential equation (ODE) problem and stabilize the IP via the horizontal force Fx using any standard control law, as in [26]. Alternatively, we can also approach the control problem with the state variable representation and stabilize the IP with a plethora of available techniques, including Liapunovs direct and indirect methods. Let us begin our study with the ODE approach, which conveys a very intuitive and direct physical interpretation.
3.1 Ordinary Differential Equations Analysis

As usual, we are interested in the neighborhood of the IP vertical position, so that we linearize the system dynamics (38) by approximating sin , cos 1 2 / 2 , 2 0 . After solving the ODE system in , we get

M + m + m ( g + y ) =

( M + m ) l

Fx ( M + m ) l

which is virtually equivalent to the pure horizontal case

F M +m g = x Ml

Ml

(38)

(39)

Control and Stabilization of the Inverted Pendulum

201 201

Thus, let us apply a PD control law of the error variable

Fx = k p e kd e = k p + kd
Which, substituted into (38), yields

(40)

kd k + p M + m + m ( g + y ) = 0 M l Ml Ml

(41)

Again, it is equivalent to the close-loop horizontal force case, whose ODE [26] is

k kd + p M + m g = 0 M l Ml Ml

(42)

the only remarkable effect of the vertical acceleration being on the root locus of the combined forces case. As is well-known, both coefficients must be positive to guarantee stability of (41)

kd > 0 kd > 0 Ml

k p > ( M + m + m ( g + y ) )

(43)

The first condition has a straightforward interpretation; namely, it implies that the feedback control force, Fx, must have a component directly proportional to the pendulum angular speed . To illustrate this fact, the four possible states of the IP have been represented in Figure 5. Note that in cases (b) and (c) the pendulum is returning to its vertical position, while in cases (a) and (d) it is moving away from it. In all cases, the orientation of the corresponding control force has been indicated.

(a)

(b)

(c)

(d)

Fig. 3. The four possible IP states. Observe the orientation of the respective feedback force.

The second stabilization condition in (43) is even more intuitive, as the feedback force must always have the same orientation as the IPs angular displacement.

202 202 D. Maravall Furthermore, the gain kp should guarantee the positiveness of the respective coefficient. Note that when the platform is falling, the vertical acceleration strengthens IP stabilization. Inversely, when the platform is ascending to recover its original position, the respective positive vertical acceleration detracts from IP stabilization. Therefore, the vertical force component i.e., the generation of vertical acceleration- must be carefully designed to tackle with this double-sided effect. Roughly speaking, when the pendulum is moving away from the vertical position, the vertical force should be immediately activated to produce a strong negative vertical acceleration . Inversely, with the pendulum recovering its vertical position, we can make Fy > 0 to bring the platform towards its original position. In short, the vertical displacement of the platform must be synchronized with the IP movements. This general control strategy can be succintly formalized as follows

If [sgn( ) = sgn( ) ] then Fy < 0 y < 0 else Fy > 0 y > 0

(44)

Apart from controlling the IPs deviation angle, which is obviously the main goal, it is also of interest to minimize the platform displacement, which must be constrained to some specific range. To this end, let us distinguish the following three states of the cart-platform-pendulum ensemble. 1. The IP is moving away from the vertical position i.e., sgn ( ) = sgn ( ) . 2. The IP is returning to the vertical position i.e., sgn ( ) sgn ( ) - but is still far from it. 3. As in state 2, but near the vertical position. Note the fuzzy linguistic qualifiers introduced to make a further distinction in the basic IP state returning to the vertical position. Accordingly, we introduce the following control action for each IP state. 1. The pendulum is leaving the vertical position

Fy ( t ) = k p ( t ) + kd ( t )
2. The pendulum is returning to and is far from the vertical position

(45)

Fy ( t ) = p k p ( t ) + kd ( t ) (1 p ) k py y( t ) + kdy y ( t )

(46)

where 0 < p < 1 weights the importance of the two control objectives: the IP deviation angle, , and the platform movement, y. Note that the latter action is aimed at minimizing the vertical displacement.

Control and Stabilization of the Inverted Pendulum

203 203

3. The pendulum is returning to and is near to the vertical position

Fy ( t ) = k py y ( t ) + kdy y ( t )

(47)

We must remember that in our preceding discussion the vertical acceleration of the platform-pendulum couple is given by

( m + m ) y m l sin m l cos 2 = Fy ( m + m ) g

(48)

so that the high nonlinearity of the vertical dynamics must be taken into account in the tuning of the control parameters appearing in formulae (45)-(47). Summarizing the basic philosophy of our combined forces control, the dynamics of the IP is directly controlled by the customary horizontal force, plus the indirect action of a vertical acceleration, , which, in turn, is controlled by the vertical force given by formulae (45)-(47). Continuing with our qualitative and general discussion of the combined forces control, we are now going to proceed with the stabilization of the IP under the state variable representation.

3.2 State Variable Representation

Although basically similar to the ODE analyis, the state variable representation can be used to extend the possibilities of IP stabilization. In particular, as shown in the sequel, we shall refine the stability conditions by means of Liapunovs direct method. Following our proposed stabilization strategy, which basically involves controlling the joint (x, ) dynamics by means of the customary horizontal force and, simultaneously, by the vertical acceleration of the platform, let us introduce the following variables change in the pendulum dynamics given by (41)

x1 = , x2 =
to get the state variable representation. Thus, after some operation, we obtain

(49)

x1 = x2

(50)

204 204 D. Maravall

x2 = =

2 ( M + m + m ) ( g + y ) sin x1 m l sin x1 cos x1 x2 Fx cos x1 ( M + m ) l + m l sin 2 x1

which is of the more compact form

x1 = f1 ( x1 , x2 )

x2 = f 2 ( x1 , x2 )

(51)

Liapunovs indirect method, also known as the first method, approximates the nonlinear dynamics by the first, linear terms of the Taylor development around a certain equilibrium point ( x1eq , x2eq )

x1 x2
In vector form

f1 (x1 x1eq ) + f1 x1 eq x2 f 2 x1

(x
eq eq

x2 eq ) x2 eq )

(52)

(x
eq

x1eq ) +

f 2 x 2

(x

x J eq ( x xeq )

(53)

where Jeq is the systems Jacobian particularized into the equilibrium point of interest, in our case, ( x1, x2 ) = ( , ) = ( 0,0 ) . After some operation, we get for this equilibrium point

1 J eq = ( M + m + m ) Fx / x1 ( M + m) l

Fx 1 ( M + m) l x2

(54)

The characteristic equation, det ( I J eq ) = 0 , yields

Fx 1 1 ( M + m + m ) ( g + y ) Fx + =0 x1 ( M + m) l ( M + m) l x2

(55)

To guarantee stability, both coefficients must be positive

Fx Fx > 0 Fx = kd ; kd > 0 x2

(56)

Control and Stabilization of the Inverted Pendulum

205 205

which coincides with the respective ODE stability condition (43). Additionally,
Fx Fx > ( M + m + m ) ( g + y ) x1

(57)

also coinciding with the second ODEs stability constraint, provided that we apply a PD control law such that F = k p + kd . Both the linearized ODE and Liapunovs indirect method only guarantee the local stability of the system. Liapunovs direct method, also known as the second method, is stronger as it provides the global stability conditions. Thus, as for any mechanical system, let us try a Liapunov function based on the total energy of the system

1 1 2 V (x1 , x2 ) = 2 + (1 cos ) = x2 + (1 cos x1 ) 2 2

(58)

which is definite positive for < < , that determines a region beyond the practical interest of IP stabilization. Its first derivative is

V ( x1, x2 ) = x2 x2 + sin x1 x1 = x1 ( x2 + sin x1 ) = ( + sin )

(59)

In order to get the global stability of the equilibrium point of interest ( x1, x2 ) = ( , ) = ( 0,0 ) , we must guarantee that V ( x1 , x2 ) is definite negative in a region comprising the equilibrium point, so that

If ( < 0 ) then + sin > 0 else + sin < 0 / < < ; 0


Thus, solving in the global nonlinear system given by (37) yields

(60)

( M + m) l + m l sin 2 ( M + m + m ) ( g + y ) sin m l sin cos 2 Fx cos

(61)

which substituted into (59) gives

206 206 D. Maravall

V ( x1, x2 ) =

+( M + m) l + m l sin 2 m l cos 2 ] sin }


Note that in step (61) we have, again, made use of the control strategy based on considering the vertical acceleration as an exogenous variable in the pendulum dynamics, which is the most feasible procedure for controlling the system when simultaneously applying horizontal and vertical forces. From (62), we propose the control law

( M + m) l + m l sin 2

{Fx cos [( M + m + m ) ( g + y )

(62)

Fx = [( M + m + m ) ( g + y ) + ( M + m ) l + m l sin 2 m l cos 2 tg + kd

(63)

that with k d > 0 completely guarantees the definite negativeness of the first derivative of the Liapunov function for < <

V ( x1, x2 ) =

kd 2 ( M + m) l + m l sin 2

(64)

Note that the control law (63) can be expressed for the values of interest of the variable as a conventional PD control law

Fx = k p tg + kd k p + kd

(65)

In fact, the control law (63) is a refinement of the stability conditions that we obtained in the ODE analysis and with Liapunovs indirect method see expressions (43) and (56)-(57), respectively-. Thus, by applying Liapunovs direct method, we have arrived at a more precise and refined control law that guarantees the global IP stability. Consequently, the first step in the actual stabilization of the IP is to design a quantitative control law by introducing specific performance indices such as rise time, settling time, percent overshoot, bandwith etc. Afterwards, the global stability of the IP is guaranteed by additionally constraining the designed control law to satisfy the condition given by (63).

Control and Stabilization of the Inverted Pendulum

207 207

4 Concluding Remarks
Although the use of high-frequency oscillating vertical forces for IP stabilization is a well-known technique, the application of generic vertical forces to stabilize the IP has not been, theoretically and practically, fully developed to date. In this chapter, the novel idea of controlling and stabilizing the IP via vertical forces has been introduced and thoroughly analyzed. After having established the dynamic equations of the IP with a generic vertical force applied to its base, we studied IP control and stabilization. The final conclusion is that the vertical force has an excellent and fast stabilization effect, although at the cost of maintaining the IP in free-fall. After this preliminary analysis, the chapter approaches its main contribution, namely, the combination of the customary horizontal force with the vertical force. Roughly speaking, the horizontal force permits a direct stabilization of IP by means of a feedback control action, while the vertical force significantly improves IP stabilization, mainly due to its fast response to external perturbations of the IP equilibrium state. The theoretical analysis of the combined forces has been developed for both the ODE and the variable state representations. In particular, the necessary and sufficient conditions of the local stability of the IP controlled by a PD algorithm have been obtained. Furthermore, by applying Lyapunovs direct method, the control law, which turns out to be a PD-like feedback action that guarantees the global stability of the IP, has also been obtained. As a general concluding remark, the chapter has demonstrated the excellent properties of the vertical force as regards the stabilization of the inverted pendulum.

Acknowledgments
The idea of stabilizing the inverted pendulum via a vertical force originated from endless discussions with my father, Prof. Dario Maravall-Casesnoves of the Royal Academy of Sciences, Madrid. The control law defined by expressions (46) and (47) was proposed by Javier Alonso-Ruiz. Special thanks are due to Prof. C. Zhou of the Singapore Polytechnic for very fruitful discussions and insightful comments and for his invitation to write this chapter.

References
1. 2. Khalil HK (1996) Nonlinear systems. Second edition. Prentice-Hall, Upper Saddle River, NJ Nelson J, Kraft LG (1994) Real-time control of an inverted pendulum system using complementary neural network and optimal techniques. Proc. American Control Conference, 2553-2554

208 208 D. Maravall 3. 4. 5. Zhou C, Ruan D (2002) Fuzzy control rules extraction from perception-based information using computing with words. Information Sciences 142: 275-290 Ghosh BK, Xi N, Tarn TJ (1999) Control in robotics and automation: sensorbased integration. Academic Press, San Diego, CA Maravall D, de Lope J (2002) A reinforcement learning method for dynamic obstacle avoidance in robotic mechanisms. In: Ruan D, Dhondt P, Kerre EE (eds) Computational intelligent systems for applied research. World Scientific, Singapore, 485-494 Schaal S (1997) Learning from demonstration. In: Mozer MC, Jordan M, Petsche T (eds) Advances in neural information processing systems 9. MIT Press, Cambridge, MA, 1040-1046 Sprenger B, Kucera L, Mourad S (1998) Balancing of an inverted pendulum with a SCARA robot. IEEE/ASME Trans. Mechatronics 3 (2): 91-97 Schreiber G, Ott C, Hirzinger G (2001) Interactive redundant robotics: control of the inverted pendulum with nullspace motion. Proc. IROS 2001, 158-164 Chung CY (2002) Balancing of an inverted pendulum with a kinematically redundant robot. Int. J General Systems 31 (1): 1-15 Bloch AM, Leonard NE, Marsden JE (2000) Controlled Lagrangians and the stabilization of mechanical systems I: the first matching theorem. IEEE Trans. Automatic Control 45 (12): 2253-2270 Bloch AM, Chang DE, Leonard NE, Marsden JE (2000) Controlled Lagrangians and the stabilization of mechanical systems II: potential shaping. IEEE Trans. Automatic Control 46 (10): 1556-1570 Stephenson A (1908) On induced stability. Philosophical Magazine 15: 233236 Kapitsa PL (1951) Dynamic stability of a pendulum with a vibrating point of suspension. Zh. Ehksp. Teor. Fiz. 21 (5): 588-598 Fliess M, Levine J, Martin P (1995) Flatness and defect of non-linear systems: introductory theory and examples. Int. J Control 61 (6): 1327-1361 Furuta K, Yamamoto M, Kobayashi S (1992) Swing-up control of inverted pendulum using pseudo-state feedback. J Systems Control Eng. 206 (6): 263269 Widjaja M, Yurkovich S (1995) Intelligent control for swing up and balancing of an inverted pendulum system. Proc. IEEE Conf. Control Applications, 534542 Fantoni I, Lozano R (2001) Non-linear control for underactuated mechanical systems. Springer, Berlin Meerkov S (1980) Principle of vibrational control: theory and applications. IEEE Trans. Automatic Control 25: 755-762 Bogaevski V, Povzner A (1991) Algebraic methods in nonlinear perturbation theory. Springer-Verlag, New York Hillsley KL, Yurkovich S (1993) Vibration control of a two link flexible robot arm. Dynamics and Control 3 (3): 261-280 Acheson D (1993) A pendulum theorem. Proc. Royal Society of London, series A 443: 239-245

6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21.

Control and Stabilization of the Inverted Pendulum

209 209

22. Baillieul J, Lehman B (1996) Open-loop control using oscillatory inputs. In: Levine WS (ed) The control Handbook. CRC Press & IEEE Press, Boca Raton, FL, 967-980 23. Dimeo RM, Thomopoulos SCA (1994) Novel control of an inverted pendulum. Proc. American Control Conference, 2185-2189 24. Wu Q, Thornton-Trump AB, Sepehri N (1998) Lyapunov stability control of constrained inverted pendulums with general base point motion. Int. J Nonlinear Mechanics 33: 801-818 25. Wu Q (1999) Lyapunovs stability of constrained inverted pendulums. Proc. American Control Conference, 293-297 26. Raya A, Maravall D (2001) Contribution to the control and stabilization of the pole-cart system. In: Moreno-Diaz R, Buchberger B, Freire JL (eds) Computer aided ystems theory. LNCS 2178, Springer, Berlin, 437-449 27. Jose JV, Saletan EJ (1998) Classical dynamics: a contemporary approach. Cambridge University Press, Cambridge

Appendix. Experimental Results


J. Alonso-Ruiz and D. Maravall Department of Artificial Intelligence, Faculty of Computer Science Universidad Politcnica de Madrid, Madrid 28660 SPAIN We briefly present some of the experimental results obtained from computer simulations, in which IP stabilization via the combination of horizontal and vertical forces is investigated and compared with a single horizontal force. We have considered the values of the system parameters to be as follows: cart mass, 2 kg; platform mass, 0.2 kg; pendulum mass and length, 0.1 kg and 0.5 m, respectively. Unless otherwise indicated, distances are in meters (m), time in seconds (s), forces in newtons (N) and angular displacements in radians in all figures. In all the reported examples the respective PD algorithm gains have been obtained to optimize the usual performance indices: rise time, overshoot peak and settling time, either for the combined horizontal and vertical forces or for the single horizontal force. Furthermore, for the combined case, the stability conditions obtained in the theoretical analysis see expressions (43), (56), (57) and (63)- have been applied. Figure 4 shows the IP trajectories for initial deviations from 5 to 30 in 5 steps.

210 210 D. Maravall

(a)

(b)

Fig. 4. Instances of IP stabilization with (a) a combination of horizontal and vertical forces and with (b) a single horizontal force.

Note the significant improvement achieved by the addition of the vertical force, which makes the IP stabilize much faster. In particular, the greater the IP initial deviation, the stronger the positive effect of the vertical component. It is also interesting to compare the control efforts, so the respective horizontal forces profiles are depicted in Figure 5. Note the + 20 N restriction over the range of the applied forces. The same initial deviations as in Figure 4 have been considered.

(a)

(b)

Fig. 5. Profiles of the horizontal forces of (a) the combined case and (b) the single horizontal case. The greater the initial deviation, the stronger the applied force.

Note that the reductions in the control effort achieved with the combination of horizontal and vertical forces are significant. Of course, in these cases there is an additional control effort produced by the vertical force, although its respective energy cost is comparatively negligible, because the platform mass is small in comparison to the cart mass. Figure 6 shows the vertical forces profiles and the respective vertical displacements of the platform.

Control and Stabilization of the Inverted Pendulum

211 211

Fig. 6. Vertical forces profiles and platform vertical displacements for the same range of initial deviations as above.