Left Half-Plane
energy shaping · hybrid control · underactuation

Swing-Up

The motor is weaker than gravity, so the pendulum cannot be lifted; it has to be pumped, like a swing. Watch the textbook do it, then draw the swing you want, angle against time. A tracking controller follows your line as well as the motor allows, and a linear controller takes over the moment the pendulum enters the region it can hold.

world —runs today 0best today —energy shaping —
Where you stand today

The torque limit is 4 N·m against a gravity torque of 9.8 N·m at the horizontal, so energy has to be pumped in over several swings. Cost is the time until the pendulum is caught and held, in seconds, plus a fiftieth of the control energy; a run that never catches scores eighteen plus energy. The catch fires when the state enters V(x) < c, the Lyapunov ellipse from Stable is Still; c = 3.5 was chosen by simulation, not proved. The textbook reference is an energy-shaping controller, three lines of code that swing it up every time; it plays on the left until you run. Today's joint friction is hidden, and it moves the best swing period.

The trick

Pump, do not lift

The motor holds the pendulum about twenty-four degrees from the bottom and no further; beyond that gravity wins. So the pendulum is swung up the way a child pumps a swing: push with the motion and every pass adds energy, push against it and you undo your own work. The period lengthens as the amplitude grows, so the rhythm that works at the start is wrong by the end, and today's friction moves it again. Your line is a plan for that rhythm. The textbook does not plan at all; it watches one number, the energy, and it loses to a good line because it cannot see the clock.

Cards
Feedback on one scalar: add energy when short, take it out when in excess.energy-shaping
E = ½ m l² θ̇² + m g l (1 − cos θ), Etop = 2 m g l, u = k (Etop − E) sign(θ̇)Ė = u θ̇ − b θ̇², so this u drives (E − E_top)² down whenever the pendulum moves

The motor's power into the pendulum is torque times angular velocity. Push with the motion and the energy rises; push against it and it falls. Steering one scalar toward its target needs no model of where the pendulum is, only of how much energy it has, and the torque limit is respected by clipping, since a smaller push with the right sign still moves the energy the right way.

It converges to an orbit, not to a point: at the target energy the pendulum reaches the top with zero velocity but does not stay, so a second controller must catch it. It cannot hurry, because it has no clock; it wastes torque near the turning points where θ̇ ≈ 0; and with friction the target must be overshot a little, by an amount today's hidden b decides.

Where par here · the lab's calm stage is the same law with the sign reversed, energy-removal
Deeper Åström & Furuta, Swinging up a pendulum by energy control, Automatica 2000 · Tedrake, Underactuated Robotics, ch. 2–3

The same law with the sign reversed calms chaos, and needs no model of the links.energy-removal
u = −c (E − Ehanging) ẋthe motor's power into the machine is u·ẋ; pushing against the cart's motion can only ever take energy out

For the double pendulum on a cart the motor acts on the cart alone, and the power it delivers is force times cart velocity. A force against the cart's velocity, scaled by the energy still stored, makes the stored energy a Lyapunov function that only descends. Nothing about the links appears in the rule: two chaotic links are drained by a law that never looked at them.

It stalls where ẋ = 0 and does nothing about the last small swings, which is why the lab hands over to a linear damper designed around the hanging rest once the links are nearly still. A second Lyapunov argument closes the gap the first one leaves.

Where the homepage lab, calm stage · lyapunov
Deeper Spong, Energy based control of a class of underactuated mechanical systems, 1996

Two controllers and a switch; the skill is knowing where the simple one applies.hybrid-switch
catch when V(φ, θ̇) = [φ θ̇] P [φ θ̇]ᵀ < c, φ = θ − π; then u = −k1φ − k2θ̇an LQR designed at the top, handed the pendulum inside a level set of its own Lyapunov function

Near the top the pendulum is nearly linear, an LQR holds it, and a sublevel set of that LQR's V is the natural place to switch: if the set is invariant, entering it settles the matter. Far from the top a nonlinear controller, here your drawn line and a tracker, does the swinging. This is hybrid control, most real swing-ups work this way, and so does a gymnast approaching a handstand.

Honesty: c = 3.5 was chosen by simulation with the 4 N·m limit, and nothing here proves the set invariant under saturation; the game switches once and does not switch back. For the double pendulum, the lab and Kick replace the ellipse with a two-second forward simulation under the balancing gains, which is a test rather than a hope. Real hybrid loops also guard the boundary against chattering with hysteresis.

Where the catch here · the lab's catchable · Kick · lyapunov
Deeper Tedrake, Underactuated Robotics, Lyapunov analysis and regions of attraction · Goebel, Sanfelice & Teel, Hybrid Dynamical Systems

References
  1. K. J. Åström and K. Furuta, "Swinging up a pendulum by energy control," Automatica, vol. 36, no. 2, pp. 287–295, 2000.
  2. M. W. Spong, "The swing up control problem for the Acrobot," IEEE Control Systems Magazine, vol. 15, no. 1, pp. 49–55, 1995.
  3. R. Lozano, I. Fantoni, and D. J. Block, "Stabilization of the inverted pendulum around its homoclinic orbit," Systems & Control Letters, vol. 40, no. 3, pp. 197–204, 2000.
  4. I. Fantoni and R. Lozano, Non-linear Control for Underactuated Mechanical Systems. Springer, 2002.
  5. M. S. Branicky, "Multiple Lyapunov functions and other analysis tools for switched and hybrid systems," IEEE Transactions on Automatic Control, vol. 43, no. 4, pp. 475–482, 1998.
  6. R. Tedrake, Underactuated Robotics, the chapters on energy shaping and on the cart-pole. Course notes, MIT, underactuated.mit.edu.