For Gliders/Soaring: How to prioritize airspeed over altitude control in waypoint missions?

Hey!

So i’m trying to glide from waypoint to waypoint. One problem i’ve come across is keeping a solid pitch angle and maintaining a consistent airspeed.

When my aircraft is below the set altitude of the next waypoint, it sets itself to the max TECS pitch angle and attempts to climb (which it cant, because no motor). I could set this to 0 degrees, but I would rather the aircraft prioritize a consistent flight speed instead.

I feared that setting the next waypoint very low would force the aircraft to dive to meet that waypoint, so i decided to use SOAR to see if the TECS airspeed control would be prioritized altitude control, but it’s the same.

Is SOAR required for this? Is it possible to tell the autopilot to not worry about altitude, or set up 2d waypoints?

Ideally i would like to be able to use RTL to return to home, but altitude control is very tightly implemented in that as well.

Here’s an example log. in this instance the aircraft ramps up desired pitch angle even before it reaches target alt, i assume because of sink speed or something else. Usually these two are pretty close together.

Here’s a log file as well. There’s two glides in there, first glide waypoint 1 was at 100 meters, rest was at 75. Second glide all waypoints were at 35.

You can plot these at plot.dron.ee.

https://drive.google.com/file/d/1BOVcB_LYRwjvf0muSyLXmteQPGzr4erA/view?usp=sharing

Hi,

Although you have TECS_SPDWEIGHT set to 2, which is correct for gliders, the TECS is internally using 0 (see log item TECS.w) due to the airspeed sensor being disabled.

This is fixed in the latest firmwares, where I have added an exception if synthetic airspeed is available, as it is in your case (TECS_SYNAIRSPEED = 1).

You might also consider setting TECS_OPTIONS = 1 (GliderOnly, which will avoid some other pitfalls).

Sam

2 Likes

Thanks Sam.

Upgrading to latest is a pain, if I set TECS_OPTIONS to 1, will I be able to glide fine on 4.0.5 or would I still have to upgrade to latest?

Also, what’s the best way to learn about all this internal stuff? Going through the code?

Hi ohitstarik

No, unfortunately you will still have the same problem even with TECS_OPTIONS=1 in the current beta release. Hopefully a new beta will fix this soon. You can load latest through Mission Planner by downloading from https://firmware.ardupilot.org/Plane/latest/ or you can select “All Options” on the Mission Planner firmware page and selecting “Dev” version type.

1 Like

Ah I didnt realize it was on the firmwares website. I’ll go ahead and update.

Thank you for all your help! You’re always on the forums helping people out and backing up your work, we really appreciate that.

and surely enough, it worked. Desired pitch is responding to airspeed. Time to strap an airspeed sensor on and tune this down.

Thank you!

For other people coming in with the same problem:

I went to te specified link and installed firmware from there.

It wants to go to max airspeed, which im assuming is because i have no airspeed set in mission mode.

I have:

TECS SPDWEIGHT 2
SOAR enabled, min alt like -10, max at 350
TECS OPTIONS at 1
TECS SYNAIRSPEED at 1

After these, you should be good for gliding. Tune:

TECS integrator gain
AIRspeed FBW min/max

Trim airspeed CD is apparently supposed to be nominal airspeed but it never changed anything for me. Desired airspeed always followed airspeed max for auto modes. (EDIT: This might have been because trim airspeed cd was 8000 for me instead of 800. oops)

My logs:

https://drive.google.com/file/d/1duqrQ4IV8hlQTxodxb2iBKPRK8iZE41t/view?usp=sharing

1 Like

Great stuff, glad it’s working better and thanks for documenting your settings here. You should find that even with SOAR disabled it will glide and this will avoid it potentially deciding the hunt thermals, unless that’s what you want :slight_smile:

Looking at the airspeed problem, I can see in the first glide you have TRIM_ASPD_CM = 8000 (80m/s), but ARSPD_FBW_MAX is 7, so this limits the target to 7m/s. In the second glide, you change min, max to 5 but trim to 5000 (50m/s) so it uses 5m/s.

1 Like