Inverted Pendulum

You might also like

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

Hagen-1

The Inverted pendulum is a classical problem used by professors in fields


ranging from Physics, Computer Science, and Mathematics. It is a clear cut
demonstration of an inherently unstable system, which is one where any miniscule force
applied to the pendulum may disrupt the system. It is useful in demonstrating concepts
of linear control when working with unstable systems. There are three basic models for
the problem, most of which have multiple solutions.
1) The Stationary Pivot Point:

With a mass m, displacement angle , and a rod length of , the equation for inverted
pendulum Is nearly identical to that of an uninverted pendulum, the only difference
being the angular position being measured from the y-axis and not the x-axis.

(1)

(2)

(1) Is the formula corresponding to system of motion for the inverted pendulum and (2)
for the uninverted pendulum.
2) Pendulum With an Oscillatory Base:

Hagen-2

Assuming the base is massless, m the mass of the pendulum arm, displacement angle
, rod length , and y(t) measuring the displacement of the base with respect to time,
then the system of motion for the pendulum with an oscillating base becomes:

(1).

(2).

(3)

(4). (5.)
Models for this form of pendulum tend to fall quickly when oscillation is slow, however
when oscillation is high the pendulum can be kept stable about the upright position.

Hagen-3

3) Pendulum on a Cart:

This is the situation I will be deriving and demonstrating in Mathematica. Here a


pendulum is fixed atop a moveable cart with the objective of stabilizing it in the upright
position. In unison with the diagram let m be the mass of the pendulum, M the mass of
the cart,

the length of the rod,

the angular displacement from the y-axis this time, f

be a force applied to the cart only in the x-axis, and x(t) to be the position of the cart.
Starting with what is given it follows that:
First we must get the Lagrangian

, where T is the kinetic energy and V

the potential. The kinetic energy in this case is the we need to account for both the cart
and the pendulum arm. So
cart and

and

let

denote the velocity of the

denote the veolicty of the the pendulum head. Then by our original equation

then our Lagrangian becomes: (1).

with

and

Hagen-4

(2).

being the first derivatives of position.


From the Euler-Lagrange equations the equations of motions are:


(3).

(4).

(5).

(6).

(7).

(8). From (3), (4), and (5):

(9). From (3), (6), and (7):

From (8) and (9) we have the system of equations:

. Now we can model the

behavior of the system by using a program such as mathematica. Using the NDsolve I
simulated the system in the most basic form where

with no external force

Hagen-5
applied and slightly off from its upright stable position( =1). The following graph shows the
height of the pendulum arm (

along the y-axis and the position of the cart relative to the

origin on the x-axis:

As is shown, with basic inputs, no restrictions, and no force the pendulum simply
oscilates indefinitely. After playing with different forces and inputs for

the chaotic

nature of the system is apparent, to stabalize it we can use Mathematica to create linear
controlize to try and stablize the nonlinear system using StateSpaceModel:
0

2 Is the resulting augmented matrix. The matrix describes

the effects of deviations in the system in respect to the controls (

),

Hagen-6

and the 5th column describes the of the control force

on the variables. The next step

is to use mathematica to find the most efficent coefficents to stabalize the system.
Using LQRegulatorGains I found the following coefficents:
. Now to
negate these changes we simply multiply the respective variables by the opposite of
these coefficents to get:
. Plotting with the new controls:

The new controls have solved the initial problem to balance an inherently unstable
system, the pendulum arm staying up at a 90 degree angel and the cart centering itself
about the origin over time. The Mathematica code is apendid at the end of this paper.

You might also like