Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    Arduino library for BHI160b for remapping the sensor orientation

    Arduino library for BHI160b for remapping the sensor orientation

    chaitanyai
    Member

    Hi team,

    1) - I am using a custom-made board with bhi160b+bmm150 and ESP32, Which used to work great with available orientation.ino code.
    After some 2weeks of usage, the IC stopped giving the data out. 
     - So I logged the data and found : after flashing the bhy.h data into the IC the BHI160B giving only once the interrupt and stops triggering again for fifo full.
     - So What I have done is read the fifo with timer for every 10ms as I kept the ODR = 100Hz but found same data always.
    -- I doubt can the bootloader code which is in the ROM could be damaged.? Or is there any thing I can test to confirm the IC is working?
    -- I am using same orientation.ino code , which i tested on another board and found working as before.

    2) In the orientation.ino code the end "Status" data represent the accuracy of the data? it always go to 3 and again falls to 0 within seconds, Why like that? Do i need to setup the orientation of the both the IMUs to get correct accuracy? 

    3) I tried to port the bhi_uc_drivers file to the arduino with no luck, this I am doing for remapping of the IMUs on the board orientation. Is there any arduino ported code/drivers for the bhi160b axis remapping drivers?

    6 REPLIES 6

    BSTRobin
    Community Moderator
    Community Moderator

    Hi chaitanyai,

    1. Did you use the example code https://github.com/BoschSensortec/BoschSensorHub/blob/master/examples/orientation/orientation.ino and load firmware "Bosch_PCB_7183_di03_BMI160_BMM150-7183_di03.2.1.11696_170103" for your hardware?

    2.Accuracy means the calibration status of funsion algorithm, value 3 indicates that the calibration is complete and the algorithm outputs the best data performance. Value 0 indicates that sensor was uncalibrated. Because you have used a geomagnetic sensor, you need to consider whether the surrounding magnetic field environment has changed, causing the calibration state to drop, and you need to recalibrate.

    3.What is your sensor placement and target coordinate system like? You could draw a picture to show it.

    HI Robin, Thank you for the response.

    1) Yes, I tested orientation.ino and it is working perfectly. One board out of three, while testing suddenly stopped working. Still, the bhi. fw getting flashed and showing the sensor ids but no output data from that board. The remaining two boards working well.
    - Can we check somehow the firmware flashed is perfectly loaded?
    - Is the Virtual sensor and Interrupt enabled?

    2)"Accuracy means the calibration status of fusion algorithm" - Yes That's what I am looking for. The sensor contains BSX-Full right? so the sensor is calibrated by power on? Or do we need to calibrate every power on? - Does BHI160B have dynamic calibration?
    I am expecting, While in motion the sensor will be auto-calibrated am I wrong?

    3)Does orientation and calibration have any relationship?
    Please check my board orientation attached - (Its a custom-made board)

    4) I want to use the Arduino library but cannot find the orientation remapping registers code ported for Arduino drivers available. Is any other Arduino drivers I can get to remap the orientation of the IMU's?

    5) This question is related to the application. As far as I studied, We can't use Euler angles for 360 degrees representation of the object in the space even at the unit axis(I mean I consider only rotations at a single point).
    To achieve this we need to move to the Quaternions. Till this I am good. I am getting the Quaternions from the IMU.
    - Now I am confused. How to represent the object orientation based on Quaternions 
    - What I want is I need to derive the object is X , Y and Z degrees rotation in space, taking board orientation as (0,0,0) reference. Is it possible?

    Can someone help me with this?

    BSTRobin
    Community Moderator
    Community Moderator

    Hi chaitanyai,

    1. You can track your code and check the return value when the code runs to determine whether the firmware is loaded successfully? Enable virtual sensor ID successfully? Is the interrupt triggered?
    2. The BSX calibration algorithm runs in the background. The first use requires calibration. After calibration, save the calibration profile. The next boot can load the calibration profile.
    3. Perform axis mapping before calibration, otherwise the output of BSX algorithm is inconsistent with the actual coordinates.
    4. The current code supporting Arduino is the da on github
    5. Based on the BSX output, we have not taken this into account at present.

    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist