Possible/Likely Bug in Servo_Autotrim

I have some very odd behavior when I set SERVO_AUTO_TRIM to enable on my Nano Talon flying the latest release of 3.9 on an Omnibus F4 Pro V3.

At some point in the flight, often at the very end, but not always, the auto-trim sets the deflection to maximum on my ailerons. The plane does not crash but it starts a violent oscillation as the FC fights this full deflection. It seems it counteracts the deflection and then goes back to fully deflected in an oscillating manner. I but retain control in FBW A. I land, reset the aileron trim to 1500 (center) take off and fly and the same thing happens. Here is a pic of the deflection when I land with my radio sticks centered.

Here is a log of a flight when this happened.

It is not spurious – it happens every flight pretty much. Since I disabled the auto trim setting I have no issues. The plane flies pretty well in wind even – it still needs a proper tune, which I can now do as I have solved this issue. It is a well behaved plane.

None of my other planes exhibit this behavior.I wonder if it is related to the small size of the Nano Talon - cannot think of another reason. I think it is worth looking at as it could have some nasty outcomes, potentially.

1 Like

You might try reversing these:

SERVO3_MAX 1200.000000
SERVO3_MIN 1800.000000

and

setting

SERVO3_REVERSE to 1

Try it on the ground before throwing it off :slight_smile:

1 Like

Thanks for responding.

But, why would I do this?

My plane flies perfectly. Why would reversing ailerons basically help with a the auto trim behavior?

Reversing ailerons would surely make the plane unflyable, would it not?

1 Like

your SERVO3_MAX and SERVO3_MIN values are reversed. So you need to correct the min and max, this will reverse the travel so you need to correct it again using SERVO3_REVERSE

1 Like

Gotcha.

I guess that threw a monkey wrench in the auto-trim.

I recall using those values to reduce throws and I set them manually and observed the throw. Odd that it would behave properly and restrain Min and Max aileron travel.

I will make changes you suggested and test.

1 Like

Can I ask a question here. Is this an inappropriate use of Min/Max on a servo travel. Everything works like this, except this odd auto-trim anomaly.

yes because your min is larger than your max

Got it.

Not sure how it ended up like this TBH. I only adjusted the min max to change servo travel limits as in a Nano Talon you do not have many options to reduce physical throws. I never knowingly inverted the min and max on that channel.

In its current form it passes all ground stabilization tests and performs in flight perfectly right up to the point it does not. And if I leave auto trim off it does not have this issue at all.

I will play around with this to see if I can understand it better and how it happened. But logically I think it may make sense to enforce this in Mission Planner or maybe make a simple change to the Auto Trim code to allow it to work in this condition – I can see some basic arithmetic is failing when auto-trim is applied in this state.

Your ARMING_CHECK’s are disabled, I think ARMING_CHECK = 1 would catch this, maybe you can test for us. If not we could add a check.

Thanks Peter.

I will spend some time with this and get back here or on Github if it needs further attention.

I hugely appreciate the time you took to look at my logs and help me out.