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

<!-- Citation-X  -->
<PropertyList>

  <!-- =============================== -->
  <!-- ======  Roll Axis Modes  ====== -->
  <!-- =============================== -->
  <pid-simple-controller>
    <name>Wing Leveler (Turn Coordinator based)</name>
    <debug>false</debug>
    <enable>
      <prop>autopilot/locks/heading</prop>
      <value>ROLL</value>
    </enable>
    <input>
      <prop>orientation/roll-deg</prop>
    </input>
    <reference>
      <prop>autopilot/settings/target-roll-deg</prop>
    </reference>
    <output>
      <prop>autopilot/internal/target-roll-deg</prop>
    </output>
    <config>
      <Kp>1.0</Kp>
      <Ki>0.0</Ki>
      <Ti>50.0</Ti>
      <u_min>
        <prop>instrumentation/flightdirector/roll-min</prop>
      </u_min>
      <u_max>
        <prop>instrumentation/flightdirector/roll-max</prop>
      </u_max>
    </config>
  </pid-simple-controller>

  <pi-simple-controller>
    <name>Heading Bug Hold</name>
    <debug>false</debug>
    <enable>
      <prop>autopilot/locks/heading</prop>
      <value>HDG</value>
    </enable>
    <input>
      <prop>autopilot/internal/fdm-heading-bug-error-deg</prop>
    </input>
    <reference>
      <value>0.0</value>
    </reference>
    <output>
      <prop>autopilot/internal/target-roll-deg</prop>
    </output>
    <config>
      <Kp>-1.0</Kp>
      <Ki>0.0</Ki>
      <u_min>
        <prop>instrumentation/flightdirector/roll-min</prop>
      </u_min>
      <u_max>
        <prop>instrumentation/flightdirector/roll-max</prop>
      </u_max>
    </config>
  </pi-simple-controller>

  <pi-simple-controller>
    <name>True Heading Hold</name>
    <debug>false</debug>
    <enable>
      <prop>autopilot/locks/heading</prop>
      <value>LNAV</value>
    </enable>
    <input>
      <prop>autopilot/internal/true-heading-error-deg</prop>
    </input>
    <reference>
      <value>0.0</value>
    </reference>
    <output>
      <prop>autopilot/internal/target-roll-deg</prop>
    </output>
    <config>
      <Kp>-1.0</Kp>
      <Ki>0.0</Ki>
      <u_min>
        <prop>instrumentation/flightdirector/roll-min</prop>
      </u_min>
      <u_max>
        <prop>instrumentation/flightdirector/roll-max</prop>
      </u_max>
    </config>
  </pi-simple-controller>

  <pi-simple-controller>
    <name>Nav1 armed</name>
    <debug>false</debug>
    <enable>
      <prop>autopilot/locks/heading</prop>
      <value>NAV-ARM</value>
    </enable>
    <input>
      <prop>autopilot/internal/fdm-heading-bug-error-deg</prop>
    </input>
    <reference>
      <value>0.0</value>
    </reference>
    <output>
      <prop>autopilot/internal/target-roll-deg</prop>
    </output>
    <config>
      <Kp>-1.0</Kp>
      <Ki>0.0</Ki>
      <u_min>
        <prop>instrumentation/flightdirector/roll-min</prop>
      </u_min>
      <u_max>
        <prop>instrumentation/flightdirector/roll-max</prop>
      </u_max>
    </config>
  </pi-simple-controller>

  <pi-simple-controller>
    <name>Nav1 Hold</name>
    <debug>false</debug>
    <enable>
      <prop>autopilot/locks/heading</prop>
      <value>NAV</value>
    </enable>
    <input>
      <prop>instrumentation/flightdirector/nav-crs-offset</prop>
    </input>
    <reference>
      <value>0.0</value>
    </reference>
    <output>
      <prop>autopilot/internal/target-roll-deg</prop>
    </output>
    <config>
      <Kp>-1.5</Kp>
      <Ki>0.0</Ki>
      <u_min>
        <prop>instrumentation/flightdirector/roll-min</prop>
      </u_min>
      <u_max>
        <prop>instrumentation/flightdirector/roll-max</prop>
      </u_max>
    </config>
  </pi-simple-controller>

  <pi-simple-controller>
    <name>Loc armed</name>
    <debug>false</debug>
    <enable>
      <prop>autopilot/locks/heading</prop>
      <value>LOC-ARM</value>
    </enable>
    <input>
      <prop>autopilot/internal/fdm-heading-bug-error-deg</prop>
    </input>
    <reference>
      <value>0.0</value>
    </reference>
    <output>
      <prop>autopilot/internal/target-roll-deg</prop>
    </output>
    <config>
      <Kp>-1.0</Kp>
      <Ki>0.0</Ki>
      <u_min>
        <prop>instrumentation/flightdirector/roll-min</prop>
      </u_min>
      <u_max>
        <prop>instrumentation/flightdirector/roll-max</prop>
      </u_max>
    </config>
  </pi-simple-controller>

  <pi-simple-controller>
    <name>Loc Hold</name>
    <debug>false</debug>
    <enable>
      <prop>autopilot/locks/heading</prop>
      <value>LOC</value>
    </enable>
    <input>
      <prop>instrumentation/flightdirector/nav-crs-offset</prop>
    </input>
    <reference>
      <value>0.0</value>
    </reference>
    <output>
      <prop>autopilot/internal/target-roll-deg</prop>
    </output>
    <config>
      <Kp>-1.5</Kp>
      <Ki>0.0</Ki>
      <u_min>
        <prop>instrumentation/flightdirector/roll-min</prop>
      </u_min>
      <u_max>
        <prop>instrumentation/flightdirector/roll-max</prop>
      </u_max>
    </config>
  </pi-simple-controller>

  <pid-controller>
    <name>Aileron Control</name>
    <debug>false</debug>
    <enable>
      <prop>autopilot/locks/roll-active</prop>
      <value>true</value>
      <honor-passive>true</honor-passive>
    </enable>
    <input>
      <prop>orientation/roll-deg</prop>
    </input>
    <reference>
      <prop>autopilot/internal/target-roll-deg</prop>
    </reference>
    <output>
      <prop>controls/flight/aileron</prop>
    </output>
    <config>
      <Kp>0.5</Kp>
      <beta>1.0</beta>
      <alpha>0.1</alpha>
      <gamma>0.0</gamma>
      <Ti>1.0</Ti>
      <Td>0.0</Td>
      <u_min>
        <value>-1.0</value>
      </u_min>
      <u_max>
        <value>1.0</value>
      </u_max>
    </config>
  </pid-controller>

  <!-- ================================ -->
  <!-- ======= Pitch Axis Modes ======= -->
  <!-- ================================ -->
  <pid-controller>
    <name>Pitch hold</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/altitude</prop>
      <value>PTCH</value>
      <honor-passive>true</honor-passive>
    </enable>
    <input>
      <prop>/orientation/pitch-deg</prop>
    </input>
    <reference>
      <prop>/autopilot/internal/target-pitch-deg</prop>
    </reference>
    <output>
      <prop>controls/flight/elevator-trim</prop>
    </output>
    <config>
      <Kp>-0.15</Kp>
      <beta>1.0</beta>
      <alpha>0.1</alpha>
      <gamma>0.0</gamma>
      <Ti>20.0</Ti>
      <Td>0.00001</Td>
      <u_min>-0.5</u_min>
      <u_max>0.5</u_max>
    </config>
  </pid-controller>

  <pi-simple-controller>
    <name>Altitude Hold (Altimeter based) Stage 1</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/altitude</prop>
      <value>ALT</value>
    </enable>
    <input>
      <prop>instrumentation/altimeter/indicated-altitude-ft</prop>
    </input>
    <reference>
      <prop>/autopilot/settings/target-altitude-ft</prop>
    </reference>
    <output>
      <prop>/autopilot/internal/target-climb-rate-fps</prop>
    </output>
    <config>
      <Kp>0.1</Kp>
      <Ki>0.0</Ki>
      <u_min>-16.67</u_min>
      <u_max>33.33</u_max>
    </config>
  </pi-simple-controller>

  <pid-controller>
    <name>Altitude Hold</name>
    <debug>false</debug>
    <enable>
      <prop>autopilot/locks/altitude</prop>
      <value>ALT</value>
      <honor-passive>true</honor-passive>
    </enable>
    <input>
      <prop>/velocities/vertical-speed-fps</prop>
    </input>
    <reference>
      <prop>/autopilot/internal/target-climb-rate-fps</prop>
    </reference>
    <output>
      <prop>controls/flight/elevator-trim</prop>
      <prop>controls/flight/elevator</prop>
    </output>
    <config>
      <Kp>-0.01</Kp>
      <beta>1.0</beta>
      <alpha>0.1</alpha>
      <gamma>0.0</gamma>
      <Ti>60.0</Ti>
      <Td>0.00001</Td>
      <u_min>-0.5</u_min>
      <u_max>0.5</u_max>
    </config>
  </pid-controller>

  <pid-controller>
    <name>Glideslop Hold</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/altitude</prop>
      <value>GS</value>
      <honor-passive>true</honor-passive>
    </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>
      <Kp>-0.15</Kp>
      <beta>1.0</beta>
      <alpha>0.1</alpha>
      <gamma>0.0</gamma>
      <Ti>20.0</Ti>
      <Td>0.00001</Td>
      <u_min>-1.0</u_min>
      <u_max>1.0</u_max>
    </config>
  </pid-controller>

  <pid-controller>
    <name>Vertical Speed Hold</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/altitude</prop>
      <value>VS</value>
      <honor-passive>true</honor-passive>
    </enable>
    <input>
      <prop>/velocities/vertical-speed-fps</prop>
    </input>
    <reference>
      <prop>/autopilot/settings/vertical-speed-fpm</prop>
      <scale>0.01667</scale>
    </reference>
    <output>
      <prop>controls/flight/elevator-trim</prop>
    </output>
    <config>
      <Kp>-0.01</Kp>
      <beta>1.0</beta>
      <alpha>0.1</alpha>
      <gamma>0.0</gamma>
      <Ti>20.0</Ti>
      <Td>0.00001</Td>
      <u_min>-0.5</u_min>
      <u_max>0.5</u_max>
    </config>
  </pid-controller>


  <pi-simple-controller>
    <name>VNAV Hold (Altimeter based) Stage 1</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/altitude</prop>
      <value>VNAV</value>
    </enable>
    <input>
      <prop>instrumentation/altimeter/indicated-altitude-ft</prop>
    </input>
    <reference>
      <prop>instrumentation/flightdirector/vnav-alt</prop>
    </reference>
    <output>
      <prop>/autopilot/internal/target-climb-rate-fps</prop>
    </output>
    <config>
      <Kp>0.1</Kp>
      <Ki>0.0</Ki>
      <u_min>-16.67</u_min>
      <u_max>33.33</u_max>
    </config>
  </pi-simple-controller>

  <pid-controller>
    <name>VNAV Hold (Altimeter based) Stage 2</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/altitude</prop>
      <value>VNAV</value>
      <honor-passive>true</honor-passive>
    </enable>
    <input>
      <prop>/velocities/vertical-speed-fps</prop>
    </input>
    <reference>
      <prop>/autopilot/internal/target-climb-rate-fps</prop>
    </reference>
    <output>
      <prop>controls/flight/elevator-trim</prop>
      <prop>controls/flight/elevator</prop>
    </output>
    <config>
      <Kp>-0.01</Kp>
      <beta>1.0</beta>
      <alpha>0.1</alpha>
      <gamma>0.0</gamma>
      <Ti>10.0</Ti>
      <Td>0.00001</Td>
      <u_min>-0.5</u_min>
      <u_max>0.5</u_max>
    </config>
  </pid-controller>

  <pid-controller>
    <name>Yaw Damper</name>
    <debug>false</debug>
    <enable>
      <prop>autopilot/locks/yaw-damper</prop>
      <value>true</value>
      <honor-passive>true</honor-passive>
    </enable>
    <input>
        <prop>orientation/side-slip-deg</prop>
        <scale>-1.0</scale> <!-- change in side-slip sign as reported by yasim, see bug #901 -->
    </input>
    <reference>
      <value>0</value>
    </reference>
    <output>
      <prop>controls/flight/rudder</prop>
    </output>
    <config>
      <Kp>0.05</Kp>
      <beta>1.0</beta>
      <alpha>0.1</alpha>
      <gamma>0.0</gamma>
      <Ti>10.0</Ti>
      <Td>0.02</Td>
      <u_min>-0.25</u_min>
      <u_max>0.25</u_max>
    </config>
  </pid-controller>

  <!--
  ==============
  Velocity Modes
  ==============
  -->
  <!-- Simple Auto throttle -->
  <pid-controller>
    <name>Auto Throttle (kt)</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/speed</prop>
      <value>IAS</value>
      <honor-passive>true</honor-passive>
    </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>
      <prop>/controls/engines/engine[1]/throttle</prop>
      <prop>/controls/engines/engine[2]/throttle</prop>
    </output>
    <config>
      <Kp>0.1</Kp>
      <beta>1.0</beta>
      <alpha>0.1</alpha>
      <gamma>0.0</gamma>
      <Ti>10.0</Ti>
      <Td>0.001</Td>
      <u_min>0.0</u_min>
      <u_max>1.0</u_max>
    </config>
  </pid-controller>

  <pid-controller>
    <name>Auto Throttle (mach)</name>
    <debug>false</debug>
    <enable>
      <prop>/autopilot/locks/speed</prop>
      <value>MACH</value>
      <honor-passive>true</honor-passive>
    </enable>
    <input>
      <prop>/velocities/mach</prop>
    </input>
    <reference>
      <prop>/autopilot/settings/target-mach</prop>
    </reference>
    <output>
      <prop>/controls/engines/engine[0]/throttle</prop>
      <prop>/controls/engines/engine[1]/throttle</prop>
      <prop>/controls/engines/engine[2]/throttle</prop>
    </output>
    <config>
      <Kp>25.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>10.0</Ti>       <!-- integrator time -->
      <Td>0.00001</Td>    <!-- derivator time -->
      <u_min>0.0</u_min>  <!-- minimum output clamp -->
      <u_max>2.2</u_max>  <!-- maximum output clamp -->
    </config>
  </pid-controller>

  <!-- Non-flight related functions
       APU governor -->
  <pi-simple-controller>
    <name>APU governor</name>
    <debug>false</debug>
    <enable>
      <prop>/controls/APU/off-start-run</prop>
      <value>1</value>
    </enable>
    <input>
      <prop>/engines/engine[3]/n1</prop>
    </input>
    <reference>
      <value>100</value>
    </reference>
    <output>
      <prop>/controls/APU/throttle</prop>
    </output>
    <config>
      <Kp>0.6</Kp>
      <Ki>0.0</Ki>
      <u_min>0</u_min>
      <u_max>1</u_max>
    </config>
  </pi-simple-controller>

</PropertyList>
