Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set zero point / Temperature calibration / Latitude calibration #8

Open
lshachar opened this issue Sep 28, 2020 · 2 comments
Open

Set zero point / Temperature calibration / Latitude calibration #8

lshachar opened this issue Sep 28, 2020 · 2 comments

Comments

@lshachar
Copy link

lshachar commented Sep 28, 2020

I became very interested in this bug, since for my use I needed to have accurate weight values from the balance board.
however, I still seem to be having a few problems and would really appreciate some help!
This is regardless to the aforementioned bug.
I bought my balance board second hand only recently.
When I have nothing on it, The values I'm getting are: (TL:-12kg, BL:-0.2,TR:-2.9,BR:-6.0kg), an overall weight of -20kg. (again, with the aforementioned bug already resolved!)

First, I'm wondering if I have a bad unit. I'd really like to see what kind of weight values (not raw values) do other people read when you're off your wii board? Anybody sees any large numbers? that differ much from zero, either positive or negative?

**Second
**, I read the 'Wii Balance Board Accessory Programming Manual', a very interesting read. It talks about several key components that are currently not implemented in Wiimote library, could it be because nobody hacked around this area?

  1. On the actual nintendo Wii, there was a way to recalibrate the balance board to the current zero point (that is, dismount the balance board, hit 'tare', and voila, you got your zero point set.) (the lack of this feature is probably why I get the large error I'm getting in weight value. So I assume.)
  2. While setting the zero point, a temperature reading is also taken. That reading along with the preconfigured calibration temperature value (and a formula which we do not have), compensates for the current temperature while using the device. (I'm in air conditioned environment so it's unlikely that this is a cause for any major error on my device)
  3. There is also an algorithm for latitude correction. (This should be simple enough for a horrible programmer like myself to write, but the difference in weight value between being at the equator or the poles is so small that I don't care much for this error either!)

I would like to (try to) implement the zero point set (tare) function. I wonder how it's implemented on nintendo's SDK. I am sure that raw sensor values are read by the application (with no weight on the balance board) for 2 seconds to calculate an average. (see top of page 15 in the manual). And then that raw value is used to set the zero point.
Here's what I don't know. Either:

A. you can take the weight in KG (that is calculated using the 3 calibration parameters, I.E -12KG for my Top Left sensor,) and call that value 0KG. (Add 12kg to the result per my example) Then. always compensate by adding +12kg for that sensor.
B. you can take the current RAW value, (I.E 14,265 for my RAW top left sensor value), remember the difference to the pre-set calibration value for 0KG (15,501 for this sensor), and then always compensate by adding the RAW difference (15,501-14,265 = 1,236, so in my case add 1,236 to whatever is the current RAW value for that sensor), and only then do the conversion from RAW to KG.
C. Is there a third possibility to program the set zero function? that I'm missing completely?

The difference isn't huge, but I'm not sure which of these two ways is the correct way to do it.
note that the 1st way is linear throughout the range (but possibly in an incorrect way), whereas the 2nd way offsets the linear interpolation between 0kg to 17kg, and keeps the same linear interpolation as before the calibration, once over 17kg. (possibly this is also wrong!)

...Is anybody still here? thanks for reading the entire darn thing... :)

@lshachar
Copy link
Author

lshachar commented Oct 5, 2020

A little update.
Julian Löhr (the developer of HID WIIMOTE) gave me an excellent idea - use dolphin emulator to compare Ninteno's weighing process results to mine. How come I didn't think about that before?!
anyways, my weight comes up as 69 kg (in dolphin), which is exactly the same as what I get with the wiimote library (updated with my zero-point calibration code #9). So, regarding my questions about calibration, in my zero point calibration code, I implemented "A" (read the original post) and it's working comparably to how Nintendo is doing it.
However, my actual weight is 66 kg. It seems that I have an 'aftermarket' balance board (it does not have 'wii' imprinted on the top plastic surface), and maybe it is a low quality knockoff? Anyways, seems like the zero point calibration code is working correctly.

I'm still very interested to know, "what kind of weight values (not raw values) do other people read when you're off your wii board? Anybody sees any large numbers? that differ much from zero, either positive or negative?", for anyone that has not calibrated the zero point, that is.
Thank you.

@lshachar
Copy link
Author

lshachar commented Nov 9, 2020

I released my updated library here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant