Forums > MaxMSP

### Interpreting the speed from the acceleration (Wii remote)

Sep 24 2007 | 9:25 am

Hello,

I am using a Wii Remote from Nintendo as 3D accelerometer. Thanks to the great aka.wiiremote external, it’s possible to capture all Wimote signals and one can calibrate the acceleration quite accurately, using a simple transformation that makes the acceleration range between -1.0 and 1.0 (0 corresponds to no acceleration, for example when there is no movement) instead of 0-255.

Then, I am interested in getting the speed (velocity) of the movement.

As acceleration is the derivative of speed, one solution is interpreting the speed as the integral of acceleration. If we call A the acceleration and V the speed, at a given time Tk we have V(Tk) = A(T=0) + A(T=e) + A(T=2e) + … + A(T=Tk) — where e repeasents the interval between the measures.
For some reason, this solution doesn’t seem to work : for example, when taking the Wimote, moving it a bit and then laying it again on the table, the speed should be zero at the end and it’s clearly not the case. I tried different time resolutions (the e factor above), but this doesn’t help.

Maybe this method only works if you have a very accurate and high time resolution measure of the acceleration … Any idea ?

Best,
-j

Sep 24 2007 | 11:33 am

Is it necessary to remove the effect of gravity when using the Wimote ? G-vector points to Earth center or close to, and its norma is 9.81 m.s^(-2). It can be measured by some accelometers, which adds a perturbation to any local acceleration measure …

I don’t know if there is already a compensator inside the Wii, or if I have to do it myself. Also, I don’t know how to compensate this gravity problem, especially because I don’t know how much should the vertical axis offset be to significate constant -9.81 m.s^(-2) for the Wimote.

Has anybody calculated speed from a measure of acceleration here ?

Sep 24 2007 | 2:37 pm

Yeah, but due to Newton’s third law, when it’s on the table, the table exerts an equal but opposite force upwards cancelling gravity. The only time gravity acts is when you let it drop – in wiich case it is accelerating. So you don’t have to worry about gravity here…

Sep 24 2007 | 4:39 pm

whoops, you are right, I forgot about this "normal reaction" force :)

Sep 25 2007 | 2:56 am

hi

you ned to subtract the planet to your calculaions.

1. the wii remote on the table points "1 g" in Z axis.

so

you need to build a patch capable of detect (calculate) where the planet is (to wii remote).

with this,

you know where to subtract the planets force, and then you can apply the acceleration formula

I think!

Sep 25 2007 | 3:04 am

in other words

you need a virtual gyroscope

Sep 25 2007 | 8:41 am

Actually, probably because of accelerometer technology, when you tilt the Wimote around the X or Y axis it outputs a small acceleration that corresponds more or less to the tilt angle. This is useful as a continuous controller.

Alternatively, it’s easy to detect a violent movement (and its direction), which can be used as a trigger (if you want to see it live, try to find some Wii Sports demonstration on Youtube).

I don’t think I will ever integrate the acceleration for getting the speed ; it looks like requiring a more accurate sensor.

Sep 26 2007 | 9:03 pm

Actually, this is not correct. If you look at the help patch for
aka.wiiremote, you can see that the blue line (y axis) has a positive
offset relative to the x & z — that is due to effect of gravity. In
fact the reason it works as a tilt sensor at all is also because of
gravity. Think about it: how could you get an acceleration value
from an unmoving object unless gravity was exerting force on it?
(The way to eliminate the effect of gravity, by the way, is by
dropping it — in freefall, there is zero acceleration, though I
wouldn’t recommend it.)

Not that knowing any of that has helped me figure how to do the
derivation needed to get velocity from it either…..

M

On Sep 24, 2007, at 10:37, Andrew Robertson wrote:

>
>
> Yeah, but due to Newton’s third law, when it’s on the table, the
> table exerts an equal but opposite force upwards cancelling
> gravity. The only time gravity acts is when you let it drop – in
> wiich case it is accelerating. So you don’t have to worry about
> gravity here…

Mar 21 2009 | 2:26 pm

you’re right – I’m shocked to read my own post here.

Basically, there is acceleration in your hand to counter the effect of gravity and so as you twist the Wii, the accleration is changing. Therefore the only way to really combat is to get a megnetometer to tell you the direction of the earth’s field. There is a crude one on the Wii telling you which way it is facing.

Integration of the accleration results in pretty bad drift. Has anyone managed to get around that?

Viewing 9 posts - 1 through 9 (of 9 total)

Forums > MaxMSP