Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    Use BMI-270 to track how far a door has opened

    Use BMI-270 to track how far a door has opened

    pr1
    New Poster

    The BMI-270 is a 6 axis IMU (accel + gyro). Trying to calulate the angle at which the door is opend and and use the gyro+accl ( complementary filter) to figure out the correct angle if the door rotation axis is horizontal to the earth ( for e.g in-earth trap door that opens upwards), but not able to do the same if the door rotation axis is vertial to the earth. The observation is that the accelerometer data remain virtually unchanged if the vertical door is swung open or closed gently. If it is opened such that there is some jerk then that data shows up but most of the motion is not captured.

    Tried to set the the interrup for anymotion check but that only triggers when there is acceleration or deacceleration.

    As described before, there is no problem if the door is opened horizontally.

    It seems the accelerometer works correctly when the height of the sensor changes with respect to earth (gravity vector), but if there is no change in the gravity vector the small gentle motions are impossible to detect.

    Any ideas on how to solve this problem.

     

     

    4 REPLIES 4

    Vincent
    Community Moderator
    Community Moderator

    How about use the any motion interrupt as trigger.

    when any motion fired, then calcualte the movement directly from respect axis of gyro.  gyro give you the rotation speed according to this axis.

    Then use no motion interrupt to stop the calculation. 

    Then in this time window,  based on gyro sensor output, you can get out how much angle the door rotated. 

    Combined with the original position stored in your MCU, you are able to get the angle postion of door.

    You can also introduce a magnetic sensor to tell you the original postion like door closed.  ( magnetic field with highest value, sensor clsoe to magnitude). 

    Unfortunately that does not work when the sensor moves horizontally to the ground. (as on a vertical axis door)

    The register 0x1c mostly reports 0x20, with the exception where there is sudden acceleration/deacceleration when it reports 0x40

    As described before, there is no problem if the location of the sensor (read distance from center of earth) vaires, but if the distance is constant then accelerometer cannot detect motion when there is no acceleration or deacceleration.

    etracer
    Established Member

    Then use the gyro. As the door swings though its arc it will generate an angular rotation in the Z axis.

    Yes, using the gyro (as stated at the start), but the gyro drifts (therefore used the complemenatry filter - accelerometer) and it works perfectly (opening angle is correct, but only when the door axis is horizontal to earth). Put it on your room door (axis perpendicular to earth)  and it does not work.

    To fix the issue decided to stop integrating gyro data while not in motion, but detecting motion /no motion when the door is moving gently is leading to misleading results as accelerometer only detects accl /deaccel.

    My conclusion is tha that the accelerometer only detects motion when it is moving along a graviy vector ( i.e the height of the senor w.r.t center of the earth varies) . If the sensor moves at a uniform veloicity along a path with fixed height to center of the earth then it can only detect rate of change.

    How to use accelerometer+gyro to detct opening of a door that has a rotation axis perpenidicular to earth. Maybe BMI270 is not suitable for this problem and need a magnetic sensor instead.

    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