understood the basics of the solution.
Now, skip ahead 40 years when I happened to Google
“inverted pendulum” and found lots of differential
equations and complex diagrams but — again — no simple
intuitive way to understand the solution. The Wikipedia
article I came across derived equations for the dynamics of
the cart pendulum system, but offered no clues on how to
What follows is my attempt to fill that void. My
inspiration for a simplified explanation came from an article
on the problems that crane operators encounter with
swinging loads. I suddenly realized that the crane problem
might be related to the inverted pendulum problem, and
indeed it is.
Let’s begin by looking back at Figure 1 in which the
three important variables of the system are the cart position
X, cart acceleration A, and pendulum angle q.
Most of the basics of the balancing problem can be
understood by considering human responses in the task of
balancing a pole on the palm of your hand. If the pole is
falling to the right, you need to move your hand to the
right faster than the pole is falling (and vice versa) in order
to “catch” it.
If the angle of the pole is q (radians), the mass at the
top of the pole will be accelerating away from vertical at A
= g q (g = acceleration of gravity = 9. 8 m/s2), so your hand
will need to accelerate faster than g q; perhaps 5 g q.
Following this idea, a proposed control system to keep the
pendulum from falling over is shown in Figure 4.
The angle q is sensed, amplified with gain G, and
applied as a current Im = G q to drive the cart motor. The
motor produces the cart acceleration in the direction to
reduce q. This is a feedback control system with the goal of
maintaining q»0. Unfortunately, as we
demonstrated in Figure 3a, there is no value of G
for which this system can stabilize the pendulum. It
may zip back and forth once or twice, but the
pendulum always falls over in a second or two as the
cart races off the end of its track.
Since most people can easily learn to balance a
pole, the human brain must be subconsciously doing
something more complex than a linear response to
the tilt of the pole.
Now, we come to the problem of the crane
operator transferring cargo from dock side to the
hold of a ship. He lifts the load from the dock and
swings the crane over the hold. The result is a
dangerously swinging load that cannot be safely
lowered. Experienced crane operators learn to avoid
this problem by moving the crane so as to prevent
Seen from the engineering point-of-view, this is a
system with a strong resonance at the pendulum
where L is the length of the cable supporting the load. If
the frequency spectrum of the crane motion contains a
component at wp, the load will end up swinging.
The solution is to place a band suppression filter with
center frequency wp between the operator’s joystick and the
position control of the crane. Modern cranes include this
In one of the beautiful symmetries of nature, this same
band suppression filter — inserted in the signal path
between the angle sensor and cart motor — solves most of
the stability problem of the inverted pendulum. With this
improvement, the pendulum may stay up for many seconds,
but always ends up drifting ever faster away from track
center. Eventually, it will reach its maximum speed or the
end of the track, and down goes the pendulum.
This remaining difficulty can be analyzed by considering
the measurement of the angle of the pole from the vertical
as defined by gravity. We do this with an angle sensor
between the track and the pole, assuming a level track.
However, the track will never be exactly level. If the cart
tries to maintain an angle that is not perfectly vertical, it
must — on average — accelerate away from its starting
For example, if the track is one millimeter out of level
in a three meter length, the cart will run off the end of the
track in 30 seconds or less. An offset of one minute of arc
in the angle sensor zero has the same effect.
This problem is solved by adding a second sensor to
measure the position of the cart and then modulating the
null angle j (the angle the cart tries to achieve; nominally
zero) by the difference between where the cart is and the
48 SERVO 12.2017
Figure 4. A proposed control system to balance an inverted
pendulum. Note the sign of each component. Positive current Im
to the motor produces a positive cart acceleration A. Positive
acceleration will tend to make q decrease, so the pendulum block
has a negative sign. Counting signs around the loop, we have one
negative sign so the loop gain is negative — the normal situation
for a feedback control system.
wp= Ög/ L