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.

Sensor Hub BoosterPack application for DIY Segway

Hey forum, 

So i have been working on a DIY segway projects and i was using the TIVA C Launchpad and the sensor hub. I was reading a lot of material that was recommending to use a filter to filter bad accelerometer and gyroscopic data. I was also looking at the material about the sensor hub and it mentions that it uses a "Direct Cosine Matrix (DCM) algorithm"

which it says provide a higher accuracy value and less prone to drop out. So what i was wondering is if i needed to still implement a filter component to my project (i was planning to use a kalman filter) or I do not need to worry about it. 

  • Nelosn,

    I moved your post to the TM4C (TIVA-C) Forum for they will be better prepared to answer your question.
  • Hello Nelson

    Is the filter being proposed to be used a hardware filter or a software filter design?
  • I don't think you can implement a Kalman filter in HW but if you know of a way I'd like to have a reference if you have one available.

    Robert
  • Hello Robert

    No, I don't have one (especially not without a programmable logic). But I wanted to be 100% sure of the poster's intent of implementation.
  • I plan to implement the filter using software to obtain a precise measurement of the sensor. The issue that i saw from most accelerometers was error values that can be accounted for. What i would like to find out is if the sensor hub already implements a filter with the "Direct cosine matrix algorithm" that is stated in the practice labs and documentation.
  • Hello Nelson,

    The DCM values are implemented by the senorlib that is provided in TivaWare. The raw values can be taken by your application software for filter implementation.
  • So i was finally able to figure it out. It took me forever to find the new link for the Tivaware sensor library as the old one i had did not work anymore. Once i was able to read through the documentation i saw that the values are indeed filtered. They use a complementary filter and specifically use the functions 

    void CompDCMAccelUpdate (tCompDCM ∗psDCM, float fAccelX, float fAccelY, float fAccelZ)
    void CompDCMComputeEulers (tCompDCM ∗psDCM, float ∗pfRoll, float ∗pfPitch, float
    ∗pfYaw)
    void CompDCMComputeQuaternion (tCompDCM ∗psDCM, float pfQuaternion[4])
    void CompDCMGyroUpdate (tCompDCM ∗psDCM, float fGyroX, float fGyroY, float fGyroZ)
    void CompDCMInit (tCompDCM ∗psDCM, float fDeltaT, float fScaleA, float fScaleG, float fScaleM)
    July 25, 2016 59
    Complementary Filter DCM Module
    void CompDCMMagnetoUpdate (tCompDCM ∗psDCM, float fMagnetoX, float fMagnetoY, float
    fMagnetoZ)
    void CompDCMMatrixGet (tCompDCM ∗psDCM, float ppfDCM[3][3])
    void CompDCMStart (tCompDCM ∗psDCM)
    void CompDCMUpdate (tCompDCM ∗psDCM)
    

    to filter the values.