08-27-2021 10:30 PM
Solved! Go to Solution.
08-30-2021 03:28 AM
Hello Velth,
Could you tell us what configuration(ODR, Range, etc...) you need? What is the specific phenomenon of the problem?
08-30-2021 02:23 PM - edited 08-30-2021 02:27 PM
Hi I'm using this configuration below, I 'm using
bma_456_t bma = { .power_save = APS_ON, .fifo_wkp = FSW_ON, .acc_enable = ACC_ON, .aux_enable = MAG_OFF, .acc_perf_mode = CIC_AVG, .acc_odr = ODR_6P25, .acc_bwp = RES_AVG128, .acc_range = RANGE_4G}; config_remote_init(bma);
for (int i = 0; i < 8 i++) { status = read_sensor_data(REG_ACCS_DATA, &sensor_data); // REGS 0X12 acc_x = (sensor_data[0] + (sensor_data[1] << 8)); // X (MSB|LSB) acc_y = (sensor_data[2] + (sensor_data[3] << 8)); // Y (MSB|LSB) acc_z = (sensor_data[4] + (sensor_data[5] << 8)); // Z (MSB|LSB) } aux_x = (float)acc_x / 100; aux_y = (float)acc_y / 100; aux_z = (float)acc_z / 100; roll = atan2(aux_y, aux_z) * 57.3; // angulo x pitch = atan2((-aux_x), sqrt(aux_y * aux_y + aux_z * aux_z)) * 57.3; // angulo y
I'm getting the acc (x,y,z) in register 0X12 to then calculate my angles, I 'm using it to see the inclination of trucks, but because of the motor vibration the values is being crazy vary up to a degree, so to exemplificate :
The inclination is 4.2º, but because the of the vibration the read values goes to 4.9 º, 5.2º, 5.1º, 4.8º, I need clean the vibration noise.
08-30-2021 02:26 PM
if you could give me a support, I'm mean I could give you my code , we can make a meeting zoom, discord, skype anything, this is being a huge problem at my job, we need to solve this with urgency.
10-14-2021 10:23 AM
Hello Velth,
1.According you sensor configuration, you set sensor to work under low power mode. As you set acc_bwp to AVG128, you couldn't set ODR higher than 6.25 Hz, otherwise, the sensor configuration will be in error. In your configuration, increase ODR, which makes you unable to read data.
From BMA456 data sheet, we could caculate: skipped smaples=(1600/ODR)-averaged samples>=0
ODR<=(1600/averaged samples)
ODR<=1600/128=12.5
2.By the way, are you very concerned about power consumption? Why not use high performance mode?