<?xml version="1.0"?>

<!--
    Autopilot Configuration for the MiG-15bis.
-->

<!--
    This is still in development, so not all of the controllers are
    currently used, or work properly.
-->

<PropertyList>

<!-- =============================================================
     Common Aileron controllers.
     These stage 1 controllers all use the same stage 2
     controller.
     =============================================================
-->
<!-- Common Stage #2 aileron driver.
     Drives the aileron-trim to achieve the desired roll.
-->
  <filter>
    <name>Common Aileron Filter</name>
    <debug>false</debug>
    <type>noise-spike</type>
    <input>/autopilot/internal/target-roll-deg-unfiltered</input>
    <output>/autopilot/internal/target-roll-deg-filtered</output>
    <max-rate-of-change>20.0</max-rate-of-change>
  </filter>

  <pid-controller>
    <name>Common Aileron Controller - Stage 2</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/common-aileron-control</prop>
      <value>engaged</value>
    </enable>
    <input>
      <prop>/orientation/roll-deg</prop>
    </input>
    <reference>
      <prop>/autopilot/internal/target-roll-deg-filtered</prop>
    </reference>
    <output>
      <prop>/controls/flight/aileron</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>0.05</Kp>
      <beta>1.0</beta>
      <alpha>0.1</alpha>
      <gamma>0.0</gamma>
      <Ti>10.0</Ti>
      <Td>0.01</Td>
      <u_min>-1.0</u_min>
      <u_max>1.0</u_max>
    </config>
  </pid-controller>

<!--
    Heading Bug hold (common aileron) controller.
    2 stage cascade controller.
    Stage #1 sets target roll.
-->

  <filter>
    <name>Heading Bug Heading Hold filter</name>
    <debug>false</debug>
    <type>noise-spike</type>
    <input>/autopilot/internal/fdm-heading-bug-error-deg</input>
    <output>/autopilot/internal/fdm-heading-bug-error-deg-filtered</output>
    <max-rate-of-change>4.0</max-rate-of-change>
  </filter>

  <pid-controller>
    <name>Heading Bug Hold Stage 1</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/heading</prop>
      <value>dg-heading-hold</value>
    </enable>
    <input>
      <prop>/autopilot/internal/fdm-heading-bug-error-deg-filtered</prop>
    </input>
    <reference>
      <value>0.0</value>
    </reference>
    <output>
      <prop>/autopilot/internal/target-roll-deg-unfiltered</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>-4.0</Kp>
      <beta>1.0</beta>
      <alpha>0.1</alpha>
      <gamma>0.0</gamma>
      <Ti>20.0</Ti>
      <Td>0.0000000000000000001</Td>
      <u_min>-50.0</u_min>
      <u_max>50.0</u_max>
    </config>
  </pid-controller>

<!--
    True Heading hold (common aileron) controller.
    2 stage cascade controller.
    Stage #1 sets target roll.
-->
  <filter>
    <name>True Heading Hold filter</name>
    <debug>false</debug>
    <type>noise-spike</type>
    <input>/autopilot/internal/true-heading-error-deg</input>
    <output>/autopilot/internal/true-heading-error-deg-filtered</output>
    <max-rate-of-change>20.0</max-rate-of-change>
  </filter>

  <pid-controller>
    <name>True Heading Hold Stage 1</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/heading</prop>
      <value>true-heading-hold</value>
    </enable>
    <input>
      <prop>/autopilot/internal/true-heading-error-deg-filtered</prop>
    </input>
    <reference>
      <value>0.0</value>
    </reference>
    <output>
      <prop>/autopilot/internal/target-roll-deg-unfiltered</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>-4.0</Kp>
      <beta>1.0</beta>
      <alpha>0.1</alpha>
      <gamma>0.0</gamma>
      <Ti>10.0</Ti>
      <Td>0.0000000000000000001</Td>
      <u_min>-50.0</u_min>
      <u_max>50.0</u_max>
    </config>
  </pid-controller>

<!--
    Nav1 Heading hold (common aileron) controller.
    2 stage cascade controller.
    Stage #1 sets target roll based on nav1-heading-error.
-->
<!--
  <filter>
    <name>Nav1 filter 1</name>
    <debug>false</debug>
    <type>noise-spike</type>
    <input>/autopilot/internal/nav1-heading-error-deg</input>
    <output>/autopilot/internal/nav1-heading-error-deg-filtered[0]</output>
    <max-rate-of-change>10.0</max-rate-of-change>
  </filter>

  <filter>
    <name>Nav1 filter 2</name>
    <debug>false</debug>
    <type>moving-average</type>
    <input>/autopilot/internal/nav1-heading-error-deg-filtered[0]</input>
    <output>/autopilot/internal/nav1-heading-error-deg-filtered[1]</output>
    <samples>20</samples>
  </filter>
-->
  <pid-controller>
    <name>Nav1 Hold Stage 1</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/heading</prop>
      <value>nav1-hold</value>
    </enable>
    <input>
<!--      <prop>/autopilot/internal/nav1-heading-error-deg-filtered[1]</prop> -->
      <prop>/autopilot/internal/nav1-heading-error-deg</prop>
    </input>
    <reference>
      <value>0.0</value>
    </reference>
    <output>
      <prop>/autopilot/internal/target-roll-deg-unfiltered</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>-2.8</Kp>        <!-- proportional gain -->
      <beta>1.0</beta>     <!-- input value weighing factor -->
      <alpha>0.1</alpha>   <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>   <!-- input value weighing factor for -->
                           <!-- unfiltered derivative error -->
      <Ti>20</Ti>        <!-- integrator time -->
      <Td>0.000000000000000001</Td>     <!-- derivator time -->
      <u_min>-50.0</u_min> <!-- minimum output clamp -->
      <u_max>50.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

<!--
    Nav1 Heading hold - Final approach (common aileron) controller.
    2 stage cascade controller.
    Stage #1 sets target roll based on heading-needle-deflection.
-->
<!--
  <filter>
    <name>Nav1-fa filter 1</name>
    <debug>false</debug>
    <type>noise-spike</type>
    <input>/instrumentation/nav[0]/heading-needle-deflection</input>
    <output>/autopilot/internal/heading-needle-deflection-filtered[0]</output>
    <max-rate-of-change>10.0</max-rate-of-change>
  </filter>

  <filter>
    <name>Nav1-fa filter 2</name>
    <debug>false</debug>
    <type>moving-average</type>
    <input>/autopilot/internal/heading-needle-deflection-filtered[0]</input>
    <output>/autopilot/internal/heading-needle-deflection-filtered[1]</output>
    <samples>20</samples>
  </filter>
-->
  <pid-controller>
    <name>Nav1 Hold (Final Approach) Stage 1</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/heading</prop>
      <value>nav1-hold-fa</value>
    </enable>
    <input>
      <prop>/instrumentation/nav[0]/heading-needle-deflection</prop>
    </input>
    <reference>
      <value>0.0</value>
    </reference>
    <output>
      <prop>/autopilot/internal/target-roll-deg-unfiltered</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>-30.0</Kp>        <!-- proportional gain -->
      <beta>1.0</beta>     <!-- input value weighing factor -->
      <alpha>0.1</alpha>   <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>   <!-- input value weighing factor for -->
                           <!-- unfiltered derivative error -->
      <Ti>120</Ti>        <!-- integrator time -->
      <Td>2.0</Td>     <!-- derivator time -->
      <u_min>-6.0</u_min> <!-- minimum output clamp -->
      <u_max>6.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

<!-- =============================================================
     Common Elevator controllers.
     
     The stage 2 controller is engaged automatically via a Nasal
     script.

     The stage 1 controllers all use the same stage 2 controller.
     =============================================================
-->
<!-- Common Stage #2 elevator driver.
     Drives the elevator-trim to achieve the desired pitch.
-->
  <filter>
    <name>Common Elevator Filter</name>
    <debug>false</debug>
    <type>noise-spike</type>
    <input>/autopilot/internal/target-pitch-deg-unfiltered</input>
    <output>/autopilot/internal/target-pitch-deg-filtered</output>
    <max-rate-of-change>4.0</max-rate-of-change>
  </filter>

  <pid-controller>
    <name>Common Elevator Controller - Stage 2</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/common-elevator-control</prop>
      <value>engaged</value>
    </enable>
    <input>
      <prop>/orientation/pitch-deg</prop>
    </input>
    <reference>
      <prop>/autopilot/internal/target-pitch-deg-filtered</prop>
    </reference>
    <output>
      <prop>/controls/flight/elevator-trim</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>-0.05</Kp>
      <beta>1.0</beta>
      <alpha>0.1</alpha>
      <gamma>0.0</gamma>
      <Ti>40.0</Ti>
      <Td>0.00000000000000000000000001</Td>
<!--      <Td>0.01</Td> -->
      <u_min>-1.0</u_min>
      <u_max>1.0</u_max>
    </config>
  </pid-controller>

<!--
    Altitude hold (common elevator) controller.
    2 stage cascade controller.
    Stage #1 sets target pitch.
-->
  <filter>
    <name>Atitude Hold (common elevator) filter</name>
    <debug>false</debug>
    <type>noise-spike</type>
    <input>/autopilot/settings/target-altitude-ft</input>
    <output>/autopilot/internal/target-altitude-ft-filtered</output>
    <max-rate-of-change>100.0</max-rate-of-change>
  </filter>

  <pid-controller>
    <name>Altitude Hold (common elevator) Stage 1</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/altitude</prop>
      <value>altitude-hold</value>
    </enable>
    <input>
      <prop>/position/altitude-ft</prop>
    </input>
    <reference>
      <prop>/autopilot/internal/target-altitude-ft-filtered</prop>
    </reference>
    <output>
      <prop>/autopilot/internal/target-pitch-deg-unfiltered</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>0.04</Kp>
      <beta>1.0</beta>
      <alpha>0.01</alpha>
      <gamma>0.0</gamma>
      <Ti>30.0</Ti>
      <Td>0.00000000000000000000000001</Td>
      <u_min>-10.0</u_min>
      <u_max>10.0</u_max>
    </config>
  </pid-controller>

<!--
    AGL hold (common elevator) controller.
    2 stage cascade controller.
    Stage #1 sets target pitch.
-->
  <filter>
    <name>AGL Hold filter</name>
    <debug>false</debug>
    <type>moving-average</type>
    <input>/position/altitude-agl-ft</input>
    <output>/autopilot/internal/altitude-agl-ft-filtered</output>
    <samples>20</samples>
  </filter>

  <pid-controller>
    <name>AGL Hold (common elevator) Stage 1</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/altitude</prop>
      <value>agl-hold</value>
    </enable>
    <input>
      <prop>/autopilot/internal/altitude-agl-ft-filtered</prop>
    </input>
    <reference>
      <prop>/autopilot/settings/target-agl-ft</prop>
    </reference>
    <output>
      <prop>/autopilot/internal/target-pitch-deg-unfiltered</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>0.04</Kp>
      <beta>1.0</beta>
      <alpha>0.01</alpha>
      <gamma>0.0</gamma>
      <Ti>6.0</Ti>
      <Td>0.00000000000000000000000001</Td>
      <u_min>-10.0</u_min>
      <u_max>80.0</u_max>
    </config>
  </pid-controller>

<!--
    Mach Climb Hold (common elevator) controller.
    2 stage cascade controller.
    Stage #1 sets target pitch.
-->
  <pid-controller>
    <name>Mach Lock Climb (common elevator) Stage 1</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/altitude</prop>
      <value>mach-climb</value>
    </enable>
    <input>
      <prop>/autopilot/settings/target-mach</prop>
    </input>
    <reference>
      <prop>/velocities/mach</prop>
    </reference>
    <output>
      <prop>/autopilot/internal/target-pitch-deg-unfiltered</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>400.0</Kp>
      <beta>1.0</beta>
      <alpha>0.1</alpha>
      <gamma>0.0</gamma>
      <Ti>120.0</Ti>
      <Td>0.0000000000000000000000000000000001</Td>
      <u_min>0.0</u_min>
      <u_max>30.0</u_max>
    </config>
  </pid-controller>

<!--
    VFPS hold (common elevator) controller.
    2 stage cascade controller.
    Stage #1 sets target pitch.
-->
  <pid-controller>
    <name>VFPS Hold</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/altitude</prop>
      <value>vfps-hold</value>
    </enable>
    <input>
      <prop>/velocities/vertical-speed-fps</prop>
    </input>
    <reference>
      <prop>/autopilot/settings/target-climb-rate-fps</prop>
    </reference>
     <output>
      <prop>/autopilot/internal/target-pitch-deg-unfiltered</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>0.4</Kp>      <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>4.0</Ti>       <!-- integrator time -->
      <Td>0.01</Td>    <!-- derivator time -->
      <u_min>-40.0</u_min> <!-- minimum output clamp -->
      <u_max>20.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

<!--
    ================
    Pitch Axis Modes
    ================
-->

<!-- Simple pitch hold -->
  <pid-controller>
    <name>Pitch hold</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/altitude</prop>
      <value>pitch-hold</value>
    </enable>
    <input>
      <prop>/orientation/pitch-deg</prop>
    </input>
    <reference>
      <prop>/autopilot/settings/target-pitch-deg</prop>
    </reference>
    <output>
      <prop>/controls/flight/elevator-trim</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>-0.01</Kp>      <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>10.0</Ti>        <!-- integrator time -->
      <Td>0.000000000001</Td>    <!-- derivator time -->
      <u_min>-1.0</u_min> <!-- minimum output clamp -->
      <u_max>1.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

<!-- Simple angle of attack hold -->
  <pid-controller>
    <name>AOA hold</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/altitude</prop>
      <value>aoa-hold</value>
    </enable>
    <input>
      <prop>/orientation/alpha-deg</prop>
    </input>
    <reference>
      <prop>/autopilot/settings/target-aoa-deg</prop>
    </reference>
    <output>
      <prop>/controls/flight/elevator-trim</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>-0.01</Kp>      <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>10.0</Ti>        <!-- integrator time -->
      <Td>0.000000000001</Td>    <!-- derivator time -->
      <u_min>-1.0</u_min> <!-- minimum output clamp -->
      <u_max>1.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

<!-- Simple Glideslope hold. -->
  <pid-controller>
    <name>Glideslope Hold</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/altitude</prop>
      <value>gs1-hold</value>
    </enable>
    <input>
      <prop>/velocities/vertical-speed-fps</prop>
    </input>
    <reference>
      <prop>/instrumentation/nav[0]/gs-rate-of-climb</prop>
    </reference>
     <output>
      <prop>/controls/flight/elevator-trim</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>-0.009</Kp>      <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>2.0</Ti>       <!-- integrator time -->
      <Td>0.0001</Td>    <!-- derivator time -->
      <u_min>-1.0</u_min> <!-- minimum output clamp -->
      <u_max>1.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

<!--
    ==============
    Velocity Modes
    ==============
-->

<!-- Simple Auto Throttle (KIAS Hold) -->
  <pid-controller>
    <name>Auto Throttle (KIAS Hold)</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/speed</prop>
      <value>speed-with-throttle</value>
    </enable>
    <input>
      <prop>/velocities/airspeed-kt</prop>
    </input>
    <reference>
      <prop>/autopilot/settings/target-speed-kt</prop>
    </reference>
    <output>
      <prop>/controls/engines/engine[0]/throttle</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>0.02</Kp>        <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>20.0</Ti>       <!-- integrator time -->
      <Td>0.00001</Td>    <!-- derivator time -->
      <u_min>0.0</u_min>  <!-- minimum output clamp -->
      <u_max>1.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

<!-- Simple Auto throttle (Mach Hold)-->
  <pid-controller>
    <name>Auto Throttle (Mach Hold)</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/speed</prop>
      <value>mach-with-throttle</value>
    </enable>
    <input>
      <prop>/velocities/mach</prop>
    </input>
    <reference>
      <prop>/autopilot/settings/target-mach</prop>
    </reference>
    <output>
      <prop>/controls/engines/engine[0]/throttle</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>8.0</Kp>        <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>8.0</Ti>       <!-- integrator time -->
      <Td>0.00001</Td>    <!-- derivator time -->
      <u_min>0.0</u_min>  <!-- minimum output clamp -->
      <u_max>1.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

<!-- Hold speed by varying pitch (Two stage cascading controller) -->
  <pid-controller>
    <name>Speed hold (vary pitch) Stage #1</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/speed</prop>
      <value>speed-with-pitch</value>
    </enable>
    <input>
      <prop>/autopilot/internal/lookahead-5-sec-airspeed-kt</prop>
    </input>
    <reference>
      <prop>/autopilot/settings/target-speed-kt</prop>
    </reference>
    <output>
      <prop>/autopilot/settings/target-pitch-deg</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>-1.0</Kp>       <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>1.0</Ti>        <!-- integrator time -->
      <Td>0.00001</Td>    <!-- derivator time -->
      <u_min>-15.0</u_min><!-- minimum output clamp -->
      <u_max>15.0</u_max> <!-- maximum output clamp -->
    </config>
  </pid-controller>

  <pid-controller>
    <name>Speed hold (vary pitch) Stage #2</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/speed</prop>
      <value>speed-with-pitch</value>
    </enable>
    <input>
      <prop>/orientation/pitch-deg</prop>
    </input>
    <reference>
      <prop>/autopilot/settings/target-pitch-deg</prop>
    </reference>
    <output>
      <prop>/controls/flight/elevator-trim</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>-0.05</Kp>      <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>1.0</Ti>        <!-- integrator time -->
      <Td>0.00001</Td>    <!-- derivator time -->
      <u_min>-1.0</u_min> <!-- minimum output clamp -->
      <u_max>1.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

<!--
     =============================================================
     Misc controllers.
     =============================================================
-->

<!-- Auto Speed-brake controller -->
  <pid-controller>
    <name>Auto Speed-brake</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/auto-speed-brake</prop>
      <value>engaged</value>
    </enable>
    <input>
      <prop>/velocities/mach</prop>
    </input>
    <reference>
      <prop>/autopilot/settings/auto-speed-brake-mach</prop>
    </reference>
    <output>
      <prop>/controls/flight/spoilers</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>-100.0</Kp>       <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>2.0</Ti>        <!-- integrator time -->
      <Td>0.00001</Td>    <!-- derivator time -->
      <u_min>-1.0</u_min><!-- minimum output clamp -->
      <u_max>1.0</u_max> <!-- maximum output clamp -->
    </config>
  </pid-controller>

<!-- Simple Ground Roll Rudder Heading Hold -->
  <pid-controller>
    <name>Ground Roll Rudder hold</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/rudder-control</prop>
      <value>gr-rudder-hold</value>
    </enable>
    <input>
      <prop>/orientation/heading-deg</prop>
    </input>
    <reference>
      <prop>/autopilot/settings/target-gr-heading-deg</prop>
    </reference>
    <output>
      <prop>/controls/flight/rudder</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>0.1</Kp>      <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>20.0</Ti>        <!-- integrator time -->
      <Td>0.000000000000000000000000001</Td>    <!-- derivator time -->
      <u_min>-1.0</u_min> <!-- minimum output clamp -->
      <u_max>1.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

<!-- Simple approach AoA-by-speed Hold -->
  <pid-controller>
    <name>Approach AoA-by-speed Hold</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/approach-aoa-hold</prop>
      <value>engaged</value>
    </enable>
    <input>
      <prop>/orientation/alpha-deg</prop>
    </input>
    <reference>
      <prop>/autopilot/settings/target-ap-aoa-deg</prop>
    </reference>
    <output>
      <prop>/autopilot/settings/target-speed-kt</prop>
    </output>
    <config>
      <Ts>0.02</Ts>
      <Kp>-2.0</Kp>      <!-- proportional gain -->
      <beta>1.0</beta>    <!-- input value weighing factor -->
      <alpha>0.1</alpha>  <!-- low pass filter weighing factor -->
      <gamma>0.0</gamma>  <!-- input value weighing factor for -->
                          <!-- unfiltered derivative error -->
      <Ti>8.0</Ti>        <!-- integrator time -->
      <Td>0.000000000000000001</Td>    <!-- derivator time -->
      <u_min>90.0</u_min> <!-- minimum output clamp -->
      <u_max>155.0</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

</PropertyList>
