Board index FlightGear Development Aircraft

Building a small UAV

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

Building a small UAV

Postby amrsaber » Mon Sep 09, 2019 1:40 pm

Hey there i am new to modelling aircrafts on FG so i was trying t build up my own aircraft , we are participants in AIAA competition and i wanted to flight simulate our design before actually test it in a real flight test so i used ac3d to convert my cad to ac extension then i used aermoatic to generate xml file but flightgear keeps crashing every time i start it
i have 1 folder named model in it is the xml file and the ac file and oytside there is the splash pic and the set.xml file.
here is the xml file
Code: Select all
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://jsbsim.sourceforge.net/JSBSim.xsl"?>
<fdm_config name="AIAA2018" version="2.0" release="ALPHA"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:noNamespaceSchemaLocation="http://jsbsim.sourceforge.net/JSBSim.xsd">

 <fileheader>
  <author> Aeromatic v 0.96 </author>
  <filecreationdate>2019-09-09</filecreationdate>
  <version>$Revision: 1.20 $</version>
  <description> Models a AIAA2018. </description>
 </fileheader>

<!--
  File:     AIAA2018.xml
  Inputs:
    name:          AIAA2018
    type:          light single
    max weight:    7.7175 lb
    wing span:     6.2339 ft
    length:        3.694406 ft
    wing area:     5.651604525 sq-ft
    gear type:     tricycle
    castering:     
    retractable?:  no
    # engines:     1
    engine type:   electric
    engine layout: forward fuselage
    yaw damper?    no

  Outputs:
    wing loading:  1.37 lb/sq-ft
    payload:       2.2 lbs
    CL-alpha:      5 per radian
    CL-0:          0.25
    CL-max:        1.4
    CD-0:          0.028
    K:             0.04

-->

 <metrics>
   <wingarea  unit="FT2">    5.65 </wingarea>
   <wingspan  unit="FT" >    6.23 </wingspan>
   <wing_incidence>          2.00 </wing_incidence>
   <chord     unit="FT" >    0.91 </chord>
   <htailarea unit="FT2">    1.40 </htailarea>
   <htailarm  unit="FT" >    2.10 </htailarm>
   <vtailarea unit="FT2">    0.43 </vtailarea>
   <vtailarm  unit="FT" >    2.10 </vtailarm>
   <location name="AERORP" unit="IN">
     <x>  19.13 </x>
     <y>   0.00 </y>
     <z>   0.00 </z>
   </location>
   <location name="EYEPOINT" unit="IN">
     <x>   5.76 </x>
     <y> -18.00 </y>
     <z>  45.00 </z>
   </location>
   <location name="VRP" unit="IN">
     <x>0</x>
     <y>0</y>
     <z>0</z>
   </location>
 </metrics>

 <mass_balance>
   <ixx unit="SLUG*FT2">         0 </ixx>
   <iyy unit="SLUG*FT2">         0 </iyy>
   <izz unit="SLUG*FT2">         0 </izz>
   <emptywt unit="LBS" >         4 </emptywt>
   <location name="CG" unit="IN">
     <x>  19.13 </x>
     <y>   0.00 </y>
     <z>  -1.11 </z>
   </location>
   <pointmass name="Payload">
    <description>  2 LBS + full ( 1 LBS) fuel should bring model up to entered max weight</description>
    <weight unit="LBS">      1.1 </weight>
    <location name="POINTMASS" unit="IN">
      <x>  19.13 </x>
      <y>   0.00 </y>
      <z>  -1.11 </z>
    </location>
  </pointmass>
 </mass_balance>

 <ground_reactions>

  <contact type="BOGEY" name="NOSE">
   <location unit="IN">
     <x>   5.76 </x>
     <y>   0.00 </y>
     <z>  -5.32 </z>
   </location>
   <static_friction>  0.80 </static_friction>
   <dynamic_friction> 0.50 </dynamic_friction>
   <rolling_friction> 0.02 </rolling_friction>
   <spring_coeff unit="LBS/FT">          2.32 </spring_coeff>
   <damping_coeff unit="LBS/FT/SEC">     1.16 </damping_coeff>
   <max_steer unit="DEG"> 5.00 </max_steer>
   <brake_group>NONE</brake_group>
   <retractable>0</retractable>
  </contact>

  <contact type="BOGEY" name="LEFT_MAIN">
   <location unit="IN">
     <x>  19.90 </x>
     <y>  -6.73 </y>
     <z>  -5.32 </z>
   </location>
   <static_friction>  0.80 </static_friction>
   <dynamic_friction> 0.50 </dynamic_friction>
   <rolling_friction> 0.02 </rolling_friction>
   <spring_coeff unit="LBS/FT">          7.72 </spring_coeff>
   <damping_coeff unit="LBS/FT/SEC">     3.86 </damping_coeff>
   <max_steer unit="DEG">0</max_steer>
   <brake_group>LEFT</brake_group>
   <retractable>0</retractable>
  </contact>

  <contact type="BOGEY" name="RIGHT_MAIN">
   <location unit="IN">
     <x>  19.90 </x>
     <y>   6.73 </y>
     <z>  -5.32 </z>
   </location>
   <static_friction>  0.80 </static_friction>
   <dynamic_friction> 0.50 </dynamic_friction>
   <rolling_friction> 0.02 </rolling_friction>
   <spring_coeff unit="LBS/FT">          7.72 </spring_coeff>
   <damping_coeff unit="LBS/FT/SEC">     3.86 </damping_coeff>
   <max_steer unit="DEG">0</max_steer>
   <brake_group>RIGHT</brake_group>
   <retractable>0</retractable>
  </contact>

  <contact type="STRUCTURE" name="LEFT_WING">
    <location unit="IN">
     <x>  19.13 </x>
     <y>  -3.12 </y>
     <z>  -1.11 </z>
    </location>
    <static_friction>  1.00 </static_friction>
    <dynamic_friction> 1.00 </dynamic_friction>
    <spring_coeff unit="LBS/FT">          7.72 </spring_coeff>
    <damping_coeff unit="LBS/FT/SEC">     7.72 </damping_coeff>
  </contact>

  <contact type="STRUCTURE" name="RIGHT_WING">
    <location unit="IN">
     <x>  19.13 </x>
     <y>   3.12 </y>
     <z>  -1.11 </z>
    </location>
    <static_friction>  1.00 </static_friction>
    <dynamic_friction> 1.00 </dynamic_friction>
    <spring_coeff unit="LBS/FT">          7.72 </spring_coeff>
    <damping_coeff unit="LBS/FT/SEC">     7.72 </damping_coeff>
  </contact>

 </ground_reactions>

 <propulsion>

   <engine file="AIAA2018_engine">
    <location unit="IN">
      <x>  36.00 </x>
      <y>   0.00 </y>
      <z>   0.00 </z>
    </location>
    <orient unit="DEG">
      <pitch> 0.00 </pitch>
      <roll>  0.00 </roll>
      <yaw>   0.00 </yaw>
    </orient>
    <feed>0</feed>
    <thruster file="direct">
     <location unit="IN">
       <x>  36.00 </x>
       <y>   0.00 </y>
       <z>   0.00 </z>
     </location>
     <orient unit="DEG">
       <pitch> 0.00 </pitch>
       <roll>  0.00 </roll>
       <yaw>   0.00 </yaw>
     </orient>
    </thruster>
  </engine>

  <tank type="FUEL" number="0">
     <location unit="IN">
       <x>  19.13 </x>
       <y>   0.00 </y>
       <z>  -1.11 </z>
     </location>
     <capacity unit="LBS">   0.57 </capacity>
     <contents unit="LBS">   0.29 </contents>
  </tank>

  <tank type="FUEL" number="1">
     <location unit="IN">
       <x>  19.13 </x>
       <y>   0.00 </y>
       <z>  -1.11 </z>
     </location>
     <capacity unit="LBS">   0.57 </capacity>
     <contents unit="LBS">   0.29 </contents>
  </tank>

 </propulsion>

 <flight_control name="FCS: AIAA2018">

  <channel name="Pitch">

   <summer name="Pitch Trim Sum">
      <input>fcs/elevator-cmd-norm</input>
      <input>fcs/pitch-trim-cmd-norm</input>
      <clipto>
        <min> -1 </min>
        <max>  1 </max>
      </clipto>
   </summer>

   <aerosurface_scale name="Elevator Control">
      <input>fcs/pitch-trim-sum</input>
      <range>
        <min> -0.35 </min>
        <max>  0.35 </max>
      </range>
      <output>fcs/elevator-pos-rad</output>
   </aerosurface_scale>

   <aerosurface_scale name="elevator normalization">
      <input>fcs/elevator-pos-rad</input>
      <domain>
        <min> -0.35 </min>
        <max>  0.35 </max>
      </domain>
      <range>
        <min> -1 </min>
        <max>  1 </max>
      </range>
      <output>fcs/elevator-pos-norm</output>
   </aerosurface_scale>

  </channel>

  <channel name="Roll">

   <summer name="Roll Trim Sum">
      <input>fcs/aileron-cmd-norm</input>
      <input>fcs/roll-trim-cmd-norm</input>
      <clipto>
        <min> -1 </min>
        <max>  1 </max>
      </clipto>
   </summer>

   <aerosurface_scale name="Left Aileron Control">
      <input>fcs/roll-trim-sum</input>
      <range>
        <min> -0.35 </min>
        <max>  0.35 </max>
      </range>
      <output>fcs/left-aileron-pos-rad</output>
   </aerosurface_scale>

   <aerosurface_scale name="Right Aileron Control">
      <input>fcs/roll-trim-sum</input>
      <range>
        <min> -0.35 </min>
        <max>  0.35 </max>
      </range>
      <output>fcs/right-aileron-pos-rad</output>
   </aerosurface_scale>

   <aerosurface_scale name="left aileron normalization">
      <input>fcs/left-aileron-pos-rad</input>
      <domain>
        <min> -0.35 </min>
        <max>  0.35 </max>
      </domain>
      <range>
        <min> -1 </min>
        <max>  1 </max>
      </range>
      <output>fcs/left-aileron-pos-norm</output>
   </aerosurface_scale>

   <aerosurface_scale name="right aileron normalization">
      <input>fcs/right-aileron-pos-rad</input>
      <domain>
        <min> -0.35 </min>
        <max>  0.35 </max>
      </domain>
      <range>
        <min> -1 </min>
        <max>  1 </max>
      </range>
      <output>fcs/right-aileron-pos-norm</output>
   </aerosurface_scale>

  </channel>

  <channel name="Yaw">

   <summer name="Rudder Command Sum">
      <input>fcs/rudder-cmd-norm</input>
      <input>fcs/yaw-trim-cmd-norm</input>
      <clipto>
        <min> -1 </min>
        <max>  1 </max>
      </clipto>
   </summer>

   <aerosurface_scale name="Rudder Control">
      <input>fcs/rudder-command-sum</input>
      <range>
        <min> -0.35 </min>
        <max>  0.35 </max>
      </range>
      <output>fcs/rudder-pos-rad</output>
   </aerosurface_scale>

   <aerosurface_scale name="rudder normalization">
      <input>fcs/rudder-pos-rad</input>
      <domain>
        <min> -0.35 </min>
        <max>  0.35 </max>
      </domain>
      <range>
        <min> -1 </min>
        <max>  1 </max>
      </range>
      <output>fcs/rudder-pos-norm</output>
   </aerosurface_scale>

  </channel>

  <channel name="Flaps">
   <kinematic name="Flaps Control">
     <input>fcs/flap-cmd-norm</input>
     <traverse>
       <setting>
          <position>  0 </position>
          <time>      0 </time>
       </setting>
       <setting>
          <position> 15 </position>
          <time>      4 </time>
       </setting>
       <setting>
          <position> 30 </position>
          <time>      3 </time>
       </setting>
     </traverse>
     <output>fcs/flap-pos-deg</output>
   </kinematic>

   <aerosurface_scale name="flap normalization">
      <input>fcs/flap-pos-deg</input>
      <domain>
        <min>  0 </min>
        <max> 30 </max>
      </domain>
      <range>
        <min> 0 </min>
        <max> 1 </max>
      </range>
      <output>fcs/flap-pos-norm</output>
   </aerosurface_scale>

  </channel>

  <channel name="Landing Gear">
  </channel>

  <channel name="Speedbrake">
   <kinematic name="Speedbrake Control">
     <input>fcs/speedbrake-cmd-norm</input>
     <traverse>
       <setting>
          <position> 0 </position>
          <time>     0 </time>
       </setting>
       <setting>
          <position> 1 </position>
          <time>     1 </time>
       </setting>
     </traverse>
     <output>fcs/speedbrake-pos-norm</output>
   </kinematic>

  </channel>

 </flight_control>

 <aerodynamics>

  <axis name="LIFT">

    <function name="aero/force/Lift_alpha">
      <description>Lift due to alpha</description>
      <product>
          <property>aero/qbar-psf</property>
          <property>metrics/Sw-sqft</property>
          <table>
            <independentVar lookup="row">aero/alpha-rad</independentVar>
            <tableData>
              -0.20 -0.750
               0.00  0.250
               0.23  1.400
               0.60  0.710
            </tableData>
          </table>
      </product>
    </function>

    <function name="aero/force/Lift_flap">
       <description>Delta Lift due to flaps</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>fcs/flap-pos-deg</property>
           <value> 0.01333 </value>
       </product>
    </function>

    <function name="aero/force/Lift_speedbrake">
       <description>Delta Lift due to speedbrake</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>fcs/speedbrake-pos-norm</property>
           <value>0</value>
       </product>
    </function>

    <function name="aero/force/Lift_elevator">
       <description>Lift due to Elevator Deflection</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>fcs/elevator-pos-rad</property>
           <value>0.2</value>
       </product>
    </function>

  </axis>

  <axis name="DRAG">

    <function name="aero/force/Drag_basic">
       <description>Drag at zero lift</description>
       <product>
          <property>aero/qbar-psf</property>
          <property>metrics/Sw-sqft</property>
          <table>
            <independentVar lookup="row">aero/alpha-rad</independentVar>
            <tableData>
             -1.57    1.500
             -0.26    0.036
              0.00    0.028
              0.26    0.036
              1.57    1.500
            </tableData>
          </table>
       </product>
    </function>

    <function name="aero/force/Drag_induced">
       <description>Induced drag</description>
         <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>aero/cl-squared</property>
           <value>0.04</value>
         </product>
    </function>

    <function name="aero/force/Drag_mach">
       <description>Drag due to mach</description>
        <product>
          <property>aero/qbar-psf</property>
          <property>metrics/Sw-sqft</property>
          <table>
            <independentVar lookup="row">velocities/mach</independentVar>
            <tableData>
                0.00      0.000
                0.7      0.000
                1.10      0.023
                1.80      0.015
            </tableData>
          </table>
        </product>
    </function>

    <function name="aero/force/Drag_flap">
       <description>Drag due to flaps</description>
         <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>fcs/flap-pos-deg</property>
           <value> 0.00100 </value>
         </product>
    </function>

    <function name="aero/force/Drag_speedbrake">
       <description>Drag due to speedbrakes</description>
         <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>fcs/speedbrake-pos-norm</property>
           <value>0.028</value>
         </product>
    </function>

    <function name="aero/force/Drag_beta">
       <description>Drag due to sideslip</description>
       <product>
          <property>aero/qbar-psf</property>
          <property>metrics/Sw-sqft</property>
          <table>
            <independentVar lookup="row">aero/beta-rad</independentVar>
            <tableData>
              -1.57    1.230
              -0.26    0.050
               0.00    0.000
               0.26    0.050
               1.57    1.230
            </tableData>
          </table>
       </product>
    </function>

    <function name="aero/force/Drag_elevator">
       <description>Drag due to Elevator Deflection</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <abs><property>fcs/elevator-pos-norm</property></abs>
           <value>0.04</value>
       </product>
    </function>

  </axis>

  <axis name="SIDE">

    <function name="aero/force/Side_beta">
       <description>Side force due to beta</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>aero/beta-rad</property>
           <value>-1</value>
       </product>
    </function>

  </axis>

  <axis name="ROLL">

    <function name="aero/moment/Roll_beta">
       <description>Roll moment due to beta</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/bw-ft</property>
           <property>aero/beta-rad</property>
           <value>-0.1</value>
       </product>
    </function>

    <function name="aero/moment/Roll_damp">
       <description>Roll moment due to roll rate</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/bw-ft</property>
           <property>aero/bi2vel</property>
           <property>velocities/p-aero-rad_sec</property>
           <value>-0.4</value>
       </product>
    </function>

    <function name="aero/moment/Roll_yaw">
       <description>Roll moment due to yaw rate</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/bw-ft</property>
           <property>aero/bi2vel</property>
           <property>velocities/r-aero-rad_sec</property>
           <value>0.15</value>
       </product>
    </function>

    <function name="aero/moment/Roll_aileron">
       <description>Roll moment due to aileron</description>
       <product>
          <property>aero/qbar-psf</property>
          <property>metrics/Sw-sqft</property>
          <property>metrics/bw-ft</property>
          <property>fcs/left-aileron-pos-rad</property>
          <value>0.17</value>
       </product>
    </function>

    <function name="aero/moment/Roll_rudder">
       <description>Roll moment due to rudder</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/bw-ft</property>
           <property>fcs/rudder-pos-rad</property>
           <value>0.01</value>
       </product>
    </function>

  </axis>

  <axis name="PITCH">

    <function name="aero/moment/Pitch_alpha">
       <description>Pitch moment due to alpha</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/cbarw-ft</property>
           <property>aero/alpha-rad</property>
           <value>-0.5</value>
       </product>
    </function>

    <function name="aero/moment/Pitch_elevator">
       <description>Pitch moment due to elevator</description>
       <product>
          <property>aero/qbar-psf</property>
          <property>metrics/Sw-sqft</property>
          <property>metrics/cbarw-ft</property>
          <property>fcs/elevator-pos-rad</property>
          <table>
            <independentVar lookup="row">velocities/mach</independentVar>
            <tableData>
              0.0     -1.100
              2.0     -0.275
            </tableData>
          </table>
       </product>
    </function>

    <function name="aero/moment/Pitch_damp">
       <description>Pitch moment due to pitch rate</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/cbarw-ft</property>
           <property>aero/ci2vel</property>
           <property>velocities/q-aero-rad_sec</property>
           <value>-12</value>
       </product>
    </function>

    <function name="aero/moment/Pitch_alphadot">
       <description>Pitch moment due to alpha rate</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/cbarw-ft</property>
           <property>aero/ci2vel</property>
           <property>aero/alphadot-rad_sec</property>
           <value>-7</value>
       </product>
    </function>

  </axis>

  <axis name="YAW">

    <function name="aero/moment/Yaw_beta">
       <description>Yaw moment due to beta</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/bw-ft</property>
           <property>aero/beta-rad</property>
           <value>0.12</value>
       </product>
    </function>

    <function name="aero/moment/Yaw_damp">
       <description>Yaw moment due to yaw rate</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/bw-ft</property>
           <property>aero/bi2vel</property>
           <property>velocities/r-aero-rad_sec</property>
           <value>-0.15</value>
       </product>
    </function>

    <function name="aero/moment/Yaw_rudder">
       <description>Yaw moment due to rudder</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/bw-ft</property>
           <property>fcs/rudder-pos-rad</property>
           <value>-0.1</value>
       </product>
    </function>

    <function name="aero/moment/Yaw_aileron">
       <description>Adverse yaw</description>
       <product>
           <property>aero/qbar-psf</property>
           <property>metrics/Sw-sqft</property>
           <property>metrics/bw-ft</property>
           <property>fcs/left-aileron-pos-rad</property>
           <value>-0.01</value>
       </product>
    </function>

  </axis>

 </aerodynamics>

 <external_reactions>
 </external_reactions>

</fdm_config>
amrsaber
 
Posts: 1
Joined: Sun Sep 08, 2019 11:06 pm

Re: Building a small UAV

Postby Thorsten » Mon Sep 09, 2019 1:56 pm

That's the JSBSim FDM config - how does your *-set.xml look like?

And with what error in the log does FG crash?
Thorsten
 
Posts: 10832
Joined: Mon Nov 02, 2009 8:33 am

Re: Building a small UAV

Postby AndersG » Mon Sep 09, 2019 2:11 pm

I'd also be rather worried about the non-existing inertia in the JSBSim file (inside the mass_balance element) - I think that may well also cause simulation problems.
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2437
Joined: Wed Nov 29, 2006 9:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux


Return to Aircraft

Who is online

Users browsing this forum: YandexBot [Bot] and 14 guests