Board index FlightGear Development Aircraft

How to make an Aircraft....

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

Re: How to make an Aircraft....

Postby openflight » Tue Jul 30, 2019 12:44 pm

The aircraft in Flight Gear using the Cessna 172 flight model. It works, and much more development needed.

Image
openflight
 
Posts: 478
Joined: Fri Sep 16, 2011 11:14 am
Version: 1 2 2018
OS: Linux Mint 19.3

Re: How to make an Aircraft....

Postby wkitty42 » Tue Jul 30, 2019 5:05 pm

your image is broken for some reason... nothing showing... is it public?
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 7230
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: How to make an Aircraft....

Postby openflight » Wed Jul 31, 2019 10:29 am

Is the site accessible?

For information on modifying an existing aircraft see my site : https://sites.google.com/site/flightgea ... g-aircraft .
openflight
 
Posts: 478
Joined: Fri Sep 16, 2011 11:14 am
Version: 1 2 2018
OS: Linux Mint 19.3

Re: How to make an Aircraft....

Postby wkitty42 » Wed Jul 31, 2019 11:56 am

openflight wrote in Wed Jul 31, 2019 10:29 am:Is the site accessible?

yes, the site is accessible... i easily see C-GDQG pictured there

openflight wrote in Wed Jul 31, 2019 10:29 am:For information on modifying an existing aircraft see my site : https://sites.google.com/site/flightgea ... g-aircraft .

this link is broken... you should wrap links in URL tags (and images in IMG tags) to be safe but it may not have been a complete URL to start with considering how many sites shorten displayed URLs with ellipse (aka three dots) in the middle of them...

regarding my initial report of the image not working, google sends this message...
403. That’s an error.

Your client does not have permission to get URL /r0BjMWSWa7Yk4vhN1j8FcSkK8gP_904PoDLxzox0_lrTH7C5iyYCgbEVv9AT6cIt8E928X50v_f7lXcDmO-ZI_wEVJ4fYUSRqhcSS0txE4E7HHikPg=w974 from this server.


assuming you are wanting to show the side shot of C-FGFS sitting on the ground, that image is
Code: Select all
https://lh4.googleusercontent.com/Y1JEzZJfx45UiYXReT2OTZ6mzYVh-HtOGRSj7v0_day3UTaNndPRX1HAHRdCvTidI2eHOb7oqK76uwHbke4obowvCgOxpah2ZsQqD-xy7ISXAGqh0os=w1175
and wrapped in IMG tags looks like
Image
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 7230
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: How to make an Aircraft....

Postby openflight » Thu Aug 01, 2019 10:28 am

openflight
 
Posts: 478
Joined: Fri Sep 16, 2011 11:14 am
Version: 1 2 2018
OS: Linux Mint 19.3

Re: How to make an Aircraft....

Postby rdclzn » Wed Jun 09, 2021 1:38 am

Hi. I'm posting here in the hopes of having someone with experience to help me just getting started with adding a new aircraft to FlightGear.
It's for an undergrad thesis, modeling an aircraft with a linear aerodynamic model from maintenance manual and measurements data, and then, after validation, simulate it and use some pilots to have a qualitative assessment of the model.
From my understanding JSBSim is quite flexible, and I could write a linear aerodynamic model for it.

But what I don't understand is, what information in the xml is FlightGear looking for to define the moment and force? What are the properties for the pilot input (that'd be needed for say, the moment variation with elevator deflection)? The documentation seems scarce and I've grown to think it's impossible to do this without the help from someone with experience. I hope I am proven wrong.

Should I give up on the second part of the thesis? So far from my reading, it's just not feasible in FlightGear, mostly because of me having no idea where to learn the needed steps.
rdclzn
 
Posts: 2
Joined: Wed Jun 09, 2021 1:25 am

Re: How to make an Aircraft....

Postby Octal450 » Wed Jun 09, 2021 2:20 am

rdclzn Good evening and welcome to the forum.

I will agree with you about documentation, if I ever get some spare time I plan to contribute to it.'

Here are some examples:
Joysticks are typically mapped to:

/controls/flight/aileron
/controls/flight/elevator
/controls/flight/rudder
/controls/flight/flaps
/controls/gear/gear-down

Here are some examples of how the moment/force are implemented:

In the main JSBsim XML: https://github.com/Octal450/MD-11/blob/ ... W.xml#L290
I am definition an aero file, you can also just put the aerodynamics within the <aerodynamics> tag.

Then the aero file itself: https://github.com/Octal450/MD-11/blob/ ... namics.xml
I am using Lift/Drag/Side/Roll/Pitch/Yaw, but you can also use Normal/Axial/Side/Roll/Pitch/Yaw if you prefer.

Hope this helps and please let me know if you need any more info/help understanding. I am always happy to help where I can.

Kind Regards,
Josh
Skillset: JSBsim, Systems, Canvas, Autoflight/Control Systems, Basic Animations
Aircraft: MD-11 (Mainly), A320-family, MD-80, Contribs in a few others

Octal450's Hangar|Launcher Catalog
|MD Dev Discord|Airbus Dev Discord
User avatar
Octal450
 
Posts: 4921
Joined: Tue Oct 06, 2015 12:51 pm
Callsign: WTF411/Octal
Version: next
OS: Windows 7/10 x64

Re: How to make an Aircraft....

Postby Johan G » Wed Jun 09, 2021 5:01 am

rdclzn wrote in Wed Jun 09, 2021 1:38 am:[...] mostly because of me having no idea where to learn the needed steps.

When the documentation suffers, look into existing aircraft.

My best hint is that the <aircraft name>-set.xml file in an aircraft's folder is the top file in every aircraft and everything of the aircraft is defined there or in the files included there through their paths in one way or another.

The backbone of FlightGear is a tree of key-value properties, the property tree. The XML configuration files essentially are parts of the property tree serialized in XML format. For example would the path to the XML file with the 3D model animation definitions, /sim/model/path, look like this serialized into XML:
Code: Select all
<?xml version="1.0"?>
<PropertyList>
  <sim>
    <model>
      <path>Aircraft/My-aircraft/Models/My-aircraft.xml</path>
    </model>
  </sim>
</PropertyList>


Though while the JSBSim configuration files looks very much the same, most parts of that property tree is local to the JSBSim flight dynamics model.


Another good starting point is the aircraft developer portal on the FlightGear wiki.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 6367
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit

Re: How to make an Aircraft....

Postby Richard » Wed Jun 09, 2021 10:32 am

rdclzn wrote in Wed Jun 09, 2021 1:38 am:From my understanding JSBSim is quite flexible, and I could write a linear aerodynamic model for it.


Firstly refer to the JSBSim reference manual; http://jsbsim.sourceforge.net/JSBSimReferenceManual.pdf section 2.6

I've created a few aerodynamic models and I generally follow the industry standard way of coefficient buildup.

For the Supermarine Swift FR.5 I used OpenVSP to create a fairly standard aerodynamic model that is documented here: https://github.com/Zaretto/Supermarine- ... 092020.pdf

Inside the JSBSim XML is a section called <aerodynamics> (e.g. https://github.com/Zaretto/Supermarine- ... p.xml#L490) and in here is where you define your functions .

e.g. for a base Drag see https://github.com/Zaretto/Supermarine- ... p.xml#L491 - however simplifying this by removing the beta component and curve fitting gives us

Code: Select all
4th Degree Polynomial Fit:  y=a+bx+cx^2+dx^3+ex^4.

Coefficient Data:   
a =   0.0286299075
b =   0.0010349516
c =   0.0003691740
d =   -0.0000004813
e =   -0.0000000104


which we can then implement as a function directly using a JSBSim expression:

Code: Select all
       <function name="aero/c/CFXB">
            <description>BASE DRAG</description>
            <sum>
                <value>0.0286299075</value>
               
                <product>
                    <value>0.0010349516</value>
                    <property>aero/alpha-deg</property>
                </product>

                <product>
                    <value>0.0003691740</value>
                    <pow>
                        <property>aero/alpha-deg</property>
                        <value>2</value>
                    </pow>
                </product>

                <product>
                    <value>-0.0000004813</value>
                    <pow>
                        <property>aero/alpha-deg</property>
                        <value>3</value>
                    </pow>
                </product>

                <product>
                    <value>-0.0000000104</value>
                    <pow>
                        <property>aero/alpha-deg</property>
                        <value>4</value>
                    </pow>
                </product>
            </sum>
        </function>


The way that I do it is to have all of my functions in the <aerodynamic> section and then at the end sum each set together and then denormalize it;

e.g.

Code: Select all
  <axis name="DRAG">
    <function name="aero/coefficients/CDRAG">
      <sum>
          <property>aero/c/CFXB</property>
          <property>aero/c/CFXDAD</property>
          <property>aero/c/CFXDADMN</property>
          <property>aero/c/CFXDGE</property>
          <property>aero/c/CFXDRD</property>
          <property>aero/c/CFXDRDMN</property>
          <property>aero/c/CFXFLAPS</property>
          <property>aero/c/CFXGEAR</property>
          <property>aero/c/CFXMN</property>
       </sum>
    </function>
    <function name="aero/force/DRAG">
    <product>
          <property>aero/qbar-psf</property>
          <property>metrics/Sw-sqft</property>
          <property>aero/coefficients/CDRAG</property>
       </product>
    </function>
  </axis>
Richard
 
Posts: 801
Joined: Sun Nov 02, 2014 10:17 pm
Version: Git
OS: Win10

Re: How to make an Aircraft....

Postby rdclzn » Wed Jun 09, 2021 5:54 pm

thank you all for the kind advices. this gives me hope!
best regards
rdclzn
 
Posts: 2
Joined: Wed Jun 09, 2021 1:25 am

Previous

Return to Aircraft

Who is online

Users browsing this forum: No registered users and 0 guests