Wiimote Project
Wiimote Projects => Wiimote accelerometer & motions detecting projects => Topic started by: wiidiscgolf on April 15, 2008, 10:41:59 AM

Using just the accelerometer data (no IR) is it possible to calculate the angle the Wiimote is being held at while swinging it? I have found various trig calculations on the net but they all seem to break down when the wiimote is in motion. I am trying to determine the release angle of a simulated disc throw so that I can plug the angle and force values into my calculations for how far the disc should travel. Maybe there is a better way to do this (without using IR tracking)?

If you are using a Mac, I know of a few different programs that read the rollpitchyaw inputs and output them in a graph that is updated in real time. http://www.iamas.ac.jp/~aka/max/#aka_wiiremote aka.wiiremote is one of them. The output graphs help a lot when trying to determine how you want the wiimote to react at certain angles.

After much digging and calculating I have come up with a formula for calculating Roll that seems to work fairly decently. Under the highest end accelerations it seems to lose some accuracy, but that is actually perfect for my game design.
RollX(t) = tan(aX(t)/sqrt(aY(t)^2 + aY(t)^2))
I also adjust mine by assuming that the initial roll is 0. Roll(t)  Roll(0)
I don't know if this formula is 100% accurate it just seems to hold true during all but the highest accelerations in my testing.

If you still need help, you should look at directional cosine matrices.
They deal with angles in the 3D

Accelerometers are dynamic measurement devices. The piezoelectric elements create a charge when deformed. However, that charge is quickly dissipated due to voltage leakage. For eample, they are good for cyclic vibrations that induce sinusoidal accelerations (a vibrating piece of machinery), but they do not work under a continuous acceleration (like gravity).
Honestly, I think that the accelerations are going to be so small that your measured signal is going to get lost in the usual noise of a system. However, it's easy enough to set up. Give it a go.