This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Sensortag fusion - quaternion service

Other Parts Discussed in Thread: CC2541

Hi all,

I have added a quaternion service to the Sensortag and uploaded the service to github here https://github.com/pruthvikar/SensorTag-Fusion

I thought it would come in handy!

Regards,

Pruth

  • Hello Pruth,

    Thank you for adding the link to that service.

    For those of us that are not familiar with Sensor Fusion or Quaternion.  Do you think you could provide a brief description of what it is and does exactly?  How it works with the SensorTag?  It looks like all the calculations are float intensive.  Are there any problems with loosing BLE Connectivity?

    Also, could you tell us if it possible to only download the specific files that would be needed for this to work with the Sensortag?  The folder looks like it contains all the /ble folders such as HAL, OSAL, etc,.  Where these files modified?

    Thanks,

  • What it is and does exactly? 

    Sensor fusion is the combination of data from several sensors to provide better information. In this case, better means being able to get the orientation of the SensorTag. 

    A quaternion is an alternative way to represent orientation. It provides an advantage over pitch, yaw and roll, where it does not suffer from Gimbal Lock.

    The resulting data allows you to create such visualisations https://www.youtube.com/watch?v=BXsGWoOMtmU .

    How it works with the SensorTag?

    This code is based on the TI SensorTag firmware and includes the addition of another service for calculating quaternions.

    Are there any problems with loosing BLE Connectivity?

    I have tested the code on two of my TI SensorTags for up to 15 minutes. I have not had any problems with losing connectivity so far. If anyone does run into issues, I would be happy to look into optimising the code.

    Is it possible to only download the specific files that would be needed for this to work with the Sensortag?  The folder looks like it contains all the /ble folders such as HAL, OSAL, etc,.  Where these files modified?

    I attempted to upload just the minimum viable project. I may have uploaded more than required. The HAL and OSAL files were not modified. just the addition of the quaternionservice and AHRS files and the modification of sensortag. (As far as i can remember)

  • Wow!  Those visualizations are very impressive.  It maintains orientation without error.  That should be good for stabilization applications.  I will definitely have to test this out.

    Thank you for the details on the project and thanks for sharing it.  It would something that should be added to the TI SenaorTag App.

  • Just to be clear, the youtube video in the link is not using the SensorTag. There is still a drift that makes it unusable over a longer period of time which I am trying to remedy.

  • Understood.  Did you use the GUI from the video.  Do you have a video using the SensorTag?

    When you say drift over time:

    1. Is this due false readings from the gyros or accelerometer?  
    2. Have you tried changing the resolution of each?  
    3. Is the drift constant and if so can it not be compensated for?

    Thanks,

  • Sorry I haven't been able to follow up on this. I have been focusing all my efforts on another project with the CC2541 and an IMU.

    I will try and find time later on but it may just be quicker for you to investigate. Speaking of which, have you had a chance to test the project?

  • I was interested with this post because I was toying with the idea of creating an Inverted Pendulum using only the SensorTag.  I did look through the code but other projects take precedence.  Until I have free time to start playing with it, I can happily wait for you to do all the hard work :-)

  • When I try to compile the project I'm getting this error:

    Error[e104]: Failed to fit all segments into specified ranges. Problem discovered in segment BANKED_CODE. Unable to place 82 block(s) (0x1c689 byte(s) total) in

    0x1b587 byte(s) of memory. The problem occurred while processing the segment placement command

    "-P(CODE)BANKED_CODE=CODE_BEG-_CODE_END,_BANK1_BEG-_BANK1_END,_BANK2_BEG-_BANK2_END,_BANK3_BEG-_BANK3_END,_BANK4_BEG- 
    BANK4_END", where at the moment of placement the available memory ranges were

    "CODE:7654-7ff7,CODE:18000-1ffff,CODE:28000-2ffff,CODE:38000-3ffff,CODE:4841d-4afff" 
    Error while running Linker

  • Project --> Options --> C/C++ Compiler --> Optimizations --> High --> Size

  • Thanks but I tried, and I have the same error

  • by the way, do you know if it is possible activate the IMU-3000 Fusion (the hardware implementation using the Secondary I2C serial interface for 3rd party accelerometer
    and the Digital Motion Processor)

  • If you are using the default linker file, then you cannot be getting a linker error for not enough code space (unless, of course, you have subsequently added more stuff to this project yourself):

  • Hi if I use the default linker the first option compiles without error but it only generates a .hex file and I need a .bin file to perform an OAD:

    How I can get a .bin file?

    If I use the "Image A" option, with the linker file changed as you suggest, and with the changes to support the quaternion service, then I get a new error:

    Fatal Error[e72]: Segment IMAGE_HEADER must be defined in a segment definition option (-Z, -b or -P)