<commit_before><?xml version="1.0"?>
<!--

  Author:   <NAME>
  Date:     18 August 2002
  Function: C-172 autopilot test file

  Note: this file represents a test only of the new autopilot
        setup in JSBSim. The same components used in the FCS
        can also be used in the autopilot section. There are
        some new FCS input and output identifiers directly
        related to the autopilot:

          ap/elevator_cmd,
          ap/aileron_cmd,
          ap/attitude_hold,
          ap/altitude_hold,
          ap/heading_hold,
          ap/altitude_setpoint,
          ap/heading_setpoint

-->
<autopilot name="C-172X Autopilot">

<!-- INTERFACE PROPERTIES -->

  <property>ap/attitude_hold</property>
  <property>ap/altitude_hold</property>
  <property>ap/heading_hold</property>
  <property>ap/altitude_setpoint</property>
  <property>ap/heading_setpoint</property>
  <property>ap/aileron_cmd</property>
  <property>ap/elevator_cmd</property>
  <property>ap/airspeed_setpoint</property>
  <property>ap/airspeed_hold</property>
  <property>ap/throttle-cmd-norm</property>

<!-- INITIAL GAIN VALUES -->
  
  <property value="0.5"> ap/hdg-roll-err-c1 </property>
  <property value="50.0"> ap/roll-pid-kp </property>
  <property value="5.0"> ap/roll-pid-ki </property>
  <property value="17.0"> ap/roll-pid-kd </property>

  <!--  <property>attitude/sensor/phi-rad</property> -->

<!-- SENSOR -->

  <sensor name="fcs/attitude/sensor/phi-rad">
    <input> attitude/phi-rad </input>
    <lag> 0.5 </lag>
    <delay> 2 </delay>
    <noise variation="PERCENT" distribution="GAUSSIAN"> 0.05 </noise>
    <quantization name="attitude/sensor/quantized/phi-rad">
      <bits> 12 </bits>
      <min> -3.1416 </min>
      <max>  3.1416 </max>
    </quantization>
    <bias> 0.001 </bias>
  </sensor>

<!--
=====================================================
ROLL CHANNEL
=====================================================
-->

<!-- Wing leveler -->

<channel name="Roll wing leveler">

  <switch name="fcs/wing-leveler-ap-on-off">
    <default value="-1"/>
    <test value="0">
      ap/attitude_hold == 1
    </test>
  </switch>

  <pid name="fcs/roll-ap-error-pid">
    <input>attitude/phi-rad</input>
    <kp> ap/roll-pid-kp </kp>
    <ki> ap/roll-pid-ki </ki>
    <kd> ap/roll-pid-kd </kd>
    <trigger> fcs/wing-leveler-ap-on-off </trigger>
  </pid>

  <switch name="fcs/roll-ap-autoswitch">
    <default value="0.0"/>
    <test value="-fcs/roll-ap-error-pid">
      ap/attitude_hold == 1
    </test>
  </switch>

</channel><commit_msg>Moved sensor<commit_after><?xml version="1.0"?>
<!--

  Author:   <NAME>
  Date:     18 August 2002
  Function: C-172 autopilot test file

  Note: this file represents a test only of the new autopilot
        setup in JSBSim. The same components used in the FCS
        can also be used in the autopilot section. There are
        some new FCS input and output identifiers directly
        related to the autopilot:

          ap/elevator_cmd,
          ap/aileron_cmd,
          ap/attitude_hold,
          ap/altitude_hold,
          ap/heading_hold,
          ap/altitude_setpoint,
          ap/heading_setpoint

-->
<autopilot name="C-172X Autopilot">

<!-- INTERFACE PROPERTIES -->

  <property>ap/attitude_hold</property>
  <property>ap/altitude_hold</property>
  <property>ap/heading_hold</property>
  <property>ap/altitude_setpoint</property>
  <property>ap/heading_setpoint</property>
  <property>ap/aileron_cmd</property>
  <property>ap/elevator_cmd</property>
  <property>ap/airspeed_setpoint</property>
  <property>ap/airspeed_hold</property>
  <property>ap/throttle-cmd-norm</property>

<!-- INITIAL GAIN VALUES -->
  
  <property value="0.5"> ap/hdg-roll-err-c1 </property>
  <property value="50.0"> ap/roll-pid-kp </property>
  <property value="5.0"> ap/roll-pid-ki </property>
  <property value="17.0"> ap/roll-pid-kd </property>

  <!--  <property>attitude/sensor/phi-rad</property> -->

<!--
=====================================================
ROLL CHANNEL
=====================================================
-->

<!-- Wing leveler -->

<channel name="Roll wing leveler">

  <sensor name="fcs/attitude/sensor/phi-rad">
    <input> attitude/phi-rad </input>
    <lag> 0.5 </lag>
    <delay> 2 </delay>
    <noise variation="PERCENT" distribution="GAUSSIAN"> 0.05 </noise>
    <quantization name="attitude/sensor/quantized/phi-rad">
      <bits> 12 </bits>
      <min> -3.1416 </min>
      <max>  3.1416 </max>
    </quantization>
    <bias> 0.001 </bias>
  </sensor>

  <switch name="fcs/wing-leveler-ap-on-off">
    <default value="-1"/>
    <test value="0">
      ap/attitude_hold == 1
    </test>
  </switch>

  <pid name="fcs/roll-ap-error-pid">
    <input>attitude/phi-rad</input>
    <kp> ap/roll-pid-kp </kp>
    <ki> ap/roll-pid-ki </ki>
    <kd> ap/roll-pid-kd </kd>
    <trigger> fcs/wing-leveler-ap-on-off </trigger>
  </pid>

  <switch name="fcs/roll-ap-autoswitch">
    <default value="0.0"/>
    <test value="-fcs/roll-ap-error-pid">
      ap/attitude_hold == 1
    </test>
  </switch>

</channel>
{'fraction_non_alphanumeric': 0.2024793388429752, 'fraction_numerical': 0.02085792994883904, 'mean_word_length': 2.9773082942097027, 'pattern_counts': {'":': 0, '<': 170, '<?xml version=': 2, '>': 170, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6854563', 'n_tokens_mistral': 1883, 'n_tokens_neox': 1770, 'n_words': 351}