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

CC2650: Wrong scale for accelerometer values #62

Closed
AlexDmr opened this issue Dec 14, 2015 · 10 comments
Closed

CC2650: Wrong scale for accelerometer values #62

AlexDmr opened this issue Dec 14, 2015 · 10 comments
Labels

Comments

@AlexDmr
Copy link

AlexDmr commented Dec 14, 2015

Hi, thanks for this great project!
I get wrong acelerometer values from my CC2650 sensorTag, I have to multiply values by 4 to get actual acceleration. It seems that the initialisation of scale is not correct?
When I observe values with the Android application values are correct.
Any idea where it could come from ?

@theavijitsarkar
Copy link

I think we need to set the sensitivity of the accelerometer. Change to 8G or 16GB.
In the app, it sets it to 8G somehow.

@AlexDmr
Copy link
Author

AlexDmr commented Dec 18, 2015

Indeed, but it is currently not possible with node-sensortag. Should be a parameter of the sensorTag.enableAccelerometer method ?

@sandeepmistry
Copy link
Owner

@AlexDmr @snowbreeze is the source code to the Android app open source? Do you have a link to it?

Which firmware version do you have on the SensorTag?

This would probably help resolve #59 as well.

Note: bit's 8-9 are used to set the accelerometer range (http://processors.wiki.ti.com/index.php/CC2650_SensorTag_User's_Guide#Configuration_2)

node-sensortag is setting config to 0x7f: https://github.com/sandeepmistry/node-sensortag/blob/master/lib/cc2650.js#L108 - does this mean 16G is set?

@AlexDmr
Copy link
Author

AlexDmr commented Dec 20, 2015

Hi, the Android application can be downloaded from the market (sensortag Texas instrument). However i don't think that the code is open source.
The firmware installed is the one from july (don't remember the precise version), i think it is the last one as the application automatically propose an update if it is not the case.
Indeed I also see the doc you point out, I think that it could be used to specify actual ranges. As far as I understand it, 0x7f means that accéléromètre, gyroscope and magnetometer are activated. Bytes 8 and 9 are set to 0 I think, which means that scale is set to 2. This seems consistant with thé value that I observe (do not reach more than x2). So the formula used to translate values may be wrong?

@sandeepmistry
Copy link
Owner

@AlexDmr I'm running firmware version1.20 (Jul 28 2015), things seemed ok with using the mask 0x007f on my SensorTag. However, if I changed the mask to 0x0038 (just accelerometer bits set), I get the 1/4th values you are seeing.

I managed to find some TI code for Android here:

It uses a mask of 0x27f, and the 8G conversion formula, so I think the accelerometer mask values currently documented are not accurate.

I've pushed some changes to master, would you mind trying them out?
npm install sandeepmistry/node-sensortag

@AlexDmr
Copy link
Author

AlexDmr commented Dec 26, 2015

Pretty good shot :)
Indeed, values are now correct when I only activate the accelerometer. Thanks a lot!

@sandeepmistry
Copy link
Owner

@AlexDmr excellent, thanks for trying out the changes! I'll publish an updated version to npm shortly.

@tobybrad
Copy link

Hey.. I've been playing with the CC6250 on Windows. Firmware is 1.20.

I currently find it impossible to change accelerometer range. I can easily switch on and off the various gyro, accelerometer, magnetometer and WOM setting and all works as expected but bits 8:9 seem permanently set to 0x02 == 8G (Verified by directly reading the characteristic).

Doesn't matter what I do to try and change it, range is stuck at 8G. Seems like a bug in either the firmware or the Windows API i'm using. Not a deal breaker for me but I did waste some time figuring this out.

@theavijitsarkar
Copy link

@tobybrad Can you tell me what are you writing in place of 0x007 to turn on individual settings.
Or maybe share a bit of your code from that area.

@sandeepmistry
Copy link
Owner

@tobybrad

Seems like a bug in either the firmware or the Windows API i'm using.

I think it's a firmware issue on the SensorTag.

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

No branches or pull requests

4 participants