Soaring/Gliding for Planes

A really nice update on soaring by @Samuel_Tabor from the dev conference:

3 Likes

Very good video (I saw it twice !)
I understood that you are using mostly condor 2
Samuel, how do you link condor 2 to ardusoar ?

Thanks

Hi ohitstarik,

Hereā€™s the branch with glide polar learning. Testing is definitely welcome, I have had some success with it. I havenā€™t written up any formal docs for it yet, but earlier in the thread I posted a description (nearly a year ago!)

Iā€™ve also added a small feature that isnā€™t in master yet and needs some testing - automatic learning of the glide polar parameters SOAR_POLAR_CD0 and SOAR_POLAR_B during a still air calibration flight. The method seems to work well in simulation and in early flight tests and should make tuning easier on new aircraft.

This only works if you are flying in still air with the new parameter SOAR_POLAR_LEARN set to 1 (set it to 0 again after the calibration flight). Itā€™s still important to set the wing loading parameter SOAR_POLAR_K first by measuring all up weight and looking up the wing area. 5 seconds of data with zero throttle output, steady airspeed target and roll angle below 10 degrees are needed before any learning is done to minimize noise.

The best way to use this is with the RC switch for SOAR_ENABLE_CH in the middle position and with periods at several different airspeed targets - e.g. see attached plot from a simulated flight. This can be done either in FBWB mode using the throttle stick or in AUTO mode with DO_CHANGE_SPEED mission items - see attached example mission file (donā€™t load this directly as itā€™s in Australia!).

After the flight the log items PLRN.CD0 and PLRN.B show the convergence of the estimates, and the parameters SOAR_POLAR_CD0 and SOAR_POLAR_B will be updated to the final values.

1 Like

Thanks @adcam,

Thatā€™s right. Unfortunately the method to link to Condor 2 is quite complicated. Condor 2 does not output all the information we would ideally like, and it also does not accept input except via joystick. Therefore there is quite a bit of intermediate infrastructure to reconstruct the missing information and to emulate a joystick.

I have some work to do to make this easier to set up. In the mean time XPlane also works well as is more straightforward. The downside is that the weather modelling is not quite as good. @marco3dr has some nice video demos using XPlane, e.g. https://youtu.be/hdln1eqVciI

It is good to see work being continued on SOAR, thank you for the time you are putting into this project ! SOAR has a lot of potential and would really help in extending range of planes if I can get it to work well. I will update to this latest ArduPilot version and try SOAR again.

Author: Samuel Tabor samuelctabor@gmail.com
Date: Sun Apr 4 23:49:13 2021 +0100

AP_Soaring: Update vario tau calculation to use SOAR_THML_BANK.

APMVERSION: ArduPlane V4.1.0dev

Hi Michael,

Right now itā€™s unlikely it will work well on your setup (without an airspeed sensor). As discussed in my talk Iā€™m going to look into whether we can improve this.

Sam

@Samuel_Tabor thanks for your great work and that brilliant presentation!

i recently built a new airframe, itā€™s a multiplex lentus 3m foam glider. iā€™m using a matek F765-wing, ms4525 airspeed sensor and a diy audio vario.

the first veritabel flight showed a pretty pleasing performance of more than two hours motorless flight, doing 95 km in 125 minutes, consuming less than 1000mAh of its 4S3P 10Ah 18650GA liion battery:

i think the flightlog contains enough data to fine-tune the soaring paramaters now. looking forward to try the new POLAR_LEARN feature!

cheers, basti.

1 Like

Hi Samuel,

I watched your video, and am very encouraged that you want more people to use the SOAR feature. I agree, SOAR is awesome, and has a lot of potential !!! A LOT more people would use SOAR if you did not require the airspeed sensor ( as you mentioned in the video ). Even more people would use SOAR if it were simple to setup without a bunch of complicated parameters. The " BANK ANGLE " setting is basically what I was proposing last year when I was talking about constant turns while measuring lift. Now that bank angle setting is a reality, the airspeed problem is easy to solve, and also easy to program !!!

  1. Make an optional " PITCH " setting for SOAR for those that do not have airspeed or want to avoid complicated setups and tuning.

Basically, fly the plane at a constant pitch and measure vertical speed. Stop measuring vertical speed for a few seconds when the plane is entering bank or leveling as this will make vertical speed unreliable until plane is stabilized. The vast majority of FPV gliders and planes will glide very well and efficiently at a constant pitch setting. This will not only negate the need for any kind of airspeed sensor and control, it makes setup incredibly easy.

  1. Enable SOAR
  2. Set bank and pitch, and fly !!!

With setup this easy, I think you would see the number of SOAR users increase by more than 100 %. Many people think this feature is cool and want to try it, but are intimidated by complicated setup and need for airspeed sensor.

If you have any doubts, I can send you a video of how well soaring by pitch and bank works in FBWA mode. Soaring in FBWA mode works so well, it is what I always use for soaring, in both powered planes and gliders. It is so much more relaxing in a multi hour flight to just command a full circle turns by holding full aileron on the stick and let ArduPilot control the bank angle and pitch. I can soar in Manual Mode and control the plane myself, but I get totally wore out with sore fingers after a couple hours of this.

1 Like

Very cool and nice plane basti.

Iā€™m interested to try your audio vario, perhaps you could take a look at this issue I posted :slight_smile:

@Samuel_Tabor iā€˜m sorry, seems iā€˜m having issues with my github notification alert settings. iā€˜ll add a proper library structure to that repo asap!

I tested the latest version of SOAR and it is working SO MUCH BETTER now. The last version I tested was last summer, and it did not work for me at all. Now SOAR is actually is able to find and circle / climb in lift. The biggest improvement I see is that when SOAR detects lift, it now very quickly banks to 45 degrees and goes into a circle before passing the thermal. Once circling, SOAR does an OK job of staying in a thermalā€¦ But it was windy, and the SOAR did go downwind with the thermals a bit, but not quite enough, eventually after a few minutes SOAR would lose the thermal and I would have to direct the glider downwind in CRUISE mode to get it back in the thermal a few times. The good news is that SOAR was actually able to achieve altitude gains on its own.

I am testing with a Phoenix 2400 and do not have an airspeed indicator, but airspeed is absolutely not needed to be able to soar well. I know I am losing some performance, not flying as efficiently without airspeed, but the plane does just fine without it when SOAR keeps it in the thermal.

Adding BANK angle to SOAR was a really big step in the right direction for getting SOAR to work with more planes. Now we need a PITCH option for planes that do not have airspeed indicators. That is basically how I use SOAR, by setting the navigation parameters of ArduPilot to always fly a pitch of 0 degrees. Max Pitch 0 and Minimum Pitch set to -1.

No airspeed indicator or complicated setup, just simple Bank, Pitch, and keep it in the thermal works great. SOAR could be used to thermal virtually any plane.

@JetPilot wow mike, now thatā€™s some lift you got there!

@JetPilot thatā€™s great to hear. Iā€™m sure the thermal tracking aspect can be improved further, I need to spend some time digging into how best to fly without airspeed. Cool screengrab!

so iā€™ll just share some of the progress i made trying to get more familiar with autonomous soaring. due to the fact that our weather conditions and my individual timeframe usually do not allow for frequent and extensive real-life tests, setting up a SITL test environment is quite helpful for me, as it lets me gain experience whenever i please with a dram of islay malt in my hand;) thanks to @Samuel_Tabor 's help i figured that the plane-soaring autotest setup basically has everything needed for that right at hand. the SITL parameter documentation still is WIP, so this might help:

having setup a build environment following the wiki guides is a requirement. as a matter of fact i just had to replace my laptop PC and set up WSL ubuntu from scratch. took about 10 minutes following the wiki, using the existing install scripts.

now fire up SITL with the soaring option set. i do like to add the OSD mockup too. thatā€™s

sim_vehicle.py -f plane-soaring --osd

from inside the ardupilot/ArduPlane folder.

now set SIM_THML_SCENARIO to 1. this will activate a single thermal about 250 m southwest of your home point which is CMAC airfield by default. the thermal however is set relative to your chosen home point, so you can have it in your preferred location alternatively, just got to find it. check https://github.com/ArduPilot/ardupilot/blob/278593a6a02a021d3a4a85f1cdc9f88b448dc9c6/libraries/SITL/SIM_Aircraft.cpp#L938 for reference.

now load and write the waypoint file from \ardupilot\Tools\autotest\ArduPlane_Tests\Soaring. this will set your flightpath to hit the thermal close to the southwest corner of the rectangle youā€™ll be flying:

you might now use the SIM_WIND_ parameters to add some realism and figure how altering the soaring parameters will affect thermal detection and centering.

iā€™m seeing a very promising performance of the soaring feature here, following and centering very well while iā€™m trying to throw the simulation off by changing windspeed and direction deliberately (within certain limitations that is, obviously):

so after practically figuring out how the SOAR_ parameters affect thermalling performance, i made some adjustments to my actual setup, that is

setting the POLAR_K to 90, as itā€™s about 3kg with 0,52 qm wing area. see the soaring wiki for reference.

set THML_BANK to 30Ā° as thatā€™s what i found gives best overall performance when tracking thermals manually in FBWA. individual preference for the most part iā€™d say.

set MIN_THML_S to roughly the time it takes to go two (!) full circles as that relevantly reduces the frequency of switching in and out of thermalling mode and allows to keep tracking lighter thermals in windy conditions. this would be ~ 40 seconds in my case.

set VSPEED to trigger thermalling to a compareably small value of 0,15 m/s as that best represents the actual conditions we got around here this time of year.

real-life testing shows some pretty satisfying results:

on a sidenote this is the first airplane ever iā€™m using an airspeed sensor in. iā€™ve been seeing good results in all my planes with GPS only, but as this is a purpose-built glider i considered a hardware sensor mandatory. however, iā€™ve not been using it for regulation yet, ARSP_USE still being set to 0.
now looking at my log data (synthetic vs hardware-airspeed) i do see only very small offsets:

most likely this is due to the fact that when thermalling, the synth arsp estimation is constantly being updated. it does show some decay on longer straight legs though, but not to an amount that affects performance imho. donā€™t get me wrong here, i really do like having an actual airspeed sensor on board, just saying that the airspeed estimationā€™s precision is quite amazing.

looking forward for the summer and the lift i hope it will bring :wink:

1 Like

I tested SOAR for several hours the other day and am very happy with the improvements in this last version. Given the improvement I see, I fully expect it will not be long before SOAR outperforms a human. Conditions were average for a spring day, and my Phoenix 2400 sailplanes does not have an airspeed indicator, flying by BANK and PITCH only ( I limit the pitch in the navigation section by setting nose up at 0 and nose down at -1 )ā€¦ SOAR could find and fly thermals and keep going all day with no other input if left to its own devices !!! I finally had to bring the glider down manually to have some time to do some other testing.

Wind was about 20 KPH so thermals were moving across the ground, SOAR would follow them, but not quite fast enough. SOAR would enter a thermal, use it for a while until the thermal got blown downwind, then SOAR would go back to CRUISE and then reenter it again ( See attached ground tracks ). I am not sure if SOAR is using the wind estimate, but thermals seem to move at different rates than the wind sometimes as there is sheer, different wind speeds at different altitudes might cause a problem with this. Here are a couple performance observations:

  1. I think an interesting test would be to IGNORE wind speed, and try having SOAR keep in a thermal by circling, measuring lift as it circles, and correcting towards areas of higher lift only.

  2. Sometimes SOAR would be 1/2 in , 1/2 outside of a thermal, with good climb rates in a certain sector of the circle, but sink in the rest of the circle. Sometimes Soar would exit thermal instead of correcting towards the higher lift area.


@vierfuffzig very nice write up. Useful observation on the synthetic airspeed accuracy in thermal vs straight line flight, Iā€™m going to start experimenting with airspeed-free soaring in the next few weeks.

@JetPilot thatā€™s great, thanks for the feedback. Currently it should do both - drift with the wind and also correct towards higher lift. Iā€™ll look into how wind drift is working without airspeed. Althouth basti has shown that the airspeed/wind estimate is good when thermalling, estimated thermal strength relative to aircraft sinkrate is also part of the calculation and this could be throwing it off.

Thank you for the reply Samuel Tabor. I have not set any of the SOAR_POLAR settings, would these make a difference ??? I assume that my Phoenix 2400 would perform and that settings would be very similar to your ASW-28, what settings did you come up with for your plane ???

SOARING POWERED PLANES:

One of the really great potential capabilities of SOAR will be the ability to extend the range of power planes. Here is a typical powered plane being soared manually in FBWA mode using only pitch and bank angle, it works great !!! I did not update the firmware on this plane yet, so I had to do this manually in FBWA mode, but SOAR could accomplish this better than I could. No need for airspeed indicator, or any sink rate or other complicated settings, making this work is really simple manually:

TO DETECT LIFT WITH POWER PLANE: Fly in CRUISE mode, and watch the power being commanded in Ardupilot for level flight. When power % goes to 0 to maintain altitude, you know you are in lift. ( You could use a higher percentage if you are cruising fast, for example activate SOAR when power level reduces to 25 % )

The time / range gains I get with this technique are HUGE. This would be well worth implementing, and would work with almost any plane. 90 + % of Ardupilot users could easily use this with no complicated setup or extra tuning required.

1 Like

@Samuel_Tabor I have replaced Arduplane 4.0.9(a632c813) with build 1.3.7788.21152 now. Do I have the latest for Soar now? I am a little uncertain about that.
Could you confirm? Thanks.
Maarten.