View Full Version : Discussion Curious about using X-Plane
ormandj
Jun 05, 2006, 05:10 PM
Is it possible to take a data stream of sorts and somehow "feed" X-Plane with it? Also, can I get output from X-Plane? I've seen input done with FlightGear, even in real-time. I'm curious if it's also possible with X-Plane, along with output. I browsed their site, saw no information pertaining to this, and thought maybe you would all have some answers. :) The reason I ask, I'm looking into building a UAV, and thought with X-Plane's excellent flight modelling, I could build my model and test in X-Plane, write my controller software and have it take input from X-Plane, and then output a data stream (or whatever kind of output X-Plane would accept) containing positions of all control surfaces, throttle, etc, and simulate flight in this fashion. This way I could test both my model, *and* my control software, before I invested in expensive hardware (that will very likely crash a thousand times before things are perfected). ;) Crashes in software don't bother me as much. ;)
Tuner
Jun 05, 2006, 06:51 PM
A good simulation environment for UAV flightgear is a great pursuite.
Good Luck!
clolson
Jun 05, 2006, 09:49 PM
Is it possible to take a data stream of sorts and somehow "feed" X-Plane with it? Also, can I get output from X-Plane? I've seen input done with FlightGear, even in real-time. I'm curious if it's also possible with X-Plane, along with output. I browsed their site, saw no information pertaining to this, and thought maybe you would all have some answers. :) The reason I ask, I'm looking into building a UAV, and thought with X-Plane's excellent flight modelling, I could build my model and test in X-Plane, write my controller software and have it take input from X-Plane, and then output a data stream (or whatever kind of output X-Plane would accept) containing positions of all control surfaces, throttle, etc, and simulate flight in this fashion. This way I could test both my model, *and* my control software, before I invested in expensive hardware (that will very likely crash a thousand times before things are perfected). ;) Crashes in software don't bother me as much. ;)
Hi Ormandj,
Disclaimer: I'm Mr. FlightGear, so take everything I say about X-Plane with due caution. :-)
First, yes, I'm sure I've heard of people turning off the X-Plane flight dynamics and feeding in external data. I don't know about output data specifically, but I'd be shocked if it wasn't possible to output a large variety of data in X-Plane.
X-Plane is known for it's excellent flight dynamics modeling, but if you are planning to do real engineering work with it, you would do well to investigate X-Plane's specific approach as it compares to other approaches. You need to understand the trade offs and strengths and weaknesses of the various approaches to modeling flight so you know what to watch out for and where you might get bit. I have opinions, but I may not be the most objective observer, and besides, it would take me hours to type in all my thoughts. :-)
For what it's worth, everything you propose is also possible in FlightGear. Right now I have a pretty accurate FlightGear model of the Rascal 110 (which we are using as our uav airframe.) I have setup and tuned several autopilot modes for our UAV inside FlightGear. Now I am working on porting the sophisticated FlightGear PID algorithm to our flight computer so I can try running the tuned PID parameters on the real aircraft. With FlightGear's I/O capabilities I plan to replace the real IMU and servo output with connections to FlightGear so I can test all my autopilot code, self monitoring code, and ground station communication code without needing to go airborne for real.
The goal for the first "real" flight is to not self destruct in the first 100 milleseconds. I'm hoping the airframe will last 2-300 milleseconds before coming apart. :-)
Again, X-Plane is a neat tool and does a lot of stuff. I'm not trying to distract you here with all this talk about FlightGear ... well, ok, maybe I am ... :-)
Either way you choose, I think you should have a lot of success.
Regards,
Curt.
hugo_vincent
Jun 09, 2006, 04:44 AM
From my understanding (which is admittedly extremely limited), the approach X-Plane takes to aircraft modelling is pretty similar in purpose and effect to that used by the YASim flight dynamic model in FlightGear. That is, you tell it about your aircrafts geometry, engine, airfoil etc, and it generates a reasonable approximation how it will fly. I haven't actually used either FlightGear or X-Plane in this way, but it is something I plan to do in the near future (with FlightGear) so I would appreciate input from those in the know, especially Curt.
clolson
Jun 09, 2006, 06:19 PM
From my understanding (which is admittedly extremely limited), the approach X-Plane takes to aircraft modelling is pretty similar in purpose and effect to that used by the YASim flight dynamic model in FlightGear. That is, you tell it about your aircrafts geometry, engine, airfoil etc, and it generates a reasonable approximation how it will fly. I haven't actually used either FlightGear or X-Plane in this way, but it is something I plan to do in the near future (with FlightGear) so I would appreciate input from those in the know, especially Curt.
Well yes, sort of at a high level. You specify pretty similar types of information in both YASim (one of FlightGear's dynamics engines) and X-Plane.
The big difference as I understand it is that in X-Plane you specify an airfoil along with all the mass and geometry data. So if you know absolutely nothing about how your aircraft might fly, X-Plane will give you a first whack, ball-park idea of what might happen. I've heard though that their conventions and hueristics don't scale down well to R/C model sized aircraft.
With YASim you specify similar mass and geometry properties, but instead of an airfoil, you specify known cruise (alt/speed) and approach (speed/aoa) data and YASim derives an "airfoil" that will nail those performance values dead on. So with YASim you need to know something about the performance of your aircraft, or at least make an educated guess.
Beyond that, I'm sure there are a myriad of subtle technical differences.
I should also point out that FlightGear also includes JSBSim which is another flight dynamics engine. With JSBSim you specify your aircraft using more traditional stability derivatives and aero coefficients ... things like pitch moment due to elevator and yaw due to aileron deflection, etc. This is all entered in a text file so it's very easy to make adjustments, although you do need a bit of aerospace engineering knowledge (or a willingness to learn a bit.) For JSBSim we have a couple tools: Aeromatic and Datcom++ that really grease the skids so to speak with getting a JSBSim dynamics model up and going quickly without needing to know a lot of aerospace magic. These output JSBSim config files directly, so once you have the file, it's much easier to go in and find the numbers you need to tweak to fine tune the performance of your model.
FlightGear (as well as X-Plane) has the ability to turn off all the internal flight dynamics and take the data from an external source. This allows you to use your own flight dynamics engine if you want, or use something like simulink to drive the simulation. It also allows you do do things like visualize a real flight in real time or after the fact. This same capability can also be leveraged to sync multiple PC's together to creat a wider field of view.
Hope that helps...
Curt.
ormandj
Jun 09, 2006, 07:08 PM
Well yes, sort of at a high level. You specify pretty similar types of information in both YASim (one of FlightGear's dynamics engines) and X-Plane.
The big difference as I understand it is that in X-Plane you specify an airfoil along with all the mass and geometry data. So if you know absolutely nothing about how your aircraft might fly, X-Plane will give you a first whack, ball-park idea of what might happen. I've heard though that their conventions and hueristics don't scale down well to R/C model sized aircraft.
With YASim you specify similar mass and geometry properties, but instead of an airfoil, you specify known cruise (alt/speed) and approach (speed/aoa) data and YASim derives an "airfoil" that will nail those performance values dead on. So with YASim you need to know something about the performance of your aircraft, or at least make an educated guess.
Beyond that, I'm sure there are a myriad of subtle technical differences.
I should also point out that FlightGear also includes JSBSim which is another flight dynamics engine. With JSBSim you specify your aircraft using more traditional stability derivatives and aero coefficients ... things like pitch moment due to elevator and yaw due to aileron deflection, etc. This is all entered in a text file so it's very easy to make adjustments, although you do need a bit of aerospace engineering knowledge (or a willingness to learn a bit.) For JSBSim we have a couple tools: Aeromatic and Datcom++ that really grease the skids so to speak with getting a JSBSim dynamics model up and going quickly without needing to know a lot of aerospace magic. These output JSBSim config files directly, so once you have the file, it's much easier to go in and find the numbers you need to tweak to fine tune the performance of your model.
FlightGear (as well as X-Plane) has the ability to turn off all the internal flight dynamics and take the data from an external source. This allows you to use your own flight dynamics engine if you want, or use something like simulink to drive the simulation. It also allows you do do things like visualize a real flight in real time or after the fact. This same capability can also be leveraged to sync multiple PC's together to creat a wider field of view.
Hope that helps...
Curt.
Thanks! It sounds like FlightGear will work wonderfully for me, I'm going to investigate what all I need to get started in electronics, and get going! Take care and best wishes.
hugo_vincent
Jun 10, 2006, 03:03 AM
With YASim you specify similar mass and geometry properties, but instead of an airfoil, you specify known cruise (alt/speed) and approach (speed/aoa) data and YASim derives an "airfoil" that will nail those performance values dead on. So with YASim you need to know something about the performance of your aircraft, or at least make an educated guess.
I should also point out that FlightGear also includes JSBSim which is another flight dynamics engine. With JSBSim you specify your aircraft using more traditional stability derivatives and aero coefficients ... things like pitch moment due to elevator and yaw due to aileron deflection, etc. This is all entered in a text file so it's very easy to make adjustments, although you do need a bit of aerospace engineering knowledge (or a willingness to learn a bit.) For JSBSim we have a couple tools: Aeromatic and Datcom++ that really grease the skids so to speak with getting a JSBSim dynamics model up and going quickly without needing to know a lot of aerospace magic. These output JSBSim config files directly, so once you have the file, it's much easier to go in and find the numbers you need to tweak to fine tune the performance of your model.
Very interesting, thanks for that summary Curt!
Which FDM would you recommend for modelling our small experimental UAV (YASim or JSBSim)? 3m wingspan, all up weight 5kg, cruise speed will be about 50 mph.
We are in the planning stages at the moment, and have a pretty good idea of what the UAV will look like and how it will be constructed, but don't have a particularly good idea of how it will perform.
I'm interested in learning more about DATCOM (what is Datcom++?). I have downloaded the FORTRAN source, and tried building it. Do you have any links to tutorials or instructions on how to get it built, and how to write the input data files?
I also came across AVL: http://web.mit.edu/drela/Public/web/avl/
It looks similar in purpose to DATCOM (computing stability derivates etc from aircraft data), but more up to date. Anyone used it to generate models for FlightGear?
Regards,
Hugo
clolson
Jun 10, 2006, 09:27 AM
Very interesting, thanks for that summary Curt!
Which FDM would you recommend for modelling our small experimental UAV (YASim or JSBSim)? 3m wingspan, all up weight 5kg, cruise speed will be about 50 mph.
We are in the planning stages at the moment, and have a pretty good idea of what the UAV will look like and how it will be constructed, but don't have a particularly good idea of how it will perform.
I'm interested in learning more about DATCOM (what is Datcom++?). I have downloaded the FORTRAN source, and tried building it. Do you have any links to tutorials or instructions on how to get it built, and how to write the input data files?
I also came across AVL: http://web.mit.edu/drela/Public/web/avl/
It looks similar in purpose to DATCOM (computing stability derivates etc from aircraft data), but more up to date. Anyone used it to generate models for FlightGear?
Regards,
Hugo
Personally, I had better luck with JSBSim for our UAV. I spent some of my favor points and had someone else do a first pass at the dynamics model. I think they used "aeromatic" which is available on the jsbsim.org web site. Then I took the model and tweaked numbers to get it to behave more like the real thing. (Things like tweaking the amount of adverse yaw, tweaking the amount of pitch up when you go from stable idle flight to full throttle, roll rates, rudder effectiveness, removing flap effects since our model doesn't have flaps, etc.) Our Rascal110 sounds pretty similar in size to yours ... 2.8m wing span, 6-7kg, 50-60 mph cruise, so it might not make a bad starting point.
Also, with FlightGear, you can do a 3d visual model of your uav and animate the control surfaces, make the prop spin, etc. That's kind of fun, but can also really help in the modeling stage because seeing the visual representation in motion gives you an excellent intuitive feel for if you are in the right ball park. Similarly, if you are replaying a flight from your sensors, you can get a good intuitive feel if your sensors are in the right ball park or not. Plus it makes for good demos.
Datcom++ is a rehash of datcom I believe that outputs JSBSim config files directly. You could ask on the JSBSim.org mailing list for more details. I haven't tried using it myself so I don't know too many details. I suspect Datcom++ is the same code as datcom, but rewritten in C++.
I'm not familiar with AVL, and I haven't heard of anyone using it with FlightGear, but that doesn't necessarily mean it hasn't happened, just that I don't recall ever hearing about it.
Regards,
Curt.
hugo_vincent
Jun 11, 2006, 05:13 AM
Hmmm, I couldn't find any references anywhere to Datcom++, but there is DATCOM+, a modification of the original USAF DATCOM Fortran sources done by Bill Galbraith, available at:
http://www.holycows.net/datcom/
His modifications include the ability to directly output in JSBsim XML format, however he has decided not to share the source code for his changes, providing only a binary for Windows and a dated Linux binary (for Red Hat 9.0!).
ormandj
Jun 11, 2006, 06:05 AM
Datcom is too antiquated for me. Fluid dynamic modeling is a much better solution for this problem. Datcom was released public domain due to the USAF's transition to CFD. :) There are some GPLd programs availble for rudimentary CFD work, but I've not been very impressed with any of them. I'm looking into FlightGear as a possible platform to export to for my own software as I'm writing it.
PS - The poster before me is correct. Digital Datcom is Fortran. The modified version he speaks about has some very basic modifications to make input easier and output compatible with LFIPLOT and JSBSim. It's still Fortran. JSBSim is C++. :) Fortran is great for math, it wouldn't make sense to switch to C++, as it's just a program which takes input, performs algorithms/computations on it, and spits out a bunch of output (and I mean a BUNCH). Datcom+ just improves upon that and spits out some semi-flightgear compat. XML.
CFD is the current "best solution", I'm surprised to see it's not already supported. Oh well, time to go re-invent the wheel. ;)
hugo_vincent
Jun 12, 2006, 03:43 AM
Cool. Well I have been investigating AVL a bit more (Datcom is too antiquated for me too :)), and it seems CrrcSim (another open source flight simulator specifically for RC aircraft) uses it extensively by people creating flight models. By all reports, the flight models that people create using data from AVL are very high fidelity (of course, the usual adage 'garbage in, garbage out' still applies). It uses the vortex lattice method, which I understand to be a CFD technique. It is kind of similar to the blade element method used in X-Plane, but much more sophisticated and accurate. Basically, a virtual wind tunnel.
The CrrcSim wiki and Yahoo group include a bunch of information on using AVL (in combination with Xfoil, which is by the same author, Mark Drela) to make flight models for CrrcSim.
(BTW, the flight model and aerodynamics code in CrrcSim is also by Mark Drela. He is a professor at MIT and it seems his interest in CrrcSim comes from the use of CrrcSim in teaching at MIT - they mostly use MS Flight Simulator but found it to be too low fidelity to be useful for some classes).
CrrcSim: http://crrcsim.sourceforge.net/ and http://groups.yahoo.com/group/crrcsim/
AVL: http://web.mit.edu/drela/Public/web/avl/
Pinga_Dog
Jun 12, 2006, 11:02 AM
Curt,
Where can I find out how to visually input our vehicle into Flightgear? Formats etc? We are working on a small uav project and just downloaded Flightgear for use in simulations, but we are real newbies (we work mostly on big airplanes).
Thanks,
Stan
clolson
Jun 12, 2006, 11:48 AM
Curt,
Where can I find out how to visually input our vehicle into Flightgear? Formats etc? We are working on a small uav project and just downloaded Flightgear for use in simulations, but we are real newbies (we work mostly on big airplanes).
Thanks,
Stan
A good place to start is the FlightGear wiki: http://wiki.flightgear.org
You need to build or adapt a 3d model of your aircraft in a format that FlightGear understands (.ac, .3ds, .flt, etc.) If you want to animate control surfaces, retractable gear, canopy, prop, etc. you setup an external animation file that defines how all the named submodels in your 3d model are positioned based on any internal flightgear value.
We have a lot of examples to look at. The Rascal110 or the J3 Cub might be good places to start. Often copying and modifying an existing similar aircraft is a *lot* easier than starting from scratch.
Curt.
Pinga_Dog
Jun 12, 2006, 12:09 PM
Curt,
Thanks, didn't see the wiki before. You guys are doing a great job with Flightgear.
Stan
clolson
Jun 12, 2006, 12:28 PM
Thanks for the kind words. One of our goals is to be the open-source "swiss army knife" of flight simulation/visualization software.
I'm sure we'll never look as pretty as MicroSoft's sim, but our goals are accuracy, fidelity, and flexibility to do new things. With flightgear you aren't necessarily locked into only the capabilities we give you. This is important for research and development. We have a rich set of external I/O (network, serial, etc.) interfacing capabilities, we are open-source so you can add to or modify the code, and we have a built in script engine that lets you do an amazing amount of add on work without needing to touch the core source code and be able to compile it. In addition we have an extensive system that gives nice human readable names to all our important internal variables so they can easily be accessed by an internal script or an external application via the network (or even a web browser if you activate the web interface.) You can literally fly the airplane through a web browser if you want to.
Regards,
Curt.
Tuner
Jun 13, 2006, 02:05 PM
This has turned into an awsome thread. I am leaning a lot about Sims for model aircraft.
I had never even bothered to look in to this an relied on my common sense and experience but this is much better.
vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.