We propose a nonlinear controller to regulate the swinging energy of t
he pendulum for a cart and pendulum system. Roughly speaking, the cont
roller is designed to regulate an output (the swing energy) while prov
iding internal stability (regulating the cart position). It is difficu
lt to apply many of the standard nonlinear control design techniques,
since the output zeroing manifold does not contain any equilibrium poi
nts and the relative degree of the system is not constant In contrast
to controllers that use a command generator and possibly a time-varyin
g feedback, our control law is a simple autonomous nonlinear controlle
r. We analyze the stability of the closed-loop system using an L(infin
ity) small-gain approach on a transverse linearization of the system a
bout the desired periodic orbit. One can easily extend this approach t
o analyze the robustness of the control system with respect to disturb
ances and parameter variations. Experimental results demonstrate the e
ffectiveness of the nonlinear controller.