Math 2.0

Mechanics of particles and systems Control of mechanical systems Example

Inverted pendulum

Builds on Underactuated systemPendulum equationLinearisation at an equilibriumLyapunov stabilityControllability

Example

Take a cart of mass M>0M > 0 that moves on a horizontal line, with position x(t)x(t). A massless rigid rod of length ℓ>0\ell > 0 is hinged on the cart and carries a point mass m>0m > 0 at its free end. Let θ(t)\theta(t) be the angle of the rod from the upward vertical, and let g>0g > 0 be the acceleration of gravity. The only input is a horizontal force u(t)u(t) on the cart. The Lagrangian L=12Mx˙2+12m(x˙2+2ℓx˙θ˙cos⁡θ+ℓ2θ˙2)−mgℓcos⁡θL = \frac{1}{2} M \dot x^2 + \frac{1}{2} m \left( \dot x^2 + 2 \ell \dot x \dot\theta \cos\theta + \ell^2 \dot\theta^2 \right) - m g \ell \cos\theta gives the equations of motion (M+m) x¨+mℓ(θ¨cos⁡θ−θ˙2sin⁡θ)=u,(M + m)\, \ddot x + m \ell \left( \ddot\theta \cos\theta - \dot\theta^2 \sin\theta \right) = u, ℓ θ¨+x¨cos⁡θ−gsin⁡θ=0.\ell\, \ddot\theta + \ddot x \cos\theta - g \sin\theta = 0. There are two degrees of freedom, xx and θ\theta, and one input, so the cart-pole is an underactuated system.

The upright position θ=0\theta = 0, θ˙=0\dot\theta = 0, x˙=0\dot x = 0 with u=0u = 0 is an equilibrium. The linearisation at it is (M+m)x¨+mℓθ¨=u(M + m) \ddot x + m \ell \ddot\theta = u and ℓθ¨+x¨=gθ\ell \ddot\theta + \ddot x = g \theta. Eliminating x¨\ddot x gives θ¨=a θ−b u,a=(M+m)gMℓ,b=1Mℓ.\ddot\theta = a\, \theta - b\, u, \qquad a = \frac{(M + m) g}{M \ell}, \quad b = \frac{1}{M \ell}. With u=0u = 0 the solutions include θ(t)=θ0ea t\theta(t) = \theta_0 e^{\sqrt{a}\, t}, so the upright position is not Lyapunov stable. With the feedback u=k1θ+k2θ˙u = k_1 \theta + k_2 \dot\theta, the angle obeys θ¨+bk2θ˙+(bk1−a)θ=0\ddot\theta + b k_2 \dot\theta + (b k_1 - a) \theta = 0. If k2>0k_2 > 0 and k1>a/b=(M+m)gk_1 > a / b = (M + m) g, both coefficients are positive, so both roots of s2+bk2s+(bk1−a)s^2 + b k_2 s + (b k_1 - a) have negative real part and θ(t)→0\theta(t) \to 0.

Remarks

This feedback keeps the rod upright in the linearised model, but the cart may drift. The full linearised system in the state (x,x˙,θ,θ˙)(x, \dot x, \theta, \dot\theta) is controllable. So a linear feedback on all four state variables makes the upright equilibrium asymptotically stable for the linearised system, and locally for the nonlinear one. The simplest version fixes the hinge and applies a torque τ\tau at it; then mℓ2θ¨=mgℓsin⁡θ+τm \ell^2 \ddot\theta = m g \ell \sin\theta + \tau, which is the pendulum equation turned upside down.

Reading path

To understand this page from the ground up, read these 42 pages in order. The foundations come first.

  1. Complex numbers object
  2. Controllability concept
  3. Differential equation concept
  4. Function concept
  5. Interval concept
  6. Lyapunov stability concept
  7. Underactuated system concept
  8. Euler's formula statement
  9. Ordinary differential equation definition
  10. Lipschitz condition definition
  11. Grönwall's inequality statement
  12. Order of a differential equation definition
  13. Solution of an ordinary differential equation definition
  14. Autonomous system definition
  15. Initial value problem definition
  16. Linear differential equation of order n definition
  17. Equilibrium point definition
  18. System of linear differential equations definition
  19. Uniqueness of solutions for Lipschitz vector fields statement
  20. Homogeneous linear equation definition
  21. Linear equation with constant coefficients definition
  22. Homogeneous linear system with constant coefficients definition
  23. Maximal solution definition
  24. Superposition principle statement
  25. Characteristic equation definition
  26. Matrix exponential as the solution of a linear system statement
  27. Flow of a vector field definition
  28. Solution space of a homogeneous linear equation has dimension n statement
  29. Lyapunov stability definition
  30. Trajectory definition
  31. Fundamental system of solutions definition
  32. Asymptotic stability definition
  33. First integral definition
  34. Solutions for distinct real roots statement
  35. Stability of linear systems via eigenvalues statement
  36. Solutions for repeated roots statement
  37. Linearisation at an equilibrium concept
  38. Solutions for complex conjugate roots statement
  39. Hyperbolic equilibrium point definition
  40. Harmonic oscillator example
  41. Pendulum equation example
  42. Inverted pendulum example

Where this leads

1 page builds on this one.

Further reading

  1. Web https://en.wikipedia.org/wiki/Inverted_pendulum
About this page
TagD0J7A9CG77
URIm2://D0J7A9CG77
Kindexample
WritingW0 stub
MSC70Q05, 93D15, 70E60
Instance ofUnderactuated system
UsesUnderactuated system, Pendulum equation, Linearisation at an equilibrium, Lyapunov stability, Controllability
Same as
Changed3 November 2026

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

Used by