Exploring Dynamical Systems Through Juggling

Tutorials

The Blind Juggler is a great way to illustrate basic concepts of dynamical system theory. You may learn more about some of the key concepts related to the juggling machines in short tutorials that use simple toy examples to explain the material.

Introduction

Linear Stability Analysis
Learn more about the tool we used to find the shape and motion of the paddle that make sure the ball does not fall off.

Linear vs. Nonlinear Systems
Learn more about the differences between linear systems and nonlinear systems. In engineering, we often analyze systems by approximating them with linear systems, because they are straightforward to analyze.

However, most physical systems are nonlinear, which are less straightforward to analyze and that have some amazing properties.

Controllability
Learn more about the concept of controllability, which can be used to find out if a robot can be controlled to do what we want or not. This concept is an important aspect of the research with the Cloverleaf Blind Juggler.

Stability

How do you build a robot that can juggle a ball without sensing? In a perfect world, it would not be hard to build: the robot would strike the ball with perfect motion and timing, the ball would be perfectly round, and it would bounce along an ideal path to exactly the same height each time

The world is not perfect, however. Balls that appear round to the eye are actually covered with tiny manufacturing defects, and even the most accurate mechanisms cannot repeat the same motion twice. The result of this imperfect world is that balls do not bounce along a perfect path—they spin, they bounce too high, too low or sideways. In other words, they deviate

Dealing with Deviations

Because the Blind Juggler has no cameras, no microphones or any other sensor to measure the deviations, it cannot actively correct the trajectory of the ball. We must therefore design the robot such that it automatically compensates for the deviations. For example, if the ball bounces up too high, the design has to force the ball to bounce lower again. The goal of the mathematical analysis is to find such a design.

Designing a Stable System

In technical terms, a system that automatically compensates for deviations is called a stable system. We have two parameters at our disposal to stabilize the juggling system: (1) the motion and (2) the shape of the paddle. The goal of the mathematical analysis is to find a stabilizing pair of parameters.

The principle of the analysis is simple: After calculating the ideal trajectory of the ball, we add small deviations to the ideal trajectory. For example, we assume the ball starts off a bit too high, and with some small horizontal velocity. We then use the physical laws of free fall and impact to model how these deviations develop over a series of bounces. If the deviations become smaller with each successive bounce, the system is stable. We therefore search a range of motions and shapes that result in deviations that become smaller over time.

The Key Parameters

The Motion
The analysis shows that the paddle must decelerate as it strikes the ball. We can intuitively understand why this makes sense: If the ball bounces too high, it takes longer to return to the paddle; since the paddle is slowing down, the paddle has a lower speed at impact and consequently, the ball bounces less high. The opposite is also true: when the ball is too low, it hits the paddle earlier the next time, so the ball is struck harder and the ball reaches a higher apex again. Therefore, the motion of the paddle forces the ball to maintain a consistent height. On the hardware page, you will find experimental results showing that the ball’s apex height is indeed very consistent.

The Shape
We find that the ball’s trajectory is stabilized in the horizontal directions by a slightly concave
paddle shape. The slight curvature of the paddle keeps the ball in the paddle’s center and prevents the ball from falling off. This is shown in the illustration: The further the ball hits the paddle away from the center, the stronger the ball is pushed inwards again. We find in our analysis that the flatter the plate, the higher we should be able to juggle. We manufactured two paddles: one is a bit flatter than the other one. The prediction our mathematical model makes is indeed true: with the more concave paddle, we can juggle up to about 1.4 meters before the ball falls off; with the flatter paddle, we can go up to 2.0 meters (see video section for a video demonstrating this).

Mathematical Background

More specifically, we analyze the dynamics of the deviations. The basic idea of the analysis is quite intuitive when we analyze the following dynamics:
 x_{k+1} = a x_k

Let x_k be the impact location deviation of the ball on the paddle, or how far the impact occurs from the paddle center. In the ideal case, this deviation is zero. The parameter a is some number and the index k denotes the number of the impact. The above equation therefore reads: The impact location at impact k+1 is a times the impact location at impact k. Basically, a describes how the impact location changes between two impacts.

Now we can think about what this number a has to be such that the ball does not fall off the paddle. Let’s assume that a = 2, and that we start with a first impact location of x_1 = 1. The sequence of impact locations is then

    \[\begin{aligned}x_1 &= 1 \\x_2 &= 2 x_1 = 2 \times 1 = 2 \\x_3 &= 2 x_2 = 2 \times 2 = 4 \\x_4 &= 2 x_3 = 2 \times 4 = 8 \\\end{aligned}\]

The impact location doubles at every impact and will get larger and larger. The system is unstable, and the ball will fall off. On the other hand, if a = \dfrac{1}{2}, we get

    \[\begin{aligned}x_1 &= 1 \\x_2 &= \dfrac{1}{2} x_1 = \dfrac{1}{2} \times 1 = \dfrac{1}{2} \\x_3 &= \dfrac{1}{2} x_2 = \dfrac{1}{2} \times \dfrac{1}{2} = \dfrac{1}{4} \\x_4 &= \dfrac{1}{2} x_3 = \dfrac{1}{2} \times \dfrac{1}{4} = \dfrac{1}{8} \\\end{aligned}\]

The impact locations get smaller and smaller—the system is stable. The same applies to negative values of a: as long as a is between -1 and 1, the system is stable. We can therefore conclude that a must be in the range

    \[-1 < a < 1\]

Nonlinear Systems

We analyze the stability of the ball motion with linear deviation dynamics (see impact location deviation example on the stability section). The real dynamics of a ball bouncing on a plate are nonlinear, however. Nonlinear dynamics are more difficult to analyze, but also more interesting than linear dynamics. In this section, we discuss some properties of nonlinear dynamical systems that we also observe in experiments with the Blind Juggler.

An excellent book, which covers the material discussed here in greater detail, is Steven Strogatz’s “Nonlinear Dynamics and Chaos”.

Linear Systems

The linear dynamics we consider on the stability section are

    \[x_{k+1} = a x_k.\]

Think of x as a number describing the dynamical system under analysis, technically referred to as the state of the system. For the Blind Juggler, x could be the impact location of the ball on the paddle. The index k counts the number of impacts, and a is some number, where, for example, a = -0.4.

The equation then reads: “The impact location x at impact k+1 is a times the location x at impact k.” It describes how the impact location changes between two consecutive impacts.

Let us analyze the linear dynamics in more detail. First, we find values of x for which a sequence x_k, x_{k+1}, x_{k+2}, \ldots remains constant. That means for all k, the value of x does not change. We find that the only x that fulfills the equation x = a x is x = 0.

    \[x = a x \implies x (1 - a) = 0 \implies x = 0.\]

This specific point where the x remains constant is called a fixed point of the system. We can also find this point by plotting the equation on a graph. Below, we show the linear system dynamics for a range of values of a.

On the lower axis, the impact location at the k-th impact is shown. We can look up what the next impact location is by finding the value of a colored line on the left, vertical axis. Each color corresponds to a different a and describes a different dynamical system. The blue line, for example, corresponds to the equation x_{k+1} = 1.5 x_k. The thin black line is where x_{k+1} = x_k. We can use this line to find the fixed point, which is where the black line intersects with the colored line. The intersection is clearly at x_k = 0 for all a.

We can also use the black line to visualize how the system evolves over time. Let us see how that works out for the green system dynamics, where a = 0.5. We start with x_1 = 1 and find the point on the green line for which x_k = 1. This point is also marked in the figure with x_1. To find the next value of x, we draw a horizontal arrow from the point x_1 to the black line, and then add a vertical arrow back to the green line. That gets us to x_2 = 0.5 = 0.5 \cdot x_1. Doing this over and over again, we realize that we will approach x = 0, the fixed point of the system. This is because the fixed point 0 is stable for a = 0.5, since a is smaller than one. We discuss this fact in more detail at the end of the stability analysis.

As an aside: set a = 1, and the line describing the system dynamics coincides with the black line. Therefore, any x_k is a fixed point, and therefore the system has an infinite number of fixed points.

Nonlinear Systems

Linear systems are quite straightforward to analyze. To find the fixed point, we need only find the intersection of two straight lines, and we can immediately tell if the fixed point is stable or not by inspecting the parameter a. We will see in a second that this is not straightforward for a nonlinear system.

As an example, we analyze one of the most famous nonlinear systems, the logistic map. The logistic map can model population growth in biology. You may read more about it here. The system dynamics are

    \[x_{k+1} = a x_k \left( 1 - x_k \right).\]

These dynamics do not look that much more complicated, but they can get very interesting depending on the number you choose for a. This system can be analyzed straightforwardly using the graphical method:

Figure 2: Non linear dynamics

We show the system dynamics for two different values of a. The red system has a fixed point at x = 0, and we find that this fixed point is stable for any starting value we pick in the interval from 0 to 1. The green curve is where things get interesting: If we check the curve for intersections with the black line, we realize that the green system has two fixed points. It intersects at x = 0 and x = 0.6. Nonlinear systems can have multiple fixed points. The system evolution for the green system, starting at the same value as the red system, shows that the value quickly gets close to the fixed point at 0.6, and then starts spiraling in to the fixed point. Let us have a closer look at this spiraling:


Figure 3: Non linear dynamics: spiraling

We see that the red dashed line is actually a pretty good fit to the green line. Therefore, the linear dynamics described by the dashed line are a good approximation to the green, nonlinear system dynamics. For small deviations of x from the fixed point, it is almost perfect. This is exactly how we can analyze the stability of a fixed point of a nonlinear system when deviations are small: We approximate the nonlinear dynamics by linear dynamics, and then analyze these dynamics. This process is called linearization. This is what we did to analyze the stability of the ball motions: We linearized the nonlinear dynamics of the impact locations, assuming the impact locations are small, and then analyzed the resulting linear system dynamics for stability.

Back to the example, we find that the approximated system (red, dashed) has the dynamics

    \[x_{k+1} = -0.5 x_k.\]

Since -0.5 is not smaller than -1, the linear, approximated dynamics are stable (see the stability page why larger than -1 is key). Immediately, we also see why the fixed point at 0 of the green system is unstable: The green line is well above the black line. The black line corresponds to linear system dynamics with a = 1, where stable linear systems turn unstable. Therefore, we see that the linearized green system at the 0 fixed point has an a that is larger than 1, which indicates that this fixed point is unstable.

Periodic Orbits

Now things get even more interesting. We set a = 3.2, and analyze the resulting dynamics:


Figure 4: The beauty of periodic orbits.

There are still two fixed points. However, it turns out that if you check their linearized dynamics, both fixed points are unstable. However, we can find another kind of stable system behavior: If we start the system at x_1 = 0.8, x switches back and forth between 0.8 and 0.51. These two values represent a periodic orbit of the system. We write the following equation for this orbit:

    \[x_{k+2} = x_k.\]

The value of x repeats every other k on this orbit. Therefore, the period of this orbit is two (fixed points are a special class of periodic orbits with period one). Lastly, we find that this periodic orbit is stable: If the system starts near the orbit, it will converge to it, similar to the behavior observed with stable fixed points. With the Blind Juggler, we can also find multiple stable periodic orbits.

Bifurcation Diagram
The behavior of the nonlinear system changes dramatically when we change the parameter a, very much in contrast to the linear system dynamics, where the parameter just determines stability of the single fixed point at zero. The changing system dynamics may well be captured with a Bifurcation Diagram. Basically, we plot all the values of x that lie on a stable orbit for a given system parameter a. We obtain the following figure (taken from Wikipedia).

Figure 5: Bifurcation diagram of the logistic map.

For every a, we search the values of x that are part of a stable periodic orbit of the system. Then, we mark all these points with a black dot. For example, recall the dynamics for a = 2.5, we found a single stable fixed point at x = 0.6. Now check the above figure: If you go up from the location on the bottom axis where a = 2.5, you will hit the black line exactly at x = 0.6. That means that if we increase a from 2.4 to 2.8, the fixed point x also increases, from slightly below 0.6 to about 0.65.

You can also see that strange things begin to happen as a gets larger. Between 2.4 and 3.0, things are not yet very special; there is only a single stable fixed point. At about 3.0, the fixed point turns into a stable periodic orbit of period two (if you look at the shape of the curve there, it is also clear why this phenomenon is called a bifurcation. At about 3.45, the stable periodic orbit of period two turns into a four-periodic orbit. Further along, we find an 8-periodic orbit, then 16, and so on, until at about 3.6, the system goes completely bananas: it is now chaotic.

Chaos

A chaotic system has two key properties:

1) Local Instability
The system is locally unstable: If you start the system from two values that are very close to each other, that small difference is amplified and the system quickly evolves very differently for the two starting values (this is illustrated below).

Figure 6: Evolution of the logistic map for a = 3.7 with two close initial conditions.

The figure shows the system evolution of the logistic map (a = 3.7) for two starting values that are very close to each other. The blue starting value is just one percent larger than the red starting value, but the system quickly evolves very differently.

2) Strange Attractor

While the system is locally unstable, the system state x does not get arbitrarily large, and remains near a specific set of values called the strange attractor. In the Bifurcation Diagram above, you see that for a > 3.6, the system won’t take any value x between 0 and 1 as the system evolves. You will only find values that are black. These black values reveal the strange attractor. It is called an attractor because this black set of values for x is stable: if the system starts close to this set (for example at x = 0.1), it quickly converges to that set of values. This is the same notion of stability as before with the periodic orbits, except that the “stable” motion is now more complicated. The word \emph{strange} in the name stems from the fact that the set of system states x that defines the strange attractor is usually not of integer dimension. Such a set could, for example, be neither a line (dimension 1), nor a plane (dimension 2), but something in between. These sets are called fractals.

Controllability

Controllability is an important concept in dynamical system theory. For complicated systems with many degrees of freedom and many different control parameters, controllability analysis can tell us whether a system can be controlled to arbitrary configurations from any initial configuration by applying a sequence of control actions. Roughly speaking, the analysis tells us if we have enough ways to influence the system to make it do what we want it to do.

This concept is best explained with a simple toy example. Consider a coin on a plate. The number x(t) describes whether the coin is heads up (x(t) = 1) or tails up (x(t) = 0). In dynamical system theory, x(t) is called the \emph{state} of the system. We can pick up the coin and turn it to the other side, which is the control parameter we may choose. We can describe the system in the same way as we do in stability analysis and nonlinear systems introduction. The dynamics of the system are

    \[x(t+1) = x(t) + u(t) \mod 2,\]

where u(t) \in \{0, 1\} is the control action at time t. At time t, we can decide whether to turn the coin over or not. Not turning the coin at time t means we choose the control action u(t) = 0. This implies that x(t+1) = x(t), and the coin remains unchanged. If we choose u(t) = 1, the coin is turned over. For example, suppose the coin is tails up, x(t) = 0, and we choose u(t) = 1. We get x(t+1) = 0 + 1 \mod 2 = 1. The coin is now heads up. In order for the math to make sense, we define that 1 \mod 2 = 1 and 2 \mod 2 = 0, which is the case when we turn the coin from heads to tails: x(t) = 1 and u(t) = 1, so x(t+1) = 1 + 1 \mod 2 = 0. This system is controllable. No matter what side of the coin is facing up, we can simply turn it to the side we wish to be facing up.

We can now introduce a system that is similar to juggling multiple balls on a single paddle. Consider two coins on a plate that we can only turn over together. The dynamics are

    \[\begin{cases}x_1(t+1) = x_1(t) + u(t) \mod 2, \\x_2(t+1) = x_2(t) + u(t) \mod 2,\end{cases}\]

where x_1(t) and x_2(t) describe the state of the first and second coin at time t, respectively. If we choose the control action u(t) = 1, we flip both coins together. The system is uncontrollable: If the coins start with the same side up, we cannot control them to one coin being heads up and the other tails up, no matter what sequence of control actions we apply.

Let’s assume we could also choose an additional control action: a simultaneous toss of both coins with a random outcome. If we apply this control, each coin may land heads up or tails up with 50\% probability each. Now the system is controllable in a stochastic (random) sense. Suppose the coins are both face up, and we want to get them to show different sides up. We simply apply the coin toss control action until the coins show different sides. This is a similar strategy to what we use to control multiple balls on the Cloverleaf Blind Juggler into a desired juggling pattern.

Long exposure shot of first prototype juggling a table tennis ball.

The Motion
Illustration of vertical stability (click to enlarge).

The Shape
Illustration of horizontal stability trough paddle shape.

Impact location data, juggling height 1.05m, 5789 impacts.

Histogram and fitted Gaussian Distribution to apex height deviation data. Juggling height 1.05m, 1079 measurements.