D310 of 10
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

D3 · Lesson 10 · Capstone

Why a stick balanced upright falls exponentially and why short sticks are harder to balance, catching it by accelerating the cart with angle feedback, why angle feedback alone lets the cart run away, and a full-state controller designed by pole placement and tested on the nonlinear pendulum

Balancing a broomstick on your palm is the classic control problem: the stick is unstable, so doing nothing means it falls, and you catch it by moving your hand under it. A Segway, a rocket on its exhaust and a walking robot all solve the same problem. It brings together every idea in this course: an unstable pole, feedback that moves it, damping to stop the swinging, the state-space view that keeps the cart from wandering off, and a simulation to check that a design based on a linear model works on the real, nonlinear system.

  • A pendulum of length L standing on a cart, near upright. Without control its angle obeys θ¨=(g/L)θ, so it falls exponentially at rate g/L.
  • The cart accelerates by a=kpθ+kdθ˙, moving under the pendulum as it leans. The arrows show how angle and angular velocity evolve from each point.
  • With kp below g (9.81 m/s² per radian), no amount of damping saves it. Above g, the upright position becomes a stable spiral or node.

Predict

Without control, a pendulum 1 m long falls away from upright with its angle growing as eg/Lt. How long does its angle take to double? And for a 25 cm pendulum?

Name it

The unstable plant

Linearized about upright, with the cart's acceleration a as the input,

θ¨=gLθ−aL

with poles at ±g/L: one in the right half plane.

Angle feedback

Accelerating the cart toward the lean, a=kpθ+kdθ˙, gives

θ¨+kdLθ˙+kp−gLθ=0

stable when kp>g and kd>0, with ωn=(kp−g)/L and ζ=kd/(2L(kp−g)). But nothing in this law cares where the cart is, so the pendulum stays up while the cart drifts off at constant speed.

Full-state feedback

With the state (x,x˙,θ,θ˙), feedback a=−K𝐱 on all four places all four poles (lesson 9), so the cart returns home too. The gains come out with a surprising sign: to move the cart left, the controller first moves it right, tipping the pendulum left so that it can follow. Systems with this "wrong-way" start are hard to control quickly.

Linear design, nonlinear check

The gains are designed on the linearized model, then tested on the full equation θ¨=(gsin⁡θ−acos⁡θ)/L. Near upright they agree; far from it the linear design eventually fails.

Worked example

A 0.5 m pendulum is controlled with kp = 20 m/s² per radian and kd = 4 m/s per radian per second. What are its natural frequency and damping?

Show the solution
  1. Natural frequency. ωn=(20−9.81)/0.5=4.51rad/s
  2. Damping. ζ=420.5×10.19=0.886
  3. What that means. It's a well-damped catch, but the cart will drift.

Answer ωn = 4.51 rad/s and ζ = 0.886.

Worked example

The full-state design in the Python step places the poles at −3, −4 and −5 ± j2 for L = 0.5 m. How does it do?

Show the solution
  1. Gains. Ackermann's formula gives K=(−17.7,−16.5,−74.2,−16.7)
  2. From 0.2 rad. The nonlinear pendulum is upright and the cart home within 5 s, with peak cart acceleration 14.8 m/s².
  3. Larger starts. The same gains recover from 0.7 rad (40°) but not from 0.9 rad, where the linear model is too far from the truth.

Answer from 0.2 rad it balances and brings the cart home within 5 s, peaking at 14.8 m/s², and it recovers from 0.7 rad but not from 0.9 rad.

Worked example

Without control, how fast does a 0.5 m inverted pendulum fall away from upright?

Show the solution
  1. Linearized equation. θ¨=(g/L)θ so small angles grow as est.
  2. Growth rate. s=9.81/0.5=4.43s−1
  3. Doubling time. ln⁡2/4.43=0.16s
  4. What the controller needs. It must act within a fraction of that, which is why balance loops run fast.

Answer the angle doubles every 0.16 s.

Check

Model the cart and pendulum, place the poles with Ackermann's formula, and test the design on the nonlinear pendulum.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

How fast does an uncontrolled pendulum 0.5 m long fall away from upright (the growth rate of its angle)?

Check

How long does an uncontrolled 0.5 m pendulum take to double its angle?

Write units the way you normally would: 1.5 s and 1500 ms are the same answer.

Check

A 0.5 m pendulum is caught with kp = 15 m/s² per radian. What's the closed loop's natural frequency?

Write units the way you normally would: 1.5 rad/s and 1500 mrad/s are the same answer.

Check

The same 0.5 m pendulum with kp = 15 has kd = 8. What's the damping ratio?

Check

An inverted pendulum of length 0.5 m is left uncontrolled.

(a)

At what rate s, in s⁻¹, does a small tilt grow as est?

(b)

How long does the tilt take to double?

Write units the way you normally would: 1.5 s and 1500 ms are the same answer.

Check

A pendulum of length 0.5 m is held up with kp = 15 m/s² per radian and kd = 4 m/s per rad/s, giving Lθ¨=(g−kp)θ−kdθ˙... rewritten as Lθ¨+kdθ˙+(kp−g)θ=0.

(a)

What is its natural frequency?

Write units the way you normally would: 1.5 rad/s and 1500 mrad/s are the same answer.

(b)

What is its damping ratio?

Explain why

Why does feeding back only the pendulum's angle let the cart drift away?

Practice

Keep practicing

8 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.