Bug in Auto Trim

Hi again,

I used the auto trim function described in the WiKi.

hold the throttle stick down and to the right until the LED blinks red, green blue. Basicly, just before the system disarms.

hover for 25 seconds, land and lower the collective to minimum and it will write to the eproms.

worked perfectly, next hover was spot on.

but, when I went back to Mission Planner, my HUD is Tilted with the heli on level ground. If this info is used for actual flight information, I think this will be a bad thing in auto.

Any ideas how to correct.

Best regards,


That is exactly how it is supposed to work. Helis need to be tilted to the right a bit to counteract the left thrust that the tail rotor is producing. So if you auto-trim in a windless environment, it remembers that roll angle. The thing is, the way it remembers it is to assume that the controller is tilted. You have set a new “level” for the controller.

This is something that I actually don’t like about the system, because it just seems wrong. On most of my helis, I do not do auto-trim. I keep the trim set flat, and then I just hold position with some right stick. In Loiter, the controller will figure this out automatically, but it gets ugly when you do a pirouette, because the controller thinks the thrust is a wind, so it rotates the lean angle as you go around. Say you are holding position in hover in Loiter, so the controller tilts the heli to the right. If you quickly rotate right, then the controller will actually make the heli pitch nose down, and the roll will go to level. So the heli will start to fly forward, and drift left, until the controller sorts it out. If you rotate continuously, the heli does a wobbly circle. It’s not great. But this is a very complicated problem to solve unfortunately.

What we need is automatic side-thrust compensation. But we don’t know what the side-thrust is, accurately.

Thanks again Rob,

The direction of the tilt made perfect sense to me, the magnitude seems excessive. 10 degrees seemed like a lot, I went as far as attaching a ruler with zip ties to get a better idea of how much tilt the heli fly’s with. The best I could tell was 3 to 4 degrees, but the Pixhawk might know better.

I re-loaded my last set of parameters and trimmed the heli in manualy by moving the HS1_TRIM and HS2_TRIM PWM values 30 or 40 to trim in the heli in. Is this an OK method to to trim the last bit. So the HUD is now aligned with heli, not with level hover flight.

It is close mechanically, a turn or two on the ball links and it will be perfect.


Typically they’ll hover at about 6-8° of roll. So 10° is a little high.

It’s possible that some of what you’re seeing is due to the Leaky I-term we have to use. The purpose of an I-term is to close the steady-state error. Exactly what we need to achieve a target angle in a hover. But there’s a big problem with a heli. If you leave it sitting on the ground, it usually has some small angle error. So the I-term builds up and builds up. Then you wind up the motor, and it will tilt over and strike the blades on the ground.

To get around this, I created what’s called the Leaky-I term. It leaks back to zero slowly. This means that when you’re sitting on the ground with some small error, the I-term will not get too big, causing it to tip over when you start the motor.

The downside is that it can never completely close the steady-state rate error. So it will usually take some angle error to reach zero rate. This is why you might require an auto-trim of 10°, so that it actually achieves 7° roll in a hands-off hover, in order to hold position. But when it’s sitting on the ground, flat, it shows that it thinks it is 10° from level.

Now… I just had an idea…