I've been working towards a realistic simulation of my high-altitude return-to-launch glider project in X-plane and this is the latest result which some here might find interesting.
The simulation is running with X-plane 9, APM-MP 1.1.36 (to keep the TAS into APM - more on that later) and a slightly modified version of ArduPlane 2.28.
To achieve the drop, I drag the aircraft up to the release altitude using the Local Map feature in X-plane and set the speed to zero. Whilst this isn't a perfect simulation of the intended release due to the flat orientation of the aircraft, for my purposes it is sufficient for now. Initially I allow the aircraft to accelerate in Manual mode until about 25kt IAS, then I switch to Stablize, manually manipulate the controls to pull out of the dive as rapidly as practicable before proceeding to switch into Automode. Eventually I need to code this whole process to trigger and execute all automatically in APM.
On this drop, I set the release point to be about 80 miles 'upwind' of the simulated launch point to make a rough allowance for the drift of the balloon on ascent. I am using the X-plane's real weather simulation (where it gets its weather data from some unknown on-line and quasi-real-time source), so I couldn't be absolutely sure what the headwind was going to be. This was the third in a series of flights, where the release point was selected from the experience of the earlier flights to give a likely head wind for the whole descent glide stage.
As you can see from the Google Earth image above, most of the travelling is done above the jetstream altitudes and the aircraft arrives at the loiter point still at nearly 45000 feet!
I logged the data using the data output to file feature in X-plane and then created a KML file using this method which uses this on-line file translator. Whilst logging the data in X-plane, I added more than just lat-long-alt and included some airspeed data so I could figure out a few other things.
The altitude profile shows the entire descent stage lasting a little over two hours:
and, the speed profile is here. You can see how the ground speed is fluctuating wildly as it tries to hold the loiter position. I'm not sure if the peak airspeed of nearly 500mph is achievable either because I didn't make a note of the Mach number, but it was probably less than 0.85. I suspect this could be an issue for airframe integrity...
More work needed here to limit the speed during the dive phase.
Finally, I integrated ground speed to give me an estimate of the distance I could feasibly travel from the release point. A pretty impressive number, don't you think? Line of sight all the way too! ;)
...and before I forget, here's a few details on the TAS problem I mentioned earlier.
The APM-MP-based HIL simulation up until recently has fed APM with true airspeed (TAS) from the X-plane data. I need this primarily for the PID loop speed scalar to allow stable control at high altitudes. The only problem is that this isn't what APM gets in real life from a pitot. The pitot-static system will give you indicated airspeed (IAS), or more correctly, dynamic pressure, which deviates wildly from true airspeed as density changes.
Michael Oborne has changed this in a later version (1.1.42 at least) so that APM now sees a realistic IAS number from X-plane, however this would mean I'd have to implement the IAS-TAS conversion in the APM code. I must do this at some stage, but for now having this little MP bug is a handy thing! :) Lazy? Moi...?
The APM software mod I've done is an embarrasingly simple one (yes, it's true I'm not a software geek!) where I expand the speed scalar clips from the standard 0.5-2.0 to a randomly selected 0.01-5.0.