This small Arduino construction reproduces the mechanics of a (single) ball kept inside a torus. By moving the Arduino board itself across the 6 dimensions, the ball virtually circulates inside the torus.
The behaviour is calculated realtime by the processor, based on standard mechanics equations, using moment of inertia.
All calculations are based on Euler angles, in the canonical (first) approach based on the ZXZ axis rotation order: ψ (psi), θ (theta) then φ (phi, ϕ in the picture bellow). This picture from Berkeley University explains the used notation.
Few additional notations:
- l : the torus radius
- α (alpha) : the angle of the ball in the torus referential with the x axis
- g : the gravity constant
- m : the mass of the ball
- fr : the friction factor
The Arduino board (the torus) is by convention located in the plane XY (p1p2 in the diagram above), where Z (p3) axis points vertically upward. When the board is steady in the earth referential, the only moment is from the gravity force:
The period of the oscillation of the ball is as bellow. For a 4cm radius vertically oriented torus, the period is about 0.4 seconds.
When the board starts to move by a human hand, the board referential can not be considered Galilean anymore. The moment of fictitious forces apply too. First as the referential translates along the 3 axis, the moment of the inertia force applies. As the referential rotates, the 3 new fictitious forces are the Euler force, the Coriolis force and the centrifugal force. The 3 forces are explained here.
A friction force has also been added, it acts inverse to the ball speed.
The moment of the 4 fictitious forces and the friction are equal to:
So the complete equation is:
I have calculated all the equations myself, so if you find any error, please contact me!
I used Fritzing for the design for the board. The raw file is here.
Thanks to Ole Eichhorn at Thingiverse for the picture of the toy.