Shop OBEX P1 Docs P2 Docs Learn Events
IMU Roll Angle: Correct when Stopped, Wrong when Moving — Parallax Forums

IMU Roll Angle: Correct when Stopped, Wrong when Moving

Hi,

I have been using an MPU6050 (3 axis gyro, 3 axis accel, built in motion filter called DMP) with an Arduino on a car axle to measure axle angle when driving. On a long banked corner (2 degrees) the sensor reads 0 degrees while moving (~40km/hr), but when stopped it reads correctly (2 degrees). The physical axle angle is the same though in both scenarios.

I believe the lateral force from going through the corner is affecting the sensors interpretation of which way gravity is, and is adjusting the roll angles accordingly. See image;

IRLiGRU.png

Can anyone comment on how this might be solved?

For example;
-Using a sensor with a magnetometer?
-Using a sensor with a different filter?
-Is this solveable at all or just an inherent factor of MEMS sensors?

Thanks in advance for your input.

Comments

  • Most IMUs use a method called sensor fusion to compute their estimated orientation, but that's all it is - an estimate. Without an external frame of reference it's an impossible problem.

    Gravity is an external reference, as is the magnetic field of earth, but they only provide pieces of information, and aren't easily measured by themselves - The accelerometer sees gravity, but also any other accelerations acting on your sensor, and the magnetometer has the same issue - any local magnetic fields will interfere with your compass readings.

    If you have a GPS, it's possible to compute the amount of centrifugal force you're experiencing, and remove that from the accelerometer readings before running the sensor fusion algorithm. If you're using the MPU6050, I'm guessing that all happens internally, so you might be stuck with it - I'm not sure if they allow modification of the sensor readings before fusion.

    It'd be worth taking a look at what ArduPilot does in their code - they account for centrifugal force in long banked turns (called a coordinated turn in an airplane), so there's code available to do it.
  • Bosch does it with 6 DOF. http://www.bosch-motorcycle.com/en/de/fahrsicherheit_fuer_zweiraeder/sicherheitssysteme_fuer_zweiraeder/schraeglagensensor_1/lean_angle_sensor.html

    I was making a race data logger a couple of months ago with a BNO055, and had a lot of issues with lean angle when moving.

    Here's a PDF that breaks down the math, although I haven't much desire to go back to getting the math to work. - http://acl.kaist.ac.kr/thesis/2013partd_OJW.pdf



  • Thinking about it last night, I was going to suggest that if you knew ground-speed (from a wheel sensor) and the steering angle you could probably get a good estimate without GPS. The PDF Xanadu posted confirmed it can work.
  • Heater.Heater. Posts: 21,230
    Certainly the accelerometer give a nice "down" reference when stationary. But as you noted will also be thrown out of whack by linear acceleration or running around a corner.

    The gyro is good for determining orientation but will drift.

    This can be compensated for by using "sensor fusion" algorithms. It helps to have a compass to mix in there as well. You might want to look at Sebastian Madgwicks sensor fusion:
    http://x-io.co.uk/open-source-imu-and-ahrs-algorithms/ It shows some impressive stability despite lateral accelerations and such.

    xanadu,

    Interesting. I presume you were using the BNO055's internal algorithms. I have been itching to get hold of one of those to try out.


  • xanaduxanadu Posts: 3,347
    edited 2017-08-16 21:19
    Yes, the internal algorithms are great for stationery projects. I assumed that Euler angles were going to be enough, lesson learned. You're given enough data to work out whatever additional algorithms you might need. In my case I was logging everything to CSV, importing it into my computer and attempting to do the math there.
  • Heater. wrote: »
    Interesting. I presume you were using the BNO055's internal algorithms. I have been itching to get hold of one of those to try out.

    The Microcenter in St. Louis had an Adafruit board with the BNO055 on it in stock for $35. When you arrive in the US next, see if you can find one.
  • JasonDorieJasonDorie Posts: 1,930
    edited 2017-08-16 23:53
    The Elev8-FC implements a variant of Madgwick in a cog (along with almost all the other flight math). I wrote a thing that compiles streams for the F32 cog, and make the F32 cog run them asynchronously so I don't have to wait for the math to run. Make happy. :)
  • Thank you all.

    Some further research is giving me more insight into how others solve the problem (which has been suggested in the replies above, thank you). Primarily using a method to calculate the centrifugal acceleration, and then compensating for it.

    These solutions come from William Premerlani in the fixed-wing UAV community.

    Using GPS;
    http://diydrones.com/profiles/blogs/acceleration-compensation-flight-testing

    Using only Accel and Gyro;
    http://diydrones.com/forum/topics/centrifugal-compensation-with-only-gyros-and-accelerometers

    This solution coming from a research paper for fixed-wing UAV;
    http://users.cecs.anu.edu.au/~Jonghyuk.Kim/pdf/2008_Euston_iros_v1.04.pdf

  • Heater.Heater. Posts: 21,230
    edited 2017-08-17 02:31
    DavidZemon,

    I am actually State side just now. Moutain View. But that means I don't have the time or wherewithal to do anything much with a BNO055, to busy. I'll order one from Adafruit or somewhere and it will be waiting when I get home.


  • Heater. wrote: »
    DavidZemon,

    I am actually State side just now. Moutain View. But that means I don't have the time or wherewithal to do anything much with a BNO055, to busy. I'll order one from Adafruit or somewhere and it will be waiting when I get home.


    You should have a good suntan and dual citizenship by now.
  • Heater.Heater. Posts: 21,230
    Sun tan?

    I'm more like a sun dried tomato!

    I don't think Trump will go for the dual citizenship idea :(
  • Heater. wrote: »
    I don't think Trump will go for the dual citizenship idea :(



    Sure he will.

    New policy: It's not who you know, it's what you know. We'll just kick a dozen dumb people out.
  • MikeDYur wrote: »
    Heater. wrote: »
    I don't think Trump will go for the dual citizenship idea :(



    Sure he will.

    New policy: It's not who you know, it's what you know. We'll just kick a dozen dumb people out.

    Moderator Edit:
    Careful, we don't do politics here. :)

  • We went from IMU roll angles to trump immigration policy in 13 posts. Not bad! :P
Sign In or Register to comment.