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

<!-- CAB G.Y.30 Supercab - Emmanuel BARANGER (  /2016)
                 Updated : Emmanuel BARANGER (09/2021)

     sources             : https://en.wikipedia.org/wiki/CAB_Supercab

     wingspan            : 8.20 m   (   26 ft 11 in )
     length              : 5.50 m   (   18 ft  1 in )
     height              : 1.65 m   (    5 ft  5 in )
     empty weight        : 400 kg   (  882 lb       )
     Gross weight        : 613 kg   ( 1351 lb       )
     engine              : 1 Continental C90 air-cooled four-cylinder horizontally opposed piston engine ( 90 hp )
     Fuel capacity       :  70 L    (   18 US gal   )
     Maximum speed       : 275 km/h (  148 kt       )
     Cruise speed        : 235 km/h (  127 kt       )
-->
<airplane mass="882" version="YASIM_VERSION_CURRENT" mtow-lbs="1351">

  <!-- Approach configuration -->
  <approach speed="44" 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="0.65"/>
    <control-setting axis="/controls/flight/flaps"               value="1"/>
  </approach>

  <!-- Cruise configuration -->
  <cruise speed="127" alt="5500" fuel="0.64">
    <control-setting axis="/controls/engines/engine[0]/throttle" value="1.0"/>
    <control-setting axis="/controls/engines/engine[0]/mixture"  value="0.65"/>
    <control-setting axis="/controls/flight/flaps"               value="0"/>
  </cruise>

  <cockpit x=" 0.583" y="0.0" z="0.465"/>

  <!-- Fuselage -->
  <fuselage ax=" 2.485" ay=" 0.169" az="-0.034" bx=" 2.209" by=" 0.168" bz="-0.031" width="0.443" taper="0.60" midpoint="1"/>
  <fuselage ax=" 2.242" ay=" 0.167" az="-0.023" bx=" 1.843" by=" 0.142" bz="-0.040" width="0.545" taper="0.80" midpoint="1"/>
  <fuselage ax=" 1.888" ay=" 0.142" az="-0.034" bx=" 0.003" by=" 0.142" bz="-0.034" width="0.545" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.003" ay=" 0.142" az="-0.034" bx="-2.618" by=" 0.000" bz="-0.022" width="0.545" taper="0.10" midpoint="0"/>

  <fuselage ax=" 2.485" ay="-0.169" az="-0.034" bx=" 2.209" by="-0.168" bz="-0.031" width="0.443" taper="0.60" midpoint="1"/>
  <fuselage ax=" 2.242" ay="-0.167" az="-0.023" bx=" 1.843" by="-0.142" bz="-0.040" width="0.545" taper="0.80" midpoint="1"/>
  <fuselage ax=" 1.888" ay="-0.142" az="-0.034" bx=" 0.003" by="-0.142" bz="-0.034" width="0.545" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.003" ay="-0.142" az="-0.034" bx="-2.618" by="-0.000" bz="-0.022" width="0.545" taper="0.10" midpoint="0"/>

  <fuselage ax=" 1.570" ay=" 0.120" az=" 0.008" bx=" 1.073" by=" 0.120" bz=" 0.369" width="0.650" taper="1.00" midpoint="1"/>
  <fuselage ax=" 1.187" ay=" 0.120" az=" 0.322" bx=" 0.735" by=" 0.120" bz=" 0.419" width="0.650" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.865" ay=" 0.053" az=" 0.352" bx="-0.079" by=" 0.053" bz=" 0.252" width="0.775" taper="0.80" midpoint="0"/>
  <fuselage ax="-0.001" ay=" 0.053" az=" 0.246" bx="-2.618" by=" 0.000" bz=" 0.145" width="0.650" taper="0.10" midpoint="0"/>

  <fuselage ax=" 1.570" ay="-0.120" az=" 0.008" bx=" 1.073" by="-0.120" bz=" 0.369" width="0.650" taper="1.00" midpoint="1"/>
  <fuselage ax=" 1.187" ay="-0.120" az=" 0.322" bx=" 0.735" by="-0.120" bz=" 0.419" width="0.650" taper="1.00" midpoint="1"/>
  <fuselage ax=" 0.865" ay="-0.053" az=" 0.352" bx="-0.079" by="-0.053" bz=" 0.252" width="0.775" taper="0.80" midpoint="0"/>
  <fuselage ax="-0.001" ay="-0.053" az=" 0.246" bx="-2.618" by="-0.000" bz=" 0.145" width="0.650" taper="0.10" midpoint="0"/>

  <wing x="0.667" y="0" z="-0.309"
        chord    = "1.582"
        length   = "4.075"
        taper    = "0.6"
        dihedral = "5"
        camber   = "0.005"
        sweep    = "-2.5">
        <stall   aoa="20" width="1"    peak="1.5"/>
        <flap0 start="0.12" end="0.59" lift="1.4" drag="2.2"/>
        <flap1 start="0.59" end="0.98" 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="-2.150" y="0" z="0.272"
         chord  = "0.825"
         length = "1.390"
         taper  = "0.7">
         <stall   aoa="18" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.4" 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="-2.026" y="0" z="0.126"
         chord  = "1.352"
         length = "1.101"
         taper  = "0.506"
         sweep  = "16">
         <stall   aoa="16" width="1" peak="1.5"/>
         <flap0 start="0"    end="1" lift="1.4" 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>

  <!-- Engines   source            : https://en.wikipedia.org/wiki/Continental_O-200

                 name              : Continental O-200
                 type              : Four-cylinder air-cooled horizontally opposed piston engine
                 power cruise      : 90 hp
                 weight            : 170.18 lb ( 77.19 kg ) dry, without accessories
                 displacement      : 201 in 3 (3.29 L)
                 compression       : 7.0:1

  -->
  <propeller x="2.221" y="0" z="0.007"
             mass          = "170.18"
             moment        = "2.69"
             radius        = "0.84"
             cruise-speed  = "127"
             cruise-rpm    = "2500"
             cruise-alt    = "6000"
             cruise-power  = "80"
             takeoff-power = "90"
             takeoff-rpm   = "2700">
             <actionpt x="2.558" y="0" z="0.007" />
             <piston-engine  eng-rpm      = "2700"
                             eng-power    = "90"
                             displacement = "201"
                             compression  = "7">
                             <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"/> <!-- Ground adjustment only -->
             </piston-engine>
  </propeller>

  <!-- Left wheel -->
  <gear x="1.52501" y="1.26761" z="-1.16716"
        compression = "0.1"
        spring      = "0.8"
        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-input  control="STEER"  axis="/sim/gears/toe-left"/>

        <control-speed  control="EXTEND" transition-time="4.5"/>

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

  <!-- Right wheel -->
  <gear x="1.52501" y="-1.26761" z="-1.16716"
        compression = "0.1"
        spring      = "0.8"
        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-input  control="STEER"  axis="/sim/gears/toe-right"/>

        <control-speed  control="EXTEND" transition-time="4.5"/>

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

  <!-- Nose wheel -->
  <gear x="-2.47746" y="0" z="-0.31619"
        compression = "0.15"
        spring      = "0.8"
        stiction    = "1">
        <control-input control="STEER" axis="/controls/flight/rudder" src0="-1.0" src1="1.0" dst0="0.5" dst1="-0.5"/>
  </gear>

  <tank x="0.8" y="0" z="-0.310" capacity="107.7"/>

  <!-- Mass distribution
       Dilbert : The cg should be about 1/6 chord ahead of the chord center.
                 1.582 / 6     = 0.263
                 0.667 + 0.263 = 0.930
  -->
  <ballast x=" 2.350" y=" 0.000" z="-0.600" mass="123"/>

</airplane>
