A Flatness-Based Controller for the Stabilization of the Inverted Pendulum

We propose a flatness based approach for controlling the inverted pendulum cart system, under the assumption that the pendulum state is always located on a vicinity of its unstable equilibrium point. This is achieved by representing the original system, as a chain of integrators with an additive nonlinear state dependent perturbation. After discarding the small nonlinear perturbation, we may directly use design tools provided by the the flatness approach. The effectiveness and robustness of the obtained control law, which turned out to have a large domain of attraction, were numerically assessed in the context of stabilization and, also, for a reference oscillatory trajectory tracking task.


Introduction
The inverted pendulum on a cart IPC is a mechanical device that consists of a free vertical rotating pendulum with its pivot point mounted on a cart moved by a horizontal input force.This device has been widely used as a challenging benchmark to test the performance of advanced control strategies see 1, 2 and references therein .Since the pendulum angular acceleration cannot be controlled, the IPC is an example of an under-actuated system with two degrees of freedom.Under-actuated systems have been widely used in robotics, especially for developing suitable control strategies for a kind of robots known as the "acrobot" or the balancing mobile manipulator.The dynamics of the IPC device resembles that of the acrobot.Contrary to customary factory robots that are attached to the ground, these robots must move in unstructured environments.Consequently, these manipulators must accomplish a sustained vertical stability in a wide range of circumstances, which is by no means an easy task.It is well-known that many control techniques developed for fully-actuated systems cannot be used directly to stabilize the IPC device.For instance, the IPC is not input-output linearizable by means of static state feedback 3 .Also, the system controllability and other geometric properties are lost while the pendulum moves through the horizontal plane 4, 5 .On the other hand, the IPC is locally controllable around the unstable equilibrium point; so that it can be stabilized by means of a direct pole placement procedure 6 .
In general, stabilizing an IPC presents two important difficulties.The first one deals with swinging up the pendulum from the hanging position to the upright vertical position.To overcome this problem, the pendulum is brought to a homoclinic orbit; then, once the system is close enough to the desired upright position, with a conveniently slow velocity, a simple change from a nonlinear to a linear controller, allows one to indefinitely keep the pendulum at the unstable position see 7-14 .The second difficulty consists in stabilizing the IPC around its unstable equilibrium point, assuming that the pendulum is initially above the horizontal plane, or lies inside an open vicinity of zero, which defines the stability domain for the closed-loop system.This problem has been treated before in the literature.In 15 , a nonlinear controller, based on the back-stepping procedure, is used to solve the stabilization problem around the unstable equilibrium point.The authors build an interconnected system by applying some nonlinear transformations, and then, by a recursively back-stepping, they derive a stabilizing controller that forces the angular position to converge toward the unstable position, while the position of the cart also tends to zero.In 16 a nonlinear controller forcing the angular position of the pendulum to zero is presented.However, this procedure does not guarantee convergence of the cart position to zero.This controller is based on nested saturation functions.In 7 a stabilization technique is proposed using a combination of switching and saturation functions, in addition to a stability enforcement via the Lyapunov method.The resulting closed-loop system possesses a quite large region of attraction for almost all initial conditions .In 17 , the authors present a control strategy based on the method of the controlled Lagrangian, in conjunction with some symmetry properties satisfied by the IPC.This strategy also ensures asymptotic stability of the origin for a rather large domain of attraction.A similar work, with similar tools, was presented in 18 .In 19 a semiglobal stabilization for the IPC is proposed by means of a fixed point controller.This controller is introduced assuming that the pendulum is initialized above the upper half plane.This technique consists of first putting the system in a cascade form.Fixed point equations for the control force are then obtained by applying the back-stepping procedure to develop a global control strategy allowing the stabilization of the pendulum around the upper position.The proposed scheme is based on the use of saturation functions.The resulting closed-loop system is asymptotically stable without switching to a stabilizing local controller.A similar work, using nested saturation function approach, is presented in 20 .In that work, the authors first write an approximate model of the IPC model as a chain of integrators, by using a convenient transformation.Then, they apply a nested saturation control technique to stabilize it.
Based on the approximate flatness property of the IPC system 21 , we introduce a linear control law, in transformed coordinates, for approximately solving both the stabilization and the reference trajectory tracking problems, under the assumption that the pendulum is located inside a vicinity around its unstable equilibrium point.To this end, we first rewrite the original IPC model as if it were an integrator chain affected by a nonlinear perturbation.Then, using a reasonable approximation, we were able to use the tools provided by the flatness property to control the nonlinear system.The obtained control strategy turns out to have a larger domain of attraction than the one we obtained analytically.To test the effectiveness of our control strategy, some controlled maneuver tasks were performed via digital computer simulations.
The rest of this paper is organized as follows.In Section 2, we introduce the IPC model and through suitable state coordinate transformations we express the system as a perturbed chain of integrators.Section 3 is devoted to design the flatness based locally stabilizing controller for the IPC.In this section we present the estimation of the domain of attraction of the closed-loop system.Numerical simulations are included assessing the effectiveness of the proposed control strategy.Finally, the conclusions are presented in Section 4.

The Inverted Pendulum Cart System
Consider the inverted pendulum mounted on a cart.This system is described by the set of normalized differential equations see, e.g., Síra-Ramirez and Agrawal 6 θ 1 where q is the normalized horizontal displacement of the cart, θ is the angular position of the pendulum with respect to the vertical, u is the horizontal normalized force applied to the cart, and δ > 0 is a constant depending directly on the cart and the pendulum masses.Note that, for u 0, and θ ∈ −π/2, π/2 , the above system exhibits one unstable equilibrium point, defined by θ 0, θ 0, q q, q 0 , with q being a constant.

Motivation
Since the IPC system is nonfeeback linearizable by means of static state feedback see 3 , nor linearizable via dynamic state feedback, it is difficult to impose some controlled manoeuvres, like the tracking of an arbitrary reference trajectory.On the other hand, the linearized tangent model, around the unstable equilibrium point of 2.1 , is indeed controllable 4 , but with the inconvenience of having the nonlinear closed-loop system exhibit a small basin of attraction.
To overcome this problem, we provide an approximate solution by considering of a nearly linear version of the original IPC system in conjunction with the use of the flatness approach.We tested the control performance in both the regulation and the reference trajectory tracking problems.We have obtained a significatively enlarged basin of attraction for the closed-loop system.

Representing the IPC Model As an Approximate Chain of Integrators
To obtain a convenient IPC model, we first introduce the following transformations: 2.2 which takes the system 2.1 into: where

2.4
Notice that the transformations in 2.2 are well defined for all |θ| < π/2.Now, if the states θ and θ are available, then u can be proposed to be Substituting the feedback law into the system equations 2.3 , we obtain

2.6
Comment 1.It is important to emphasize that the previous IPC model is quasilinear and controllable inside of region defined by |w 2 | < 1.This is due to the fact that, max |φ 0 w 1 | κ 2/3 3/2 ≈ 0.39.Notice that the virtual controller v acts directly on the coordinate w 1 tan θ.
For details on the system 2.6 The reader is referred to Olfati-Saber 19 .

A Flatness-Based Pole Placement Approach for Stabilization of the IPC System
In this section, we develop some control strategies for controlling the under-actuated inverted pendulum by using flatness techniques.These techniques work well for any of the two transformed models of the IPC system, 2.3 and 2.6 .Both mathematical models describe the behavior of this system, under the assumption that the pendulum moves in the upper half plane.Note that for achieving the control model 2.6 , the whole state has to be available, while this condition is not necessary for the model 2.3 .

Upright IPC System Stabilization When the Entire State Is Available
The tangent linearized version of system 2.6 , around the origin, is given by ż1 z 2 ; ż2 w 1 ; ẇ1 w 2 ; ẇ2 v f .

3.1
Evidently, this system is controllable and, hence, it is flat, with a flat output given by F z 1 .
It is easy to show that the system variables can be parameterized in terms of "F" and a finite number of its time derivative, as follows Therefore, approximate reference trajectory tracking my be achieved by choosing v f , as follows: where F * is the flat output reference signal and the set of coefficients {h 0 , h 1 , h 2 , h 3 } is chosen so that the characteristic polynomial of the closed-loop linearized system, given by p s h 0 h 1 s h 2 s 2 h 3 s 3 s 4 3.4 is Hurwitz.Notice that the stabilization of the single IPC, around x 0, can be equally achieved in a local manner by setting F * 0.

Simulation Results
To show the effectiveness of the derived feedback controller, described by 2.2 , 2.3 , 2.5 , and 3.3 , when applied to the nonlinear normalized IPC model 2.1 , we carried out some pertinent digital computer simulations.

Regulation of the IPC around Its Unstable Position
The purpose of this simulation is to assess how large is the domain of attraction of our control strategy.The numerical experiment consisted of three simulation using the following set of hypothesized initial conditions, p 1 q 0.4, q 0.25, θ 0.2 rad , θ 2 rad/sec , p 2 q 0, q 0, θ 1.2 rad , θ 0.2 rad/sec , p 3 q 1, q 0, θ −0.8 rad , θ 0 rad/sec .

Mathematical Problems in Engineering
The closed-loop characteristic polynomial was chosen to be p s s 1 4 .

3.6
That is, v f , is implemented in the normalized coordinates, as which are well defined for all |θ| < π/2.The numerical simulation results are shown in Figure 1.From this figure we can see that the proposed control strategy is capable of stabilizing the system, even when the initial conditions are selected far from the origin.

Oscillating around the IPC Unstable Equilibrium Point
To show the effectiveness and robustness of the proposed control strategy, we performed a more challenging task, which consisted in making the system flat output oscillate around its unstable point.In other words, we designed a feedback law that makes the inverted pendulum to reach a periodic motion in a stable way.This is an interesting and challenging problem due to the fact that when periodic oscillations are present, we may have solutions that are not completely stable.That means that the inverted pendulum can reach stable orbits, while the cart position does not remain bounded.From the simulation results shown in Figure 2, we claim that our control strategy is quite robust, considering that the obtained transformed model is nearly linear.The initial conditions are fixed sustained far from the origin as q 0, q 0, θ 1 rad , θ 0 rad/sec .The gains of the controller was set as before, while the selected trajectory was defined to be, F * t 2 sin t/2 .

A Conservative Estimation of the Domain of Attraction
In this section, we discuss the stability and robustness of the proposed flatness based controller 3.3 , when acting in closed-loop with the transformed nonlinear IPC system 2.6 .We emphasize that the proposed strategy exhibits a domain of attraction which is significantly large, when compared to the corresponding domains achieved by the majority of the approximate linear feedback control approaches.For simplicity, we only analyze the case when all the system states are available.We assume that the the desired, locally valid, closed-loop characteristic polynomial is given by p s s 1 4 .Under these assumptions, the closed-loop system can be rewriten as To have a good estimation of the domain of attraction, we use the following linear state transformation, q Tx, defined by Mathematical Problems in Engineering The closed-loop system 3.8 is then expressed as q1 −q 1 3β q , q2 −q 1 − q 2 β q , q3 −q 1 − q 2 − q 3 , q4 −q 1 − q 2 − q 3 − q 4 , 3.10 where, β q q 2 4 φ 0 w 1 .Consider the following Lyapunov function candidate, V q , defined as: Mathematical Problems in Engineering 9 The first order time derivative of V q , computed along the trajectories of 3.10 , leads to: V Φ q −q T Mq 3q 1 q 2 β q q 3 q 4 − q 2 4 , 3.12 where M is a symmetric matrix defined by M M T {m ij }: if i j then m ii 1 else m ij 1/2.This matrix exhibits the following property: λ min {M} 1/2.Notice that from the well-known inequality |xy| ≤ αx 2 /2 y 2 / 2α , valid for any positive real number α, and the fact that, |φ 0 w | ≤ κ; for all w.Then, the following inequality is readily verified:

3.13
After some algebraic manipulations and recalling that −q T Mq ≤ 1/2 q T q, we have that V q satisfies where α > 0 is selected, such that the two first terms in the right hand side of inequality 3.14 are strictly negative.This can be assured whenever, α ≤ 2/3κ √ 3. On the other hand, the fourth term in 3.14 is strictly negative provided q 2 4 < α/ 2κ ≈ 2.25.Let c 2.25.Hence, V q ≤ 0, for all q 2 4 ≤ c with α ≤ √ 3.That is, any initial condition, q 0 , satisfying q 0 2 ≤ c, guarantees that the closed-loop solution converges to the origin.On the other hand, the estimation of c can be improved by using some iterative numerical method, such as the one suggested by Khalil in 22 , which consists of finding a c such that

3.15
In our case, applying this method, the corresponding domain of attraction is found to be characterized by c 2 * 4.89.Hence, the region of attraction of the closed-loop system can be estimated as U 0 x q 2 tanh −1 tan θ 2 , q θ sec θ, tan θ, θ sec 2 θ : Tx 2 ≤ c * .

3.16
This result means, roughly speaking, that, for the initial conditions q 0, q 0, θ 0 0, the pendulum angular position can be initialized inside the sector −60 • < θ 0 < 60 • .Finally, we must emphasize that the numerical estimation of c * is quite conservative.In actual applications, this value is found to be even larger, as it can be seen in Figure 1.From this figure, we can see that for initial conditions set sufficiently far from origin, say, θ 0 ±1.3 rad, the proposed flatness based controller stabilizes the system state to origin.A better estimation of the stability domain is beyond the scope of this paper.Remark 3.1.Even if we used a quadratic Lyapunov function to estimate the domain of attraction, we suspect that the system in 2.6 can be almost globally stabilized by using a linear controller, despite the fact that we were not able to prove it.

Conclusions
In this work, we introduced a feedback control strategy for controlling the IPC system around its unstable equilibrium point.From the fact that the original system can be approximately expressed as a chain of integrators, we may use the differential flatness approach for deriving a suitable stabilizing controller.We propose a quasilinear controller when all the states are available.Some numerical simulations have been performed to evaluate the effectiveness of the proposed control strategies.

Figure 2 :
Figure 2:Closed-loop behavior of the state pairs: θ, θ and q, q , respectively, in a and b when tracking the reference F * t 2 sin t/2 .c depicts the corresponding tracking error.