Soaring/Gliding for Planes

@JetPilot @marco3dr @wkf94025

I agree. That’s why automatic re-centring of thermals is fully supported in the current version :slight_smile:

I’m going to make some updates to the wiki as I don’t think it is clear enough on what features are implemented.

The thermal centring method uses an extended kalman filter to continuously compare the measured updraft with the expectation from the estimate of the thermal’s characteristics. The estimate is then adjusted to better fit the measurements. Of course this is noisy due to turbulence and imperfect sensors, which makes the kalman filter a good tool as it inherently deals with noisy measurements and uncertainty. Another good feature is that the uncertainly is initialised to a rather large value, and this helps to “lock on” to the good areas of lift during the initial search.

@RainFly unfortunately automatic activation of CROW is not yet supported . . . it’s something that could be done quite easily with a script however.

SOAR SUCCESS !!! But…

I soar manually using FBWA and using the vertical speed indicator from Ardupilot, so I have the exact same aircraft performance and information that SOAR has, but I still outperform it many times over. Here is a guess, and maybe some ideas how to fix this ???

I tested SOAR on a normal day with average strong thermals, and actually got it to work ! If you see the picture below, I gained altitude by manually thermaling, then switched to SOAR. It did correct sized circles, and managed to stay in thermal OK, but not really good, it did not center as well as I could. I could see the corrections where the plane would go to 1/2 bank angle for a bit to adjust its course. The first thermal SOAR did a succssful climb, but some later thermals SOAR lost the thermal entirely by heading AWAY from the lift in its circle corrections, so there was little altitude gain… So now, I am suspecting:

  1. My plane take a few seconds to stabilize after a bank angle change. When the glider banks into a turn, nose goes down, so Vertical Speed readings are low for the first few seconds. Opposite happens when bank angle is reduce, plane climbs for very high vertical speed readings until pitch stablizes again. Could SOAR be confused by trying to read to soon after banking, or reducing bank ???

  2. Vercial speed varies in each circle, when manually soaring, I never take one circles reading, it usually takes me 3 - 4 circles to confirm the section of the circle where the best lift is… Turblance, etc, can make a single circles readings give bad information.

  3. I am using default performance settings, all the polar, etc, settings have not been changed. The documentation said it was tuned for a Radian, that should be close enough to the Phoenix 2400 performance. Ardupilot and SOAR flys the plane very well, the only thing that needs to be done is for SOAR to center towards the thermal, rather than make the wrong guess and move away from thermal sometimes.

  4. How about a setting where we can adjust how many circles the readings should be average over to make the next thermal centering correction ???

  5. A setting to IGNORE vertical speed for a few seconds after a big change in bank angle ???

Hi @JetPilot

Sounds like progress! In principle the additional sink during turns should be corrected for but this does depends on the SOAR_POLAR* params being set correctly. You are right that the defaults should be okay for most foamy gliders - it’s usually worth setting SOAR_POLAR_K following the wiki however, as this is essentially wing loading and can vary quite a bit.

Also if you have a .BIN file available I’ll be able to be a bit more specific.

Hi Samuel,

Thank you for your response, but you misunderstand what I am saying. The plane will sink much more for about 2 seconds when entering a turn, until it is stablized in the turn. This will cause SOAR to get a bad V/S reading of increased sink. The plane will also climb much more for about 2 seconds when leaving turn until the plane stabilizes again, giving false readings. So I am guessing that SOAR is getting bad Vertical speed readings for a few seconds from the effect of changing bank angles ? Is anyone else seeing this ? Here are a couple suggestions based of what I am seeing:

  1. Wait about 2 seconds after circling is entered before beginning to take vertical speed measurements.

  2. PARAMETER OPTION: Set number of circles to measure and average them all before making any adjustment towards the center of thermal.

I have read all the SOAR documentation in the link below several times. But I am not understanding some of the choices it makes. Does SOAR average measurements over several circles, or just measure one circule ? How many measurements does it take in one circle ? Are they averaged, or just one instantaneous readings ? I find averaging very important as instant and single sector readings can vary a lot with turbulence in a thermal.

https://ardupilot.org/plane/docs/soaring.html

Hi Michael,

Without seeing any data I would guess that this additional climb and sink when changing bank angle is due to the autopilot not tightly controlling pitch. If so the additional climb and sink are being exchanged for airspeed - this acceleration is taken into account when determining vertical speed as a correction, but again this depends on it being setup correctly.

The algorithm doesn’t simply average over one circle, or over a number or circles, but compares each measurements with the expected value and makes adjustments based on the estimated uncertainties in the measurements (constant) and the uncertainties in the position and strength of the thermal (these vary as data is gathered, starting high at first and reducing).

Without seeing any data I would guess that this additional climb and sink when changing bank angle is due to the autopilot not tightly controlling pitch. If so the additional climb and sink are being exchanged for airspeed -

Hi Samuel,

Yes, you said it perfectly, this is exactly what is happening. It does not bother me at all, I am happy to leave it like that… I just did not know if this is causing a problem for SOAR or not.

I am not a programmer, or I would be glad to help. I think it would be worth your time to try a simple experiment, and center in thermals they way sailplane pilots have been doing for over 70 years now…

Break up the circle into 8 sectors, and measure average vertical speed in each sector over 4 circles. Then offset the plane towards the sector with the strongest lift, mesure again and keep repeating… You might be very suprised at how very well this simple method works, worth a quick try to get SOAR to perform better than you thought possible. If you ever need a test, just let me know and I will be happy to put the firmware into my Matek F765 / Phoenix 2400 and flight test it on a good thermal day.

Sam, I am getting close to being ready to soar my 2.4 foamie glider, but just discovered the latest beta firmware I loaded on the PixFalcon lacks all of the SOAR_ parameters. Not quite sure why that is, but thinking I will now flash today’s latest build for Pixhawk1 here. Is Soar code included in daily builds by default?

Kelly

Hi Kelly,

Yes it is, as long as the board is supported.

Sam

Finally! now to pick a thermaling type day…no wind today, but overcast…luckily most days here are bumpy…

Sam,

Not to be too much of a simpleton here, but this description of the PixFalcon suggests it should be able to run the SOAR-enabled latest build, right?

Processor : 32bit STM32F427 Cortex M4 core with FPU, 168 MHz 256 KB RAM, 2 MB Flash Storge,32 bit STM32F103 failsafe co-processor.

Also, how hard is it to eliminate features that I’ll never use in a custom build. It’s been a few years since I did my own builds, but I remember it being fairly straightforward to get my WSL env set up, and flash from those custom builds. Is it a matter of a few flags to build a “SOAR-lean” version, turning off fat code sections that are NA for me?

Kelly

It does - what target are you building/installing? The page for that board suggest it is compatible with Pixhawk 1. There is a build for 2Mb Pixhawk 1 (target “Pixhawk1”) and for 1Mb Pixhawk 1 (target “Pixhawk1-1M”. Soaring is excluded from the 1Mb, so make sure you use the 2Mb version.

Sam

Fantastic. Thank you.

EDIT: loaded today’s (30jul20) latest build, Pixhawk 1 firmware, and sure enough all the SOAR parameters are back! Getting closer to re-maiden.

@Samuel_Tabor Samuel, first soaring attempt today…first I took it up in CRUISE and let it glide in Soar-no loiter so I would have a log of speed…and varied speed demand…seemed acceptable from the log…then let it fully SOAR…caught one thermal and it rode it for a small gain…then just let it glide, caught another but said it was too weak but never left LOITER…went below SOAR_ALT_MIN but did not go it RTL…I was fiddling with my new T16 trying to force CRUISE again, when it met a light pole on the soccer field…no damage luckily…why did it stay in LOITER? why did it not RTL below 50m?

After more study of the log, I think I know why it did not RTL, because it seemed stuck in LOITER while losing altitude and not exiting back to CRUISE, I switched SOAR off…so it wouldnt change to RTL…but why did it stay in LOITER for so long while losing altitude and not switch back to CRUISE?

Hi Henry,

Yes switching SOAR off with the RC switch will disable any further mode changes.

You switched it off about 30s into the second LOITER. The first 20s was taken up with SOAR_MIN_THML_S. After this it will switch back to CRUISE as soon as it is pointing in the original CRUISE direction. Your WP_LOITER_RAD is quite large (60m) compared to 12m/s airspeed so the time to line up was longer than typical, this would usually average an extra 3 - 5s.

Sam

very strange, I had set loiter rad to 7…but changed the firmware from master to master + Alex’s bi-directional telemetry…params should not have changed…now I need to do a diff to see if anything else changed…thanks!

edit: weird only that one parameter had changed thru the firmware swap…very strange

Better second flight!

1 Like

Would like to get comments on a few improvements I thought of after brief experience with SOARing…I have discussed these with Sam, but would like the group’s thoughts…

  1. Having the option to have FBWB/CRUISE climb back to entry altitude or SOAR_ALT_CUTOFF, instead of RTL when reaching SOAR_ALT_MIN…this was originally done for LOS flyers, but with FPV we have situational awareness and having it behave like AUTO would allow un-restricted hunting for thermal areas, rather than only pre-planned flight courses.
  2. Have the middle position of the SOAR switch exit LOITERing in a thermal. Currently, it has no effect until the thermal is exited and then prevents entering LOITERs…this would allow a bail out of a thermal and allow you to continue on course (AUTO mission or CRUISE entry heading) until you are ready to thermal again by putting switch back high…I had my ALT_MAX at 1500 feet this flight and got a little uneasy at 1200 feet, given my location, and wanted to bail, but did not want to switch modes…but had to
  3. I missed a big boomer exiting a thermal because of SOAR_MIN_CRUISE_S timeout…perhaps an option to ignore that timeout if the SOAR_VSPEED is exceeded by some multiplier, maybe 2X…

just some thoughts…comments welcomed

1 Like

I don’t typically use soaring in CRUISE or FBWB modes so they haven’t received enough attention. Thanks @hwurzburg for adding some impetus there, these are great suggestions and should help make it more useful for more people. Keen to hear what people think.

I like Henry’s suggestions. Great video BTW. I agree the SOAR_MIN_CRUISE_S seems quite unnecessary, and should effectively be set to zero / disabled.

Henry, did the tapered shape of the 2nd thermal match downwind drift?

A high level concept: let me geofence a box or polygon, and let SOAR hunt anywhere within that box, until I pull it out of that mode, or battery gets low. When I hit the low altitude, and it’s time to motor up, aim toward the center of the playground, perhaps with a bias upwind. Get to the upwind edge of the box, and zig zag downwind hunting for lift.

Kelly