gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS Motion Sensor > Callibration?

#133470 - spinal_cord - Fri Jul 06, 2007 9:59 am

Just wondering (after using the Wii sinse xmas) would it be a good idea to have a set callibration in a motion game? perhaps just a default callibration with the ability to recallibrate at a later time. I get bored with having to hold the DS steady at the start of every game.
_________________
I'm not a boring person, it's just that boring things keep happening to me.
Homepage

#134987 - Ant6n - Thu Jul 19, 2007 1:01 am

I have been looking at the problem of calibration, too. I think there are two levels of calibration. The first would be finding the zero and scale of each axis. This one should stay the same as long as the same motion sensor is used.
The other is related to how the gba/ds is held by the player. This one might change all the time.
When mixing these two problems together, one might get awkward/inaccurate results. So I have been trying to calibrate at least the first level, by reading values and using some sort of iterative approach to try to calibrate the six values. But since my math is a little limited, I haven't had much luck.
So now I tend toward saving the offset and scale in sram (on gba). I do wonder though how big the range of possible zeroes is. on my accelerator i get
X: ~2095, ~797 ticks/g
Y: ~2135, ~781 ticks/g
Z: ~2080, ~852 ticks/g
Does anybody have uppoer/lower bounds for these values?

#135040 - KeithE - Thu Jul 19, 2007 5:51 pm

You can expect up to about 10% error on offset and 5% on sensitivity.

Most DS Motion Cards/Paks will be within 5% on offset and 3% on sensitivity, but some have higher error.

There are a few ways to calibrate that pop into my head right now. I'm sure there are others as well.

1) set the DS flat on table to calibrate - gives you X=0, Y=0, Z=1
2) Have the user hold in a desired orientation to set the "zeroed position"
3) Do a calibration like in Yoshi Topsy Turvy as follows:
Draw a line on the screen from bottom left to top right, and tell the user to tip the console until the line is flat, then repeat with a line drawn from bottom right to top left.

Warioware Twisted requires the user to calibrate the gyro every time the game starts by holding it still. I believe it measures the gyro output and keeps sampling until it is not changing more than a certain amount. Then it averages the saved samples and calls that the "zero rate offset".

#135060 - sirpoonga - Thu Jul 19, 2007 8:34 pm

KeithE wrote:

2) Have the user hold in a desired orientation to set the "zeroed position"

This is how I plan to calibrate motion maze. I think everyone will have a difference in what they feel is level.

#135067 - Ant6n - Thu Jul 19, 2007 10:26 pm

The way I found my zero values is putting my SP flat on a table, and turning it around 360 degrees (around z axis). Since the table might not be perfectly leveled, and the sensors might not be perfectly leveled with the SP, i get a range of values on the x and y axis. The median of the min and max should be the zero value. When doing this on the side one can find the zero of the z (easy for SP, not so easy for original GBA).
When knowing x0,y0,z0, one can have the user hold the game boy in all directions (approximately), and get the sensitivity values. This is fairly simple i.e.
if x >> y,z then xsensitiviy += (1/x - xsensitivy)*0.1

People feel differently about what is 'level', especially around the x-axis. That's why I'll use some trig and keep adjusting that value. But my trigonometry might not be very good if my zeroes and sensitivities are all wrong.

#135216 - Dood77 - Fri Jul 20, 2007 11:09 pm

sirpoonga wrote:
KeithE wrote:

2) Have the user hold in a desired orientation to set the "zeroed position"

This is how I plan to calibrate motion maze. I think everyone will have a difference in what they feel is level.

Also good if someone wants to play lying down.
_________________
If I use a term wrong or something then feel free to correct, I?m not much of a programmer.

Original DS Phat obtained on day of release + flashme v7
Supercard: miniSD, Kingston 1GB, Kingston 2GB
Ralink chipset PCI NIC