Author Topic: IMU brick improvements needed  (Read 665 times)

stevehayles

  • Newbie
  • *
  • Posts: 13
    • View Profile
IMU brick improvements needed
« on: July 20, 2018, 12:09:37 »
Hi,

One for the developers and hopefully not a difficult change.  The IMU v2 based on the Bosch BNO055 which has more 'sensor fusion modes' than we have options for.

In testing the unit I have found that the FMC (fast magnetometer calibration) is troublesome and makes yaw / compass / heading output very unrepeatable.

There is a fusion mode called 'NDOF_FMC_OFF' (0b00001011) which is the same as the BrickIMUV2.SENSOR_FUSION_ON mode but has the auto calibration routine for the magnetometer disabled.

You can still store a full calibration profile and all other functions are the same.  Using the same chip in an Arduino device has resulted in a more stable system without the unexplained 'jumps' in yaw output that are often seen in the NDOF mode

It looks like a simple enough change with no backward compatibility issues ?

Thanks for your consideration

borg

  • Tinkerforge Staff
  • Administrator
  • Hero Member
  • *****
  • Posts: 3.119
    • View Profile
Re: IMU brick improvements needed
« Reply #1 on: July 20, 2018, 15:26:58 »
Sounds useful to me, i will implement it.
Wir sind die Borg, Widerstand ist Spannung durch Stromstärke!

borg

  • Tinkerforge Staff
  • Administrator
  • Hero Member
  • *****
  • Posts: 3.119
    • View Profile
Re: IMU brick improvements needed
« Reply #2 on: July 20, 2018, 16:00:14 »
I just released IMU Brick V2 firmware 2.0.13 with the new parameter. Call set_sensor_fusion_mode with 3. The new constant will be available with the next Bindings release.

Changes:
https://github.com/Tinkerforge/imu-v2-brick/commit/cb5d24238a7e403ba1cb981c574e093d63176ebd
https://github.com/Tinkerforge/imu-v2-brick/commit/2d1e81f59339a4ea83eb09d3fe3dbc0a8b822366
https://github.com/Tinkerforge/generators/commit/f4f2a0d3b1660fb45aaf19d65b9bf1a51a7dfbe9

I tested with this small script and played around in Brick Viewer. I think i can see the difference between the two modes.
Code: [Select]
#!/usr/bin/env python
# -*- coding: utf-8 -*-

HOST = "localhost"
PORT = 4223
UID = "6xEivJ" # Change to your UID

from tinkerforge.ip_connection import IPConnection
from tinkerforge.brick_imu_v2 import BrickIMUV2

if __name__ == "__main__":
    ipcon = IPConnection() # Create IP connection
    imu = BrickIMUV2(UID, ipcon) # Create device object

    ipcon.connect(HOST, PORT) # Connect to brickd

    imu.set_sensor_fusion_mode(3)
    print(imu.get_sensor_fusion_mode())
Wir sind die Borg, Widerstand ist Spannung durch Stromstärke!

stevehayles

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: IMU brick improvements needed
« Reply #3 on: July 21, 2018, 14:27:24 »
Hi,

Tested and working here.  Thank you for the amazingly fast response.

The BNO055 has some quirks around the magnetometer and compass / absolute yaw output.  My testing has shown the mode to be useful.

Thanks again