MATLAB Answers

AHRS sensor fusion IMU input values

55 views (last 30 days)
Benjamin9119
Benjamin9119 on 8 Apr 2019
Answered: Brian Fanous on 22 Apr 2019
Hello Matlab Community,
Firstly, my sincere apologies if this is not the correct place to be posting this question but I really did not know what other website to post to!
I am just wondering if anyone has had any experience with measuring any of the parameters required for tuning the AHRS sensor fusion output? I appear to be obtaining reasonable results for slow movements but faster movements are proving to be troublesome, thus I think it may have something to do with the sensor parameters I am specifying.
The parameters which the ahrs fusion algorithm requires are:
  • Accelerometer noise - variance of accelerometer signal noise ((m/s^2)^2)
  • Magnetometer noise - variance of magnetometer signal noise (T^2)
  • Gyroscope noise - variance of gyroscope signal noise (rad/s)^2
  • Gyroscope drift noise - variance of gyroscope offset drift (rad/s)^2
  • Linear acceleration noise - variance of linear acceleration noise (m/s^2)^2
  • Linear acceleration decay factor (this appears to be dependent on the application/movement velocity)
  • Magnetic disturbance noise - variance of magnetic disturbance noise (T^2)
  • Magnetic disturbance decay factor - decay factor for magnetic disturbance
  • Expected magnetic field strength (I understand this as being location dependant)
  • Initial process noise - covariance matrix for process noise
My understanding of IMUs is very basic but I have been trying to get my head around them. I am looking at using the Allan Variance method to determine Angle Random Walk and Rate Random Walk from a static sample of IMU data.
Is my understanding correct in thinking that this will assist me in obtaining values for Gyroscope noise and Gyroscope drift noise?
Any help, input, thoughts or inspiration would be very much appreciated! :)
Kind Regards,
Ben

  0 Comments

Sign in to comment.

Answers (2)

Brian Fanous
Brian Fanous on 18 Apr 2019
Hi Ben
The ARHS filter has several parameters that will affect its response. The first 4 you have listed are related to the sensors themselves, and you may be able to find good values from the datasheets.
The LinearAccelerationNoise and LinearAccelerationDecayFactor will affect how the filter responds to fast movements, like shaking.
The section on “Tuning Filter Parameters” in this example may help:

  1 Comment

Benjamin9119
Benjamin9119 on 21 Apr 2019
Hi Brian,
Thank you for your response. I am using the InvenSense ICM-20948 and have managed to set the Accelerometer noise and Gyroscope noise based on values provided in the data sheet.
I now also using the Matlab funciton magcal to compensate for hard/soft iron effects.
Implementing the above definitely seems to be resulting in better orientation estimation, however I am still getting a reasonable amount of heading/yaw drift that I would like to reduce.
I am playing around with the weighting of the LinearAccelerationNoise and GyroscopeDriftNoise weightings based on the suggestions in the above link using somewhat arbitary values, however was hoping that there may be a way of measuring this as opposed to 'tuning'. I was thinking perhaps an Allan variance approach may help in measuring these values?
If anyone has and recommendations on how to measure there values that would be great?
Thanks again,
Ben

Sign in to comment.


Brian Fanous
Brian Fanous on 22 Apr 2019
Hi Ben
Using magcal should definitely help. Collecting a good distribution of magnetometer samples is very important for successful calibration. Follow this example to see how the distribution of data affects the results of magcal:
The allanvar function will also give you a good starting point for the AHRS filter gyro parameters. But you will still likely have to tweak some of the parameters (including those from the datasheet) slightly to get the best performance.
If you are mostly seeing drift in the yaw, you should focus on tuning the gyroscope parameters and the magnetometer parameters. The magnetometer should compensate for the gyro drift. The Linear Acceleration parameters will have less of a direct effect on the yaw.

  0 Comments

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by