Swinging a playground swing
Torque controls for inducing sustained oscillations
Abstract
Models of a playground swing have been studied since the 1960s. However, in most of them, the position of the swinger is controlled directly. This simplifies the problem but hides the mechanics of torques applied to keep the swing moving in a regular pattern. This article studies these mechanics. Two models of a swing with torques as controls that we consider are identical to popular models of modern robotics: the Acrobot and reaction wheel pendulum. However, the control task of sustaining the swing’s regular oscillations by a static feedback control is new and challenging, especially when damping in the joint connecting the swing to the frame is considered. We develop two types of controls to accomplish this task. One works for small damping and is based on linearizing the undamped system by a suitable preliminary feedback control. The other works for large damping. In the steady state, the resulting closed-loop system describes a harmonically driven damped pendulum (a simple system known for its complex behavior), including chaotic motion for some parameter values. To address such complexities, we build free parameters into the controls, then adjust them based on simulations to avoid chaos and achieve regular oscillations that are seen on playgrounds.
Keywords: underactuated system, orbital stabilization, sustained oscillations, limit cycle, static state feedback, feedback linearization, bounded zero dynamics, swing up, Acrobot, reaction wheel pendulum, driven damped pendulum
MSC: 70K05 34C15 70K40 70E17 70Q05 93D25 93C85
1 Introduction
The main goal of this paper is to design torque controls for a common model of a playground swing, the model of swinging in the sitting position proposed by Case and Swanson [1], with damping added for more realism. As it turns out, the addition of damping makes the problem much more complex from the analytic standpoint. Modeling human control of playground swings has venerable history going back at least to 1960s, see [1, 2] and references therein. However, even aside from the fact that damping or friction are rarely included, all models in the literature, to the best of our knowledge, take the body’s position as the control input. For swinging in the sitting position it is described by the angle between the body and the swing’s axis (rods, chains or cables attaching the seat to the frame). This is a natural simplification given that human swingers can use their biophysical machinery to generate torques for muscle movements that change and stabilize the requisite body angle. But much complexity is hidden in these built-in mechanisms, and if we want to understand them, or design an electromechanical device that would relieve parents of the chore of swinging their kids, then we can not rely on biophysics to do the work.
Aside from the recreational motivation, torque control of the swing is closely related to control tasks in modern robotics, such as bipedal walking and brachiating for robots with rotating joints [3, 4, 5, 6]. Simplified models of robots, such as the Acrobot and the Pendubot, have been developed to design and analyze controls of similar nature [7, ch. 5],[8, 9, 10], as well as component models such as the reaction wheel pendulum [11, 12, 13, 14] and Furuta pendulum [15]. When there is no damping in the swing’s joints, the equations of motion of the Case-Swanson model with the torque control are identical (up to the signs of constants) to those of the Acrobot, and for the simplified model that we focus on (the balanced swing) to those of the reaction wheel pendulum. Another related task is synchronizing a pair of two connected pendulums [16, 17], where one is equipped with clock escapement.
These systems share common features of underactuation and trigonometric nonlinearity that make them convenient test cases for the methods of nonlinear geometric control theory [7, 18, 19]. Underactuation means that only some degrees of freedom are directly affected by control inputs, which forces one to balance achieving desired behavior with maintaining reasonable internal dynamics of the uncontrolled degrees of freedom. In robotics, underactuation comes up when some joints do not have an associated motor to move them. In human execution, performing such tasks is often associated with dexterity. In part, we use the problem of playground swinging to investigate what sort of controls an underactuated robot would require for some tasks easily performed by humans.
In the Case-Swanson model the body is represented by a rigid dumbbell made of three masses attached to a rigid axis that connects it to a fixed pivot. The axis and the dumbbell can rotate around the upper and the lower joint, respectively. We add damping to both joints, but it is adding it to the unactuated upper joint that complicates the problem considerably. The open loop equations of motion are formally identical to those of the damped double pendulum, and, with the torque control, to those of the damped Acrobot. For analytic simplicity, in most of the paper we consider the case of the balanced swing, where the moments of inertia of the side masses are equal, a variant singled out already in [1]. The equations of motion reduce to those of the damped reaction wheel pendulum. Unbalanced swinging in the sitting position can be treated as a small perturbation of the balanced case (Section “Unbalanced swing”).
While the control system is familiar from robotics, the control task is unusual. It is not stabilization near an equilibrium, but rather inducing sustained oscillations of prescribed amplitude and frequency (by a static state feedback control law). Sometimes such a task is interpreted as a version of trajectory tracking for a selected periodic trajectory [1, 12, 15, 13], but this artificially fixes the phase of oscillations that a swinger does not care about and would not want to spend energy maintaining. Therefore, a more natural control goal is orbital stabilization, where the orbit is a stable limit cycle [20, 21, 22]. Practical considerations lead to further design criteria that the desired control must satisfy:
-
1.
In the closed loop system the angle of the swing axis with the vertical approaches a stable limit cycle of oscillations with a single dominant frequency, without beats or chaotic motion.
-
2.
The dynamics of the body angle with the swing axis is bounded and oscillatory with a single dominant frequency.
-
3.
The transient motion, before the limit cycle is reached, is reasonably short.
Meeting all three desiderata turns out to be surprisingly challenging. The first two criteria are hard to express in analytic form, and we are not aware of general results for nonlinear systems that would guarantee meeting them. Accordingly, our design strategy is semi-analytic. We look for a control ansatz that meets part of our design criteria and contains sufficiently many parameters that are adjusted in simulations to meet the rest. Such hybrid approach is typical for studying systems that are capable of chaotic behavior, like harmonically driven damped pendulum [23, 24]. Our adaptation of it to control design that sustains regular oscillations offers a novel methodology for controlling underactuated mechanical systems with friction that appear in robotics.
Most of the cited work on control of robot arms and pendula concerns the swing up task and stabilization near the unstable equilibrium. Many classical control techniques employed there, such as linearization around a stable equilibrium, pole placement and standard stabilizing controllers such as LQR (including its variants for trajectory tracking), are not suitable for our control task of orbital stabilization. However, the technique of feedback linearization [18, 19], that has been applied to control of swing up in [8, 10] and of the undamped reaction wheel pendulum in [11, 25], is central to our approach. Our control design is closest to that of [20], that uses dynamic state feedback construction to induce limit cycles with bounded zero dynamics in feedback linearizable multi-dimensional systems. Its simplification to a static state feedback form, and application to control of swinging appear to be new. Generally speaking, to make use of feedback linearization one has to get lucky twice. First, the studied system has to be feedback linearizable, or at least close to one in some sense. And second, the new variables have to be related to the original ones in a way that preserves desirable behavior. This second condition is not met in our case by an alternative construction of [22] based on backstepping. It is one of the main observations of this paper that we do get lucky with the balanced swing.
The paper is organized as follows. In Section “Playground swing: equations of motion and naive controls” we show how several natural ideas lead to controls that fail at least one of the design criteria. It also serves as preliminaries, introducing the model of the swing along with some useful background and terminology.
In Section “Feedback linearization and imposing a limit cycle” we generalize the standard construction of a static state feedback law that imposes a limit cycle on a single second order equation [21, 26] to a linear system of any dimension in the Brunovsky canonical form. It is motivated by the dynamic state feedback construction of [20]. The law imposes a limit cycle on a two-dimensional subsystem, while producing bounded zero dynamics on a complementary subsystem. Since the system is linear this dynamics is oscillatory.
In Section “Feedback linearization control: analysis and variations” we analyze the resulting control law for the balanced swing. In principle, our construction includes an arbitrary energy function that determines the shape of the limit cycle, but we always chose it to be quadratic for simplicity, and did not investigate closed loop behavior when it is varied beyond shifting the center of the cycle. So our limit cycle is an ellipse and we have five control parameters to adjust: two describe the ellipse, and three control gains determine transient behavior. Using simulations, we adjust the parameter values to meet our design criteria for realistic playground swings and swingers. Shifting the center of the ellipse is used to incorporate an additional constraint on the range of the body’s angle, which is especially salient for swings with back benches that prevent backward leaning. In simulations, the zero damping law (with minor corrections) turns out to work quite well even when the damping is non-zero but relatively small. But the damped system is no longer feedback linearizable, and the resulting closed loop system is analytically opaque.
To remedy the situation somewhat, in Section “Damping corrections for small amplitudes” we linearize the balanced swing for small amplitudes and run the process of reduction to the Brunovsky canonical form and imposing the limit cycle on it in parallel to the non-linear zero damping case. This allows us to obtain damping corrections analytically, and to track what happens to the closed loop system (for small amplitudes) when the damping increases. The linearized closed loop system can be transformed into an alternative form that makes the physics behind the control more transparent. One can think of it as imposing a limit cycle on a combination of the swing and the body angles and their velocities designed to periodically drive the swing angle, while adding artificial damping (and stiffness) to a complementary degree of freedom. For the linearized system this combination is a linear combination that can be explicitly written for all values of damping and control parameters. But for the non-linear system it exists (in exact form) only in the case of zero damping (as we already know), and also in one other case.
This second case is of independent interest because it does not involve feedback linearization and a small parameter perturbation. We study it in Section “From balanced swing to driven damped pendulum”. Physically, the control can be interpreted as imposing a limit cycle on a linear combination of the angles only, without involving velocities, but the analysis only works for a special choice of the ratio of the last two control gains. The resulting closed loop system for the swing angle turns out to be (in the steady state) the damped pendulum driven by a harmonic excitation. As is well known, this is one of the simplest systems with chaotic behavior, but its appearance is not entirely unexpected since the double pendulum itself is already such a system. If the driving frequency or the driving amplitude is increased, while all other parameters are kept fixed, the pendulum dynamics undergoes a cascade of period doubling bifurcations that ends in regions of chaotic behavior interspersed with returns to regular oscillations at yet higher values [23, 6.3], [24, 3.3.5].
Obviously, meeting our second design criterion requires avoiding chaos, or even period doubling, and having one less control gain makes the task more difficult. It turns out that for realistic values of lengths and masses this is only possible when the damping in the upper joint is relatively large to begin with. We estimate the requisite range of damping values using the results of [27]. Outside of this range in simulations we encountered long transient times, oscillations without dominant frequency (beats), and sometimes numerical instability that indicates sensitivity to initial values characteristic of chaotic dynamics.
In Section “Unbalanced swing” we represent the unbalanced swing as a perturbation of the balanced swing, and show, in simulations, that balanced controls continue to perform well for small imbalances. Finally, in Conclusions we summarize our results, and discuss their limitations and directions of future work they point to. The upshot is that the “well-known” playground swing still holds a lot of unanswered questions.
2 Playground swing: equations of motion and naive controls
There is a general agreement that two mechanisms contribute to keeping a playground swing going: moving the body’s center of mass up and down and rotating it around the pivot (angular momentum transfer). In idealized models of swinging these two mechanisms are often studied separately, as swinging in the standing and in the sitting position, respectively. We will start by considering the model of a swing with a human in the sitting position proposed by Case and Swanson [1].
2.1 Case-Swanson model
Human body is modeled by a rigid dumbbell with three masses, and the middle mass is attached to the end of a damped pendulum, see Figure 1. The angle of the swing axis with the vertical is denoted , and the angle of the dumbbell with the axis is .

Following [1], we introduce the combined mass , the moments of inertia and , and the imbalance coefficient . Then the Lagrangian of the system is
(1) |
Note that the form of the Lagrangian is identical to the form of it for the double pendulum, which is obtained by setting . The only difference is that for a double pendulum the imbalance can only be non-negative, whereas for the swing it can have any sign depending on the size and location of dumbbell masses, i.e. the positioning of the body.
Our control variable is not the angle , as in most simple models, but rather the torque in the lower joint. The Lagrangian does not take into account damping, which, as we shall see, complicates the problem considerably. We introduce the damping coefficients and in the upper and the lower joint, respectively, and modify the Euler-Lagrange equations as follows:
(2) |
Throughout most of the paper we assume that the body is perfectly balanced, i.e. . This isolates the angular momentum transfer as the energy pumping mechanism and simplifies the equations of motion. The unbalanced swing is briefly considered in Section “Unbalanced swing”. For (2) reduces to
(3) |
When one easily recognizes in (3) the equations of motion of the reaction wheel pendulum introduced in [11], see also [9, 13, 14, 20, 21, 25]. It will be convenient for us to transform (3) into a simpler form. First, we eliminate from the first equation in (3) using the second:
Next, by introducing new constants and variables:
(4) |
we reduce the equations of motion to:
(5) |
2.2 Damping canceling control
The first equation describes a driven damped pendulum, and the first thought that comes to mind for inducing sustained oscillations of it is to simply cancel the damping in the upper joint by setting , or equivalently . With it, will follow the dynamics of a simple undamped pendulum that oscillates at the natural frequency . Unfortunately, if one is interested in swinging with a particular amplitude this will not work. Natural oscillations are neutral rather than stable, and any perturbation will shift the amplitude up or down. In other words, the cancelling control fails already our first design criterion: swing oscillations are not attracted to a stable limit cycle.
(a)
(b)
2.3 Trajectory tracking
This popular approach is pursued in [1, 12, 15, 13], e.g. by prescribing as the target trajectory, is also unsatisfactory. While the canceling control does not do enough, a tracking control does too much, prescribing not only the frequency and the amplitude but also the phase of oscillations. This is bound to create a lot of unnecessary effort trying to shift the phase when it is offset, something a swinger does not really care about.
2.4 Naive limit cycle
The next idea is to use the standard construction of imposing a stable limit cycle on a single second-order equation [21, 26]. One specifies the desired limit cycle of the form , where is an “energy function” determining its shape, e.g. or , and determines its size, see Figure 2. Then is chosen so that the closed loop equation becomes
(6) |
with a positive gain . One can then prove, using the Lyapunov function and La Salle’s invariance principle, that is its stable limit cycle [20]. For the pendulum is the most natural choice, and it leads to
(7) |
with a very transparent interpretation. When the damping term is positive and decreases the amplitude, and when it turns negative and the energy is pumped into the swing instead. Asymptotically, and we have oscillations at the natural frequency as with the naive control, but now they are stabilized against perturbations.
(a)
(b)
While this is a fine solution for stabilizing oscillations of a damped pendulum, applied directly to (5) it runs into a problem well-known from stabilizing equilibria in underactuated systems. When the controlled subsystem is close to the equilibrium point or manifold, the remaining degrees of freedom follow what is called zero dynamics [18, 4.3]. In this case, we simply ignored , and hence . But in zero dynamics the stabilizing control reduces to the damping cancellation, and the second equation from (3) becomes . Double integration then produces a secular term that grows linearly with time. Since undergoes something close to harmonic oscillations on the limit cycle we can expect to grow without a bound for generic initial values, and indeed this is the case, see Figure 3. Even when we select initial values to make the secular term vanish, random perturbations and/or parameter imprecision would knock the swing with this control off a bounded trajectory. Since is an angle unbounded growth means that the body will be making full rotations around the pivot point, so this solution is not physically realizable by humans. Even with a robot, this type of control would require a lot of wasted energy to implement. Ruling out full rotations motivated our second design criterion.
2.5 Velocity dependent feedback
Taking a closer look at human swingers, we see that they typically throw their body back and feet forward on the forward motion of the swing, and reverse this configuration on the backward motion [2], see also Figure 4. Spong proposed the same energy pumping strategy, in a feedback form, for swing up control of the Acrobot arm [8]. The idea is that the sign of should be matched with the sign of , for example by setting with some . The problem is that such a control leads to a third order equation for , and, although it seems to take care of keeping bounded, it really does not. Once we convert the expression for into one for the corresponding torque we can no longer guarantee that the closed loop solution will be a trajectory where stays bounded. This is not a problem for the swing up task, where the goal is to swing the arm into the vertical upward position and stabilize it there by some other means, e.g. by LQR, but it is for periodic swinging. We need a controller that will itself work somewhat like an LQR, but for a limit cycle orbit rather than for an equilibrium point or a fixed trajectory.
3 Feedback linearization and imposing a limit cycle
The previous section should suggest to the reader that designing a suitable torque control for the swing is not as simple as it seems, and may require more sophisticated techniques. A more successful approach comes from the observation that the balanced swing system (3) has the same equations of motion as the reaction wheel pendulum with damping. And with the damping turned off this system is feedback linearizable [11, 20, 25]. This means that it can be transformed into a chain of integrators by a change of coordinates and of the control input [18, 4.2][19, 2]. The problem of inducing a limit cycle with bounded zero dynamics in feedback linearizable systems has also received some attention in the recent literature [20, 22].
Feedback linearization transforms the system into one for new state variables , and the original variables are expressed as explicit functions of them and their derivatives. This is where we get lucky the second time – these functions turn out to be such that imposing linear oscillatory dynamics on has the effect of driving to a limit cycle with bounded zero dynamics for . To introduce the new variables, note that the system (5) with is just
(8) |
It is feedback linearized by the output below, and we define the corresponding state vector and the new control variable as follows:
(9) |
Remark 1.
Note that one can solve for given only if does not vanish, so this linearizing transformation is only well-defined in the range .
In terms of the system is transformed into the Brunovsky canonical form for :
(10) |
General approach to inducing stable limit cycles on a two-dimensional subspace of such a system, with a bounded oscillatory dynamics on its complement, is described in [20, 22]. We will simplify the dynamic state feedback construction of [20] to a static state feedback form. The idea is to impose a stable limit cycle on by applying the two-dimensional construction (6), where is a vector and is a matrix, while ensuring stable zero dynamics for the uncontrolled degrees of freedom.
Remark 2.
To apply the two-dimensional construction we need to isolate an autonomous two-dimensional system for the dynamics of . Assuming, without loss of generality, that it is also in the Brunovsky canonical form, has to be selected so that and reduce to and . Playing with the system’s equations leads to imposing the following identities:
(11) |
where is some gain vector that provides flexibility for constraining the zero dynamics. The first identity implies that the vector must be of the form , and the second then implies that
(12) |
Theorem 1.
For the chain of integrators (10) set with selected so that the polynomial is Hurwitz, i.e. its roots have negative real parts. Then the control
(13) |
produces a closed loop system where has a stable limit cycle of harmonic oscillations with the frequency and the amplitude , while the complementary state variables have bounded oscillatory zero dynamics.
Proof.
Since we have . Applying equation (10) and identities (11), we obtain
Therefore, , and
Applying the strategy used in (6) with we define the control by (13) and obtain a closed loop system with a stable limit cycle for . Note that the values of are left undetermined so far.
To complete the proof we have to account for the zero dynamics of the remaining degrees of freedom, this will also provide the constraints on the choice of . The initial variables together with can be chosen as coordinates on the entire state space, and we define the complementary subspace state vector as . Since with we can express in the matrix form as
(14) |
The matrix is the companion matrix of the polynomial , and its eigenvalues are its roots [28, 4.11]. If is Hurwitz then the zero dynamics of is driven by a harmonic excitation with a Hurwitz matrix , i.e. it is bounded and oscillatory. ∎
Remark 3.
One can see this result as generalizing the static state feedback construction of imposing a limit cycle on a single second order equation discussed in Section “Playground swing: equations of motion and naive controls”, and it is inspired by the dynamic state feedback construction of [20]. Hurwitz polynomials are polynomials all of whose roots have negative real parts. They commonly appear in control theory because when the characteristic polynomial of the matrix of a linear system is Hurwitz the system is asymptotically stable. In the operational calculus they appear in the denominator of the transfer function, and their roots are its poles. Accordingly, a popular method of linear control design is known as pole placement. There are well-known computational methods for testing whether a polynomial is Hurwitz, such as the Hermite-Biehler test and the Routh-Hurwitz criterion.
To generate a Hurwitz polynomial one can directly assign its roots, and recover the polynomial’s coefficients by the Vieta’s formulas. For the system in Theorem 1 this amounts to pole placement for the transfer function of the zero dynamics. More sophisticated generation methods, based on backward application of the Hermite-Biehler test or the Routh-Hurwitz criterion, are discussed in [29]. They are particularly useful when sampling polynomials to obtain a more desirable behavior by trial and error..
In our case, has only two gains , so , and . Hence, explicitly:
(15) |
Naively, we would prefer to select , so that the limit cycle is imposed directly on . This is what we tried with the canceling control in the previous section, and now it becomes clear why it did not work. The polynomial is Hurwitz if and only if . To get bounded zero dynamics and have to be mixed in into the variable upon which the limit cycle is imposed. The angle of the swing would still undergo bounded oscillations under this refined construction because the entire state vector does, although we do lose some control over their exact shape.
4 Feedback linearization control: analysis and variations
In this section we take a closer look at the swing dynamics under the control law designed in the previous section, and discuss some variations on it. In terms of , , the closed loop system is the following:
(16) |
The second equation imposes a stable limit cycle on , and in the steady state oscillates harmonically with the frequency and the amplitude . The first equation then describes a damped harmonic oscillator driven by . The original angles are recovered by inverting the linearizing transformation (9):
(17) |






It is the special form of these relations, in addition to the properties of the feedback linearized system, that is responsible for the resulting control being suitable for our purposes. They imply that and undergo bounded anharmonic oscillations with a single dominant frequency in the steady state. Using the standard results on driven harmonic oscillators [30, 9.10.3], in conjunction with (17), gives the following theorem.
Theorem 2.
Numerical simulations of the undamped balanced swing (3) with the control law induced by (15) are shown on Figure 5 (a). The physical parameters are selected to match a typical human body and a playground swing, the standard SI units are used throughout the paper. The transient time and the shape of oscillations are quite satisfactory, the amplitudes can be controlled by changing . The anharmonicity is only visible in the shape of the graph. One can also see that the body’s and the swing’s oscillations are exactly anti-phase in the steady state. This is also a direct consequence of the recovery relations (17) for this type of control, because and hence oscillates in-phase with , while is their linear combination with negative coefficients.
(a)
(b)
Remark 4.
The type of swinging prescribed by our control does not really resemble human swinging as observed on playgrounds. It is too symmetric, the dumbbell leans one way as much as the other way to transfer as much momentum as possible. Humans are constrained in how much they can lean backwards without falling over, see Figure 4, and some swings have benches with back rests that prevent negative values of altogether.
These constraints may or may not be relevant for an electromechanical swinging device or a robot, but, in any case, they can be taken into account even by the type of control we proposed, with a small modification. It turns out that all we have to do is shift the center of the limit cycle for . Changing the energy function from Theorem 2 to has the effect of shifting the center of oscillations for from to , and for from to . This does not affect because it is related to through the second derivative, but for the center is shifted to . One can adjust and so that oscillates between (or some small negative minimum) and a positive maximum. Numerical simulations of the system with the shift that makes the minimal value (no leaning backwards) are shown on Figure 5 (b).
(a)
(b)
Remark 5.
As one can see from Figure 5, the shift of the middle angle also changes the shape of body’s oscillations, and forces more forward leaning to maintain the same swing amplitude. This may not be comfortable for a human swinger. To remedy this, the amplitude of , which is monotonically related to the amplitudes of and by (17), should also be reduced by making smaller. The tradeoff is that the swing amplitude will become smaller as well, see Figure 6.
(a)
(b)
Even though the feedback linearization control was designed for the case of zero damping it works quite well when the damping is turned on as well, with small corrections. The new expression for becomes and we have to modify the control in (15) accordingly:
(18) |
With these corrections, the closed loop system becomes
(19) |
Recall that and the value of is quite large for human swingers, so functions as a small parameter, partially explaining why the control still works. However, system (19) is analytically opaque, especially considering that there is no simple expression for in terms of and anymore.
Numerical simulations of the balanced swing (3) with relatively small damping in the upper joint are shown on Figure 7 (compare to sketches on Figure 4). One can see that the amplitude of the body needed to achieve the same amplitude of the swing increases with the increase of damping, to compensate for the additional energy loss, and the oscillations of the swing and body angles shift away from being exactly anti-phase at zero damping, which does match playground observations better. An animation of the corresponding swing motion, with a shift that allows some backward leaning, is shown on Figure 8. As one would expect, the main difference from human swinging is that the rotation of the body is spread out over the entire swing cycle rather than confined to swift motions near the turning points.






5 Damping corrections for small amplitudes
While the damped () reaction wheel pendulum system (5) is not feedback linearizable we can get some insight into its behavior by considering the case of small amplitudes, when . The linearized system is analytically tractable, and we can better understand what happens in the closed loop system when a similar control is applied, unlike for the perturbed system (19). As a bonus, it will suggest an alternative control law for the original non-linear system that is applicable when the damping is large.
The linearization of system (5) for small is
(20) |
and can be written in the matrix form by taking , , , and :
An output that converts it into the Brunovsky canonical form (10) can be chosen as [18, 4.1], [19], where is a vector orthogonal to , , . When we choose as below the conversion runs parallel to (9), but with explicit damping corrections:
(21) |
Indeed, for the expressions for and are exactly as before, and is instead of , which are close for small amplitudes. Effectively, the new is the approximate second anti-derivative of for , in explicit feedback form. The auxiliary control that transforms (20) into the Brunovsky form (10), and the auxiliary variable , upon which the limit cycle is imposed according to Theorem 1, also have similar form. The resulting control law is
(22) |
and the closed loop system in terms of , takes the exact same form as (16):
(23) |
However, because we now also have , and the equations are linear, we can rewrite (23) in terms of directly. Differentiating the first equation twice eliminates , and solving for in the second equation we derive an alternative form of the closed loop system:
(24) |
The second equation again produces a stable limit cycle consisting of harmonic oscillations with the frequency and the amplitude . The first equation is a damped harmonic oscillator driven, in the steady state limit, by a harmonic excitation .
Remark 6.
The closed loop system is particularly transparent when choosing the natural gains and , as the expression for suggests. Then and . In other words, we are imposing a prescribed limit cycle on the sum of the swing and body angles (recall that ) rather than on the swing angle itself. This is somewhat counterintuitive, because it is that we really want to control, but, in hindsight, understandable. The reason the naive law that controlled directly produced unbounded zero dynamics was that the equation for in (5) or (20) has no damping or stiffness of its own. This is exactly what our controls introduce artificially, at the expense of controlling only indirectly. Some of the flexibility in controlling has to be sacrificed for the sake of suppressing unbounded growth of , and hence of .
From the standard results on driven harmonic oscillators [30, 9.10.3] we can derive the following.
Theorem 3.
This explains why the reaction wheel control law still works (for small amplitudes, at least) with non-zero damping. But if we try to apply linear corrections for from (21) to the original non-linear system (5) we do not get to come out cleanly as , but rather get . The exact second anti-derivative does not exist in a static state feedback form because the system is not feedback linearizable, so there is no exact non-linear analog of .
However, things are better for . The control law (22) simplifies already when we take , i.e. when the control gains are in the same ratio as the natural gains. Moreover, this choice cancels the derivatives in the definition of and reduces it to a linear combination of and only:
The advantage is that we can define this way even for the non-linear system, and, although we can no longer write the closed loop system in terms of and , it turns out that the system (24) for and does have a non-linear analog, and a well-studied one. This is the approach we pursue in the next section. However, there is a downside. Fixing the gain ratio leaves a single gain parameter to vary and reduces control options. As we will see, such single gain control only works well when the damping in the upper joint of the uncontrolled swing is already large.
6 From balanced swing to driven damped pendulum
As we saw for the linearized balanced swing, for a particular choice of the gain ratio the variable upon which the stable limit cycle is imposed reduces to a linear combination of the swing and the body angles, without time derivatives, and the alternative closed loop system (24) simplifies. We will show that a similar simplification occurs in the original non-linear system, even though, with the damping turned on, it is no longer feedback linearizable. One can see it as implementing the idea that the limit cycle should be imposed on a combination of angles rather than on the swing angle itself to ensure bounded zero dynamics.
It is convenient to rescale the auxiliary variable we used before and define
where is a constant. Then from (5) we obtain
(25) |
We impose a limit cycle on as in (24) by using the control:
(26) |
and obtain the closed loop system
(27) |
We need to select for the damping to be positive. In the steady state, is oscillating harmonically with the frequency and the amplitude , and drives the equation for with the scaled amplitude .
Remark 7.
The interpretation of is most transparent when and (this corresponds to choosing the natural gains in the linearized control of the previous section), and when and . Moreover, taking corresponds to imposing the limit cycle on directly, in which case the two equations in (27) collapse into a single one, and the zero dynamics is unbounded, as we already saw in Section “Playground swing: equations of motion and naive controls”.
Thus, in the steady-state limit our problem reduces to driving a damped pendulum by a harmonic excitation
(28) |
In the case of small amplitudes we have a driven harmonic oscillator as in the linearized problem (24). The steady-state oscillations then have the frequency and the amplitude
(29) |
We can select any desired frequency and any desired positive damping coefficient by adjusting . Then can be adjusted to set the amplitude . The energy transfer is most efficient at the resonance, when the expression under the square root is minimized, which gives:
(30) |
and this is a natural choice for , leaving only and to select.
As before, we can accommodate constraints on the range of . It is easiest to do by choosing which gives , we simply choose , with some prescribed shifted middle angle , as the energy function. Then the equation of motion (6) for becomes
(31) |
The amplitude of the steady state oscillations is still given by , but they are now centered at rather than at , and hence the range of angles is .
(a)
(b)
(c)
(d)
By choosing we get rotations between and characteristic for swings with back rests, and by choosing , we get rotations between and that humans can achieve on swings with flat seats without falling over. Perhaps, one can lean even further back by holding on tight to the swing chains or ropes. The corresponding control is given by
(32) |
and the zero dynamics equation for the swing angle is
(33) |
Compared to (33) (with ) we have an additional constant driving term . Its effect is easy to understand intuitively for small amplitudes when . In that case the shift can be subsumed into , and we have regular oscillations around a shifted middle position . Because typically and the shift in is barely noticeable in practice. This approximation remains valid roughly for or .
Damped pendulum driven by a harmonic excitation is one of the simplest, and best studied, mechanical systems that can exhibit chaotic behavior [23, 24]. For small driving amplitudes and frequencies it is well approximated by driven damped harmonic oscillator, which goes into resonance when the driving and the natural frequencies are close to each other. The dynamics remains qualitatively similar even as the approximation is no longer accurate for somewhat larger values. But this does not remain the case forever. As the driving frequency or amplitude are increased, the pendulum starts behaving differently in a dramatic fashion, its motion undergoes a cascade of period doubling bifurcations. Period doubling means that the oscillations no longer have a single dominant frequency. It splits in two, and the graph of the pendulum angle as a function of time looks like a wave of one frequency modulated by another, the pattern known as beats, see Figure 9 (a), (c). As more and more frequencies are superimposed, the motion becomes increasingly erratic. The period doubling cascade ends in fully chaotic behavior, which, surprisingly, gives way back to regular oscillations at still higher values of the frequency or the amplitude, but only for narrow ranges of their values [24, 3.3.5].
Our simulations show that for realistic values of lengths and masses the closed loop driven damped pendulum falls within the range of regular oscillations (and hence satisfies our design criteria) only for relatively large values of the damping coefficient , see Figure 9. For smaller values of , the steady state oscillations display the pattern of beats, a wave with one frequency modulated by another. It appears that the closed loop system undergoes a period doubling bifurcation as is decreased, past which this type of control is no longer satisfactory.
Remark 8.
The appearance of beats is a price of having a more analytically transparent closed loop system (27). It gives us one less control parameter than the feedback linearization control ansatz. While allows us to increase the damping in the closed loop system (28), it can only do so by also increasing its “stiffness” (the coefficient of ) at the same time, which leads to the beats. The only way to have damping large enough without too much spurious oscillation is to have it large enough to begin with, before the control is applied.
To interpret our results, we rescale the time variable to with and convert (28) into the dimensionless form
(34) |
where
(35) |
In terms of the dimensionless parameters the amplitude formula (29) simplifies to
(36) |
Note that the choice corresponds to the resonance in the absence of damping, and (30) reduces to . Regular oscillations, for which this formula is valid, take place for small and , with close to .
A detailed semi-analytic investigation of the onset of chaos in a harmonically driven damped pendulum by perturbation methods can be found in [27]. It is based on Fourier approximation with a dominant mode. It turns out that in the next order of approximation the amplitude formula (36) has to be corrected by replacing in the denominator with an expression that depends on the amplitude , and so it turns into an implicit equation for . This equation (see (38) below) defines curves in the - plane called the resonance curves. They are plotted in [27] for some typical parameter values, and have two branches, normal and anomalous.
There is a range of parameter values where the normal branch represents stable regimes and resembles the resonance curve for the driven damped harmonic oscillator given by (36). This is the primary range of regular oscillatory behavior. Increasing deforms the resonance curves into multi-valued graphs, and regular oscillations destabilize, setting off the period doubling cascade where the dominant mode approximation is no longer applicable. But it can be used to analytically estimate the threshold values where the onset of the period doubling occurs. We will use the following result from [27].
Theorem 4.
Suppose that , , and
(37) |
Then the steady state motion of the driven damped pendulum (34) is anharmonic oscillation with the dominant frequency and the amplitude implicitly determined, to the first order of approximation, by
(38) |
where is the first Bessel function.
It is the amplitude condition (37) that cannot be satisfied when the value of (and hence of ) is small. For our choice of swing parameters and the threshold value for falling within the regular oscillatory range is roughly . Because we only have one control gain to vary, we cannot increase independently of and . Moreover, values of close to the threshold, that increase , lead to numerical instability in simulations. On the other hand, if we keep both gains the asymptotic closed loop dynamics is no longer described by the driven damped pendulum or some other known system, see (19).
7 Unbalanced swing
Up to this point we assumed that the swinger is fully balanced, i.e. her center of mass is on the swing’s axis. When this is not so, rotating the body (modeled by the attached dumbbell), aside from the momentum transfer, has the additional effect of moving the center of mass up and down. This additional energy pumping mechanism is used exclusively when pumping up the swing from the standing position [2, 31]. There is, however, a tradeoff. Pumping the swing up by moving the center of mass is most effective near the midswing, whereas the angular momentum transfer is most effective when it is near the turning points. Since in our dumbbell model both moves can only be accomplished by rotation the two strategies cannot be used simultaneously.
With the terms included the equations of motion (2) become
(39) |
Considering the prevalence of the angle sum and its derivatives in the above equations it is natural to introduce as a new variable. In terms of , the equations transform into (we keep for brevity)
(40) |
Up to the damping terms and reinterpretation of constants, these are the equations of motion of the Acrobot [10, 11, 14]. Subtracting the second equation from the first simplifies the latter to:
(41) |
Remark 9.
If we then eliminate from it and neglect the term the simplified system becomes
(42) |
Since we can rewrite the last system as a perturbation of (5):
(43) |
(a)
(b)
From our experience with the balanced swing we should impose a limit cycle on (or its linear combination with ) and then consider the behavior of as driven by the resulting output. Supposing for simplicity (this corresponds to taking in Section “From balanced swing to driven damped pendulum”)
as before, we obtain the control law
The closed loop equation for in the steady state is a perturbation of (27) with and :
(44) |
When and for small angles this reduces to a harmonically driven damped pendulum, but with the driving amplitude corrected by an dependent term.
Simulations implementing this control law are shown on Figure 10. For the smaller value of the imbalance we get regular swinging after a short transient, but when the imbalance is increased to this control produces beats despite the large baseline damping in the upper joint. At this value, the closed loop is an externally and parametrically driven pendulum, and the parametric effects can no longer be neglected when designing the control.
8 Conclusions
We constructed two types of static state feedback torque controls for sustained oscillations of the balanced swing with a single dominant frequency. The first construction uses a combination of feedback linearization at zero damping in the upper joint, when the equations of motion coincide with those of the reaction wheel pendulum, with a novel static state feedback construction of a limit cycle for linear systems in the Brunovsky canonical form. The resulting feedback law performs well also for relatively small non-zero damping. The second construction is based on relating the balanced swing to harmonically driven damped pendulum, but the resulting control performs well (without beats and chaos) only for relatively large values. Both controls can be modified to shift the center of body rotations, so that the angles vary between two specified bounds. In particular, the angles can be kept positive to mimic human limitations and swings with a back bench. We also studied the relationship between these two controls in the limit of small swing amplitudes, and looked at the complications that arise when the swing is unbalanced. Balanced controls do seem to work for small imbalances, but physically (and mathematically) the unbalanced swing problem is much more complex.
To make analysis tractable, our approach was to find controls that allow to decompose the closed loop system into an autonomous subsystem with a stable limit cycle and a dependent subsystem driven by its output. Decompositions of this sort, other than the ones we found, would be useful, particularly those that behave well for the intermediate range of damping values. Energy functions other than the quadratic ones we used are also worth exploring. But even more desirable are alternative approaches to producing controls with analytically tractable closed loop systems, especially since human swinging may not be amenable to such a decomposition, see below.
8.1 Feedback linearization
It is of interest to investigate whether partial feedback linearization [8, 14, 18], that was used for some control tasks for the Acrobot, can be adapted to generate limit cycles. Just like the Acrobot, the damped balanced swing has the relative degree three [18, 4.1], i.e. a three dimensional subsystem of it can be feedback linearized. The remaining degree of freedom can be made asymptotically stable, but it is not immediately clear what to do with it when sustained oscillations are the goal instead. The Theorem 1 type construction does not seem to go through when the linearization is only partial.
Other variations on feedback linearization are of ineterst as well. A transformation that “almost” feedback linearizes the Acrobot (with a small residual non-linearity) is defined in [14]. Perhaps it can be combined with a suitable generalization of our limit cycle construction to produce a torque control of the unbalanced swing without restrictions on the value of the imbalance. Approximate feedback linearization of the Acrobot in [10] suggests another possible approach via hybrid controls.
8.2 Control efficiency
Our analysis had to be complemented by trial and error adjustment of control parameters to produce “good behavior” for realistic swings. Part of the reason is that a more precise characterization of relevantly “good” behavior is hard to spell out. Clearly, the resulting dynamics has to be bounded, but it is unclear how to define a set of outputs that matches the intuition of “regular oscillations” of the sort seen on a playground and has a precise analytic description with nice technical properties.
This also complicates studying control efficiency. We used efficiency considerations qualitatively to set up our design criteria and select parameter values, but a quantitative framework is much more preferable. Optimal control of the swing was considered for swinging in the standing position [31, 32], which is modeled by reducing the swing to a single mass moving up and down the swing axis, with its position as the control input. Extending the results to swinging in the sitting position, and with torques as control inputs, promises to be much more challenging even in the balanced case. It would be interesting to see what types of state constraints and cost functionals would produce optimal control with a limit cycle in the closed loop system, and whether we get “regular oscillations” automatically, or some regularity constraint has to be imposed by hand. One possible choice is to include the Lyapunov function used in (6) into the cost functional. Heuristic considerations in [2] suggest that for something like energy minimization with a lower bound on the amplitude the optimal control might be singular, with instant rotation at the turning points, but this already presupposes trajectories of a form for which the notion of “amplitude” makes sense.
There is an additional complication in the unbalanced case. The two energy pumping mechanisms (center of mass motion and angular momentum transfer) interact in inscrutable ways, and work at cross purposes. The optimal time for the momentum transfer is at the turning points, while for the center of mass pumping it is a shift at the midswing [2]. The most efficient control would have to be some non-linear mixture of the two, or, perhaps, even some quaint maneuvering that humans do not and/or can not perform. Although we took human swinging as the prototype, control parameters in our simulations can be selected so that the “body” dumbbell oscillations are quite quirky compared to the ones observed on a playground. For example, the dumbbell may perform flips near one of the turning points while the swing goes through regular oscillations unperturbed. This suggests that robotic devices designed to swing swings do not necessarily have to imitate humans, especially if energy efficiency, or some other technical considerations, are important.
8.3 Human swinging
In case one is interested in understanding the biophysics of human swinging, it is worth pointing out that even our shifted controls only partially “fake” human behavior. To name a couple of discrepancies, there is no characteristic delay between reaching the turning point and the body’s reaction, and the induced dumbbell rotations are too gradual.
Ideally, one should instantaneously rotate the body (throw the head back and feet forward) from, say, to at the start of the forward swing, and rotate it back for the backward swing, instead of spreading out the motion harmonically over the entire half-swing, as in (31). Human swingers are not ideal, and react with delay, but their repositioning still does not take the entire half-swing. The body is rotated swiftly near the turning points, and the swing oscillates naturally in between. This is similar to the workings of cogwheel escapements in old school mechanical clocks [16]. Since those are often modeled using piecewise smooth or van der Pohl limit cycles [17] those may provide a better fit for human swinging as well.
While human swinging maneuvers are simple enough to describe in terms of the body angle, reverse engineering torques that accomplish them is structurally more complex than the static state feedback philosophy we followed so far. We can implement the maneuvering described above by specifying the requisite torque for . However, as the timing of the moves requires tracking , will depend on it, so and the equation for will not be autonomous.
And this is not the end of it. As described, the procedure would pump energy into the swing endlessly resulting in unbounded growth of the swinging amplitude. Preventing that is simple enough for human swingers – simply sit out a cycle when the swing up is too high – then resume when damping reduces the amplitude sufficiently. However, implementing such a control directly requires memory, and the closed loop will no longer be described by a differential equation. A static state feedback workaround is to track swing’s total energy instead, i.e. stop applying any torque whenever the energy exceeds a chosen threshold.
But even this static state feedback imitation of human control is not of the form that naturally flows from the standard methods of control theory. The reason is simple enough, the closed loop system does not have an autonomous subsystem, or some other apparent analytic backdoor, and is harder to analyze and predict as a result. Our tentative attempts to experiment with human inspired controls in simulations were inconclusive because the relatively abrupt changes in the body angle produced torques that made the equation for swing angle numerically unstable.
Acknowledgments: The authors are grateful to the anonymous reviewers for insightful critique of and many helpful suggestions to the original draft of the paper that greatly improved the final version.
References
- [1] W. Case and M. Swanson, “The pumping of a swing from the seated position,” Amer. J. Phys., vol. 58(5), pp. 463–467, 1990.
- [2] S. Wirkus, R. Rand, and A. Ruina, “How to pump a swing,” College Math. J., vol. 29, no. 4, pp. 266–275, 1998.
- [3] F. Asano, “Limit cycle gaits,” in Humanoid Robotics: A Reference, A. Goswami and P. Vadakkepat, Eds. Springer, 2018, pp. 949–978.
- [4] J. Nakanishi, T. Fukuda, and D. Koditschek, “A brachiating robot controller,” IEEE Trans. Robot. Autom., vol. 16, no. 2, pp. 109–123, 2000.
- [5] C. de Wit, B. Siciliano, and G. Bastin, Eds., Theory of Robot Control. London: Springer, 1996.
- [6] S. Tzafestas, Introduction to Mobile Robot Control. Amsterdam, New York: Elsevier Science, 2013.
- [7] I. Fantoni and R. Lozano, Non-linear Control for Underactuated Mechanical Systems. London: Springer-Verlag, 2002.
- [8] M. Spong, “The swing up control problem for the Acrobot,” IEEE Control Syst. Mag., vol. 15, no. 1, pp. 49–55, 1995.
- [9] S. Krafes, Z. Chalh, and A. Saka, “A review on the control of second order underactuated mechanical systems,” Complexity, vol. Article ID 9573514, 2018.
- [10] M. Murray and J. Hauser, “A case study in approximate linearization: the Acrobot example,” Electronics Research Laboratory, vol. Memorandum no. UCB/ERL M91/46, UC Berkeley, 1991.
- [11] M. Spong, P. Corke, and R. Lozano, “Nonlinear control of the inertia wheel pendulum,” Automatica, vol. 37, no. 11, pp. 1845–1851, 2001.
- [12] S. Andary, A. Chemori, and S. Krut, “Control of the underactuated inertia wheel inverted pendulum for stable limit cycle generation,” Adv. Robot., vol. 23, pp. 1999–2014, 2009.
- [13] H. Gritli, N. Khraief, and A. Chemori, “Self-generated limit cycle tracking of the underactuated inertia wheel inverted pendulum under IDA-PBC,” Nonlinear Dynam., vol. 89, pp. 2195–2226, 2017.
- [14] J. Zikmund, S. Celikovsky, and C. Moog, “Nonlinear control design for the Acrobot,” IFAC Proc. Vol., vol. 40, no. 20, pp. 446–451, 2007.
- [15] L. Freidovich, A. Shiriaev, F. Gordillo, F. Gómez-Estern, and J. Aracil, “Partial-energy-shaping control for orbital stabilization of high-frequency oscillations of the Furuta pendulum,” IEEE Trans. Control Syst. Technol., vol. 17, no. 4, pp. 853–858, 2009.
- [16] I. Blekhman, Synchronization of dynamical systems. Moscow: Nauka, 1971, (Russian).
- [17] V. Jovanovic and S. Koshkin, “Synchronization of Huygens’ clocks and the Poincaré method,” J. Sound Vibration, vol. 331, no. 12, pp. 2887–2900, 2012.
- [18] A. Isidori, Nonlinear control systems. London: Springer Verlag, 1995.
- [19] W. Respondek, Introduction to Geometric Nonlinear Control. Trieste: Lectures given at the Summer School on Mathematical Control Theory, 2001.
- [20] C. Aguilar-Ibánez, J. Martinez, J. de Jesus Rubio, and M. Suarez-Castanon, “Inducing sustained oscillations in feedback-linearizable single-input nonlinear systems,” ISA Trans., vol. 54, pp. 117–124, 2015.
- [21] A. Hakimi and T. Binazadeh, “Stable limit cycles generating in a class of uncertain nonlinear systems: Application in inertia pendulum,” Modares J. Elect. Eng., vol. 12, no. 3, pp. 1–6, 2012.
- [22] ——, “Robust generation of limit cycles in nonlinear systems: Application on two mechanical systems,” J. Comput. Nonlinear Dyn., vol. 12, pp. 1–8, 2017.
- [23] G. Baker and J. Blackburn, The pendulum. A case study in physics. Oxford: Oxford University Press, 2005.
- [24] G. Baker and J. Gollub, Chaotic dynamics. An introduction. Cambridge: Cambridge University Press, 1996.
- [25] J. Grizzle, C. Moog, and C. Chevallereau, “Nonlinear control of mechanical systems with an unactuated cyclic variable,” IEEE Trans. Automat. Contr., vol. 50, no. 5, pp. 559–576, 2005.
- [26] T. Iwasaki, “Basics of autonomous nonlinear oscillators: Limit cycle, orbital stability, and synchronization,” SICE J. Contr. Meas. Sys. Integr., vol. 11, no. 1, pp. 2–13, 2018.
- [27] J. Miles, “Resonance and symmetry breaking for the pendulum,” Phys. D: Nonlinear Phenomena, vol. 31, no. 2, pp. 252–268, 1988.
- [28] P. Lancaster, Theory of matrices. New York-London: Academic Press, 1969.
- [29] F. D. P. Shcherbakov, “On the generation of random stable polynomials,” Eur. J. Control, vol. 17, no. 2, pp. 145–159, 2011.
- [30] H. Davis, Introduction to nonlinear differential and integral equations. New York: Dover Publications, 1962.
- [31] E. Lavrovskii and A. Formal’skii, “Optimal control of the pumping and damping of a swing,” J. Appl. Math. Mech., vol. 57, no. 2, pp. 311–320, 1993.
- [32] J. Kulkarni, “Time-optimal control of a swing,” in Proceedings of the 42nd IEEE Conferenee on Decision and Control (IEEE Cat. No.03CH37475), vol. 2. IEEE, Maui, HI, 2003, pp. 1729–1733.