Leaky i-term use cases

I am trying to figure out what are use cases of leaky i-term except takeoff from off-level ground.
Can we use regular i-term immediately after taking off the ground?

Some explanations according with current implementation (in source code):

  1. Leaky i-term switches off at dynamic flight (e.g. 5 m/s).
    But there is no differens between hovering at 5m/s wind and flying at 5m/s ground speed with no wind.

  2. If we are flying at > 5 m/s at straight line leaky i-term become regular i-term not only for pitch, but also for roll, however we are not moving at roll axis.

No. The leaky integrator does not turn off until the aircraft ground speed is greater than 5m/s.

True but the aircraft has no sensor telling it the airspeed. I’ve been looking to get the airspeed sensor working in copter but currently it is not in there. So we have to use ground speed. Plus ground speed is actually what we are using to determine if the aircraft is going to land so we can start using the leaky integrator.

Ultimately it is not desirable from a controls standpoint to have the leaky integrator. But it is used to manage integrator authority for air/ground transition to keep the autopilot from flipping the aircraft on it’s side. I guess we could not use the leaky integrator in roll because, as you suggest, the roll axis may not require a large i term in forward flight. And thus could be set to a smaller value that would keep the autopilot from tipping the aircraft.
So I have done a lot of thinking on this subject and even have coded up a few ideas but am waiting until I get done with some major code maintenance PRs before going any further. The big unknown in trying to manage the I term is knowing when the aircraft is on the ground. It appears that the landing detector is doing a pretty good job with that but some would argue that we shouldn’t trust it. That is why we have the leaky integrator currently.
So there is more to come on this after some code maintenance gets done.

I think it is safe to switch to regular i-term if heli in air, is not it?

I mean, that it seems to be safe to replace check “ground speed greater that 5” with “heli in air”. I understand that heli could flip if it is taking off and using regular i-term, but if we are already in air it is impossible to flip with regular i-term and it does not metter do we have ground speed or not.

that is the issue. How do you determine when you are in the air? the previous control law designer decided that as long as the aircraft has ground speed then the aircraft must be flying. he did not trust the landing detector.

Edit: one thing to add. the leaky i term is used quite a bit in 3 axis gyro units but they use a much lower leak rate. the leak rate in arduheli is much faster than I would want it but as long as you are using a non zero ILMI that provides enough authority, then it works well.

Are you having an issue?

I’ve never really seen where the I-term does much in hover or slow speed flight. Back when the recommendation was to tune as tight as possible on P-gain it might have been more important. But the tuning recommendation is to use the feedforward path as primary, and since we have gone to that the only difference you would be able to detect would be to look at the logs and see that actual vs desired attitude might be off a bit in hover. But you can’t tell it in the way the helicopter flies otherwise.

In flight, after the machine goes into translational lift, it’s different. Now we need a little more gain to fight blowback. But we don’t want excessive P-gain that will cause it to break into an oscillation in high speed flight. That’s where the I-term provides the extra “nudge” to keep the attitude of the heli on track without oscillation problems.

If you are having problems in hover I would look at the rate control (VFF) first.

I have custom-build helicopter with high weight. Pitch limited at about 5 degrees. It hovers well, except some shaking with headwind when i-term is about ILMI. But when it starts to accelerate actual vs desired differs for about 1.5-2 degrees (with is noticable with 5 degrees max pitch limitation) before 5m/s reached. After 5m/s it goes well.

The only thing I wanted to know, is there any purposes of leaky i-term except taking off. So I will just fork and perform needed for my purposes modifications in sources. I have radio altimeter and do not have problems with “in air” detection.

Thanks for your anwers.

My opinion is that it is an unusual setup. If you have frame pitch limited to 5 degrees, then roll is limited to 5 degrees as well. If it is a conventional helicopter you’re using up a good chunk of your available attitude just to hover it due to tailrotor thrust. And it wants more than 5 degrees of nose down to accelerate, so the shaking you see is probably an oscillation with the attitude controller fighting the limit of available attitude in acceleration.

I think I would recommend giving it more attitude control room, at least 20 degrees. 40 degrees is better. 60 degrees is better yet. It is difficult to even make a coordinated turn with a helicopter on 5 degrees without tail skidding it. And even more difficult to bring it to a stop from high speed flight.

Why? It is not quadrotor and pitch limit should not be the same as roll. For now roll limited at about 15 degrees.

are these limits only when the aircraft is close to the ground or are they in flight away from the ground as well?

This is in flight limitations. And as I said 5 degrees of pitch is enough to fly 15 m/s on this aircraft, but going to try more.

5 degrees is certainly enough to fly 30-40kts in no-wind conditions. But how did you set the roll and pitch frame limits separately?

so now you have me curious. Why do you feel you have to limit your pitch attitude to 5 deg? Is this a structural limit of some sort? I would find that hard to believe because structural limits are normally due to accelerations. if you are concerned with moments on the rotor head, you can limit the acceleration with the ATC_ACCEL params.

or as Chris is elluding to, are you setting the actual max angle limit parameter to 5 deg?

Already done some local modifications for this.

Oh ok, nice! I would like that mod. I like 60-75 degrees of roll with my UAV heli’s but don’t need that much pitch.

Yeah, I think I would recommend giving it more room on the pitch axis at least. As Bill said, you can use the ATC_ACCEL settings to limit frame acceleration in the control axes. And there is also new ATC_RATE settings in 3.6 that you can use to limit the deg/sec of frame rotation. With these settings, if you are flying at or near (or over) the maximum takeoff weight of the helicopter you can slow down its response with those settings to keep it within the limits of available engine shaft power and rotor thrust.

You mentioned the helicopter is quite heavy, so I suspect you’re using the frame angle limits to keep it within the limitations of available shaft power. In hover will be the worst in that case. At 30kts you are in the range of best efficiency for most RC heli’s where the power requirement will be the lowest of all other flight profiles. But at only 5 degrees I suspect it’s going to struggle a bit in a headwind. It don’t take a lot. I fly my UAV heli’s heavy all the time (disc loading 1.25lb/ft^2) but they like about 7 degrees to cruise at 40-50kts in no wind or downwind. About 8 degrees upwind in a typical 10-12kt headwind.