<?xml version="1.0" encoding="ISO-8859-1"?>

<!-- Antonov An 22        : BARANGER Emmanuel (2014)

     Sources              : http://en.wikipedia.org/wiki/Antonov_An-22

     Wingspan             :  64.40 m   (   211 ft  4     in )
     Lenght               :  57.90 m   (   189 ft 11 1/2 in )
     Height               :  12.53 m   (    41 ft  1 1/2 in )
     Empty weight         :  114000 kg (   251325 lb        )
     Engines              : 4 x Kuznetsov NK-12MA turboprops driving contra-rotating propellers ( 15000 shp each )
     Max speed            : 740 km/h   (   399 kt      )
-->

<airplane mass="251325" version="YASIM_VERSION_CURRENT">

  <approach speed="120" aoa="6" fuel="0.2">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="0.7"/>
    <control-setting axis="/controls/engines/engine[0]/condition" value="1"/>
    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="0"/>
    
    <control-setting axis="/controls/engines/engine[1]/throttle" value="0.7"/>
    <control-setting axis="/controls/engines/engine[1]/condition" value="1"/>
    <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="0"/>
    
    <control-setting axis="/controls/engines/engine[2]/throttle" value="0.7"/>
    <control-setting axis="/controls/engines/engine[2]/condition" value="1"/>
    <control-setting axis="/controls/engines/engine[2]/propeller-pitch" value="0"/>
    
    <control-setting axis="/controls/engines/engine[3]/throttle" value="0.7"/>
    <control-setting axis="/controls/engines/engine[3]/condition" value="1"/>
    <control-setting axis="/controls/engines/engine[3]/propeller-pitch" value="0"/>
    
    <control-setting axis="/controls/flight/flaps" value="0.7"/>
    <control-setting axis="/controls/gear/gear-down" value="1"/>
  </approach>

  <cruise speed="340" alt="39370" fuel="0.8">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="1"/>
    <control-setting axis="/controls/engines/engine[0]/condition" value="1"/>
    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="1"/>
    
    <control-setting axis="/controls/engines/engine[1]/throttle" value="1"/>
    <control-setting axis="/controls/engines/engine[1]/condition" value="1"/>
    <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="1"/>
    
    <control-setting axis="/controls/engines/engine[2]/throttle" value="1"/>
    <control-setting axis="/controls/engines/engine[2]/condition" value="1"/>
    <control-setting axis="/controls/engines/engine[2]/propeller-pitch" value="1"/>
    
    <control-setting axis="/controls/engines/engine[3]/throttle" value="1"/>
    <control-setting axis="/controls/engines/engine[3]/condition" value="1"/>
    <control-setting axis="/controls/engines/engine[3]/propeller-pitch" value="1"/>
    
    <control-setting axis="/controls/flight/flaps" value="0"/>
    <control-setting axis="/controls/gear/gear-down" value="0"/>
  </cruise>

  <cockpit x="24.41012" y="0.41799" z="-0.67554"/>

  <!-- Fuselage -->
  <fuselage ax=" 28.76046" ay="0" az="-2.24423" bx=" 21.39809" by="0" bz="-2.14046" width="5.066" taper="0.3" midpoint="1.0"/>
  <fuselage ax=" 21.39809" ay="0" az="-2.14046" bx=" -3.45695" by="0" bz="-2.14936" width="5.066" taper="1.0" midpoint="0.0"/>
  <fuselage ax=" -3.45695" ay="0" az="-2.14936" bx="-21.34291" by="0" bz=" 1.03286" width="5.066" taper="0.3" midpoint="0.0"/>
  <fuselage ax="-21.34291" ay="0" az=" 1.03286" bx="-28.65440" by="0" bz=" 1.18538" width="1.474" taper="1.0" midpoint="0.0"/>
  
  <!-- Engine exterior left -->
  <fuselage ax=" 9.89801"  ay=" 13.45214" az="-0.18105" bx="3.09717" by=" 13.45214" bz="-0.18105" width="1.724" taper="0.8" midpoint="0.1"/>
  <!-- Engine interior left -->
  <fuselage ax="10.49855"  ay="  6.87900" az="-0.18105" bx="3.69771" by="  6.87900" bz="-0.18105" width="1.724" taper="0.8" midpoint="0.1"/>
  <!-- Engine interior right -->
  <fuselage ax="10.49855"  ay=" -6.87900" az="-0.18105" bx="3.69771" by=" -6.87900" bz="-0.18105" width="1.724" taper="0.8" midpoint="0.1"/>
  <!-- Engine exterior right -->
  <fuselage ax=" 9.89801"  ay="-13.45214" az="-0.18105" bx="3.09717" by="-13.45214" bz="-0.18105" width="1.724" taper="0.8" midpoint="0.1"/>
  
  <!-- Wing -->
  <wing x="3.92059" y="0" z="0.86412"
        chord="7.781"
        length="20.375"
        taper="0.6"
        sweep="2"
        dihedral="-1"
        camber="0.001">
        <stall aoa="20" width="1" peak="3.5"/>
        <flap0 start="0.15" end="1" lift="1.8" drag="1.6"/>

        <control-input axis="/controls/flight/flaps" control="FLAP0" invert="true"/>

        <control-output control="FLAP0" prop="/surface-positions/flap-pos-norm"/>

        <control-speed control="FLAP0" transition-time="5"/>
  </wing>

  <mstab x="3.20951" y="20.35949" z="0.50874"
         chord="4.637"
         length="11.873"
         taper="0.6"
         sweep="3"
         dihedral="-4">
         <stall aoa="20" width="1" peak="1.4"/>
         <flap1 start="0" end="1" lift="1.2" drag="1.1"/>

         <control-input axis="/controls/flight/aileron" control="FLAP1" split="true"/>
         <control-input axis="/controls/flight/aileron-trim" control="FLAP1" split="true"/>

         <control-output control="FLAP1" side="left" prop="/surface-positions/left-aileron-pos-norm"/>
         <control-output control="FLAP1" side="right" prop="/surface-positions/right-aileron-pos-norm"/>
  </mstab>

   <!-- Elevator -->
  <hstab x="-23.44338" y="0" z="1.66519"
         chord="5.551"
         length="9.905"
         sweep="3"
         taper="0.6">
         <stall aoa="18" width="1" peak="1.4"/>
         <flap0 start="0" end="1" lift="1.4" drag="1.5"/>

         <control-input axis="/controls/flight/elevator" control="FLAP0"/>
         <control-input axis="/controls/flight/elevator-trim" control="FLAP0"/>

         <control-output control="FLAP0" prop="/surface-positions/elevator-pos-norm"/>
  </hstab>

  <!-- Ruder -->
  <vstab x="-22.77339" y="6.96456" z="-1.92091"
         chord="5.023"
         length="7.967"
         sweep="0"
         taper="0.7">
         <stall aoa="16" width="1" peak="1.5"/>
         <flap0 start="0" end="1" lift="1.5" drag="1.2"/>

         <control-input axis="/controls/flight/rudder" control="FLAP0" invert="true"/>
         <control-input axis="/controls/flight/rudder-trim" control="FLAP0" invert="true"/>

         <control-output control="FLAP0" prop="/surface-positions/rudder-pos-norm"/>
  </vstab>

  <vstab x="-22.77339" y="-6.96456" z="-1.92091"
         chord="5.023"
         length="7.967"
         sweep="0"
         taper="0.7">
         <stall aoa="16" width="1" peak="1.5"/>
         <flap0 start="0" end="1" lift="1.5" drag="1.2"/>

         <control-input axis="/controls/flight/rudder" control="FLAP0" invert="true"/>
         <control-input axis="/controls/flight/rudder-trim" control="FLAP0" invert="true"/>

         <control-output control="FLAP0" prop="/surface-positions/rudder-pos-norm"/>
  </vstab>

  <!-- Engines   source            : http://en.wikipedia.org/wiki/Kuznetsov_NK-12

                 name              : Kuznetsov NK-12
                 type              : Turboprop
                 power cruise      : 14795 ehp hp
                 weight            : 2900 kg  ( 6393 lbs)
  -->
  <!-- Engine left exterior -->
  <propeller x="7.26952" y="13.45214" z="-0.18105"
             radius="3.188"
             mass="6393"
             moment="10500"
             cruise-alt="30000"
             cruise-speed="340"
             cruise-rpm="750"
             cruise-power="9700"
             takeoff-rpm="840"
             takeoff-power="14600"
             min-rpm="700"
             max-rpm="840"
             manual="true"
             contra="1">
             <actionpt x="10.68032" y="13.45214" z="-0.18105"/>
             <control-input axis="/controls/engines/engine[0]/propeller-pitch" control="ADVANCE"/>
             <turbine-engine eng-power="14600"
                             eng-rpm="840"
                             alt="36000"
                             min-n2="40"
                             max-n2="100"
                             flat-rating="14660"
                             bsfc="0.360">
                             <control-input axis="/controls/engines/engine[0]/condition" control="CONDLEVER"/>
                             <control-input axis="/controls/engines/engine[0]/throttle" control="THROTTLE"/>
             </turbine-engine>
  </propeller>

  <!-- Engine left interior -->
  <propeller x="7.87006" y="6.87901" z="-0.18105"
             radius="3.188"
             mass="6393"
             moment="10500"
             cruise-alt="30000"
             cruise-speed="340"
             cruise-rpm="750"
             cruise-power="9700"
             takeoff-rpm="840"
             takeoff-power="14600"
             min-rpm="700"
             max-rpm="840"
             manual="true"
             contra="1">
             <actionpt x="11.28087" y="6.87901" z="-0.18105"/>
             <control-input axis="/controls/engines/engine[1]/propeller-pitch" control="ADVANCE"/>
             <turbine-engine eng-power="14600"
                             eng-rpm="840"
                             alt="36000"
                             min-n2="40"
                             max-n2="100"
                             flat-rating="14660"
                             bsfc="0.360">
                             <control-input axis="/controls/engines/engine[1]/condition" control="CONDLEVER"/>
                             <control-input axis="/controls/engines/engine[1]/throttle" control="THROTTLE"/>
             </turbine-engine>
  </propeller>

  <!-- Engine right interior-->
  <propeller x="7.87006" y="-6.87901" z="-0.18105"
             radius="3.188"
             mass="6393"
             moment="10500"
             cruise-alt="30000"
             cruise-speed="340"
             cruise-rpm="750"
             cruise-power="9700"
             takeoff-rpm="840"
             takeoff-power="14600"
             min-rpm="700"
             max-rpm="840"
             manual="true"
             contra="1">
             <actionpt x="11.28087" y="-6.87901" z="-0.18105"/>
             <control-input axis="/controls/engines/engine[2]/propeller-pitch" control="ADVANCE"/>
             <turbine-engine eng-power="14600"
                             eng-rpm="840"
                             alt="36000"
                             min-n2="40"
                             max-n2="100"
                             flat-rating="14660"
                             bsfc="0.360">
                             <control-input axis="/controls/engines/engine[2]/condition" control="CONDLEVER"/>
                             <control-input axis="/controls/engines/engine[2]/throttle" control="THROTTLE"/>
             </turbine-engine>
  </propeller>

  <!-- Engine right exterior-->
  <propeller x="7.26952" y="-13.45214" z="-0.18105"
             radius="3.188"
             mass="6393"
             moment="10500"
             cruise-alt="30000"
             cruise-speed="340"
             cruise-rpm="750"
             cruise-power="9700"
             takeoff-rpm="840"
             takeoff-power="14600"
             min-rpm="700"
             max-rpm="840"
             manual="true"
             contra="1">
             <actionpt x="10.68032" y="-13.45214" z="-0.18105"/>
             <control-input axis="/controls/engines/engine[3]/propeller-pitch" control="ADVANCE"/>
             <turbine-engine eng-power="14600"
                             eng-rpm="840"
                             alt="36000"
                             min-n2="40"
                             max-n2="100"
                             flat-rating="14660"
                             bsfc="0.360">
                             <control-input axis="/controls/engines/engine[3]/condition" control="CONDLEVER"/>
                             <control-input axis="/controls/engines/engine[3]/throttle" control="THROTTLE"/>
             </turbine-engine>
  </propeller>

  <!-- Noze wheel -->
  <gear x="20.40663" y="0" z="-6.26719"
        retract-time="7"
        compression="0.45"
        spring="0.78"
        damp="1.35">
        <control-input axis="/controls/flight/rudder" control="STEER" square="true"/>
        <control-input axis="/controls/gear/gear-down" control="EXTEND"/>

        <control-output control="STEER" prop="/gear/gear[0]/steering-norm"/>
        <control-output control="EXTEND" prop="/gear/gear[0]/position-norm"/>

        <control-speed control="EXTEND" transition-time="5"/>
  </gear>

  <!-- Left wheel 1 -->
  <gear x="5.83364" y=" 3.28059" z="-6.08679"
        retract-time="7"
        compression="0.45"
        spring="0.80"
        damp="1.10">
        <control-input axis="/controls/gear/brake-left" control="BRAKE"/>
        <control-input axis="/controls/gear/brake-parking" control="BRAKE"/>
        <control-input axis="/controls/gear/gear-down" control="EXTEND"/>
        
        <control-output control="EXTEND" prop="/gear/gear[1]/position-norm"/>
        
        <control-speed control="EXTEND" transition-time="5"/>
  </gear>

  <!-- Left wheel 2 -->
  <gear x="3.30963" y=" 3.28059" z="-6.00918"
        retract-time="7"
        compression="0.45"
        spring="0.80"
        damp="1.10">
        <control-input axis="/controls/gear/brake-left" control="BRAKE"/>
        <control-input axis="/controls/gear/brake-parking" control="BRAKE"/>
        <control-input axis="/controls/gear/gear-down" control="EXTEND"/>
        
        <control-output control="EXTEND" prop="/gear/gear[2]/position-norm"/>
        
        <control-speed control="EXTEND" transition-time="5"/>
  </gear>

  <!-- Left wheel 3 -->
  <gear x="0.84250" y=" 3.28059" z="-5.98100"
        retract-time="7"
        compression="0.45"
        spring="0.80"
        damp="1.10">
        <control-input axis="/controls/gear/brake-left" control="BRAKE"/>
        <control-input axis="/controls/gear/brake-parking" control="BRAKE"/>
        <control-input axis="/controls/gear/gear-down" control="EXTEND"/>
        
        <control-output control="EXTEND" prop="/gear/gear[3]/position-norm"/>
        
        <control-speed control="EXTEND" transition-time="5"/>
  </gear>

  <!-- Right wheel 1 -->
  <gear x="5.83364" y="-3.28059" z="-6.08679"
        retract-time="7"
        compression="0.45"
        spring="0.80"
        damp="1.10">
        <control-input axis="/controls/gear/brake-left" control="BRAKE"/>
        <control-input axis="/controls/gear/brake-parking" control="BRAKE"/>
        <control-input axis="/controls/gear/gear-down" control="EXTEND"/>
        
        <control-output control="EXTEND" prop="/gear/gear[4]/position-norm"/>
        
        <control-speed control="EXTEND" transition-time="5"/>
  </gear>

  <!-- Right wheel 2 -->
  <gear x="3.30963" y="-3.28059" z="-6.00918"
        retract-time="7"
        compression="0.45"
        spring="0.80"
        damp="1.10">
        <control-input axis="/controls/gear/brake-left" control="BRAKE"/>
        <control-input axis="/controls/gear/brake-parking" control="BRAKE"/>
        <control-input axis="/controls/gear/gear-down" control="EXTEND"/>
        
        <control-output control="EXTEND" prop="/gear/gear[5]/position-norm"/>
        
        <control-speed control="EXTEND" transition-time="5"/>
  </gear>

  <!-- Right wheel 2 -->
  <gear x="0.84250" y="-3.28059" z="-5.98100"
        retract-time="7"
        compression="0.45"
        spring="0.80"
        damp="1.10">
        <control-input axis="/controls/gear/brake-left" control="BRAKE"/>
        <control-input axis="/controls/gear/brake-parking" control="BRAKE"/>
        <control-input axis="/controls/gear/gear-down" control="EXTEND"/>
        
        <control-output control="EXTEND" prop="/gear/gear[6]/position-norm"/>
        
        <control-speed control="EXTEND" transition-time="5"/>
  </gear>

  <tank x="3" y=" 10.36101" z="-0.661" capacity="3000"/>
  <tank x="3" y="-10.36101" z="-0.661" capacity="3000"/>

  <!-- Mass distribution -->
  <ballast x="26" y="0" z="-4" mass="40000"/>

</airplane>
