inav icon indicating copy to clipboard operation
inav copied to clipboard

Alternative for TPA in fixed wing.

Open Dronek opened this issue 9 years ago • 36 comments

TPA is intended to attenuate PIDs with increasing throttle. While this is useful for multicopters, it makes sense for fixed wings exclusively in scenarios where high throttle is equivalent to high airspeed. However, there are possible scenarios where the mentioned equivalence is not met. Steep diving with low throttle might lead to oscillations due to high (not properly attenuated) PID gains. Steep climbing with high throttle might in turn result in lack of PID activity. It might be therefore more elegant to use "airspeed PID attenuation" instead of TPA. If airspeed sensing is not available PID attenuation could also be controlled as a function of throttle, aircraft orientation (nose up/down) and vertical speed with respective logical dependency.

Dronek avatar Feb 10 '17 16:02 Dronek

Airspeed sensor is one the way to iNav, and once it's working it will become logical to use aitpseed sensor for PIDs attenuation. Which I believe is already planned.

Without airspeed sensor a simple solution was taken to map it to throttle with known limitations as you pointed out.

But I agree current implementation could be improved with having the TPA applied both weighted by throttle and pitch.

So full throttle and pitch up ( aircraft going up ) would still not reduce PIDs completely.

While also opposite low throttle and pitch down would still apply some TPA.

oleost avatar Feb 10 '17 17:02 oleost

@Dronek You mean when airspeed is not available, base TPA on 3D ground speed?

WaspFPV avatar Feb 14 '17 08:02 WaspFPV

@Dronek You mean when airspeed is not available, base TPA on 3D ground speed?

Not sure what you mean by 3D ground speed but I don't think that ground speed (or GPS based speed in general) is a useful reference for PIFF attenuation (PA), at least not when wind is involved. Also, if the plane is in a steep dive, groundspeed is very low but airspeed can get very high.

EDIT: The current TPA curve for fixed wing can actually lead to severe oscillation during steep dives in acro with zero throttle which is probably the most critical bug of the current "TPA for airplane" implementation. I will try to come up with some suggestions how to improve TPA for airplane...

Dronek avatar Feb 14 '17 09:02 Dronek

@Dronek by 3D ground speed I mean total sped, not only horizontal, but the total of horizontal and vertical. But you are right, it wouldn't work if there was too much wind. You would need telemetry to a weather station, and still calculate the airspeed to make it work well.

WaspFPV avatar Feb 15 '17 08:02 WaspFPV

I suspect TPA gets used to deal with induced motor/prop vibration more than anything and people should know how to deal with that ;) lets not forget a steep dive at zero throttle is still going to make your motor spin not far short of the RPM it would be if propelling that speed itself. Speed sensitive TPA, like Car steering is a good thing but not essential if the car handles and steers properly in the first place.

Redshifft avatar Feb 17 '17 13:02 Redshifft

Not sure what your point is... I'm using a folding prop on my wing and ESC brake when throttle is zero. Nothing spinning there. But even when you have a regular prop and it continues to spin without throttle TPA will amplify PIFF gains in the current implementation during rhe dive.

Dronek avatar Feb 17 '17 15:02 Dronek

@Dronek And how does it do that when your first point suggested TPA needs to be speed aware ? Unless things have changed TPA can only attenuate. As TPA is not working for you why don't you tune without it and see how you get on.

Redshifft avatar Feb 18 '17 07:02 Redshifft

OK, I see. Obviously there is a misconception here. TPA in iNav actually works differently for fixed wing than for multirotor. Please refer to the following wiki page and you will note that below mid throttle TPA factor becomes >1.0 https://github.com/iNavFlight/inav/wiki/PID-Attenuation-and-scaling

Dronek avatar Feb 18 '17 10:02 Dronek

Wtf, that looks like some sort of work around and changes everything, is it even current (2 Nov 2016) with the new Aeroplane pid controller ? Very few will use an Airspeed probe anyway so it needs to be clarified that it's still there for 1.6 firstly. If it is add me to your supporter list :)

Redshifft avatar Feb 18 '17 12:02 Redshifft

For airplanes TPA is not really attenuation accounting for thrust/vibration at high throttle. It's designed to be a substitute for airspeed sensor - in most cases airspeed is proportional to throttle (not talking about rapid climbs and steep dives).

digitalentity avatar Feb 18 '17 12:02 digitalentity

@digitalentity Read my comment?

So a new variable called fw_tpa_pitch_weight. So when it's zero TPA will behave as now, only looking at throttle. But the more weight the more pitch will be used in combination with throttle.

So when flying straight throttle TPA would work as now, but when climbing the "fw_tpa_pitch_weight" would assume the airplane is going slower than just straight and therefore increase PIDs. Also same with diving. ?

Unsure if this is doable, or if it would be hard to tune when example diving and then going up again.

oleost avatar Feb 18 '17 13:02 oleost

Yes, it's definitely possible to create, but it will be very hard to tune - pitch contribution to airspeed depends on too many factors (drag factor, mass, lift etc).

digitalentity avatar Feb 18 '17 13:02 digitalentity

We need more data from BB logs to figure out some relation between pitch and airspeed. Unfortunately for that we need planes with pitot tubes and so far only @sambas has one (I might be wrong though).

digitalentity avatar Feb 18 '17 13:02 digitalentity

I already mentioned my readiness to test an airspeed sensor with inav in the forum. If you tell me which sensor is most likely to work reliable with inav I can provide you BB data as well. In my opinion TPA schould be additonally weighted by the angle between acceleration vector and a plane perpendicular to roll axis. This way an aircraft diving upside down could also be attenuated correctly...

Dronek avatar Feb 18 '17 13:02 Dronek

A straight desensitizing of pids increasing from "flyable" throttle range should work - normal TPA Are we looking for it to "stabilize right" or "feel right" on the controls ?

Redshifft avatar Feb 18 '17 13:02 Redshifft

Rather to "not actively de-stabilize". In fact, throttle range below flyable throttle is more critical and more complicated to handle in terms of correct PIFF gain modulation.

Dronek avatar Feb 18 '17 21:02 Dronek

@Dronek There are some very strange defaults in this fw/configurator for Aeroplanes, let me test it in the air before I comment further.

Redshifft avatar Feb 19 '17 13:02 Redshifft

Defaults are not so well suited yet.

We need to update those. Please remember it's 1.6 is not out yet.

oleost avatar Feb 19 '17 13:02 oleost

Airspeed support is in progress. Closing.

digitalentity avatar Apr 04 '17 13:04 digitalentity

How about return to this feature? We don't really need airspeed to use TPA. Gps speed will give more accurate coefficient for tpa than throttle level. Say more - throttle based pid attenuation is a bit pain for hand launch and high speed planes.

brat002 avatar Oct 15 '17 15:10 brat002