-
Notifications
You must be signed in to change notification settings - Fork 8
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
Signal range and value problems #10
Comments
Answering some:
|
@edumeneses Is there a way for the tinypico to automatically change those ranges for battery life, it is a pain when fixing t-sticks that I can't trust the battery life signal to give me an accurate value |
Not that I know. The max and min voltage values depend on the battery. What we can do is maybe measure the voltage of the battery from empty to full and back to empty a couple of times (+ with different batteries) and plot a profile for it. Then we can apply the profile to get a more accurate percentage, or maybe have 3 or 4 different levels. |
In principle, if we wanted to have an accurate battery life estimate, we would need specific battery hardware (a fuel gauge I think it's called) in order to accurately measure the electrical current while charging and discharging. |
I notice there seem to be some issues with the accel range on my recently updated T-Stick (thanks again for that edu). The device correctly outputs 9.8 m/s^2 when stationary, reflecting approximately 1 g of acceleration as expected. So the math scaling from the raw readout of the sensor to m/s^2 is good. However, the following observations conflict:
|
There's a similar story with the gyro:
|
This is most likely a problem with the SparkFunLSM9DS1 library. I put a note to myself at https://github.com/IDMIL/T-Stick/blob/db5db96958b0cc35d567e9623f4d9122b5e7fa7b/firmware/src/lsm9ds1.h (lines 3-6) referring to this known bug: sparkfun/SparkFun_LSM9DS1_Arduino_Library#27 A possible workaround is to follow my note and manually change the SparkFunLSM9DS1.cpp file. I believe can also be done permanently using platformio.ini and python to create a script to edit the file during compilation. Another possible solution is to clone the library and hardcode the sensitivity values, we can then refer to our clone at the platformio.ini file. Of course, we can also properly fix their init function and open a PR to upstream our fix. As I'm currently focusing on the MPU image, I can't check that right now, but the workarounds should work fine. |
Partial fix for #10 The issue sparkfun/SparkFun_LSM9DS1_Arduino_Library#27 is worked around by pulling CAP1Sup/Arduino_LSM9DS1, which has a fix applied, instead of Sparkfun's original (apparently unmaintained) library. I also made adjustments to the full scale ranges of the accelerometer and magnetometer based on my experimentation, with notes in the source code describing my reasoning.
Thanks, @DocSunset, to replace the IMU library. Suppose it honours the user settings we have at the lsm9ds1.cpp file, I suggest we close this issue and open a specific one for the battery reading if needed. All other values are explained in my message above. If needed, I also suggest opening another issue to change the range values for libmapper. |
Notes from testing signals with webmapper:
The text was updated successfully, but these errors were encountered: