Observed wobbly behavior after MagFit calibration

Hello,

I am currently engaged in the process of conducting magfit calibration for an agricultural hexacopter. Following the application of magfit offset values, the drone exhibits a noticeable wobbling during flight. Upon analysis of flight logs, it was initially inferred that this might be attributed to the activation of motor compensation. I wanted to ask whether it is advisable to disable motor compensation during the calibration of magfit offset values as our agricultural drone is subject to varying payloads. Additionally, I am utilizing the

copter-magfit-helper.lua

script by @Yuri_Rage and adhering to the guidelines outlined in the Scripted MagFit flightpath generation thread for this calibration process.

Logs are attached below, the former is log from flight in which I performed Magfit using the script. The latter one is the log of flight where we experienced wobbly behavior. Offset values were obtained using MAVExplorer. In second flight I forgot to reduce the battery critical voltage to 35V, the margin was low between the Low and Critical voltage so battery critical failsafe triggered not log after battery low failsafe was triggered. The wobbly behavior was observed after battery failsafe.

Parameter changes after offset values were obtained:

COMPASS_DIA_Y 0.994564 → 1.042000
COMPASS_DIA_Z 0.998087 → 1.066000
COMPASS_DIA2_X 0.995666 → 1.043000
COMPASS_DIA2_Y 0.993159 → 1.038000
COMPASS_DIA2_Z 1.015994 → 1.054000
COMPASS_DIA3_X 0.982871 → 1.018000
COMPASS_DIA3_Y 1.013732 → 1.042000
COMPASS_DIA3_Z 0.960502 → 0.853000
COMPASS_MOT_X 0.000000 → 1.202000
COMPASS_MOT_Y 0.000000 → 0.568000
COMPASS_MOT_Z 0.000000 → 1.583000
COMPASS_MOT2_X 0.000000 → 0.684000
COMPASS_MOT2_Y 0.000000 → -1.241000
COMPASS_MOT2_Z 0.000000 → -0.996000
COMPASS_MOT3_X 0.000000 → 2.616000
COMPASS_MOT3_Y 0.000000 → -0.803000
COMPASS_MOT3_Z 0.000000 → -0.967000
COMPASS_MOTCT 0.000000 → 2.000000
COMPASS_ODI_X -0.005439 → -0.006000
COMPASS_ODI_Y -0.018371 → -0.031000
COMPASS_ODI_Z -0.010437 → -0.027000
COMPASS_ODI2_X -0.009823 → -0.011000
COMPASS_ODI2_Y 0.023745 → 0.057000
COMPASS_ODI2_Z -0.000398 → -0.002000
COMPASS_ODI3_X 0.002051 → -0.011000
COMPASS_ODI3_Y -0.004804 → -0.011000
COMPASS_ODI3_Z 0.000447 → -0.007000
COMPASS_OFS_X -12.285492 → -16.000000
COMPASS_OFS_Y -15.485242 → -20.000000
COMPASS_OFS_Z -40.018341 → -31.000000
COMPASS_OFS2_X -19.971905 → -30.000000
COMPASS_OFS2_Y 8.591290 → -7.000000
COMPASS_OFS2_Z -39.632401 → -41.000000
COMPASS_OFS3_X -133.142166 → -113.000000
COMPASS_OFS3_Y 108.608307 → 123.000000
COMPASS_OFS3_Z 107.512703 → 110.000000
COMPASS_SCALE 1.040326 → 1.000000
COMPASS_SCALE2 1.037302 → 1.000000
COMPASS_SCALE3 1.029600 → 1.000000

Logs:
MagFit Log from flight in which MagFit was performed
Second Flight Log from flight in which wobbly behavior was observed.

1 Like

Have you seen the youtube video?

@amilcarlucas thanks for the reply. Will rewatch the Video.

The stability and control of Drone until the battery failsafe is good, after the battery critical failsafe triggered, as excepted land mode is activated and I switched back to loiter/althold, the drone is little bit jerky in both the modes.

I have done something wrong during setting up the MAGFIT values, it become jerky after battery failsafe triggered is my concern. (is it because of high current values).

I was following the procedure in this article for tuning..

Do it gain, and use a shorter flight where the battery does not go that low.

The magfit flight was done with higher battery voltage.

The flight behaviour was observed after writing the magfit values.

Magfit looks okay. It’s the battery voltage. What are you running for a battery?


All 3 compasses looked more or less the same. They all go crazy about the same time the battery voltage drops off the chart. The only thing that works out is you’re using a 10S battery, and even with that you ran the voltages far to low, even for LiIon.

Batteries are 2 LIPO 6S connected in series. It was a mistake on my part I provided critical and low battery as 37V.

for getting magfit values i used the following setting shown below. Is it because of CURRENT consumption become very high, the interference also very high. Do i need to remove CMOT option and get the magfit values.

You’re destroying those batteries.

Assuming the battery voltage is correct…

A lipo battery should not be down to a resting voltage of 3.5V/cell. 3.5 x 12 = 42V. That flight started with a dead battery. A finished resting voltage of less than 35 volts is below 2.9 v/cell. That is far below a safe voltage for a lipo battery.

My opinion: Looking at the compass data, the magfit calibration is fine. The batteries are ruined. Your issues were all battery related. Given the “wobbly” behavior, you’re lucky you got the drone back in one piece.

Do not reduce the critical voltage to 35v. That is 2.9V/Cell and far too low for a LiPo battery. If you are using uncorrected voltage then I would suggest a critical voltage of 43.2 and low of 44.4. A fully charged 12S should be 50.4 (or 25.2 for each 6S). Continuing to fly a LiPo below 3.5v/cell (42V) will destroy the battery.

1 Like

@Allister Thanks for the feedback. sorry for the mistake, batteries are Lithium Ion..

I will consider the battery critical and low voltage settings.

That makes a big difference.

Either way, I still think the MagFit is reasonable. The compass performance is clearly stable until the point where the voltage and current start to fluctuate wildly. Perhaps at that lower voltage the increased current is too much for some part of your system. LiIon batteries are known to create a lot of extra interference to compasses.

The issue is not the compass. It’s the power system. Why did the voltage and current start to fluctuate like that? No, the compass wouldn’t do that.

@Allister do you think because of the high fluctuations in power system, causes the compass interference to become very high and caused that behaviour.

No, no. You are stuck on this notion of a compass problem, but that is a correlation vs causation issue. You properly performed a compass mag fit. But just because that’s the last change you made doesn’t mean that it’s the cause of the subsequent issue.

The cause is very simple: the batteries were discharged beyond their useful capacity, they could no longer supply current consistent with stable flight, and a crash ensued.

Based on the manufacturer specs, your use of 37V as a failsafe might be a bit low, since it’s less than 0.1V/cell away from the min safe voltage. You may want to consult someone more versed in high performance Li Ion cells to confirm.

You should verify that your battery monitor settings are accurate. Use a multimeter to measure voltage at the battery and then compare it with reported voltage in telemetry. Adjust the multiplier as needed to get accurate results.

Additionally, those batteries may be damaged beyond repair. You might put them through some charge/discharge cycles to see how they perform before attempting to fly again.

2 Likes