Fourier Caterpillar

or

How to design a caterpillar the size of a shoe with a mechanism the size of a house.

Thirty years ago, during a hike in Utah, I knelt down to examine a caterpillar.  It was walking in a wave-like fashion, and it appeared to me that the wave existed on its own, outside of the caterpillar.  I was also struck that at any given moment half of the caterpillar did not move.  The part of a caterpillar that is in contact with the world stays still.  A caterpillar needs this stillness as much as it needs motion in order to advance.

At the time I was hungry for a math problem, and working on caterpillar math proved to be a delicious multi-course meal that still nourishes me today.  So far I have made about 10 caterpillars, each one using a different technique including flip books, analog electrical, analog mechanical, digital electrical, stop motion, and as I expanded the math to follow arbitrary 3d paths, Python, Blender and hand-drawn animations.  The caterpillar also led the way to making over 40 wave sculptures, often overhead, and often large scale.  This project combines what I learned making wave sculptures with the more rigorous and particular math of caterpillars.

 

This slideshow requires JavaScript.

If you look at one section of the caterpillar, and plot its height against time, you get a curve like the first image above.  The flat part, what I’m calling the dwell, is when that section stays still.  Other sections of the caterpillar would have the same curve profile, except the dwell would occur at a different time in the cycle.  For example, the peak of the curve might be in the middle, or toward the right side of the drawing.  I knew from making wave sculptures how to add waves together mechanically, and I began to wonder how many waves it would take to get close to this caterpillar curve.

First took a Fourier transform of the curve.  In the second image you see how close you can get with only a single wavelength.  It’s got the peak and valley in roughly the right place but it’s missing the dwell and the peak isn’t high enough.  The number in the image is the square of the differences between the wave and the caterpillar curve.  It doesn’t mean anything absolutely, but relatively the smaller the number the closer the waveform is to the caterpillar curve and so it provides a useful metric for comparing them.  In the next image I’ve added the second frequency.  It’s closer, but not great and there’s too much movement in the dwell. However, when I added the third frequency I couldn’t believe how close it matched caterpillar!  There was not a big improvement adding a higher frequency waves so three seemed to be the magic number.

 

 

The Fourier Transform works by describing waves of particular amplitudes, phases and frequencies that added together form the curve you began with.  However, when I’m making analog wave sculptures I’m not working with pure waves but mechanical ones, which almost always differ from pure waves.   Since a suspended wave sculpture is not constrained by the ground, its math is easier than caterpillar math because I just have to keep an eye on the distortions to make sure that the wave looks good.  But with caterpillars I am trying to get a very specific curve and so need to calculate the exact effect of the geometric distortion.  As an example of distortion look at the above video.  There is a rotating arm pulling on a string.  The string goes around a pulley on a ring.  As this ring gets big compared to the arm, the waveform approaches a negative cosine wave.  However, as the ring gets smaller the waveform diverges.  Most notably the valleys get pointy.

 

 

 

The use of pulleys can also transform the wave into a different shape.  For example, here a pulley doubles the amplitude of a wave.  In this case the pulley string lines are parallel and there is no distortion added.

 

 

However, here you can see that if the string lines are not kept parallel, the waveform is distorted.  In this case the valley of the waveform spreads out.

 

 

The cool thing about waves and transformations is that you can just add them up.  Here the arm-ring relationship creates a pointy-bottom wave, but then the pulley configuration spreads out the bottom of the wave and what you are left with is a nice looking wave!  I’ve done this on quite a few wave sculptures where I had space constraints and couldn’t make the ring as big as I’d like.

 

 

Taking a Fourier Transform of the caterpillar curve got me close, but the next step was to look at specific geometry.  In this animation, the circle in the lower left (which might be hiding behind the play button) is connected to the third frequency by a string that is in turn being modified by a different string that goes between the first and second frequency.  In this way the circle height is determine by all three frequencies.  Given certain practical constraints, the above animation shows an optimization after playing the pointy-bottom distortion against the wide-bottom distortion. The circle at the end of the string shows the caterpillar section height as determined by the mechanism, and the point that moves around in the circle is the mathematically exact point I’m trying to match.  The result of this optimized analog approach is more accurate than using the pure waves as determined from the Fourier Transform.

 

 

However, having non-parallel pulley lines is not ideal because it gives more opportunities for error during fabrication, and I realized that I could very close with parallel lines and equal diameter rings, if I made an upside down caterpillar.  This sort of makes sense because if you look at the caterpillar curve and flip it upside down, it is more similar to a pointy-bottom wave than a wide-bottom wave, and so the arm-ring effect of the analog mechanism is a natural fit.  At first, I didn’t like the idea of making an upside down caterpillar, but as you’ll see later there are some advantages.

 

This slideshow requires JavaScript.

So far we’ve only been looking at one section of the caterpillar, but the other sections are just offset a certain angle.  You might notice some wacky pulleys with strings wrapped around more than once.  During a final design these pulleys would get finessed, but they are mathematically consistent as drawn and are like this because it was the easiest way to ensure that the string length calculations are correct without having to custom place pulleys.

 

 

The next thing to do is design a mechanism to translate the vertical movement side-to-side without changing height.  In this animation the waves are zeroed out. The upper mechanism is attached to counterweights that form the upside down caterpillar, but the strings going to a caterpillar attach to these weights via a pulley, thus inverting the motion.  This has the advantage that the top part can run without the caterpillar attached.  It wasn’t until I thought of this advantage that I came to peace with the notion that the mechanism naturally favored an upside down caterpillar.  The strings then go through two static trucks and two moving trucks.  The upper truck moves half the speed of the lower truck, and this allows horizontal movement without introducing vertical movement.  The pulley trucks have slightly tapered pulley diameters so that the strings can all be parallel and not overlap and thus not introduce any distortion.  The frequencies are integer related, meaning that all rotating arms and pulley trucks can be driven from a single motor with sprockets and chains.

 

 

This slideshow requires JavaScript.

The last bit of math is shown in the images above.  If we brought the waves back and looked at one moment in time, and just hung each caterpillar section from a string we would get the first image.  However, there are two constraints that the caterpillar has, one that the sections don’t move when in contact with the ground, and two that the caterpillar (at least this mechanical version) is incompressible.  So if we introduce a scalloped landscape and assumed one section was keyed in place, we could solve for the adjacent segment.  Since the caterpillar segments are circles that remain tangent, and we know the string length, the location of the next segment is at the intersection of two circles.  This means that the location of each segment can be sequentially solved for.  In the last image above, you see how the caterpillar would be given the string lengths and constraints.  The strings are at angles rather than straight down but the distortion this causes diminishes as the distance between caterpillar and pulley truck grows, and I was pleasantly surprised at how quickly the effect became negligible as soon as there was a reasonable amount of height.

 

 

Putting it all together you get this lovely little caterpillar!  It could walk to one end and then a limit switch in the mechanism would reverse the motor and it would walk back.  Am I going to make it?  I hope so!  If you have a big wall that needs a little caterpillar I’d love to hear from you.