Compass performance

Hello everyone!
I calibrated my quad and flew to check if I am getting variances in EKF since I changed position of battery. I calibrated compass before flight.
I wanted to know whether my velocity and compass variances are in the acceptable limit or not
Do I need to use magfit tool values of compass_mot_* because magfit tool from MavExplorer as well as magfit web tool are not giving good values.
I have uploaded two logs one in which script was run for figure 8 and another a simple rectangle mission for 5 times.
Figure 8
Rectangle

Thank you!

Do you have current monitoring? Is it calibrated?

I have current sensor in ESC, yes it is calibrated.

Good, that is a good start.

Can you explain your definition of bad results in the magfit webtool?

In first graph the uncorrected and expected value overlap. In second graph expected and corrected values donot.

Similarly the mean field error is seen increased after corrections in web tool


Thanks for the clarification . It makes sense.

But the important doubt i have is, are my velocity variances and compass variances under limit. I also observe that at takeoff the velocity variance suddenly increases and settles in 1-2 seconds. Its the z velocity that is doing this.

@iampete what is your opinion here?

You existing calibration is using a large scale value and iron correction. When the fit is done including more than just offsets the MAGFit also finds a large scale value outside of its valid range of 0.8 to 1.2. Because of this it assumes got a bad fit and dons’t show it as a option. You only get then basic offsets only fits.

I guess your using a here2? It requires a scale of 1.2. The WebTool has no options to change the acceptable range of values, but you can using MAVExplorer.

@iampete @amilcarlucas
I am using RM3100 compass separately.

Below is the param file while doing figure 8 flight.
params.param (21.7 KB)

I changed scale min to 0.8 and scale max to 1.2 in magfit and got following graphs. The original and corrected are now looking similar.


and these are compass params after magfit
image

If your getting 1.2 scale with a standalone RM3100 there is something wrong with the setup.

@iampete Its not a standalone board, it is put on the same board where gps f9p is. Both are independent though only having common power supply.
Also what might be wrong? Is it magnetic interference?

Interference should not affect the scale. What unit are you using? If it also supports CAN then you might not be talking directly to the RM3100, often there is a micro controller in the middle.

@iampete We are using i2c. It does not have CAN.

We are using following IC
image
I can provide user manual if needed.
We have assembled the board ourselves using pni sensors and chip.

Sorry, you have exhausted my knowledge. It would be worth getting a known working RM3100 and connect them both at once for comparison. I know one issue that we sometimes see is getting one (or more) of the coils backwards. It would also be worth reading the data sheet to see if there is some way to set the scale factor via pin pull ups/downs which you may have configured differently to usual.

1 Like

@iampete I will definately go through the data sheet. Can you tell me what is scale factor seen in this kind of sensor?

We would expect very close to 1.0.

1 Like

@iampete @amilcarlucas
what will happen if I leave the compass as it is? What might be consequences?

In compass.calibrator,
image

If you have a good calibration then it should be fine. As you have found the built in calibration had a little wider tolerance than the MAGFit tool.

I will insert magfit values and do a test.
How do I come to know that I have achieved good calibration? Is it by looking at compass innovations and scale factor should be close to 1.2 or is there something else?

Also I am continuously getting velocity variances only due to Z velocity innovations high, is it something to do with compass or is it fundamentally different issue. I am not getting any significant innovation in east and north velocity so i doubt it is due to compass. I have uploaded logs at start itself if needed.

Thanks!