Skip to content

guyplusplus/Arduino_Virtual_Ball_in_Torus

Repository files navigation

Arduino Virtual Ball inside a Torus

My Toy

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.

The Math

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.

Euler angles

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:

    Moment from 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.

    Pendulum period

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.

    Non Galilean fictitious forces

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:

    Non Galilean fictitious forces

So the complete equation is:

    Complete equation

I have calculated all the equations myself, so if you find any error, please contact me!

Arduino schematic

I used Fritzing for the design for the board.

schematic

Thanks

Thanks to Ole Eichhorn at Thingiverse for the picture of the toy.

About

Arduino project simulating a moving ball inside a torus

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages