Accelerometer Range not changing

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
6 posts / 0 new
Last post
pureform
Offline
Last seen:8 months 2 weeks ago
Joined:2017-12-28 08:37
Accelerometer Range not changing

We are trying to increase the accelerometer range from 2G to 8G/16G but the values are still being capped at 2G no matter what we do. We saw an earlier post where you posted that adding these lines in bmi160.c at line 477 :

s_bmi160.delay_msec(C_BMI160_ONE_UBX);
bmi160_set_accel_range(BMI_160_ACCEL_RANGE);

would solve the problem but it still doesn't work for us. We have also tried to change the default range value in user_app_wrbl_config.h but nothing seems to work. Kindly provide us with the solution to increase the accelerometer range to uptown 8G/16G so we can obtain raw data values in those range.

Device:
MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
Hi pureform,

Hi pureform,

The fix is valid for the SFL project of the IoT, and i can see the values changing after the fix is applied, depending on the range set for the accellerometer. What version of the project are you using is it the SFL or the RAW project ?

Thanks MT_dialog

pureform
Offline
Last seen:8 months 2 weeks ago
Joined:2017-12-28 08:37
We are using the RAW project

We are using the RAW project not the SFL project.

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
Hi pureform,

Hi pureform,

Using the raw project i am able to see the values changing accoring to the range of the accellerometer as set from the IoT Sensors android/iOS application, there is no need to add the extra lines for using this on the RAW project (used a sniffer in order to check that, so that values that i read are obtained over the air, i can see that the z axis is modified according to the range when measuring 1G). Regarding the fact that you always get the values just like the device isconfigured to operate in 2G, are you certain about that, there might be a chance that due to the accellerometer calibration procedure you will get wrong values when changing the accelerometer range. Try to disable the definition USE_FAST_ACC_VAL and check.

Thanks MT_dialog

pureform
Offline
Last seen:8 months 2 weeks ago
Joined:2017-12-28 08:37
We have set the data range to

We have set the data range to 16G instead of taking the command from app side and the app configuration page recognizes 16G when we press 'Read configuration from NV'.

As we don't have a sniffer, this is how we check the data streaming from the sensor.

For the app project on Xcode (the official IoT project), I just added a line to print out the parsed value of accelerometer into the console. But as you can see, the data we're getting is still capped at 2G.

We have attached the screenshot of Keli & Xcode.

Attachment:
MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
Joined:2015-06-08 11:34
Hi pureform,

Hi pureform,

Then what you are mentioning should be an issue of the iOS application and not of the IoT fw, apparently the app is trying to block changes to the range of the accelerometer because the official fw on the IoT had the issue. So try to do the following mod on the iOS source code, and check if that works.

SensorController.m
- (void)外围:(CBPeripheral *)周边didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(nullable NSError *)error {

// Workaround for old IoT firmware bug. The range setting isn't effective.

// We keep the default sensitivity, which corresponds to 2G range.

if ([self isIoTNewVersion]) { //comment out this condition

self.accelerometerSensitivity = [[ACCELEROMETER_SENSITIVITY objectForKey:[NSNumber numberWithInt: byte_accelerometer_range]] floatValue];

NSLog(@"Accelerometer parameters: sensitivity=%.2f", self.accelerometerSensitivity);

}

Thanks MT_dialog