<?xml version="1.0" encoding="UTF-8"?>

<!-- Tecnam P92 Echo
     3D model by Emmanuel BARANGER 2011
-->
<!--  Tecnam P92 Echo
      3D model/FDM by Emmanuel BARANGER 2011

      Sources       : http://en.wikipedia.org/wiki/Tecnam_P92

      Wingspan      : 8.70 m   (  28 ft  6 in )
      Length        : 6.40 m   (  20 ft 11 in )
      Height        : 2.50 m   (   8 ft  3 in )
      Empty weight  :  670 lb  ( 304 kg )
      Cruise speed  : 215 km/h ( 105 kt )
      Engines       : Rotax 912ULS (100 hp)

improvement by Flavien Blanc (fly) - 28/05/11:
-Geometry of the FDM (<fuselage>)

-->

<airplane mass="670">

  <!-- Approach configuration -->
  <approach speed="30" aoa="4" fuel="0.2">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="0.2"/>
    <control-setting axis="/controls/engines/engine[0]/mixture" value="1.0"/>
    <control-setting axis="/controls/flight/flaps" value="1.0"/>
    <control-setting axis="/sim/weight[0]/weight-lb" value ="180"/>
    <control-setting axis="/sim/weight[1]/weight-lb" value ="0"/>
    <control-setting axis="/sim/weight[2]/weight-lb" value ="0"/>
  </approach>

  <!-- Cruise configuration -->
  <cruise speed="105" alt="6000" fuel="0.5">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="0.7"/>
    <control-setting axis="/controls/engines/engine[0]/mixture" value="0.6"/>
    <control-setting axis="/controls/flight/flaps" value="0.0"/>
    <control-setting axis="/sim/weight[0]/weight-lb" value ="180"/>
    <control-setting axis="/sim/weight[1]/weight-lb" value ="0"/>
    <control-setting axis="/sim/weight[2]/weight-lb" value ="0"/>
  </cruise>

  <cockpit x="1.256" y="0.206" z="0.315"/>

  <!--fuselage-->
  <fuselage ax=" 3.020" ay="0" az="-0.131" bx=" 2.475" by="0" bz="-0.248" width="0.68" taper="0.50" midpoint="1"/>
  <fuselage ax=" 2.475" ay="0" az="-0.248" bx=" 2.268" by="0" bz="-0.248" width="0.68" taper="1.00" midpoint="1"/>
  <fuselage ax=" 2.268" ay="0" az="-0.248" bx=" 1.522" by="0" bz="-0.059" width="1.00" taper="0.70" midpoint="1"/>
  <fuselage ax=" 1.522" ay="0" az="-0.059" bx=" 0.552" by="0" bz="-0.059" width="1.00" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.552" ay="0" az="-0.059" bx="-0.740" by="0" bz="-0.186" width="1.00" taper="0.46" midpoint="0"/>
  <fuselage ax="-0.740" ay="0" az="-0.186" bx="-2.918" by="0" bz="-0.130" width="0.50" taper="0.45" midpoint="0"/>

  <wing x="0.861" y="0.176" z="0.494"
        chord="1.512"
        length="4.639"
        taper="1" 
        camber="0.01">
        <stall aoa="24" width="6.0" peak="1.5"/>
        <flap0 start="0.053" end="0.485" lift="1.2" drag="1.25"/>
        <flap1 start="0.485" end="0.920" lift="1.12" drag="1.1"/>

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

        <control-output control="FLAP0" prop="/surface-positions/flap-pos-norm"/>
        <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"/>

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

  <hstab x="-2.964" y="0" z="-0.144"
         chord="0.717"
         length="1.472"
         taper="1" >
         <stall aoa="25" width="2" peak="1.5"/>
         <flap0 start="0" end="1.00" lift="1.5" drag="1.3"/>
         <flap1 start="0" end="0.66" lift="1.5" drag="1.3"/>

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

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

  <vstab x="-2.417" y="0" z="-0.020"
         chord="1.120"
         length="1.400"
         taper="0.5"
         sweep="27">
         <stall aoa="14" width="3" peak="1.5"/>
         <flap0 start="0" end="1" lift="1.75" drag="1.35"/>

         <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" min="1" max="-1"/>
  </vstab>

  <!-- Engines   source            : http://en.wikipedia.org/wiki/Rolls-Royce_Goshawk

                 name              : ROTAX 912 S ULS
                 type              : 4-cylinder, 4-stroke liquid / air cooled engine
                 power cruise      : 79.9 hp at 5800 rpm
                 weight            :     60 kg   ( 132.3 lb  )
                 displacement      : 1211.2 cm3  ( 73.91 in3 )
                 compression       : 9:1
  -->
  <propeller x="2.614" y="0.0" z="-0.244"
             radius="0.83"
             mass="132.3"
             moment="0.60"
             cruise-speed="105"
             cruise-rpm="2263"
             cruise-alt="6000"
             cruise-power="79"
             takeoff-power="81"
             takeoff-rpm="2387"
             gear-ratio="0.412" >
             <actionpt x="3.081" y="0.0" z="-0.133"/>
             <piston-engine eng-rpm="5800"
                            eng-power="79"
                            displacement="73.91"
	                    compression="9"/>
             <control-input control="THROTTLE" axis="/controls/engines/engine[0]/throttle" />
             <control-input control="STARTER" axis="/controls/engines/engine[0]/starter" />
             <control-input control="MAGNETOS" axis="/controls/engines/engine[0]/magnetos" />
             <control-input control="MIXTURE" axis="/controls/engines/engine[0]/mixture" />
  </propeller>

  <!-- Retractable wheels 0/1/2/3 -->
  <gear x="3.531" y="0.877" z="-1.645" 
        compression="0.2"  
        spring="2" 
        sfric="0.5" 
        dfric="0.45" 
        retract-time="4" 
        initial-load="0" 
        damp="0.6">
        <control-input control="STEER" axis="/controls/flight/rudder" square="true"/>
        <control-input axis="/controls/gear/gear-down" control="EXTEND"/>
        <control-output control="EXTEND" prop="/gear/gear[0]/position-norm"/>
        <control-speed control="EXTEND" transition-time="4"/>
  </gear>

  <gear x="3.531" y="-0.877" z="-1.645" 
        compression="0.2" 
        spring="2" 
        sfric="0.5" 
        dfric="0.45" 
        retract-time="4" 
        initial-load="0" 
        damp="0.6">
        <control-input control="STEER" axis="/controls/flight/rudder" square="true"/>
        <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="4"/>
  </gear>

  <gear x="0.668" y="0.877" z="-1.652" 
        compression="0.2" 
        spring="2" 
        sfric="0.5" 
        dfric="0.45" 
        retract-time="4" 
        initial-load="0" 
        damp="0.6">
        <control-input control="BRAKE" axis="/controls/gear/brake-parking" />
        <control-input control="BRAKE" axis="/controls/gear/brake-left" />
        <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="4"/>
  </gear>

  <gear x="0.668" y="-0.877" z="-1.652" 
        compression="0.2" 
        spring="2" 
        sfric="0.5" 
        dfric="0.45" 
        retract-time="4" 
        initial-load="0" 
        damp="0.6">
        <control-input control="BRAKE" axis="/controls/gear/brake-parking" />
        <control-input control="BRAKE" axis="/controls/gear/brake-right" />
        <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="4"/>
  </gear>

  <!-- Flotteurs -->
  <!-- Avant 4/5 -->
  <gear x="3.307" y="0.877" z="-1.6" 
        compression="0.4"  
        spring="15" 
        damp="8" 
        sfric="0.4" 
        dfric="0.3" 
        on-water="1" 
        on-solid="0"
        ignored-by-solver="1"
        reduce-friction-by-extension="1.0"
        speed-planing="25" 
        spring-factor-not-planing="0.2">
        <control-output control="EXTEND" prop="/gear/gear[4]/position-norm"/>
  </gear>

  <gear x="3.307" y="-0.877" z="-1.6" 
        compression="0.4"  
        spring="15" 
        damp="8" 
        sfric="0.4" 
        dfric="0.3" 
        on-water="1" 
        on-solid="0"
        ignored-by-solver="1"
        reduce-friction-by-extension="1.0"
        speed-planing="25" 
        spring-factor-not-planing="0.2">
        <control-output control="EXTEND" prop="/gear/gear[5]/position-norm"/>
  </gear>

  <!-- Central 6/7 -->
  <gear x="0.874" y="0.877" z="-1.5" 
        compression="0.8"  
        spring="20" 
        damp="8" 
        sfric="0.4" 
        dfric="0.3" 
        on-water="1" 
        on-solid="0"
        ignored-by-solver="1"
        reduce-friction-by-extension="1.0"
        speed-planing="25" 
        spring-factor-not-planing="0.2">
        <control-output control="EXTEND" prop="/gear/gear[6]/position-norm"/>
  </gear>

  <gear x="0.874" y="-0.877" z="-1.5" 
        compression="0.8"  
        spring="20" 
        damp="8" 
        sfric="0.4" 
        dfric="0.3" 
        on-water="1" 
        on-solid="0"
        ignored-by-solver="1"
        reduce-friction-by-extension="1.0"
        speed-planing="25" 
        spring-factor-not-planing="0.2">
        <control-output control="EXTEND" prop="/gear/gear[7]/position-norm"/>
  </gear>
 
  <!-- Arriere 8/9 -->
  <gear x="-0.894" y="0.877" z="-1.4" 
        compression="0.4"  
        spring="15" 
        damp="8" 
        sfric="0.4" 
        dfric="0.3" 
        on-water="1" 
        on-solid="0"
        ignored-by-solver="1"
        reduce-friction-by-extension="1.0"
        speed-planing="25" 
        spring-factor-not-planing="0.2">
        <control-output control="EXTEND" prop="/gear/gear[8]/position-norm"/>
  </gear>

  <gear x="-0.894" y="-0.877" z="-1.4" 
        compression="0.4"  
        spring="15" 
        damp="8" 
        sfric="0.4" 
        dfric="0.3" 
        on-water="1" 
        on-solid="0"
        ignored-by-solver="1"
        reduce-friction-by-extension="1.0"
        speed-planing="25" 
        spring-factor-not-planing="0.2">
        <control-output control="EXTEND" prop="/gear/gear[9]/position-norm"/>
  </gear>

  <tank x="1.460" y="-0.7" z="0.490" capacity="77"/>
  <tank x="1.460" y="0.7" z="0.490" capacity="77"/>

  <!-- pilot -->
  <weight x="1.10" y="0.3" z="-0.1" mass-prop="/sim/weight[0]/weight-lb"/>

  <!-- copilot -->
  <weight x="1.10" y="-0.3" z="-0.1" mass-prop="/sim/weight[1]/weight-lb"/>

  <!-- baggage -->
  <weight x="0.7" y="0" z="-0.1" mass-prop="/sim/weight[2]/weight-lb"/>

  <!-- Mass distribution -->
  <ballast x="2.6" y="0" z="-1.032" mass="150"/>

</airplane>

