Inverted
Pendulum
What is Inverted Pendulum
A Pendulum that has its centre of mass above its pivot point.
• Inherently unstable.
• Must be actively balanced in order to remain upright.
• Must have a feedback system to keep it balanced.
Jens Martensson 2
Why Inverted
Pendulum ?
Jens Martensson 3
A Pendulum has two positions of equilibrium:
1. Stable
2. Unstable
Stable Unstable
Jens Martensson 4
Criteria for Balancing
• Moving the Pivot point
• Applying torque at the Pivot point
• Generating a net torque on the Pivot point.
Jens Martensson 5
Types of motor that can be used:
1. DC Motor
2. Stepper Motor 1 2
3. Servo Motor
Jens Martensson 6
Comparison
DC Motor Stepper Motor
• DC Motor has high torque and high speed. • Stepper Motor has High torque but lacks in
speed.
• It requires more power to run the motor
• It requires comparatively less power.
• It has average efficiency.
• It has low efficiency.
Jens Martensson 7
Formulating the problem:
Forces Acting on the Pendulum
ẑ
• Gravity
• Force of the pivot
• Frictional force m
l
θ
A, ω
Jens Martensson 8
Equation Of Motion
Newton’s Second Law
ẑ
d 2x
F ma m 2
• Linear motion: dt
d 2
I I 2
• Circular motion: dt m
Equation of Motion
l
d
2
total I θ
dt 2
A, ω
Jens Martensson 9
Torques
Gravity: grav r F sin
grav mgl sin
Oscillating pivot:
• Force: y (t ) A cos(t )
d 2 y (t )
a 2
2
A cos(t )
dt
d 2 y (t )
F ma m 2
m 2
A cos(t )
dt
pivot r F sin
• Torque: pivot ml 2 A cos(t ) sin
Jens Martensson 10
Equation Of Motion
d 2 2 d
2
total grav pivot I 2 ml
dt dt 2
d 2
ml 2
2
mgl sin mg 2 A cos(t ) sin
dt
d 2 g 2 A
cos( t ) sin 0
dt 2 l l
Gravity Pivot
term term
m
For example:
θ
θ
m
g 9.81m.s 2
g l 19 cm
d 2 g d 2 g 02
0 0 l
dt 2 l dt 2 l 0 7.19 rad.s 1
(t ) exp(0 t ) (t ) sin 0 t
Jens Martensson 11
Physical Intuition
d 2 2 2 A
0 cos( t ) sin 0
dt 2 l
Pivot term
(dominates for
large values of ω)
F m 2 A cos(t )
Inertial (lab) Fmax m 2 A
frame
F1 F2
rF sin
Non-inertial
frame 2 1
(of pendulum)
2 1
Jens Martensson 12
Re-Parameterization
Reparameterize: t t
d 2 02 A
cos( ) sin 0
d 2 2 l
2
A
Let: 0
l
d 2
cos( ) sin 0
d 2
For small values of θ: sin
d 2
cos( ) 0
d 2
Mathieu's Equation
Jens Martensson 13
Types of
Controller
which can be
used :
i. LQR Controller
ii. Two loop PID Controller
Jens Martensson 14
LQR Controller
Jens Martensson 15
LQR Controller
• The Linear Quadratic Regulator (LQR) is a well-known method that provides optimally controlled
feedback gains to enable the closed-loop stable and high performance design of systems.
• The main focus of an LQR control system is to achieve and hold a target configuration for a given
linear system using an optimal control law.
• An LQR Control system generates the control law using four matrices:
A Matrix: physical dynamics
B Matrix: control dynamics
Q Matrix: state cost
R Matrix: control cost
Jens Martensson 16
PID Controller
Jens Martensson 17
Two-Loop PID Controller
---------------------------------------------
• Double-loop PID control system, a PID controller and the object can form an inner loop that can make the unstable object
stable.
• In the forward channel of the control system, another PID controller and the object form an outer loop that can make the
control system have the expected performance.
• When we use the double-loop PID controller, the inner loop controls the pendulum angle and the outer loop controls the
cart horizontal position.
• In order to simplify the computation, two PID controllers are all designed as PD controllers.
• An amplifier G is placed in the inner loop in order to suppress interference and unit negative feedback is used in the outer
loop in order to obtain better following performance.
Jens Martensson 18
Comparison
LQR Controller PID Controller
• LQR by definition gives the optimal state- • PID controller is simple and it can be tuned
feedback law that minimizes certain without having an analytical model.
quadratic objective function.
• For commercial applications, the PID
• In that sense, LQR is the best controller. controller is favorable for its simplicity and
simple tuning procedures.
• LQR has a drawback that it assumes that all
the states of the system are measurable.
• So, the design may be quite complex.
Jens Martensson 19
Applications
Jens Martensson 20
Real life Applications
Of Inverted Pendulum.
• HUMANS- make constant adjustments to maintain the upright position
of the body whether standing, walking or running.
• Balancing brooms with a hand or a finger.
• Rocket and missile guidance.
• Balancing a biped humanoid robot.
• Two-wheeled personal transports that offer higher maneuverability are
designed based on inverted pendulum models.
• Metronome
Jens Martensson 21
Thank You