Skip to content

guyplusplus/Arduino_Virtual_Ball_in_Torus

Repository files navigation

Arduino Virtual Ball in Torus

My Toy

This small Arduino construction reproduces the machanics of a (single) ball kept inside a torus. By moving the Arduino board itself accross the 6 dimansions, the ball circulates inside.

The behavior 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 angles: ψ (psi), θ (theta) then φ (phi). This picture from Berkeley University explains the used notation.

Euler angles

Few notations:

  • the torus has a radius of l
  • α (alpha) is the angle of the ball in the torus referential with x axis
  • g is the gravity constant
  • fr is the fiction factor

Assuming a fixed board, where its z axis points verticaly upward, the only moment is from the gravity force:

    Moment from gravity force

Then as the board is actually a non galilean referencial, the moment of virtual forces appply too. First as the referential translates along the 3 axis, the monent of the inertia force applies. As the referential rotates, the 3 new virtual forces are the Euler force, the Coriolis force and the centrifugal force. The 3 forces are explained here.

    Non Galilean virtual forces

The moment of the 4 virtual forces are equal to:

    Non Galilean virtual forces

Finally a friction moment has been added which acts inverse to the ball speed.

    Friction force

So the complete equation is:

    Complete equation

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

Thanks to STLFinder 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