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

<!-- Blohm & Voss BV 170 -    2010 Emmanuel BARANGER
                 updated -    2013 Emmanuel BARANGER / Tobias Henkel
                 updated -    2020 Emmanuel BARANGER
                 updated - 05/2024 Emmanuel BARANGER
                 updated - 03/2025 Emmanuel BARANGER

     sources          : http://www.luft46.com/bv/bvp170.html
                        http://hastur.net/abbe/crimsonskies/aircraft/luft46/bv.p.170/bv.p.170.html
                        http://deuxiemeguerremondia.forumactif.com/les-avions-f39/blohm-und-voss-bv-p-170-t10533.htm

     wingspan         : 16.00 m     (   52 ft  6 in )
     length           : 14.30 m     (   46 ft 11 in )
     height           :  3.65 m     (   12 ft  0 in )
     max speed        :   820 km/h a 8000 m (430 kt )
     empty weight     :  9100 kg    ( 20062 lb      )
     max weight       : 13300 kg    ( 29321 lb      )
     engine           :  3 BMW 801D ( 1742 hp each  )
-->
<airplane mass="20062" version="YASIM_VERSION_CURRENT" mtow-lbs="29321">

  <!-- Approach configuration -->
  <approach speed="60" aoa="4" fuel="0.4">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="0.4"/>
    <control-setting axis="/controls/engines/engine[1]/throttle"        value="0.4"/>
    <control-setting axis="/controls/engines/engine[2]/throttle"        value="0.4"/>

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

    <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/engines/engine[2]/propeller-pitch" value="1"/>

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

  <!-- Cruise configuration -->
  <cruise speed="410" alt="26000" fuel="0.9">
    <control-setting axis="/controls/engines/engine[0]/throttle"        value="1"/>
    <control-setting axis="/controls/engines/engine[1]/throttle"        value="1"/>
    <control-setting axis="/controls/engines/engine[2]/throttle"        value="1"/>

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

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

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

  <cockpit x="-2.720" y="0" z="1.590"/>

  <!-- Fuselage -->
  <fuselage ax=" 6.335" ay=" 0.000" az=" 0.681" bx=" 6.283" by=" 0.000" bz=" 0.681" width="1.200" taper="0.70" midpoint="1"/>
  <fuselage ax=" 6.283" ay=" 0.000" az=" 0.681" bx="-1.871" by=" 0.000" bz=" 0.768" width="1.200" taper="1.00" midpoint="1"/>
  <fuselage ax="-1.871" ay=" 0.000" az=" 0.768" bx="-4.317" by=" 0.000" bz=" 0.778" width="1.200" taper="0.75" midpoint="0"/>
  <fuselage ax="-4.317" ay=" 0.000" az=" 0.778" bx="-6.174" by=" 0.000" bz=" 0.807" width="0.909" taper="0.42" midpoint="0"/>
  <fuselage ax="-6.174" ay=" 0.000" az=" 0.807" bx="-7.111" by=" 0.000" bz=" 0.931" width="0.390" taper="0.20" midpoint="0"/>

  <!-- Cockpit -->
  <fuselage ax="-1.870" ay=" 0.000" az=" 1.201" bx="-2.480" by=" 0.000" bz=" 1.201" width="1.140" taper="0.30" midpoint="1"/>
  <fuselage ax="-2.480" ay=" 0.000" az=" 1.201" bx="-4.329" by=" 0.000" bz=" 1.295" width="1.140" taper="0.80" midpoint="0"/>
  <fuselage ax="-4.329" ay=" 0.000" az=" 1.295" bx="-6.184" by=" 0.000" bz=" 1.205" width="0.896" taper="0.44" midpoint="0"/>
  <fuselage ax="-6.184" ay=" 0.000" az=" 1.205" bx="-7.112" by=" 0.000" bz=" 1.091" width="0.403" taper="0.20" midpoint="0"/>

  <!-- Left engines -->
  <fuselage ax=" 6.437" ay=" 7.343" az=" 0.681" bx=" 6.283" by=" 7.343" bz=" 0.681" width="1.200" taper="0.70" midpoint="1"/>
  <fuselage ax=" 6.283" ay=" 7.343" az=" 0.681" bx=" 2.498" by=" 7.343" bz=" 0.681" width="1.200" taper="1.00" midpoint="1"/>
  <fuselage ax=" 2.498" ay=" 7.343" az=" 0.681" bx=" 0.412" by=" 7.343" bz=" 0.619" width="1.200" taper="0.60" midpoint="0"/>
  <fuselage ax=" 0.412" ay=" 7.343" az=" 0.619" bx="-0.986" by=" 7.343" bz=" 0.521" width="0.711" taper="0.20" midpoint="0"/>

  <!-- Right engines -->
  <fuselage ax=" 6.437" ay="-7.343" az=" 0.681" bx=" 6.283" by="-7.343" bz=" 0.681" width="1.200" taper="0.70" midpoint="1"/>
  <fuselage ax=" 6.283" ay="-7.343" az=" 0.681" bx=" 2.498" by="-7.343" bz=" 0.681" width="1.200" taper="1.00" midpoint="1"/>
  <fuselage ax=" 2.498" ay="-7.343" az=" 0.681" bx=" 0.412" by="-7.343" bz=" 0.619" width="1.200" taper="0.60" midpoint="0"/>
  <fuselage ax=" 0.412" ay="-7.343" az=" 0.619" bx="-0.986" by="-7.343" bz=" 0.521" width="0.711" taper="0.20" midpoint="0"/>

  <wing x="2.854" y="0" z="0.937"
        chord="3.041"
        length="8"
        taper="1"
        camber="0.005">
        <stall   aoa="16" width="1.0"  peak="1.5"/>
        <flap0 start="0.12" end="0.83" lift="1.4" drag="1.5"/>
        <flap1 start="0.20" end="0.71" lift="1.2" drag="1.2"/>

        <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="5"/>
  </wing>

  <hstab x="-5.314" y="0" z="1.264"
         chord="2.227"
         length="2.539"
         taper="0.4"
         sweep="8">
         <stall   aoa="16" width="2" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.2" drag="1.2"/>

         <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="-0.676" y="7.343" z="-0.244"
         chord="1.320"
         length="1.660"
         taper="1">
         <stall   aoa="14" width="3" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.5" drag="1.2"/>

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

  <vstab x="-0.676" y="-7.343" z="-0.244"
         chord="1.320"
         length="1.660"
         taper="1">
         <stall   aoa="14" width="3" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.5" drag="1.2"/>

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

  <!--  Source : http://en.wikipedia.org/wiki/BMW_801

                 Engine       : BMW 801
                 type         : 14-cylinder supercharged two-row air-cooled radial engine
                 power        : 1742 hp at 2700 rpm for takeoff at sea level
                 weight       : 1012 kg ( 2226 lb  )
                 Displacement : 41.8 l  ( 2560 in3 )
                 Compression  : 6.5:1
  -->
  <propeller x="6.080" y="7.343" z="0.681"
             mass="2226"
             moment="20"
             radius="1.80"
             cruise-power="1500"
             cruise-speed="410"
             cruise-rpm="2550"
             cruise-alt="26000"
             gear-ratio="0.62"
             contra="1">
             <actionpt x="6.691" y="7.343" z="0.681"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[0]/propeller-rpm"/>
             <piston-engine eng-power="1742"
                            eng-rpm="2700"
                            displacement="2560"
                            compression="6.5"
                            supercharger="1"
                            turbo-mul="3.4"
                            wastegate-mp="45.0">
                            <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"/>
                            <control-input control="BOOST"    axis="/controls/engines/engine[0]/boost"/>
             </piston-engine>
  </propeller>

  <propeller x="6.080" y="0" z="0.681"
             mass="2226"
             moment="20"
             radius="1.80"
             cruise-power="1500"
             cruise-speed="410"
             cruise-rpm="2550"
             cruise-alt="26000"
             gear-ratio="0.62">
             <actionpt x="6.691" y="0" z="0.681"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[1]/propeller-rpm"/>
             <piston-engine eng-power="1742"
                            eng-rpm="2700"
                            displacement="2560"
                            compression="6.5"
                            supercharger="1"
                            turbo-mul="3.4"
                            wastegate-mp="45.0">
                            <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="MIXTURE"  axis="/controls/engines/engine[1]/mixture"/>
                            <control-input control="BOOST"    axis="/controls/engines/engine[1]/boost"/>
             </piston-engine>
  </propeller>

  <propeller x="6.080" y="-7.343" z="0.681"
             mass="2226"
             moment="20"
             radius="1.80"
             cruise-power="1500"
             cruise-speed="410"
             cruise-rpm="2550"
             cruise-alt="26000"
             gear-ratio="0.62"
             contra="1">
             <actionpt x="6.691" y="-7.343" z="0.681"/>
             <control-input control="ADVANCE" axis="/controls/engines/engine[2]/propeller-rpm"/>
             <piston-engine eng-power="1742"
                            eng-rpm="2700"
                            displacement="2560"
                            compression="6.5"
                            supercharger="1"
                            turbo-mul="3.4"
                            wastegate-mp="45.0">
                            <control-input control="THROTTLE" axis="/controls/engines/engine[2]/throttle"/>
                            <control-input control="STARTER"  axis="/controls/engines/engine[2]/starter"/>
                            <control-input control="MAGNETOS" axis="/controls/engines/engine[2]/magnetos"/>
                            <control-input control="MIXTURE"  axis="/controls/engines/engine[2]/mixture"/>
                            <control-input control="BOOST"    axis="/controls/engines/engine[2]/boost"/>
             </piston-engine>
  </propeller>

  <!-- Left  -->
  <gear x="4.305" y="7.273" z="-1.809"
        compression="0.2"
        spring="0.6"
        stiction="1">
        <control-input  control="BRAKE"  axis="/controls/gear/brake-left"    split="true"/>
        <control-input  control="BRAKE"  axis="/controls/gear/brake-parking" split="true"/>
        <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="4"/>
  </gear>

  <!-- Center -->
  <gear x="4.305" y="-0.080" z="-1.809"
        compression="0.2"
        spring="0.6"
        stiction="1">
        <control-input  control="BRAKE"  axis="/controls/gear/brake-parking" split="true"/>
        <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="4"/>
  </gear>

  <!-- Right -->
  <gear x="4.305" y="-7.393" z="-1.809"
        compression="0.2"
        spring="0.6"
        stiction="1">
        <control-input  control="BRAKE"  axis="/controls/gear/brake-right"   split="true"/>
        <control-input  control="BRAKE"  axis="/controls/gear/brake-parking" split="true"/>
        <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="4"/>
  </gear>

  <!-- Tail -->
  <gear x="-5.502" y="0" z="-0.070"
        compression="0.15"
        spring="0.6"
        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-input  control="BRAKE"  axis="/controls/gear/brake-center"/>
        <control-input  control="BRAKE"  axis="/controls/gear/brake-parking" split="true"/>

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

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

  <!-- 2000 liters each - 4410 lbs -->
  <tank x="3.5" y=" 7.5" z="0.900" capacity="4410"/>
  <tank x="3.5" y=" 0.0" z="0.900" capacity="4410"/>
  <tank x="3.5" y="-7.5" z="0.900" capacity="4410"/>

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 3.041 / 6     = 0.506
                 1.182 + 0.506 = 1.688
  -->
  <ballast x="-7.000" y="0.000" z="0.400" mass="4660"/>

</airplane>
