Soaring/Gliding for Planes

Hi Samuel,
Thank you for your kind advice.
I flew my glider but had a strange behavior. This is the flight log.
https://drive.google.com/file/d/18yVvg_EDhw23fE1fPs5dPEpF34wbAR8U/view?usp=sharing
It happened during AUTO mode when the glider was climbing with motor on. Soon after the glider passed a waypoint, it suddenly turned very tightly. The turning radius was about 3.3m and the bank angle was around 80 degrees.
It was so tight turn I changed the flight mode during the third turn and escaped from the turn. Below is the time history.


During the turn ATT.DesRoll oscillates quickly between -50deg to +40deg but ATT.Roll could not follow it.

Could you teach me why this strange behavior happend and how I can treat it?

Hi @RCnorm, Can you grant access on the log so I can take a look?

Hi Samuel,
I believe you can open the file by clicking below. https://drive.google.com/file/d/18yVvg_EDhw23fE1fPs5dPEpF34wbAR8U/view?usp=sharing

Thank you

Hi @RCnorm

It looks like your plane is weaving quite badly especially when the motor is running. Iā€™d suggest to first try increasing NAVL1_PERIOD to smooth this out.

Hi Samuel

Thank you. I will test it later following your sugestion.

Hi Samuel,

I tested my glider with corrected parameters and succeeded the auto soaring, but there remains one question or doubt.
I set parameters as below,
NAVL1_PERIOD=25
WP_LOITER_RAD=-11
LIM_ROLL_CD=4500
TRIM_ARSPD_CM=10
You can check other parameters data by clicking below.
https://drive.google.com/file/d/1bu0B4oozFt1A1foPEiM7Xpg78L9jd-tI/view?usp=sharing

My question/doubt is loiter radius. I set it as 11m following the equation of
r=V^2/(g惻tanĪ¦) where I set V=10 and wanted bank angle Ī¦=43 degrees.

Actual radius is around 25m as you can see in the following flight path data.


The dashed white rectangular has 135mƗ300m length.

Airspeed is just 10m/sec as I set it.

But the desired and actual roll angles were around 22 degrees.

Desired roll angle is a half of what I intended and Loiter radius is double of what I intended.
It seems as if there is confusion between radius and diameter.

How do you think this flight data?

Hi @RCnorm

It looks like the NAVL1_PERIOD is now too long to allow a turn as tight as 11m. To get a tighter circle you will need to reduce this, but previously we saw problems with weaving. Have you done an autotune on this aircraft? The roll control looks quite loose which is probably why you needed to increase NAVL1_PERIOD.

Hereā€™s roughly a minute of roll control from your plane:

And here is an example from a tuned plane:

As you can see in your log the roll follows the demand but with quite a lot of error and overshoot. If you can improve this, you should be able to reduce NAVL1_PERIOD without the weaving coming back, and the circles will improve.

I suggest you take a step back and get LOITER mode to produce the circles that you want, and AUTO mode following waypoints precisely, before enabling soaring.

Sam

Hi Sam,
Thank you for your quick response.
Yes I am also feeling the roll response is too slow, although I have done an autotune on this glider. Below is the log of the autotune.
https://drive.google.com/file/d/1xMlehQBplpTeqlon2HNm1vTVJiVy_Ceo/view?usp=sharing

Your roll data looks very responsive. Is it a small aircraft? How long its wing span? My glider has 3.2m wing span.

I want to test it in LOITER and AUTO modes but I donā€™t know how to stop the motor during these flight modes. Could you teach me how to set for gliding in these mode?

Hi @RCnorm

My plane is a 2.6m ASW28 - so a little smaller than yours. However good roll tracking should be achievable on any plane with reasonable aileron authority.

Looking at your autotune log, it looks like the roll gains werenā€™t adjusted much. Iā€™m not an expert in how autotune works, but I think this is because the default maximum roll rate of 75 degrees per second is much higher than your plane can achieve. Unfortunately this isnā€™t automatically adjusted during the autotune. This resulted in full aileron being applied during the autotune to try to achieve this high roll rate, and the gains are not adjusted when full control is being applied. I suggest reducing this parameter RLL2SRV_RMAX to 30 (degrees per second) and re-running the autotune.

BTW your autotune technique is great as you are getting full max rates demanded, it should work great once RLL2SRV_RMAX is adjusted.

Demanded and achieved roll rates:

Aileron output:

Roll controller P gain:

Sam

Hi Sam,
I am very much appreciated your kind support.
I will try Autotune once again with RLL2SRV_RMAX=30.
By the way could you teach me how to stop the motor during LOITER and AUTO mode?

Norm

Hi Norm,

No problem. In AUTO you can plan a mission with a a descending path to stop the motor. Iā€™m not sure if LOITER support changing altitude, but GUIDED mode does and is otherwise very similar.

Hi Sam,
Why didnā€™t I think of this!? I will try it soon.
Thank you.

Hi Sam,
Today I re-conducted the Autotune with the parameter RLL2SRV_RMAX=40 with the AUTOTUNE_LEVEL=6.
The RMAX parameter was set slightly bigger than that of 30 you had suggested to me because I increased airlon travel a little bit.

When I downloaded the log data, I found very strange data.
The RLL2SRV_MAX value was changed automaticaly to 75 and roll tuning was done only 2 times, while pitch tuning was done more than 10 times.

At first the ArduPlane set same PID values both for roll and pitch. They were,
P=1.34 D=0.101 I=0.112

The final PID values are,
P=1.407 D=0.106 I=0.112 for roll
P=0.874 D=0.0655 I=0.112 for pitch

You can check the log data by clicking below.
https://drive.google.com/file/d/1V_g2kmVUq5VkZWMVBZztHZV3lK0RYsJt/view?usp=sharing

I conducted 2nd AUTOTUNE flight with RLL2SRV_MAX=35. This time only roll tuning was tried.
By checking the flight log I found there is no effective gain change.
https://drive.google.com/file/d/1qoJoeuhqze8YVejMnLaGLIgDFfANRB4_/view?usp=sharing

Could you give me your comment?

Norm

Hi RCNorm,

Looking a little deeper I now see that the RMAX parameter is automatically set at the start of auto tuning based on the AUTOTUNE_LEVEL parameter. This is actually described here but unfortunately the actual rates are not documented outside the code. Iā€™ll fix that but in the meantime the appropriate level for your aircraft would be level 3 or level 4 (30 or 40 deg/s). The default setting of 6 corresponds to 75 deg/s as you have observed. If you set this parameter to 3 or 4 before your next attempt you should get better results. Sorry for the confusion, I did say I wasnā€™t an autotune expert :slight_smile:

In the second flight it looks like you were in FBWA rather than AUTOTUNE (except for one very brief period) so that explains lack of gain changes, however autotune would have re-set the RMAX parameter anyway just like in the first flight.

Thanks! Itā€™s a student team run research project.

Iā€™ve read through the POMDSoar paper - iā€™ve flown the POMDSoar code once so far (seems like itā€™s based on arduplane 3.9.x), thereā€™s a lot different about it, and the rest of the ardupilot code as well (seems like microsoft mightve messed with mavlink update rates a bit and some of how the waypoints work, or just some parameters) so I just went back to ardusoar since iā€™m trying to make quick progress.

Iā€™ll be flying ardusoar and doing a bit of POMDSoar, if you need any pre-alpha testing or anything of the sort when youā€™re trying to merge the two let me know or drop it here, iā€™m more than ecstatic to test new stuff.

1 Like

Hi Samuel Tabor,

It has been a while since I have posted here, but I have experimented with SOAR a lot in different planes, and my experience is that you are much to concentrated on the details of flying the planes perfectly, rather than finding and centering in areas of lift.

I can manually thermal my planes all day long in FBWA mode, so I know ardupilot is flying the plane more than well enough, this is not an issue. But when I switch to SOAR mode, it just does not stay centered in obvious, nice thermals. I saw the commercial project posted here where they used SOAR for a very long flight, but if it takes a professional team a long time to set up one plane perfectly, then SOAR is not usable for 99 % of people.

It should be fairly easy to have the option to just use some basic parameters ( soaring pitch angle and bank angle in thermals is all that is needed for most planes ) and have SOAR capable of finding and staying centered in thermals in a an average plane without crazy complicated setups and settings. This would be very useful to extend range / flight duration of typical powered planes such as the Believer, and also work well with sailplanes.

1 Like

Hi Michael,

It doesnā€™t need a team of people, but it does need a well setup plane and attention to detail. I do the majority of test flights on very simple foamies.

Further development should remove some of the common pitfalls. As a case in point, last time you posted the problem was that you had a very large loiter radius specified. In the latest version the thermalling turn is specified by a dedicated bank angle setting rather than using the general loiter radius. This makes the defaults applicable to a wider variety of planes and will improve the odds of success for those users that donā€™t follow the setup guide.

From your description there isnā€™t enough information to tell what the problem is with your setup, but Iā€™d guess that since you seem to fly mostly in FBWA that it may be linked to airspeed control, which FBWA doesnā€™t use.

I have a lot of experience in long endurance thermal flights, note the 5 1/2 hour flight below, so I hope you can consider some good suggestions.

Thank you for your reply, I did fix the waypoint turning radius after you suggested it last year. My last testing was using Summer 2020 firmware version, so I am sure some things have been improved since then, I will update to the latest version before my next test. I was not aware you implemented Bank Angle already, which is why I just suggested it in my last post. The fact that we both came to the same solution says that I do have some good suggestions that you should consider. This simple change is a HUGE improvement, I really look forward to trying it.

I am not using airspeed control, do not have an airspeed sensor, nor is it needed.
I thermal beyond what most people ever dream of without an airspeed sensor, using PITCH and BANK ANGLE in FBWA mode works amazing well, simplifies things a lot, and can be used in almost any plane. If you could implement a simple option for using PITCH for planes that do not have airspeed indicators that would make SOAR usable in many more planes. I know using airspeed is even better and more efficient, but the thermals are strong enough here that the efficiency of my planes is not a problem in my testing, and the planes fly very well in SOAR and FBWA mode.

My first problem was that soar would take to long to respond to obvious strong thermals, so it would fly past strong thermals, and already be leaving the strong lift of the thermal once it did go into SOAR mode and start to circle.

My second problem was that SOAR did not do well in centering in the thermal. I would watch the climb rates, and could easily know where the thermal was, but SOAR would kind of wander around. I could always go into manual and easily gain altitude in FBWA mode.

Here is a simple technique that works best for me:

  1. Sense lift, start full constant 45 degree bank circling.
  2. Do a few constant pitch, constant bank 45 degree circles, and measure climb rate for strongest quadrant of lift.
  3. Level the wings for a few seconds to fly towards the strongest area of lift.
  4. Start full 45 degree bank, constant pitch circling again and sense strongest quadrant of lift.
  5. Level and fly towards strong lift again for a few seconds.
  6. Repeat, Repeat, Repeat until thermal is no longer productive.

Hey @Samuel_Tabor, great talk today! Is the glide polar parameter learning forked with master yet or open for testing/use at all?

Hi @ohitstarik

Currently itā€™s in my development branch along with some other features, Iā€™ll split it out and rebase it tomorrow.

1 Like