Ardusoar cross country X-Plane simulation

3689576559?profile=original

Hello all,

I have been doing some work on Peter Braswell's Ardusoar code (http://diydrones.com/forum/topics/autonomous-soaring?xg_source=activity) to improve thermal centring.

I finally got around to getting HIL working in XPlane to allow some cross country soaring simulations. I am using the PT60 model which has a terrible glide ratio (about 1:7) so thermal strength has been set quite high (1000 ft/min) although thermal coverage is only 10%. The Ardusoar code is working very well - the extended Kalman filter does a good job of centring thermals and almost never loses them. The throttle is set to zero when soaring but is re-enabled if the altitude drops too low, allowing automated climbs back to a good altitude. The flight mode is AUTO until an updraft is encountered (climbrate exceeds a certain threshold) at which point the mode is switched to LOITER. In LOITER mode, the Kalman filter is updated whenever new measurements (GPS positions and barometric altitude) are available. The update takes 4-5ms and doesn't appear to slow down the main loop below 50Hz. My repository is here if anyone is interested in trying out the code. https://github.com/samuelctabor/Arduplane

Below is a several kilometre flight (this was a 5-hour Xplane flight) with quite a lot of thermal encounters. The code includes logic about whether a thermal at a given strength and height is worth taking. This leads to quite a few brief thermal encounters in which the algorithm begins to search for the thermal but decided not to continue based on the thermals strength (too weak for the altitude the plane is at).

Below is the altitude throughout the flight (after the initial climb to 850m, the motor is off). There are a few long thermal climbs, especially early in the flight up to 3000m (cloudbase).3689576511?profile=original

Below is a close up of a typical climb. After switching to loiter mode (purple)  it takes a couple of circles to centre the thermal. 

3689576618?profile=original

The filter's states are saving in the onboard log to allow post-flight analysis. Here the algorithm's estimate of the thermal centre location is the blue track. You can see it moves it quite a bit during the initial centring and very little after that.3689576591?profile=original

The internal model of the updraft strength is a Gaussian distribution. Effectively the Kalman filter tries to adjust the estimated strength size and location to match the measurements.

3689576534?profile=original

As you can see the states change quite a lot during the initial centring. After that they are quite stable except for some ripple. This is due to the XPlane thermals not quite matching the Gaussian distribution assumed in the algorithm.

3689576642?profile=original

I am hoping to do some real-world flight testing when the weather improves here. Eventually this code is going to be used in a 3m balsa Bird of Time glider I am building, but flight testing will probably be done on something a little more tough and expendable, probably a Parkzone Radian.

3689576664?profile=original

Happy flying!

Sam

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • ....had to say about the subject ... etc

  • This is what Pi Towers had to say about the ject this morning (https://www.raspberrypi.org/blog/raspberry-pi-3-on-sale/). Quoting from the blog:

    Alex says: 29th Feb 2016 at 8:54 am
    (....) how long will the Zero continue to be made available?

    Reply
    Liz Upton says: 29th Feb 2016 at 9:03 am
    Forever – we’re churning them out as fast as we can. We’re really sorry we weren’t able to explain why there was a bit of a slow-down; it was because we were using the whole production line for Pi 3 pre-launch!

    Raspberry Pi 3 on sale now at $35
    Another update: I managed to miss Baruyr Mirican and Darshan Gopal from the Broadcom test engineering team off the list too. My grade this year is D:…
  • @sam, yesterday i am told - the news does come from the embedded world in nurenberg.

    i still hope to get my hands on two of these ...

  • Nice flight logs Gary, I'd chicken out too at those sorts of distances!

    Are you sure it's phased out Robert? I can't find it in stock anywhere but I thought that was just due to demand, they're going for ~5x official price on eBay.

  • Moderator

    I had great success with Ardusoar, truly amazing work by Sam, then life also got in the way for me. New baby and two very sad family happenings. We all go through it. All that said its the right time of year again for me! I need to try it in a glider, I just used a Skywalker, but still managed 10km of autonomous circling on one trip.

    3702195523?profile=original

    A better airframe and it would have been magical! So the image shows me flying forward to catch the thermal and then letting it circle back over me downwind until I chickened out and flew forward again.

  • it's bad news that the raspi zero is already phased out.

    the pxfmini would be a nice and small cape..

  • 100KM

    Sam, I know the feeling.  Work was very busy for me as well, but I'll have to find the time.  I only have APM derivatives, but thought the Pixhawk's digital air speed sensor may be of use for thermalling.  I was very impressed with the stability of my buddy's Pix/digital AS sensor.  I'll try my miniAPM w/ analog airspeed first.  I have been considering the mini Pixhawk/PX4's as well.

    Good luck with the move, Sam.

  • Good stuff - I haven't yet bought a replacement controller for the same reason, Pixhawk too big and APM deprecated. I have been considering getting the PXFmini as a smaller and more capable system. I think the code should run fine on it.

  • the same here - last year was just terrible with the workload.

    for summer it looks much better - more time for soaring.

    at least at the moment it looks like this ...

    i will port the code to a smaller system as the pixhawk is way to large for small gliders.

  • Hey Trung, unfortunately I didn't get much done last year. I was pretty busy with work and also managed to lose my Radian in a tree! I did compile for Pixhawk back in April, obviously this is slightly behind the main ArduPlane code now. I am hoping to be more active this year although I have to move into and renovate a house first! All the best, Sam

This reply was deleted.