Skip to content

Placing the breadboard with BMI160 to horizontally(remapping axis) #606

@brightproject

Description

@brightproject

I use such a board in the device
BMI160

Based on examle code

only placing it not horizontally, but vertically.
Скриншот 10-08-2023 19 36 00

How to remap the axes, I did not find another way how to do remapping through Bosch software.

I pass the data through the Madgwick filter and get the roll, pitch and heading angles at the output.
But if I use this data when the board is in a vertical position, I have very small movements, due to the lack of axes.
But if I use the received data for processing and visualize them using the transformation matrix, then all rotations of the body are normally performed.
Скриншот 10-08-2023 22 58 59

As far as I understand, there are two ways to solve the problem with the orientation of the axes:

  1. changing raw data directly in the Bosch sensor
  2. application of the transformation matrix, but this requires the computing power of the microcontroller
    Unfortunately, I did not find working examples with axis orientation for BMI160.
    I try apply calibration offsets also
    BMI160.autoCalibrateGyroOffset();

    BMI160.autoCalibrateAccelerometerOffset(X_AXIS, 0);
    BMI160.autoCalibrateAccelerometerOffset(Y_AXIS, 0);
    BMI160.autoCalibrateAccelerometerOffset(Z_AXIS, 1);

While I do not understand the functions autoCalibrateAccelerometerOffset and autoCalibrateGyroOffset well enough, it seems to me that it should set the value of accelerometers and accelerations to zero when the board is placed in the desired position (on its side, upside down, at an angle) and start counting from a calibrated "point".
Or am I misinterpreting the autoCalibrateAccelerometerOffset and autoCalibrateGyroOffset functionality?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions