Bosch Sensortec Community

    Showing results for 
    Search instead for 
    Did you mean: 

    Need some guidelines for BMI270 accel and gyro FOC

    Need some guidelines for BMI270 accel and gyro FOC

    New Poster

    Hi all, 

            I am using BMI270 shuttle board 3.0 using the SPI interface and I can able to read accel and gyro values. But I need to develop code using FOC for that I used example code present in the BMI270-Sensor-API-master library in the git hub. The code is attached to my environment and works with errors. In that I need a few explanations on putting the sensor in the right position and keeping the sensor in the wrong position.

    What does it mean to keep BMI270 in the right or wrong position? And I am facing OUT OF RANGE ERROR also.

    I am new to this BMI270 sensor so I need help with that. Any help would be appreciated.

    Thanks in advance.

    With Regards,


    3 REPLIES 3

    Community Moderator
    Community Moderator

    Hi Ragu,

    Do you mean you run github code

    What problems have you encountered? Could you describe it in detail when you use BMI270?

    Hi Robin,
    yeah, I use the same code in github code
    The issue I am facing is, the code asks for two inputs from the user
    1) Shake the sensor
    2) Keep sensor stable in right position

    First operation: shake the sensor:
    I started to shake the sensor and the perform_foc_range_test function result is BMI2_OK( Valid input - Sensor is shaking.)

    Second operation: Keep sensor stable in right position
    I leave the sensor stable(not even touching it). In that case I get BMI2_E_OUT_OF_RANGE(-4) as a result.
    So, I need to know is any specific position there to done this.
    I need clarity on what is the right position. And same thing for accel_foc.c also.


    P. Ragu.


    Community Moderator
    Community Moderator

    Hi Ragu,

    Sorry for the delayed reply.
    The FOC is made to calibrate the offset, which requires the still sensor to read the sensor offset and calibrate it. When performing gyro FOC test, the sensor should be stationary, not shaken. The code has misunderstanding.