till.com Articles

The Kahn Chaotic Pendulum

J. Donald Tillman
May 2020


Some time ago, back in the mid 90s, my family and I were visiting The Exploratorium in San Francisco. A wonderful experience, of course. But while there, I came across the Chaotic Pendulum exhibit. And it made a big impression on me. I ended up staring at the thing for about half an hour. The family was getting concerned.

Chaotic Pendulum

Chaotic pendulums are usually in the form of a Double Pendulum, one pendulum dangling from another. And while the motion of a single pendulum is simple and predictable, the motion of the double pendulum is chaotic. And while the math behind the single pendulum is simple, the math behind the double pendulum is much more complex.

But this chaotic pendulum is different. It is an elegant work by San Francisco Bay area environmental artist and sculptor Ned Kahn. This is a quadruple pendulum, where a T-shaped bar pivots at the juncture, and three regular pendulums pivot off from its endpoints. The whole thing is encased in an acrylic frame so nobody gets their fingers stuck or heads bonked. And a knob lets the visitor crank the main T-shaped bar.

This simple structure is capable of some remarkable movements. A dance of sorts. Expressing a palette of behaviors.

I thought it would be interesting to simulate Kahn Quadruple Chaotic Pendulum in JavaScript. Please enjoy!

The Simulation

Use the mouse to give it a spin...

(This is a first pass; I'll improve things later. No, I have not compared the dimensions, masses, and time constants of this with the real pendulum. If you'd like to look at the code, it's here. About 6 pages.)

Why is the movement of this device so fascinating?

Normally mechanical devices operate on individual axes. Like on a robot; each servo motor has the responsibility of positioning a particular piece to an intended angle, and it goes about doing that job, meeting that spec, and applying power to get that peice to that angle.

Here there are no servo motors. Instead energy is being transferred between potential energy and kinetic energy, with the total kinetic + potential energy remaining constant. The potential energy is due to the height of the masses. The kinetic energy is due to the speed of the masses.

It turns out that this is very similar to the way human and mobile animals move around. We naturally minimize the energy we use to get a particular task done. And robots typically don't do that.

Derivation

The system is described with four angles, the angular position of the T Bar and the three small pendulums. And the derivatives of those. We'll number them; 0 is the T Bar on top, and 1, 2, and 3 are the smaller pendulums, left to right.

We'll be using the Lagrange approach; calculating the kinetic and potential energies of the system, and finding the accelerations. This is pretty straightforward, but the math is error-prone as all hell, so I'm writing it out here to keep things straight.

Here are the x,y positions of the endpoints of the T Bar:

(x,y)left=(l0cosθ0,l0sinθ0)(x,y)bottom=(l0sinθ0,l0cosθ0)(x,y)right=(l0cosθ0,l0sinθ0)

Calculate the kinetic energy, T, and the potential energy, V, (those are traditional Lagrange variable names) of all four parts, and add them up.

T=T0+T1+T2+T3 Ti=12mivi2 V=V0+V1+V2+V3 Vi=gmiyi T0=12m0l02θ02˙V0=gm0l0cosθ0T1=12m1(l02θ02˙+l12θ12˙+2l0l1θ˙0θ˙1sin(θ0θ1))V1=gm1(l0sinθ0+l1cosθ1)T2=12m2(l02θ02˙+l22θ22˙+2l0l2θ˙0θ˙2cos(θ0θ2))V2=gm2(l0cosθ0+l2cosθ2)T3=12m3(l02θ02˙+l32θ32˙2l0l3θ˙0θ˙3sin(θ0θ3))V3=gm3(l0sinθ0+l3cosθ3)

Find the total kinetic energy, T:

T=12(m0+m1+m2+m3)l02θ02˙+12m1l12θ12˙+m1l0l1θ˙0θ˙1sin(θ0θ1)+12m2l22θ22˙+m2l0l2θ˙0θ˙2cos(θ0θ2)+12m3l32θ32˙m3l0l3θ˙0θ˙3sin(θ0θ3)

Find the total potential energy, V:

V=g(l0(m0+m2)cosθ0+l0(m1m3)sinθ0+m1l1cosθ1+m2l2cosθ2+m3l3cosθ3)

Calculate the Lagrange:

L=TV L=12(m0+m1+m2+m3)l02θ02˙+12m1l12θ12˙+m1l0l1θ˙0θ˙1sin(θ0θ1)+12m2l22θ22˙+m2l0l2θ˙0θ˙2cos(θ0θ2)+12m3l32θ32˙m3l0l3θ˙0θ˙3sin(θ0θ3)+g(l0(m0+m2)cosθ0+l0(m1m3)sinθ0+m1l1cosθ1+m2l2cosθ2+m3l3cosθ3)

Find the partial derivatives of L over the angles:

Lθ0=m1l0l1θ˙0θ˙1cos(θ0θ1)m2l0l2θ˙0θ˙2sin(θ0θ2)m3l0l3θ˙0θ˙3cos(θ0θ3)gl0(m0+m2)sinθ+gl0(m1m3)cosθ0Lθ1=m1l0l1θ˙0θ˙1cos(θ0θ1)gm1l1sinθ1Lθ2=m2l0l2θ˙0θ˙2sin(θ0θ2)gm2l2sinθ2Lθ3=m3l0l3θ˙0θ˙3cos(θ0θ3)gm3l3sinθ3

Find the partial derivatives of L over the angular velocities:

Lθ˙0=(m0+m1+m2+m3)l02θ˙0+m1l0l1θ˙1sin(θ0θ1)+m2l0l2θ˙2cos(θ0θ2)m3l0l3θ˙3sin(θ0θ3)Lθ˙1=m1l12θ1˙+m1l0l1θ0˙sin(θ0θ1)Lθ˙2=m2l22θ2˙+m2l0l2θ0˙cos(θ0θ2)Lθ˙3=m3l32θ3˙m3l0l3θ0˙sin(θ0θ3)

Now, take the time derivative of those:

ddt(Lθ˙0)=(m0+m1+m2+m3)l02θ0¨+m1l0l1θ¨1sin(θ0θ1)+m1l0l1(θ˙0θ˙1)θ˙1cos(θ0θ1)+m2l0l2θ¨2cos(θ0θ2)m2l0l2(θ˙0θ˙2)θ˙2sin(θ0θ2)m3l0l3θ¨3sin(θ0θ3)m3l0l3(θ˙0θ˙3)θ˙3cos(θ0θ3)ddt(Lθ˙1)=m1l12θ1¨+m1l0l1θ¨0sin(θ0θ1)+m1l0l1θ˙0(θ˙0θ˙1)cos(θ0θ1)ddt(Lθ˙2)=m2l22θ2¨+m2l0l2θ¨0cos(θ0θ2)m2l0l2θ˙0(θ˙0θ˙2)sin(θ0θ2)ddt(Lθ˙3)=m3l32θ3¨m3l0l3θ¨0sin(θ0θ3)m3l0l3θ˙0(θ˙0θ˙3)cos(θ0θ3)

Now, bring them together, with the double dotted angles on the left and everthing else on the right.

ddt(Lθ˙i)=Lθi
(m0+m1+m2+m3)l02θ0¨+m1l0l1sin(θ0θ1)θ¨1+m2l0l2cos(θ0θ2)θ¨2m3l0l3sin(θ0θ3)θ¨3=m1l0l1(θ˙0θ˙1)θ˙1cos(θ0θ1)+m2l0l2(θ˙0θ˙2)θ˙2sin(θ0θ2)+m3l0l3(θ˙0θ˙3)θ˙3cos(θ0θ3)+m1l0l1θ˙0θ˙1cos(θ0θ1)m2l0l2θ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inθ2l0sin(θ0θ3)θ¨0+l3θ¨3=l0θ˙02cos(θ0θ3)gsinθ3

And from here we can use a little matrix math to solve for the four accelerations given the four positions and four velocities.

Copyright 2020 J. Donald Tillman
email: don@till.com
web page: till.com