PX4-Autopilot
PX4-Autopilot copied to clipboard
TECS: addition of pitch in turns based on load factor
Solved Problem
While flying a standard VTOL in FW we notice a drop in altitude that we would like to reduce as much as possible. We already set FW_T_RLL2THR to 20 (max value) and we didn't want to push throttle more than needed. Since during turns lift decreases with bank angle, my proposal is to add some pitch based on load factor in order to increase AoA
Fixes #{Github issue ID}
Solution
- Inside the computation of Energy balance, add a term proportional to load factor similarly on how is already done inside total energy for additional throttle. The two computations are independent one from the other, so the additional load factor term is added only once for each output.
- Creation of a new PX4 parameter FW_T_RLL2PTCH, so to be independent from value of FW_T_RLL2THR. Maybe for some platforms is not needed so can be simply set to 0
Changelog Entry
For release notes:
Feature/Bugfix: tecs additional pitch during turns
New parameter: FW_T_RLL2PTCH
Documentation: Find a better description for the parameter
Alternatives
Don't have any other option in mind for the moment but open to discussion
Test coverage
For the moment I just tested it in SITL , waiting for any feedback before traying on a real standard VTOL Simulation has of course its limits and I think that the model itself could be tuned better Comparisson of the same mission. I tried to show as better as possible the difference
- standard TECS
- TECS + additional pitch
Single logs don't say much, so I thought that this comparison could give a better idea
Altitude (peaks happen when turning)
Pitch Sp
Pitch
The interesting thing in my opinion is reduction of the jump in performing the same turns If needed I'm happy to do more test. Please let me know because it's possible that I'm missing something
Context
Follow-up from discord thread. I presented another comparison
Cool!
Two flight logs of real flights to illustrate the problem:
- https://logs.px4.io/plot_app?log=6f21071e-21d8-484b-95de-298cbc599ab8
- https://logs.px4.io/plot_app?log=b7a08d35-8b07-4f9d-a2fc-0f4c4fc63631 (airspeedless flight)
They were in almost perfect flying conditions, basically no wind etc. We often observe variations around 5m in case of wind. The pattern is :
- loss of altitude on intial roll
- stabilisation during turn
- altitude gain when decreasing roll
Would be cool if we can break through this pattern with this PR by better anticipating the loss of lift when rolling. :)
Hi @ciresimo ! Interesting proposal - interesting because you seem to have exactly opposed priorities to me for tuning fixed-wing turns. I usually prioritize airspeed tracking with my main concern to avoid a stall at all cost (this is mostly valid for vehicles flying in the endurance category, so rather slow). To assure that I'm generally happy to sacrifice a couple of m of altitude loss in a steep turn.
I found this random log of a Standard VTOL that I tuned where you can see a hard turn (45°), which results in an increased airspeed setpoint (*) and (partly because of the increased airspeed) a momentary reduction of the pitch until the new airspeed sp is reached. In the maneuver here the vehicle lost 2m.
Adding a pitch-up linked to the roll would work exactly against that - the vehicle would decelerate when entering the turn.
I acknowledge that for many vehicles tighter altitude tracking at the loss of airspeed tracking is okay - but wonder if that couldn't be achieved through tighter TECS altitude tuning in general. Would you be able to share how "bad" the altitude loss in turns looks like on your real vehicle and what TECS tuning you use? Maybe there are alternatives in tuning that would make you happy and we don't need to add more of these little "knobs" to TECS that are super hard to tune properly and pose a big danger for the unaware people.
(*) FW_AIRSPD_MIN is close to FW_AIRSPD_TRIM, so that's needed to not increase the AoA above what's needed for MIN airspeed and risk a stall)
@ThomasRigi sorry missed your attached flight logs. Going through them now. What I'm a bit missing in this flight is a long straight line, to see how stead the altitude tracking looks in this phase. And would be nice to have the initial conditions before a turn is started to be from level flight, not the constant turning as in this flight. And can you make a screenshot from the plots from a turn that you find looks particularly "bad"?