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

<!-- Dornier Do 228  : 2013 BARANGER Emmanuel
            Updated  : March 2016 BARANGER Emmanuel
            Updated  : April 2020 BARANGER Emmanuel
            Updated  : march 2025 BARANGER Emmanuel

     sources         : http://en.wikipedia.org/wiki/Dornier_Do_228

     wingspan           : 16.97 m  ( 55 ft  8 in )
     length             : 16.56 m  ( 54 ft  4 in )
     height             :  4.86 m  ( 15 ft 11 in )
     Moteurs            : 2 Garrett AiResearch TPE-331-5-252D or -10 variation
                          turboprop ( 776 shp/715 shp flat rated for -10 powerplants) each
     Empty weight       :  3739 kg (  8243 lb    )
     Max takeoff weight :  6575 kg ( 14495 lb    )
     Maximum speed      : 433 km/h (   234 kt    ) at 3050 m ( 10000 ft) (max cruise)
     Cruise speed       : 315 km/h (   170 kt    ) at  610 m (  2000 ft) (long-range cruise)
     Service ceiling    : 8535 m   ( 28000 ft    )
-->
<airplane mass="8243" version="YASIM_VERSION_CURRENT" mtow-lbs="14495">

  <approach speed="74" aoa="6" fuel="0.3">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.2"/>
    <control-setting axis="/controls/engines/engine[1]/throttle"        value="0.2"/>

    <control-setting axis="/controls/engines/engine[0]/mixture"         value="1"/>
    <control-setting axis="/controls/engines/engine[1]/mixture"         value="1"/>

    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="1"/>
    <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="1"/>

    <control-setting axis="/controls/gear/gear-down"                    value="1"/>
  </approach>

  <cruise speed="170" alt="10000">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.7"/>
    <control-setting axis="/controls/engines/engine[1]/throttle"        value="0.7"/>

    <control-setting axis="/controls/engines/engine[0]/mixture"         value="0.7"/>
    <control-setting axis="/controls/engines/engine[1]/mixture"         value="0.7"/>

    <control-setting axis="/controls/engines/engine[0]/propeller-pitch" value="0.77"/>
    <control-setting axis="/controls/engines/engine[1]/propeller-pitch" value="0.77"/>

    <control-setting axis="/controls/gear/gear-down"                    value="0"/>
  </cruise>

  <cockpit x="4.775" y="0.295" z="-0.264"/>

  <!-- Left side down -->
  <fuselage ax=" 8.265" ay=" 0.000" az="-1.441" bx=" 8.123" by=" 0.035" bz="-1.428" width="0.439" taper="0.30" midpoint="1"/>
  <fuselage ax=" 8.111" ay=" 0.035" az="-1.459" bx=" 7.905" by=" 0.089" bz="-1.384" width="0.611" taper="0.70" midpoint="1"/>
  <fuselage ax=" 7.945" ay=" 0.093" az="-1.385" bx=" 7.337" by=" 0.167" bz="-1.258" width="0.872" taper="0.67" midpoint="1"/>
  <fuselage ax=" 7.378" ay=" 0.167" az="-1.263" bx=" 6.008" by=" 0.201" bz="-1.090" width="1.148" taper="0.75" midpoint="1"/>
  <fuselage ax=" 6.072" ay=" 0.208" az="-1.090" bx="-2.631" by=" 0.208" bz="-1.090" width="1.133" taper="1.00" midpoint="1"/>
  <fuselage ax="-2.631" ay=" 0.208" az="-1.090" bx="-7.750" by=" 0.000" bz="-0.612" width="1.133" taper="0.30" midpoint="0"/>
  <!-- up -->
  <fuselage ax=" 5.947" ay=" 0.208" az="-0.768" bx=" 4.850" by=" 0.208" bz="-0.370" width="1.133" taper="0.40" midpoint="1"/>
  <fuselage ax=" 4.943" ay=" 0.208" az="-0.370" bx="-2.631" by=" 0.208" bz="-0.370" width="1.133" taper="1.00" midpoint="1"/>
  <fuselage ax="-2.611" ay=" 0.208" az="-0.370" bx="-7.750" by=" 0.000" bz="-0.612" width="1.133" taper="0.30" midpoint="0"/>

  <!-- Right side down -->
  <fuselage ax=" 8.265" ay="-0.000" az="-1.441" bx=" 8.123" by="-0.035" bz="-1.428" width="0.439" taper="0.30" midpoint="1"/>
  <fuselage ax=" 8.111" ay="-0.035" az="-1.459" bx=" 7.905" by="-0.089" bz="-1.384" width="0.611" taper="0.70" midpoint="1"/>
  <fuselage ax=" 7.945" ay="-0.093" az="-1.385" bx=" 7.337" by="-0.167" bz="-1.258" width="0.872" taper="0.67" midpoint="1"/>
  <fuselage ax=" 7.378" ay="-0.167" az="-1.263" bx=" 6.008" by="-0.201" bz="-1.090" width="1.148" taper="0.75" midpoint="1"/>
  <fuselage ax=" 6.072" ay="-0.208" az="-1.090" bx="-2.631" by="-0.208" bz="-1.090" width="1.133" taper="1.00" midpoint="1"/>
  <fuselage ax="-2.631" ay="-0.208" az="-1.090" bx="-7.750" by="-0.000" bz="-0.612" width="1.133" taper="0.30" midpoint="0"/>

  <!-- up -->
  <fuselage ax=" 5.947" ay="-0.208" az="-0.768" bx=" 4.850" by="-0.208" bz="-0.370" width="1.133" taper="0.40" midpoint="1"/>
  <fuselage ax=" 4.943" ay="-0.208" az="-0.370" bx="-2.631" by="-0.208" bz="-0.370" width="1.133" taper="1.00" midpoint="1"/>
  <fuselage ax="-2.611" ay="-0.208" az="-0.370" bx="-7.750" by="-0.000" bz="-0.612" width="1.133" taper="0.30" midpoint="0"/>

  <!-- Left engine -->
  <fuselage ax=" 3.629" ay=" 2.522" az="-0.019" bx=" 3.531" by=" 2.522" bz="-0.019" width="0.255" taper="0.10" midpoint="1"/>
  <fuselage ax=" 3.531" ay=" 2.522" az="-0.019" bx=" 3.366" by=" 2.522" bz="-0.019" width="0.405" taper="0.63" midpoint="1"/>
  <fuselage ax=" 3.366" ay=" 2.522" az="-0.019" bx=" 3.151" by=" 2.522" bz="-0.019" width="0.573" taper="0.71" midpoint="1"/>
  <fuselage ax=" 3.151" ay=" 2.522" az="-0.019" bx=" 2.936" by=" 2.522" bz="-0.019" width="0.680" taper="0.84" midpoint="1"/>
  <fuselage ax=" 2.936" ay=" 2.522" az="-0.019" bx=" 1.425" by=" 2.522" bz="-0.019" width="0.680" taper="1.0" midpoint="1"/>

  <!-- Right engine -->
  <fuselage ax=" 3.629" ay="-2.522" az="-0.019" bx=" 3.531" by="-2.522" bz="-0.019" width="0.255" taper="0.10" midpoint="1"/>
  <fuselage ax=" 3.531" ay="-2.522" az="-0.019" bx=" 3.366" by="-2.522" bz="-0.019" width="0.405" taper="0.63" midpoint="1"/>
  <fuselage ax=" 3.366" ay="-2.522" az="-0.019" bx=" 3.151" by="-2.522" bz="-0.019" width="0.573" taper="0.71" midpoint="1"/>
  <fuselage ax=" 3.151" ay="-2.522" az="-0.019" bx=" 2.936" by="-2.522" bz="-0.019" width="0.680" taper="0.84" midpoint="1"/>
  <fuselage ax=" 2.936" ay="-2.522" az="-0.019" bx=" 1.425" by="-2.522" bz="-0.019" width="0.680" taper="1.0" midpoint="1"/>

  <wing x="1.14704" y="0" z="0.23212"
        chord="2.281"
        length="2.969"
        taper="1"
        sweep="0"
        camber="0.05">
        <stall   aoa="86" width="1" peak="1.5"/>
        <flap0 start="0.28" end="1" lift="1.34" drag="1.9"/>

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

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

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

  <wing x="1.14704" y="2.969" z="0.23212"
        append="1"
        chord="2.281"
        length="3.948"
        taper="0.74"
        sweep="3.5"
        camber="0.05">
        <stall   aoa="28" width="1"    peak="1.5"/>
        <flap0 start="0.00" end="0.55" lift="1.34" drag="1.9"/>
        <flap1 start="0.55" end="1.00" lift="1.30" drag="1.1"/>

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

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

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

  <wing x="0.90602" y="6.90964" z="0.23212"
        append="1"
        chord="1.686"
        length="1.679"
        taper="0.15"
        sweep="25"
        camber="0.05">
        <stall   aoa="28" width="1"    peak="1.5"/>
        <flap1 start="0"    end="0.48" lift="1.3" drag="1.1"/>

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

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

  <hstab x="-7.46287" y="0" z="-0.32794"
         chord="1.301"
         length="3.247"
         taper="1">
         <stall   aoa="26" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.3" drag="1.1"/>

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

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

  <vstab x="-3.966" y="0" z="-0.235"
         chord="4.815"
         length="2.842"
         taper="0.1"
         sweep="70">
  </vstab>

  <vstab x="-6.63187" y="0" z="-0.503"
         chord="2.711"
         length="2.855"
         taper="0.5"
         sweep="12">
         <stall   aoa="22" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.3" drag="1.1"/>

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

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

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

                 name              : Garrett AiResearch TPE331
                 type              : Single-shaft turboprop with integral gearbox
                 power cruise      : 715 hp
                 weight            :    336 lb  (153 kg)
  -->
  <propeller x="2.33095" y="2.52204" z="-0.01975"
             mass="336"
             moment="250"
             radius="1.3625"
             cruise-speed="170"
             cruise-rpm="2000"
             cruise-power="700"
             cruise-alt="10000"
             min-rpm="220"
             max-rpm="1800">
             <actionpt x="3.06092" y="2.52204" z="-0.01975"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[0]/propeller-pitch"/>
             <turbine-engine eng-power="715"
                             eng-rpm="2700"
                             alt="28000"
                             flat-rating="750"
                             min-n2="70"
                             max-n2="100">
                             <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="BOOST"    axis="/controls/engines/engine[0]/boost"/>
             </turbine-engine>
  </propeller>

  <propeller x="2.33095" y="-2.52204" z="-0.01975"
             mass="336"
             moment="250"
             radius="1.3625"
             cruise-speed="170"
             cruise-rpm="2000"
             cruise-power="700"
             cruise-alt="10000"
             min-rpm="220"
             max-rpm="1800">
             <actionpt x="3.06092" y="-2.52204" z="-0.01975"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[1]/propeller-pitch"/>
             <turbine-engine eng-power="715"
                             eng-rpm="2700"
                             alt="28000"
                             flat-rating="750"
                             min-n2="70"
                             max-n2="100">
                             <control-input control="THROTTLE" axis="/controls/engines/engine[1]/throttle"/>
                             <control-input control="STARTER"  axis="/controls/engines/engine[1]/starter"/>
                             <control-input control="MAGNETOS" axis="/controls/engines/engine[1]/magnetos"/>
                             <control-input control="BOOST"    axis="/controls/engines/engine[1]/boost"/>
             </turbine-engine>
  </propeller>

  <!-- Roue du nez -->
  <gear x="6.80360" y="0" z="-2.43484"
        compression="0.1"
        spring="4"
        damp="2"
        stiction="1">
        <control-input  control="STEER"  axis="/controls/flight/rudder" square="true" src0="-1.0" src1="1.0" dst0="-0.8" dst1="0.8"/>
        <control-input  control="EXTEND" axis="/controls/gear/gear-down"/>

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

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

  <!-- Roue gauche -->
  <gear x="0.59273" y="1.67379" z="-2.42968"
        compression="0.2"
        spring="4"
        damp="2"
        stiction="1">
        <control-input  control="BRAKE"  axis="/controls/gear/brake-parking"/>
        <control-input  control="BRAKE"  axis="/controls/gear/brake-left"/>
        <control-input  control="EXTEND" axis="/controls/gear/gear-down"/>

        <control-output control="EXTEND" prop="/gear/gear[1]/position-norm"/>

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

  <!-- Roue droite -->
  <gear x="0.59273" y="-1.67379" z="-2.42968"
        compression="0.2"
        spring="4"
        damp="2"
        stiction="1">
        <control-input  control="BRAKE"  axis="/controls/gear/brake-parking"/>
        <control-input  control="BRAKE"  axis="/controls/gear/brake-right"/>
        <control-input  control="EXTEND" axis="/controls/gear/gear-down"/>

        <control-output control="EXTEND" prop="/gear/gear[2]/position-norm"/>

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

  <!-- 346.3 gal us = 2078 lb -->
  <tank x="1.33" y=" 2.5" z="0.23" capacity="2078"/>
  <!-- 346.3 gal us = 2078 lb -->
  <tank x="1.33" y="-2.5" z="0.23" capacity="2078"/>

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 2.281 / 6     = 0.380
                 1.147 + 0.380 = 1.527
  -->
  <ballast x="8" y="0" z="-1.5" mass="2018"/>

</airplane>
