Balancing a stick on a cart
Stand a broom on its bristles and let go, and it falls every time. Stand it on your palm and you can keep it up for as long as your attention lasts. The broom has not changed. What changed is that something underneath it now moves in answer to the lean. The equations that say the stick must fall also say exactly how to catch it.
What is being claimed
Two separate facts about one machine: a cart that rolls along a track, with a stick hinged on top. First, the upright position is unstable. Leave the cart alone and any small lean grows until the stick falls. Second, the upright position is still controllable. By pushing the cart the right way at the right moment, you can bring the stick back to vertical from any small lean and hold it there. Instability belongs to the system on its own. Controllability belongs to the system together with the push you are allowed to apply. The two questions have different answers here, and that is the point of this page.
Why it is worth knowing
Åström and Murray call this whole family balance systems: “a mechanical system in which the center of mass is balanced above a pivot point”. Their examples are the Segway transporter, a rocket steered by a “gimbaled nozzle at the bottom”, and “humans or other animals standing upright or a person balancing a stick on their hand”. Each one keeps its heavy part on top by applying forces at the bottom. The cart and stick is the version simple enough to work through in full, so the book returns to it in chapter after chapter.
Why the top is unstable
An equilibrium is a position where, with no push, nothing moves. The pendulum has two: hanging straight down and standing straight up. To ask whether one is stable, you imagine a tiny lean and see whether it shrinks or grows. For small angles the book replaces the curved gravity term with a straight line, and the two equilibria turn out to differ by a single sign. Hanging down, a small lean makes gravity pull the stick back toward the bottom, so it swings and settles. Standing up, a small lean makes gravity push the stick further over. The book concludes that the upright point “is unstable” while the hanging point is stable.
How fast it goes is set by an eigenvalue: a growth rate that the equations themselves pick out. In the book's worked example (Example 6.7, a cart of 10 kg carrying an 80 kg body whose centre of mass is 1 m up, “corresponding roughly to a human being balanced on a stabilizing cart”), a small lean grows like e2.68t, with t in seconds. That 2.68 per second is our arithmetic from the book's own matrix, and it is also the value the book itself uses for this system in its chapter on limits (p = 2.68). It means the lean multiplies by e every 0.37 s and doubles every 0.26 s (our arithmetic). In our simulation of the full equations, a lean of 1° becomes a fallen stick in about 2 seconds. A note on the source: the text of Example 6.7 lists the open-loop eigenvalues as about 0, 4.7 and −1.9 ± 2.7i. We could not reproduce that list from the stated parameters. The same matrix does put the book's own gains, below, on the eigenvalues the book designed them for, to within the rounding of the printed gains, so we use the 2.68.
Why it can still be caught
Whether a push can steer a system is a separate test, called reachability: can some choice of push move the state (cart position, stick angle and their two speeds) from any starting point to any other? For a linear model it comes down to a single matrix built from the dynamics and from where the push enters. If that matrix's determinant is not zero, the answer is yes. For the cart and stick the book computes the determinant as g2l4m4/μ4, which is never zero. It concludes that “we can always find an input to bring the system from an initial state to an equilibrium point.” The push does not remove the instability. It reaches every part of the state, so it can always be chosen to counter it. (The linear model puts no limit on the push; real motors do.)
The book's counter-example shows what failure looks like: two identical sticks on one cart. The cart can only move one way at a time, so it cannot make the two sticks do different things, and the pair is not reachable. The trouble there is not instability. It is that one push cannot tell two identical sticks apart.
Interactive Press release with the controller off and watch the stick fall; switch it on and release again; then drag the tilt and the fast-pair speed and compare the peak push.
A real controller
The simplest way to catch the stick is state feedback. Measure all four state variables, multiply each by a fixed gain, and push with the sum. With the gains K = [−15.6, 1730, −50.1, 443] from Example 6.7, the push works out to about 1730 newtons for every radian of lean, roughly 30 N per degree (our arithmetic). The push also depends on how fast the stick is falling, and on where the cart is and how fast it is moving. The book chose those gains by picking where the closed-loop eigenvalues should sit. A fast pair at −1 ± 2i catches the stick. A slow pair at −0.35 ± 0.35i brings the cart home. Every eigenvalue now has a negative real part, so every small disturbance dies away.
Speed costs force. The book found its first design needed an input that was “excessively large”, so it slowed the fast pair by a factor of three to −0.33 ± 0.66i. In our simulation, starting from a 10° lean, the book's first design peaks at 302 N, or 0.39 times the body's weight mg of 784 N. Double the fast speed and the peak rises to 671 N (0.86 mg). Halve it and the peak falls to 202 N, but the cart now travels 3.2 m to make the catch, against 1.5 m.
Where it stops working
The gains come from the straight-line model, which is only accurate near vertical. In our simulation the book's design recovers a stick released at 45° but loses one released at 55°. Speed matters in another way too. The book shows that an unstable pole p forces a minimum speed on the whole control loop, “ωgc > 1.7 p” for a typical allowance of lag, about 4.6 rad/s for this cart (our arithmetic). “The control of unstable systems imposes minimum bandwidth requirements for process actuators and sensors.” For a point mass on a light rod of length l, with its base held still, the upward growth rate is the square root of g/l (our arithmetic from the book's pendulum equation, 2.10). A 25 cm stick then diverges at 6.3 per second, twice the 3.1 per second of a 1 m one, which is why a pencil is harder to balance than a broom.
What you measure matters as much as how hard you push. Goswami and Chatterjee note that the cart-pendulum “is easy to stabilize with pendulum angle feedback”, but that if you see only the cart's position it “cannot be stabilized with stable and proper compensators”. They call this balancing a stick with eyes shut. They show it becomes possible with an extra feedforward path, at a noise sensitivity that “seems to be about 3 times worse” than with angle feedback. They note that a shorter version was due to appear in the ASME journal JDSMC.
In short
Standing up, gravity amplifies any lean; for the book's cart it grows like e2.68t. That is instability. But a push at the base reaches every state of the system, so feedback can move the growth rates to the stable side. That is controllability. Faster catching needs harder pushes, and a large enough lean still escapes a controller designed for small ones.
Where this comes from
- Balancing a Stick with Eyes Shut: Inverted Pendulum on a Cart without Angle Measurement reuse permitted with attribution
arxiv.org/abs/2301.04289 - Feedback Systems: An Introduction for Scientists and Engineers (Princeton University Press; electronic edition v2.10b) linked only, not reproduced
www.cds.caltech.edu/~murray/books/AM08/pdf/am08-complete_22Feb09.pdf