Spatial IMU/AHRS algorithm params

Any hardware type questions or problems for all other Phidget devices.
Post Reply
StevenCoral
Phidgetsian
Posts: 6
Joined: Wed Sep 13, 2023 12:13 am
Contact:

Spatial IMU/AHRS algorithm params

Post by StevenCoral »

Hi all,
I have some experience with spatial estimation algorithms, and I have checked out this link (spatial guide) thoroughly.
I have 2 questions about the AHRS parameters which I would appreciate if anyone could answer:
1. There is no explanation of to what each parameter controls. I could not find any info on the internet and the names are hardly self-explanatory.
2. Setting these values seem to have no effect on the IMU algorithm. I still need to increase the "integration corridor" over the drifting gyroscopes but can't figure out how. Is there a way to set parameters for the IMU algo as well, not just the AHRS?

Best Regards,
Steve
jdecoux
Labview Developer
Posts: 180
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Spatial IMU/AHRS algorithm params

Post by jdecoux »

For clarity, are you using the MOT0110?

1: You can find explanations for what each parameter does on the linked page here: https://www.phidgets.com/docs/Spatial_G ... Parameters

However, that wouldn't help you much at the moment because

2: Looking into it, setting the AHRS parameters was broken between firmware V100 and V104

We are looking into it, and will have a bugfix ready soon. For your purposes at the moment, you can downgrade your firmware to V100
Last edited by jdecoux on Wed Sep 13, 2023 1:04 pm, edited 1 time in total.
jdecoux
Labview Developer
Posts: 180
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Spatial IMU/AHRS algorithm params

Post by jdecoux »

Please disregard the comment about V104, after more intensive testing, it is completely functional. The problems mentioned above were present in an internal, unreleased build.

We revert to recommending V104 at this time.

To your earlier question 2: To check if AHRS/IMU parameters are doing anything at all for you, you can set the control panel example between "No Gyro" and "General Purpose" example settings. In No Gyro mode, the image should be very jittery with any movement, and in General Purpose, movements should be smooth.

Are there any specific parameters that seem most confusing? I can describe how best to find settings for them if need be.
StevenCoral
Phidgetsian
Posts: 6
Joined: Wed Sep 13, 2023 12:13 am
Contact:

Re: Spatial IMU/AHRS algorithm params

Post by StevenCoral »

Hi again, and thank you for answering.
I did check out that page, but since I was looking at angle-output prints using the Python library on Ubuntu, it was difficult to assess the effect of changing the parameters. Since I use the IMU (no magnetometer), did not see any significant change, and with the variables being named "AHRS Parameters", I assumed they were for AHRS mode only. Looking at the 3D representation in the Windows control panel, I can see that there is an effect, but can't really figure out exactly what it is.

First of all, knowing the units of these parameters (Ang Vel, Ang Vel Delta, Acc Threshold) would help a lot in their understanding.

I assumed "Angular Velocity Threshold" was kind of a "corridor" around the converged zero under which there is no integration of angular velocity (to result in an angle).
By this logic, setting a very high value (1000, assuming deg/sec) should stop the phidget from recognizing any slow rotations. But it does, so I guess I'm wrong.

The "Angular Vel Delta Threshold" is a mystery to me, even with the explanation. Setting a high value makes it "jump back" a little after I stop rotating it.
I will try to set it to a value stated in the instructions using the Control Panel, but an Intuitive explanation would be very welcome.

Aside from that - my phidget's purpose is to detect the heading of a car.
It is sitting in a place with magnetic interference so magnetometer is not an option, but it's good enough for me to have a measurement "since last init", rather than world-absolute (hence the IMU and not AHRS).
Assumingly due to vibrations, I am getting stable reading at times, but terrible drift in other times (up to several degrees every second, both while driving or while standing completely still).
From your experience, do you have any recommendations?

If you made it till here,
Thanks again,
Steve :)
jdecoux
Labview Developer
Posts: 180
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Spatial IMU/AHRS algorithm params

Post by jdecoux »

Thanks for clarifying the question! Knowing what confuses people really helps in improving documentation.

I'm seeing there could be confusion between the documentation saying the device assuming it's at rest, and what that means practically.

The device never fully disregards the gyroscope. Exceeding the set thresholds simply prevents the gyro from converging on a consistent actual rotation (e.g. you don't want your gyro zeroing around a sustained turn of 30°/s), or settling towards the accelerometer/magnetometer readings while accelerating.

Inside the thresholds, the gyroscope biases itself towards the current reading being zero, and the model tries to align itself with the other sensors. If any threshold is exceeded, the gyro is on its own.

Angular Velocity Threshold is pretty straightforward in this regard. You have the right idea, other than that the system never assumes the gyroscope is exactly zero.

Angular Vel Delta Threshold is the acceptable noise from sample to sample. This number is expected to be smaller than double the Angular Velocity Threshold, as otherwise the latter will be exceeded first.

To get a proper characterization of the parameters, you will want to graph the readings of the gyros and accelerometer with the vehicle running but at rest. Set the Angular Vel Delta Threshold just outside the peak-to-peak noise of the system. If the vibrations exceed 0.5-1°/s, you will have to set the Angular Velocity Threshold just outside the peak noise as well. Same goes for Acceleration Threshold.

From there you can experiment narrowing the parameters, but this should give a functional baseline. The rotation of the model should always settle towards not rotating when stopped.

If drift persists with the vehicle at rest, one or more of your thresholds are likely not wide enough.

We have had best results keeping Bias Time on the order of 1-2s when we tested tracking the the device heading in a car. Stop times can be relatively short and the gyro should be re-biased as often as possible to prevent any errors accumulated while the device was in motion from persisting and compounding over time.
StevenCoral
Phidgetsian
Posts: 6
Joined: Wed Sep 13, 2023 12:13 am
Contact:

Re: Spatial IMU/AHRS algorithm params

Post by StevenCoral »

Thanks again, your post has made the meaning very clear.
I can also see some changes were made to the documentation.

So there is no "don't integrate" corridor, only bias-pulling in effect or not.
I will attempt to calibrate the thresholds as per your suggestion, which makes a lot of sense.

Best Regards!
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests