<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.paparazziuav.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tobias</id>
	<title>PaparazziUAV - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.paparazziuav.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tobias"/>
	<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/wiki/Special:Contributions/Tobias"/>
	<updated>2026-04-30T12:42:46Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Adaptive&amp;diff=19981</id>
		<title>Adaptive</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Adaptive&amp;diff=19981"/>
		<updated>2015-07-03T16:48:06Z</updated>

		<summary type="html">&lt;p&gt;Tobias: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Implementation of stabilization adaptive&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;define name=&amp;quot;USE_ANGLE_REF&amp;quot;/&amp;gt;  &amp;lt;!-- USING ATTITUDE REFERENCE GENERATOR --&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;USE_GYRO_PITCH_RATE&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt; &amp;lt;!--default TRUE--&amp;gt;&lt;br /&gt;
 &amp;lt;!-- &amp;lt;define name=&amp;quot;USE_KFF_UPDATE_ROLL&amp;quot;/&amp;gt; --&amp;gt;&lt;br /&gt;
 &amp;lt;!-- &amp;lt;define name=&amp;quot;USE_KFF_UPDATE_PITCH&amp;quot;/&amp;gt; --&amp;gt; &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;command_laws&amp;gt;&lt;br /&gt;
    &amp;lt;set servo=&amp;quot;MOTOR_LEFT&amp;quot;  value=&amp;quot;@THROTTLE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;set servo=&amp;quot;MOTOR_RIGHT&amp;quot; value=&amp;quot;@THROTTLE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;set servo=&amp;quot;ELEVATOR&amp;quot; value=&amp;quot;@PITCH&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;let var=&amp;quot;roll&amp;quot; value=&amp;quot;@ROLL&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;set servo=&amp;quot;AILERON_LEFT&amp;quot; value=&amp;quot;($roll &amp;gt; 0 ? AILERON_DIFF : 1) * $roll&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;set servo=&amp;quot;AILERON_RIGHT&amp;quot; value=&amp;quot;($roll &amp;gt; 0 ? 1 : AILERON_DIFF) * $roll&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;set servo=&amp;quot;RUDDER&amp;quot; value=&amp;quot;@YAW&amp;quot;/&amp;gt; &amp;lt;!-- with yaw damper active --&amp;gt;&lt;br /&gt;
    &amp;lt;!-- &amp;lt;set servo=&amp;quot;RUDDER&amp;quot; value=&amp;quot;@YAW&amp;quot; + @ROLL&amp;quot;/&amp;gt;--&amp;gt; &amp;lt;!-- without yaw damper --&amp;gt;&lt;br /&gt;
    &amp;lt;set servo=&amp;quot;FLAP_LEFT&amp;quot; value=&amp;quot;@CL&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;set servo=&amp;quot;FLAP_RIGHT&amp;quot; value=&amp;quot;@CL&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/command_laws&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;section name=&amp;quot;AUTO1&amp;quot; prefix=&amp;quot;AUTO1_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MAX_ROLL&amp;quot; value=&amp;quot;RadOfDeg(60)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MAX_PITCH&amp;quot; value=&amp;quot;RadOfDeg(30)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MAX_YAW_RATE&amp;quot; value=&amp;quot;RadOfDeg(100)&amp;quot;/&amp;gt; &amp;lt;!-- rad/s for yaw damper--&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;section name=&amp;quot;HORIZONTAL CONTROL&amp;quot; prefix=&amp;quot;H_CTL_&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;COURSE_PGAIN&amp;quot; value=&amp;quot;0.8&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;COURSE_DGAIN&amp;quot; value=&amp;quot;0.3&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_MAX_SETPOINT&amp;quot; value=&amp;quot;50&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_ATTITUDE_GAIN&amp;quot; value=&amp;quot;7400.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_RATE_GAIN&amp;quot; value=&amp;quot;200.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_IGAIN&amp;quot; value=&amp;quot;100.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_KFFA&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_KFFD&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_MAX_SETPOINT&amp;quot; value=&amp;quot;30&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_MIN_SETPOINT&amp;quot; value=&amp;quot;-30&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_PGAIN&amp;quot; value=&amp;quot;8000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_DGAIN&amp;quot; value=&amp;quot;0.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_IGAIN&amp;quot; value=&amp;quot;100.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_KFFA&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_KFFD&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_OF_ROLL&amp;quot; value=&amp;quot;0.03&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AILERON_OF_THROTTLE&amp;quot; value=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_LOOP&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_TRIM_NY&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_DGAIN&amp;quot; value=&amp;quot;5000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_NY_IGAIN&amp;quot; value=&amp;quot;5000.&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_LOOP&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_LOOP_USE_AIRSPEED_SETPOINT&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_LOOP_INCREASE_FLAPS_WITH_LOADFACTOR&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_FLAPS_STALL&amp;quot; value=&amp;quot;0.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_FLAPS_NOMINAL&amp;quot; value=&amp;quot;0.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_FLAPS_RACE&amp;quot; value=&amp;quot;-0.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_DEADBAND&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Tobias</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=EnergyControl&amp;diff=19980</id>
		<title>EnergyControl</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=EnergyControl&amp;diff=19980"/>
		<updated>2015-07-03T13:19:18Z</updated>

		<summary type="html">&lt;p&gt;Tobias: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some more info [[http://paparazzi.github.com/docs/latest/energy__ctrl_8c.html#details| Doxygen]]&lt;br /&gt;
&lt;br /&gt;
Total Energy (speed + height) control for fixed wing vehicles.&lt;br /&gt;
An airspeed sensor is mandatory!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
implementation of guidance energy&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;section name=&amp;quot;VERTICAL CONTROL&amp;quot; prefix=&amp;quot;V_CTL_&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;GLIDE_RATIO&amp;quot; value=&amp;quot;8.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;POWER_CTL_BAT_NOMINAL&amp;quot; value=&amp;quot;11.1&amp;quot; unit=&amp;quot;volt&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MAX_ACCELERATION&amp;quot; value=&amp;quot;0.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;THROTTLE_SLEW_LIMITER&amp;quot; value=&amp;quot;1.&amp;quot; unit=&amp;quot;s&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ALTITUDE_PGAIN&amp;quot; value=&amp;quot;0.13&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ALTITUDE_MAX_CLIMB&amp;quot; value=&amp;quot;2.&amp;quot;/&amp;gt; &amp;lt;!--default 2--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE&amp;quot; value=&amp;quot;0.3&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_NOMINAL_CRUISE_PITCH&amp;quot; value=&amp;quot;0.&amp;quot;/&amp;gt; &amp;lt;!-- default 0 --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT&amp;quot; value=&amp;quot;0.1&amp;quot; unit=&amp;quot;%/(m/s)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_PITCH_OF_VZ_PGAIN&amp;quot; value=&amp;quot;0.15&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AIRSPEED_PGAIN&amp;quot; value=&amp;quot;0.6&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_OF_AIRSPEED_PGAIN&amp;quot; value=&amp;quot;0.069&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_OF_AIRSPEED_IGAIN&amp;quot; value=&amp;quot;0.01&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_OF_AIRSPEED_PGAIN&amp;quot; value=&amp;quot;0.01&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_OF_AIRSPEED_IGAIN&amp;quot; value=&amp;quot;0.003&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_OF_AIRSPEED_DGAIN&amp;quot; value=&amp;quot;0.03&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ENERGY_TOT_PGAIN&amp;quot; value=&amp;quot;0.3&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ENERGY_TOT_IGAIN&amp;quot; value=&amp;quot;0.05&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ENERGY_DIFF_PGAIN&amp;quot; value=&amp;quot;0.4&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ENERGY_DIFF_IGAIN&amp;quot; value=&amp;quot;0.01&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_GROUNDSPEED_SETPOINT&amp;quot; value=&amp;quot;6.0&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_GROUNDSPEED_PGAIN&amp;quot; value=&amp;quot;0.75&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_GROUNDSPEED_IGAIN&amp;quot; value=&amp;quot;0.25&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
schematics for guidance energy. They represent only the main part for a better over view. Not included are any kind of safety functions.&lt;br /&gt;
&lt;br /&gt;
[[Image:Energycontrol.png|Energy Control loop]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Very Quick I'm feeling Lucky Tuning Manual ==&lt;br /&gt;
&lt;br /&gt;
Start with:&lt;br /&gt;
&lt;br /&gt;
=== outerloop: ===&lt;br /&gt;
&lt;br /&gt;
* '''alt-pgain''' about 0.1 &lt;br /&gt;
* '''speed-pgain''' about 0.2&lt;br /&gt;
&lt;br /&gt;
=== innerloop: ===&lt;br /&gt;
&lt;br /&gt;
* '''airspeed sp''' -&amp;gt; make sure it is OK&lt;br /&gt;
* '''cruise_throttle''' -&amp;gt; your preferred initial cruise throttle: 0.6 ? (this is overruled/adapted by the tot_en_i-gain)&lt;br /&gt;
* '''cruise pitch''' -&amp;gt; zero or your preferred initial cruise pitch (this is overruled/adapted by the dis_en_i-gain)&lt;br /&gt;
&lt;br /&gt;
* '''P_en_tot'''  -&amp;gt; 20% of slider&lt;br /&gt;
* '''I_en_tot'''  -&amp;gt; 20% of slider&lt;br /&gt;
* '''P_en_dis'''  -&amp;gt; 20% of slider&lt;br /&gt;
* '''I_en_dis'''  -&amp;gt; 20% of slider&lt;br /&gt;
&lt;br /&gt;
== More Step By Step ==&lt;br /&gt;
&lt;br /&gt;
To allow nice step by step tuning with less risk, I recommend to start with the integrators set to zero. &lt;br /&gt;
&lt;br /&gt;
If you do not thrust your airspeed or IMU you might even start with all '''en_tot''' en '''en_dis''' gains set to zero but with the '''throttle_incr''' gain set to about 0.1 and the '''pitch_of_vz''' set to also about 0.1 to turn it into a traditional old-style fixedwing outerloop (without airspeed). &lt;br /&gt;
&lt;br /&gt;
A next possible step is to add a very small bit of '''I_th_air'''. This will slowly adapt the cruise throttle to get the correct average airspeed.&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
incomplete ...&lt;/div&gt;</summary>
		<author><name>Tobias</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Adaptive&amp;diff=19979</id>
		<title>Adaptive</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Adaptive&amp;diff=19979"/>
		<updated>2015-07-03T13:03:02Z</updated>

		<summary type="html">&lt;p&gt;Tobias: /* A */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Implementation of stabilization adaptive&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;HORIZONTAL CONTROL&amp;quot; prefix=&amp;quot;H_CTL_&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;COURSE_PGAIN&amp;quot; value=&amp;quot;0.8&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;COURSE_DGAIN&amp;quot; value=&amp;quot;0.3&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_MAX_SETPOINT&amp;quot; value=&amp;quot;50&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_ATTITUDE_GAIN&amp;quot; value=&amp;quot;7400.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_RATE_GAIN&amp;quot; value=&amp;quot;200.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_IGAIN&amp;quot; value=&amp;quot;100.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_KFFA&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_KFFD&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_MAX_SETPOINT&amp;quot; value=&amp;quot;30&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_MIN_SETPOINT&amp;quot; value=&amp;quot;-30&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_PGAIN&amp;quot; value=&amp;quot;8000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_DGAIN&amp;quot; value=&amp;quot;0.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_IGAIN&amp;quot; value=&amp;quot;100.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_KFFA&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_KFFD&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_OF_ROLL&amp;quot; value=&amp;quot;0.03&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AILERON_OF_THROTTLE&amp;quot; value=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_LOOP&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_TRIM_NY&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_DGAIN&amp;quot; value=&amp;quot;5000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_NY_IGAIN&amp;quot; value=&amp;quot;5000.&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_LOOP&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_LOOP_USE_AIRSPEED_SETPOINT&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_LOOP_INCREASE_FLAPS_WITH_LOADFACTOR&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_FLAPS_STALL&amp;quot; value=&amp;quot;0.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_FLAPS_NOMINAL&amp;quot; value=&amp;quot;0.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_FLAPS_RACE&amp;quot; value=&amp;quot;-0.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_DEADBAND&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Tobias</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Adaptive&amp;diff=19978</id>
		<title>Adaptive</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Adaptive&amp;diff=19978"/>
		<updated>2015-07-03T13:02:42Z</updated>

		<summary type="html">&lt;p&gt;Tobias: Created page with &amp;quot;Implementation of stabilization adaptive  === A ===  {{Box Code|conf/airframes/myplane.xml| &amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;   &amp;lt;section name=&amp;quot;HORIZONTAL CONTROL&amp;quot; prefix=&amp;quot;H_CTL_&amp;quot;&amp;gt;      &amp;lt;def...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Implementation of stabilization adaptive&lt;br /&gt;
&lt;br /&gt;
=== A ===&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;HORIZONTAL CONTROL&amp;quot; prefix=&amp;quot;H_CTL_&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;COURSE_PGAIN&amp;quot; value=&amp;quot;0.8&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;COURSE_DGAIN&amp;quot; value=&amp;quot;0.3&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_MAX_SETPOINT&amp;quot; value=&amp;quot;50&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_ATTITUDE_GAIN&amp;quot; value=&amp;quot;7400.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_RATE_GAIN&amp;quot; value=&amp;quot;200.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_IGAIN&amp;quot; value=&amp;quot;100.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_KFFA&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_KFFD&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_MAX_SETPOINT&amp;quot; value=&amp;quot;30&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_MIN_SETPOINT&amp;quot; value=&amp;quot;-30&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_PGAIN&amp;quot; value=&amp;quot;8000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_DGAIN&amp;quot; value=&amp;quot;0.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_IGAIN&amp;quot; value=&amp;quot;100.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_KFFA&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_KFFD&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_OF_ROLL&amp;quot; value=&amp;quot;0.03&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AILERON_OF_THROTTLE&amp;quot; value=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_LOOP&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_TRIM_NY&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_DGAIN&amp;quot; value=&amp;quot;5000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_NY_IGAIN&amp;quot; value=&amp;quot;5000.&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_LOOP&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_LOOP_USE_AIRSPEED_SETPOINT&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_LOOP_INCREASE_FLAPS_WITH_LOADFACTOR&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_FLAPS_STALL&amp;quot; value=&amp;quot;0.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_FLAPS_NOMINAL&amp;quot; value=&amp;quot;0.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_FLAPS_RACE&amp;quot; value=&amp;quot;-0.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CL_DEADBAND&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Tobias</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Fixedwing_Configuration&amp;diff=19977</id>
		<title>Fixedwing Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Fixedwing_Configuration&amp;diff=19977"/>
		<updated>2015-07-03T12:54:49Z</updated>

		<summary type="html">&lt;p&gt;Tobias: /* Control loops */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Airframe_Configuration&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
This page describes configuration options &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;lt;b&amp;gt;specific to the fixedwing firmware&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt; in the [[Airframe_Configuration|airframe file]].&lt;br /&gt;
== Firmware and Hardware definitions ==&lt;br /&gt;
&lt;br /&gt;
=== Select your Board ===&lt;br /&gt;
Make sure you use the &amp;lt;b&amp;gt;fixedwing [[Airframe_Configuration#Firmware|firmware]]&amp;lt;/b&amp;gt; and choose the correct board, e.g.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;sim&amp;quot; 	board=&amp;quot;pc&amp;quot;/&amp;gt;       &amp;lt;!-- For simulation --&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot; 	board=&amp;quot;lisa_m_2.0&amp;quot;/&amp;gt; &amp;lt;!-- Select your board here --&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The ap board name can be found in /conf/boards.&lt;br /&gt;
&lt;br /&gt;
=== Attitude and Heading Reference System (AHRS) ===&lt;br /&gt;
&lt;br /&gt;
Next the filter for attitude estimation needs to be selected, where&lt;br /&gt;
the tratidtional approach is to use infrared sensors (see blow).&lt;br /&gt;
To select the type of [[Subsystem/ahrs|AHRS]] use the subsystem-tag as follows:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot;  board=&amp;quot;tiny_2.11&amp;quot;/&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ahrs&amp;quot; type=&amp;quot;int_cmpl_quat&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Infrared Sensors ====&lt;br /&gt;
To use the IR sensors for attitude estimation add the infrared module and ahrs infrared subsystem:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot;  board=&amp;quot;tiny_2.11&amp;quot;/&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ahrs&amp;quot; type=&amp;quot;infrared&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
  &amp;lt;modules&amp;gt;&lt;br /&gt;
    &amp;lt;load name=&amp;quot;infrared_adc.xml&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/modules&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See the [[Module/infrared|infrared module page]] for more details on configuration.&lt;br /&gt;
&lt;br /&gt;
=== Control loops ===&lt;br /&gt;
&lt;br /&gt;
The [[Subsystem/control|control loops]] can be divided in two independent groups: &lt;br /&gt;
&lt;br /&gt;
* stabilization &lt;br /&gt;
* guidance&lt;br /&gt;
&lt;br /&gt;
stabilization is the part that is given a pitch and a roll angle (desired) and calculates a respective elevator or aileron deflection to reach the desired angle&lt;br /&gt;
&lt;br /&gt;
this part is always used when engaging Auto1 or Auto2&lt;br /&gt;
&lt;br /&gt;
in Auto1 the desired angles are generated by the RC transmitter&lt;br /&gt;
&lt;br /&gt;
in Auto2 the desired angles are generated by the respective guidance loops&lt;br /&gt;
&lt;br /&gt;
files can be found in sw/airborne/firmwares/fixedwing/stabilization/xxx.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
guidance is the part on top of stabilization that calculates the desired pitch and roll angle, taking into account the desired altitude / climb reqirement from the flight plan or the airspeed for example&lt;br /&gt;
&lt;br /&gt;
only used when in Auto2&lt;br /&gt;
&lt;br /&gt;
files can be found in sw/airborne/firmwares/fixedwing/guidance/xxx.c&lt;br /&gt;
&lt;br /&gt;
Just specify the appropriate subsystem in your firmware section. &lt;br /&gt;
&lt;br /&gt;
Currently you can choose between:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! type !! stabilization !! guidance !! description&lt;br /&gt;
|-&lt;br /&gt;
| - || attitude || v || &lt;br /&gt;
|-&lt;br /&gt;
| adaptive || adaptive || v || &lt;br /&gt;
|-&lt;br /&gt;
| new || adaptive || v_n || &lt;br /&gt;
|-&lt;br /&gt;
| energy || attitude || [[EnergyControl|energy]] || &lt;br /&gt;
|-&lt;br /&gt;
| energyadaptie || adaptive || [[EnergyControl|energy]] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot; board=&amp;quot;tiny_2.11&amp;quot;/&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;control&amp;quot; /&amp;gt;  &amp;lt;!-- Standard fixed wing control loops --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Different control loop types can be enabled instead (Use only one) --&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;control&amp;quot; type=&amp;quot;adaptive&amp;quot;/&amp;gt;  &amp;lt;!-- fixed wing control loops with adaptive horizontal control, standard vertical control --&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;control&amp;quot; type=&amp;quot;new&amp;quot;/&amp;gt;       &amp;lt;!-- new fixed wing control loops with merged auto pitch and auto throttle, adaptive horizontal control --&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;control&amp;quot; type=&amp;quot;energy&amp;quot;/&amp;gt;    &amp;lt;!-- Since v4.1.0 --&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;control&amp;quot; type=&amp;quot;energyadaptive&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== XML Parameters ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Manual ===&lt;br /&gt;
The &amp;lt;tt&amp;gt;rc_command&amp;lt;/tt&amp;gt; sections links the channels of the RC transmitter (defined in the [[Radio_Control|Radio Control]] file) to the &amp;lt;tt&amp;gt;commands&amp;lt;/tt&amp;gt; defined above:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;rc_commands&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;THROTTLE&amp;quot; value=&amp;quot;@THROTTLE&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;ROLL&amp;quot;     value=&amp;quot;@ROLL&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;PITCH&amp;quot;    value=&amp;quot;@PITCH&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/rc_commands&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This example looks trivial since the channel values have the same name than the commands.&lt;br /&gt;
&lt;br /&gt;
=== RC commands in Auto ===&lt;br /&gt;
To control servos or other servo signal compatible devices by RC in Auto1 or Auto2, define them in the &amp;lt;auto_rc_commands&amp;gt; section.&lt;br /&gt;
If you have an airframe with a dedicated rudder (YAW channel) then it is still controllable in auto mode via RC. This is the default behavior and is equivalent to setting the YAW command in auto_rc_commands:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;auto_rc_commands&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;YAW&amp;quot; value=&amp;quot;@YAW&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/auto_rc_commands&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To disable this behavior (meaning no RC control of the rudder in auto) define an empty auto_rc_commands section:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;auto_rc_commands&amp;gt;&lt;br /&gt;
 &amp;lt;/auto_rc_commands&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Autopilot Only Commands ===&lt;br /&gt;
For certain missions it might be required to control servos (payload) from the autopilot (gcs) at all times (even during manual flight). These commands should not be in the &amp;lt;rc_commands&amp;gt; block but in the special &amp;lt;ap_only_commands&amp;gt; block. This allows for instance the pantilt operator to keep working when in manual flight, or safety logic to automatically close cameras below a certain altitude during manual landings.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;ap_only_commands&amp;gt;&lt;br /&gt;
   &amp;lt;copy command=&amp;quot;PAN&amp;quot;   /&amp;gt;&lt;br /&gt;
   &amp;lt;copy command=&amp;quot;TILT&amp;quot;  /&amp;gt;&lt;br /&gt;
   &amp;lt;copy command=&amp;quot;SHOOT&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/ap_only_commands&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Auto1 ===&lt;br /&gt;
The next section, named &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;AUTO1&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;, gives the maximum roll and pitch (in radians) allowed for the augmented stability mode.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;AUTO1&amp;quot; prefix=&amp;quot;AUTO1_&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_ROLL&amp;quot;  value=&amp;quot;35&amp;quot; unit=&amp;quot;deg&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_PITCH&amp;quot; value=&amp;quot;5&amp;quot;  unit=&amp;quot;deg&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE'': [[Units|automatic unit conversion]] using &amp;lt;tt&amp;gt;unit=&amp;quot;deg&amp;quot;&amp;lt;/tt&amp;gt; is supported since v3.9, if you have an older version set it in radians or using &amp;lt;tt&amp;gt;value=&amp;quot;RadOfDeg(35)&amp;quot;&amp;lt;/tt&amp;gt;&lt;br /&gt;
=== Infrared === &lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;INFRARED&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section describes the configuration of the infrared sensors. For additional configuration to change the defaults, see the [[Module/infrared|infrared module page]].&lt;br /&gt;
&lt;br /&gt;
The only mandatory definitions are the sensor neutral readings and how the IR sensors are mounted.&lt;br /&gt;
&lt;br /&gt;
The electronic neutral of the sensors (a sensor here is a '''pair''' of thermopiles). A perfect sensor should give 512 if it measures the same value on both sides.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;INFRARED&amp;quot; prefix=&amp;quot;IR_&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_IR1_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_IR2_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_TOP_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;HORIZ_SENSOR_ALIGNED&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
These neutrals are tuned with the &amp;quot;cupboard test&amp;quot;: Put the sensor in a close box (a cupboard) and read the values of the IR_SENSORS message (ir1, ir2 and vertical). Set the neutrals (they are subtracted from the measurement) to get null values. E.g. if you read 5 for the ir1 value with ADC_IR1_NEUTRAL equal to 512, change the latter to 517.&lt;br /&gt;
&lt;br /&gt;
In the example above the horizontal sensor is connected to the airframe in ''aligned'' orientation. The other possibility is ''tilted''.&lt;br /&gt;
Define either&lt;br /&gt;
* '''HORIZ_SENSOR_ALIGNED''': ir1 is along the lateral axis (The axis that passes through the plane from wingtip to wingtip) and ir2 along the longitudinal one.&lt;br /&gt;
or&lt;br /&gt;
* '''HORIZ_SENSOR_TILTED''': the sensors are tilted by 45 degrees; ir1 is along rear-left -- front-right, and ir2 along rear-right -- front-left.&lt;br /&gt;
If the airframe construction allows choose an aligned sensor orientation since this gives the best stabilization response results.&lt;br /&gt;
&lt;br /&gt;
=== Gyro ===&lt;br /&gt;
'''This section only applies to versions prior to v3.9 when using a gyro with IR sensors.'''&lt;br /&gt;
Defines the type of gyro installed, each axis neutral, and any required temperature compensation. If the gyro has two axes, the pitch neutral is defined as well. Many gyros output their internal temperature and require a temperature-dependent linear correction be made to the neutral value.  No correction is done for the temperature in this example.(&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;ADC_TEMP_SLOPE=0&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;GYRO&amp;quot; prefix=&amp;quot;GYRO_&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_ROLL_COEFF&amp;quot;   value=&amp;quot;1&amp;quot;   /&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ROLL_NEUTRAL&amp;quot;     value=&amp;quot;500&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_TEMP_NEUTRAL&amp;quot; value=&amp;quot;476&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_TEMP_SLOPE&amp;quot;   value=&amp;quot;0&amp;quot;   /&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Horizontal Control ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;HORIZONTAL CONTROL&amp;quot; prefix=&amp;quot;H_CTL_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;COURSE_PGAIN&amp;quot;       value=&amp;quot;0.4&amp;quot;   /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_MAX_SETPOINT&amp;quot;  value=&amp;quot;20&amp;quot;    unit=&amp;quot;deg&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_ATTITUDE_GAIN&amp;quot; value=&amp;quot;7500.&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_RATE_GAIN&amp;quot;     value=&amp;quot;1500&amp;quot;  /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_PGAIN&amp;quot;        value=&amp;quot;8000.&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ELEVATOR_OF_ROLL&amp;quot;   value=&amp;quot;1250&amp;quot;  /&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The outer loop acts on the route. It will produce a roll command from a course setpoint and a course measurement. The COURSE_PGAIN parameter is the factor multiplied by the course error (in radian) to get a roll setpoint (in radian). So if the plane is expected to go north (course=0) and is actually flying to 57 degrees (course=1 radian, i.e. ENE), with a gain of '''0.4''', a roll of -0.4 (-23 degrees) will be set for the lower control loop.&lt;br /&gt;
&lt;br /&gt;
The ROLL_ATTITUDE_GAIN is used to compute a ROLL command from the roll error (setpoint minus measurement). If a gyro in installed, the ROLL_RATE_GAIN to keep a null roll rate. So these two gains provide a P-D controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''IMPORTANT''': Previous to v3.9 some of the gains need to be set with a '''negative sign''': ''COURSE_PGAIN'', ''ROLL_ATTITUDE_GAIN'', ''ROLL_RATE_GAIN'', ''PITCH_PGAIN''&lt;br /&gt;
&lt;br /&gt;
''NOTE'': [[Units|automatic unit conversion]] using &amp;lt;tt&amp;gt;unit=&amp;quot;deg&amp;quot;&amp;lt;/tt&amp;gt; is supported since v3.9, if you have an older version set it in radians or using &amp;lt;tt&amp;gt;value=&amp;quot;RadOfDeg(20)&amp;quot;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[Control_Loops#Fixed-wing_autopilot|graphical representation of the control loops]] can help you to visualize the effect of each gain.&lt;br /&gt;
&lt;br /&gt;
===Vertical Control===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;VERTICAL CONTROL&amp;quot; prefix=&amp;quot;V_CTL_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- outer loop proportional gain --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ALTITUDE_PGAIN&amp;quot;     value=&amp;quot;0.1&amp;quot; unit=&amp;quot;(m/s)/m&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;!-- outer loop saturation --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ALTITUDE_MAX_CLIMB&amp;quot; value=&amp;quot;3.&amp;quot;  unit=&amp;quot;m/s&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
These lines are associated with vertical control loops contained in sw/airborne/firmwares/fixedwing/guidance/guidance_v.c.  These are outer loop parameters that calculate a desired climb rate based on altitude error. Here, if the altitude error is 10m, the climb setpoint will be set to 1m/s. ALTITUDE_MAX_CLIMB is a bounded value (in m/s) so that the outer loop does not calculate too large of a climb rate&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE&amp;quot; value=&amp;quot;0.65&amp;quot; unit=&amp;quot;%&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_MIN_CRUISE_THROTTLE&amp;quot;     value=&amp;quot;.4&amp;quot;   unit=&amp;quot;%&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_MAX_CRUISE_THROTTLE&amp;quot;     value=&amp;quot;1&amp;quot;    unit=&amp;quot;%&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_LOITER_TRIM&amp;quot;  value=&amp;quot;1000&amp;quot;  unit=&amp;quot;pprz_t&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_DASH_TRIM&amp;quot;    value=&amp;quot;-2500&amp;quot; unit=&amp;quot;pprz_t&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_PGAIN&amp;quot; value=&amp;quot;0.008&amp;quot; unit=&amp;quot;%/(m/s)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_IGAIN&amp;quot; value=&amp;quot;0.25&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_PITCH_OF_VZ_PGAIN&amp;quot;        value=&amp;quot;0.35&amp;quot; unit=&amp;quot;rad/(m/s)&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT&amp;quot; value=&amp;quot;0.15&amp;quot; unit=&amp;quot;%/(m/s)&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These lines are associated with vertical rate control loops contained in sw/airborne/firmwares/fixedwing/guidance/guidance_v.c and are used by default in most cases.  The default vertical control law is for the vertical rate to be managed by a combination of throttle and pitch.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_PGAIN&amp;quot; value=&amp;quot;0.1&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_IGAIN&amp;quot; value=&amp;quot;0.025&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_MAX_PITCH&amp;quot; value=&amp;quot;30&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_MIN_PITCH&amp;quot; value=&amp;quot;30&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
These lines are associated with vertical control loops contained in sw/airborne/firmwares/fixedwing/guidance/guidance_v.c but are not used in default. The non-default vertical control law is for the vertical rate to be managed by the pitch.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;THROTTLE_SLEW_LIMITER&amp;quot; value=&amp;quot;2&amp;quot; unit=&amp;quot;s&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
THROTTLE_SLEW_LIMITER is the required time is seconds to change throttle from 0% to 100%.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''IMPORTANT''': Previous to v3.9 some of the gains need to be set with a '''negative sign''': ''ALTITUDE_PGAIN'', ''AUTO_THROTTLE_PGAIN'', ''AUTO_PITCH_PGAIN'', ''''&lt;br /&gt;
&lt;br /&gt;
''NOTE'': [[Units|automatic unit conversion]] using &amp;lt;tt&amp;gt;unit=&amp;quot;deg&amp;quot;&amp;lt;/tt&amp;gt; is supported since v3.9, if you have an older version set it in radians or using &amp;lt;tt&amp;gt;value=&amp;quot;RadOfDeg(20)&amp;quot;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[Control_Loops#Fixed-wing_autopilot|graphical representation of the control loops]] can help you to visualize the effect of each gain.&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;NOMINAL_AIRSPEED&amp;quot;    value =&amp;quot;12.0&amp;quot; unit=&amp;quot;m/s&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CONTROL_RATE&amp;quot;        value=&amp;quot;60&amp;quot;    unit=&amp;quot;Hz&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CARROT&amp;quot;              value=&amp;quot;5.0&amp;quot;   unit=&amp;quot;s&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;KILL_MODE_DISTANCE&amp;quot;  value=&amp;quot;(1.5*MAX_DIST_FROM_HOME)&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* The &amp;quot;NOMINAL_AIRSPEED&amp;quot; is mainly used in the simulator.&lt;br /&gt;
* &amp;quot;CARROT&amp;quot; gives the distance (in seconds, so ground speed is taken into account) between the carrot and the aircraft.&lt;br /&gt;
* &amp;quot;KILL_MODE_DISTANCE&amp;quot; is the threshold distance to switch the autopilot into KILL mode (defined descent with no throttle)&lt;br /&gt;
* &amp;quot;CONTROL_RATE&amp;quot; is the rate of the low level control loops in Hertz (60 or 20).&lt;br /&gt;
&lt;br /&gt;
=== Simu ===&lt;br /&gt;
Values from this section can be used to tweak the software in the loop (SITL) simulation.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;SIMU&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;WEIGHT&amp;quot; value =&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;YAW_RESPONSE_FACTOR&amp;quot;  value =&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ROLL_RESPONSE_FACTOR&amp;quot; value =&amp;quot;15.&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;quot;YAW_RESPONSE_FACTOR&amp;quot; adapts the aircraft's turn rate corresponding to a bank angle; a larger value increases the turn radius&lt;br /&gt;
* &amp;quot;ROLL_RESPONSE_FACTOR&amp;quot; is basically your aileron efficiency; a higher value increases roll agility&lt;br /&gt;
&lt;br /&gt;
If you want to use JSBSim as SITL simulator, you have to make some definitions in this section as well; see [[Simulation#JSBSim|here]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:User_Documentation]] [[Category:Airframe_Configuration]]&lt;/div&gt;</summary>
		<author><name>Tobias</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Fixedwing_Configuration&amp;diff=19975</id>
		<title>Fixedwing Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Fixedwing_Configuration&amp;diff=19975"/>
		<updated>2015-07-03T12:11:51Z</updated>

		<summary type="html">&lt;p&gt;Tobias: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Airframe_Configuration&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
This page describes configuration options &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;lt;b&amp;gt;specific to the fixedwing firmware&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt; in the [[Airframe_Configuration|airframe file]].&lt;br /&gt;
== Firmware and Hardware definitions ==&lt;br /&gt;
&lt;br /&gt;
=== Select your Board ===&lt;br /&gt;
Make sure you use the &amp;lt;b&amp;gt;fixedwing [[Airframe_Configuration#Firmware|firmware]]&amp;lt;/b&amp;gt; and choose the correct board, e.g.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;sim&amp;quot; 	board=&amp;quot;pc&amp;quot;/&amp;gt;       &amp;lt;!-- For simulation --&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot; 	board=&amp;quot;lisa_m_2.0&amp;quot;/&amp;gt; &amp;lt;!-- Select your board here --&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The ap board name can be found in /conf/boards.&lt;br /&gt;
&lt;br /&gt;
=== Attitude and Heading Reference System (AHRS) ===&lt;br /&gt;
&lt;br /&gt;
Next the filter for attitude estimation needs to be selected, where&lt;br /&gt;
the tratidtional approach is to use infrared sensors (see blow).&lt;br /&gt;
To select the type of [[Subsystem/ahrs|AHRS]] use the subsystem-tag as follows:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot;  board=&amp;quot;tiny_2.11&amp;quot;/&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ahrs&amp;quot; type=&amp;quot;int_cmpl_quat&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Infrared Sensors ====&lt;br /&gt;
To use the IR sensors for attitude estimation add the infrared module and ahrs infrared subsystem:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot;  board=&amp;quot;tiny_2.11&amp;quot;/&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ahrs&amp;quot; type=&amp;quot;infrared&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
  &amp;lt;modules&amp;gt;&lt;br /&gt;
    &amp;lt;load name=&amp;quot;infrared_adc.xml&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/modules&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See the [[Module/infrared|infrared module page]] for more details on configuration.&lt;br /&gt;
&lt;br /&gt;
=== Control loops ===&lt;br /&gt;
&lt;br /&gt;
The [[Control_Loops#Fixed-wing_autopilot|control loops]] can be divided in two independent groups: &lt;br /&gt;
&lt;br /&gt;
* stabilization &lt;br /&gt;
* guidance&lt;br /&gt;
&lt;br /&gt;
stabilization is the part that is given a pitch and a roll angle (desired) and calculates a respective elevator or aileron deflection to reach the desired angle&lt;br /&gt;
&lt;br /&gt;
this part is always used when engaging Auto1 or Auto2&lt;br /&gt;
&lt;br /&gt;
in Auto1 the desired angles are generated by the RC transmitter&lt;br /&gt;
&lt;br /&gt;
in Auto2 the desired angles are generated by the respective guidance loops&lt;br /&gt;
&lt;br /&gt;
files can be found in sw/airborne/firmwares/fixedwing/stabilization/xxx.c&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
guidance is the part on top of stabilization that calculates the desired pitch and roll angle, taking into account the desired altitude / climb reqirement from the flight plan or the airspeed for example&lt;br /&gt;
&lt;br /&gt;
only used when in Auto2&lt;br /&gt;
&lt;br /&gt;
files can be found in sw/airborne/firmwares/fixedwing/guidance/xxx.c&lt;br /&gt;
&lt;br /&gt;
Just specify the appropriate subsystem in your firmware section. &lt;br /&gt;
&lt;br /&gt;
Currently you can choose between:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! type !! stabilization !! guidance !! description&lt;br /&gt;
|-&lt;br /&gt;
| - || attitude || v || &lt;br /&gt;
|-&lt;br /&gt;
| adaptive || adaptive || v || &lt;br /&gt;
|-&lt;br /&gt;
| new || adaptive || v_n || &lt;br /&gt;
|-&lt;br /&gt;
| energy || attitude || [[EnergyControl|energy]] || &lt;br /&gt;
|-&lt;br /&gt;
| energyadaptie || adaptive || [[EnergyControl|energy]] || &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot; board=&amp;quot;tiny_2.11&amp;quot;/&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;control&amp;quot; /&amp;gt;  &amp;lt;!-- Standard fixed wing control loops --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- Different control loop types can be enabled instead (Use only one) --&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;control&amp;quot; type=&amp;quot;adaptive&amp;quot;/&amp;gt;  &amp;lt;!-- fixed wing control loops with adaptive horizontal control, standard vertical control --&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;control&amp;quot; type=&amp;quot;new&amp;quot;/&amp;gt;       &amp;lt;!-- new fixed wing control loops with merged auto pitch and auto throttle, adaptive horizontal control --&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;control&amp;quot; type=&amp;quot;energy&amp;quot;/&amp;gt;    &amp;lt;!-- Since v4.1.0 --&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;control&amp;quot; type=&amp;quot;energyadaptive&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== XML Parameters ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Manual ===&lt;br /&gt;
The &amp;lt;tt&amp;gt;rc_command&amp;lt;/tt&amp;gt; sections links the channels of the RC transmitter (defined in the [[Radio_Control|Radio Control]] file) to the &amp;lt;tt&amp;gt;commands&amp;lt;/tt&amp;gt; defined above:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;rc_commands&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;THROTTLE&amp;quot; value=&amp;quot;@THROTTLE&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;ROLL&amp;quot;     value=&amp;quot;@ROLL&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;PITCH&amp;quot;    value=&amp;quot;@PITCH&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/rc_commands&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This example looks trivial since the channel values have the same name than the commands.&lt;br /&gt;
&lt;br /&gt;
=== RC commands in Auto ===&lt;br /&gt;
To control servos or other servo signal compatible devices by RC in Auto1 or Auto2, define them in the &amp;lt;auto_rc_commands&amp;gt; section.&lt;br /&gt;
If you have an airframe with a dedicated rudder (YAW channel) then it is still controllable in auto mode via RC. This is the default behavior and is equivalent to setting the YAW command in auto_rc_commands:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;auto_rc_commands&amp;gt;&lt;br /&gt;
   &amp;lt;set command=&amp;quot;YAW&amp;quot; value=&amp;quot;@YAW&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/auto_rc_commands&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To disable this behavior (meaning no RC control of the rudder in auto) define an empty auto_rc_commands section:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;auto_rc_commands&amp;gt;&lt;br /&gt;
 &amp;lt;/auto_rc_commands&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Autopilot Only Commands ===&lt;br /&gt;
For certain missions it might be required to control servos (payload) from the autopilot (gcs) at all times (even during manual flight). These commands should not be in the &amp;lt;rc_commands&amp;gt; block but in the special &amp;lt;ap_only_commands&amp;gt; block. This allows for instance the pantilt operator to keep working when in manual flight, or safety logic to automatically close cameras below a certain altitude during manual landings.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;ap_only_commands&amp;gt;&lt;br /&gt;
   &amp;lt;copy command=&amp;quot;PAN&amp;quot;   /&amp;gt;&lt;br /&gt;
   &amp;lt;copy command=&amp;quot;TILT&amp;quot;  /&amp;gt;&lt;br /&gt;
   &amp;lt;copy command=&amp;quot;SHOOT&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/ap_only_commands&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Auto1 ===&lt;br /&gt;
The next section, named &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;AUTO1&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;, gives the maximum roll and pitch (in radians) allowed for the augmented stability mode.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;AUTO1&amp;quot; prefix=&amp;quot;AUTO1_&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_ROLL&amp;quot;  value=&amp;quot;35&amp;quot; unit=&amp;quot;deg&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_PITCH&amp;quot; value=&amp;quot;5&amp;quot;  unit=&amp;quot;deg&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''NOTE'': [[Units|automatic unit conversion]] using &amp;lt;tt&amp;gt;unit=&amp;quot;deg&amp;quot;&amp;lt;/tt&amp;gt; is supported since v3.9, if you have an older version set it in radians or using &amp;lt;tt&amp;gt;value=&amp;quot;RadOfDeg(35)&amp;quot;&amp;lt;/tt&amp;gt;&lt;br /&gt;
=== Infrared === &lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;INFRARED&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section describes the configuration of the infrared sensors. For additional configuration to change the defaults, see the [[Module/infrared|infrared module page]].&lt;br /&gt;
&lt;br /&gt;
The only mandatory definitions are the sensor neutral readings and how the IR sensors are mounted.&lt;br /&gt;
&lt;br /&gt;
The electronic neutral of the sensors (a sensor here is a '''pair''' of thermopiles). A perfect sensor should give 512 if it measures the same value on both sides.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;INFRARED&amp;quot; prefix=&amp;quot;IR_&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_IR1_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_IR2_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ADC_TOP_NEUTRAL&amp;quot; value=&amp;quot;512&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;HORIZ_SENSOR_ALIGNED&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
These neutrals are tuned with the &amp;quot;cupboard test&amp;quot;: Put the sensor in a close box (a cupboard) and read the values of the IR_SENSORS message (ir1, ir2 and vertical). Set the neutrals (they are subtracted from the measurement) to get null values. E.g. if you read 5 for the ir1 value with ADC_IR1_NEUTRAL equal to 512, change the latter to 517.&lt;br /&gt;
&lt;br /&gt;
In the example above the horizontal sensor is connected to the airframe in ''aligned'' orientation. The other possibility is ''tilted''.&lt;br /&gt;
Define either&lt;br /&gt;
* '''HORIZ_SENSOR_ALIGNED''': ir1 is along the lateral axis (The axis that passes through the plane from wingtip to wingtip) and ir2 along the longitudinal one.&lt;br /&gt;
or&lt;br /&gt;
* '''HORIZ_SENSOR_TILTED''': the sensors are tilted by 45 degrees; ir1 is along rear-left -- front-right, and ir2 along rear-right -- front-left.&lt;br /&gt;
If the airframe construction allows choose an aligned sensor orientation since this gives the best stabilization response results.&lt;br /&gt;
&lt;br /&gt;
=== Gyro ===&lt;br /&gt;
'''This section only applies to versions prior to v3.9 when using a gyro with IR sensors.'''&lt;br /&gt;
Defines the type of gyro installed, each axis neutral, and any required temperature compensation. If the gyro has two axes, the pitch neutral is defined as well. Many gyros output their internal temperature and require a temperature-dependent linear correction be made to the neutral value.  No correction is done for the temperature in this example.(&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;ADC_TEMP_SLOPE=0&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;GYRO&amp;quot; prefix=&amp;quot;GYRO_&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_ROLL_COEFF&amp;quot;   value=&amp;quot;1&amp;quot;   /&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ROLL_NEUTRAL&amp;quot;     value=&amp;quot;500&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_TEMP_NEUTRAL&amp;quot; value=&amp;quot;476&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ADC_TEMP_SLOPE&amp;quot;   value=&amp;quot;0&amp;quot;   /&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Horizontal Control ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;HORIZONTAL CONTROL&amp;quot; prefix=&amp;quot;H_CTL_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;COURSE_PGAIN&amp;quot;       value=&amp;quot;0.4&amp;quot;   /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_MAX_SETPOINT&amp;quot;  value=&amp;quot;20&amp;quot;    unit=&amp;quot;deg&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_ATTITUDE_GAIN&amp;quot; value=&amp;quot;7500.&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_RATE_GAIN&amp;quot;     value=&amp;quot;1500&amp;quot;  /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_PGAIN&amp;quot;        value=&amp;quot;8000.&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ELEVATOR_OF_ROLL&amp;quot;   value=&amp;quot;1250&amp;quot;  /&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The outer loop acts on the route. It will produce a roll command from a course setpoint and a course measurement. The COURSE_PGAIN parameter is the factor multiplied by the course error (in radian) to get a roll setpoint (in radian). So if the plane is expected to go north (course=0) and is actually flying to 57 degrees (course=1 radian, i.e. ENE), with a gain of '''0.4''', a roll of -0.4 (-23 degrees) will be set for the lower control loop.&lt;br /&gt;
&lt;br /&gt;
The ROLL_ATTITUDE_GAIN is used to compute a ROLL command from the roll error (setpoint minus measurement). If a gyro in installed, the ROLL_RATE_GAIN to keep a null roll rate. So these two gains provide a P-D controller.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''IMPORTANT''': Previous to v3.9 some of the gains need to be set with a '''negative sign''': ''COURSE_PGAIN'', ''ROLL_ATTITUDE_GAIN'', ''ROLL_RATE_GAIN'', ''PITCH_PGAIN''&lt;br /&gt;
&lt;br /&gt;
''NOTE'': [[Units|automatic unit conversion]] using &amp;lt;tt&amp;gt;unit=&amp;quot;deg&amp;quot;&amp;lt;/tt&amp;gt; is supported since v3.9, if you have an older version set it in radians or using &amp;lt;tt&amp;gt;value=&amp;quot;RadOfDeg(20)&amp;quot;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[Control_Loops#Fixed-wing_autopilot|graphical representation of the control loops]] can help you to visualize the effect of each gain.&lt;br /&gt;
&lt;br /&gt;
===Vertical Control===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;VERTICAL CONTROL&amp;quot; prefix=&amp;quot;V_CTL_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;!-- outer loop proportional gain --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ALTITUDE_PGAIN&amp;quot;     value=&amp;quot;0.1&amp;quot; unit=&amp;quot;(m/s)/m&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;!-- outer loop saturation --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ALTITUDE_MAX_CLIMB&amp;quot; value=&amp;quot;3.&amp;quot;  unit=&amp;quot;m/s&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
These lines are associated with vertical control loops contained in sw/airborne/firmwares/fixedwing/guidance/guidance_v.c.  These are outer loop parameters that calculate a desired climb rate based on altitude error. Here, if the altitude error is 10m, the climb setpoint will be set to 1m/s. ALTITUDE_MAX_CLIMB is a bounded value (in m/s) so that the outer loop does not calculate too large of a climb rate&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE&amp;quot; value=&amp;quot;0.65&amp;quot; unit=&amp;quot;%&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_MIN_CRUISE_THROTTLE&amp;quot;     value=&amp;quot;.4&amp;quot;   unit=&amp;quot;%&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_MAX_CRUISE_THROTTLE&amp;quot;     value=&amp;quot;1&amp;quot;    unit=&amp;quot;%&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_LOITER_TRIM&amp;quot;  value=&amp;quot;1000&amp;quot;  unit=&amp;quot;pprz_t&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_DASH_TRIM&amp;quot;    value=&amp;quot;-2500&amp;quot; unit=&amp;quot;pprz_t&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_PGAIN&amp;quot; value=&amp;quot;0.008&amp;quot; unit=&amp;quot;%/(m/s)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_IGAIN&amp;quot; value=&amp;quot;0.25&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_PITCH_OF_VZ_PGAIN&amp;quot;        value=&amp;quot;0.35&amp;quot; unit=&amp;quot;rad/(m/s)&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_CLIMB_THROTTLE_INCREMENT&amp;quot; value=&amp;quot;0.15&amp;quot; unit=&amp;quot;%/(m/s)&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These lines are associated with vertical rate control loops contained in sw/airborne/firmwares/fixedwing/guidance/guidance_v.c and are used by default in most cases.  The default vertical control law is for the vertical rate to be managed by a combination of throttle and pitch.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_PGAIN&amp;quot; value=&amp;quot;0.1&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_IGAIN&amp;quot; value=&amp;quot;0.025&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_MAX_PITCH&amp;quot; value=&amp;quot;30&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_MIN_PITCH&amp;quot; value=&amp;quot;30&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
These lines are associated with vertical control loops contained in sw/airborne/firmwares/fixedwing/guidance/guidance_v.c but are not used in default. The non-default vertical control law is for the vertical rate to be managed by the pitch.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;THROTTLE_SLEW_LIMITER&amp;quot; value=&amp;quot;2&amp;quot; unit=&amp;quot;s&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
THROTTLE_SLEW_LIMITER is the required time is seconds to change throttle from 0% to 100%.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''IMPORTANT''': Previous to v3.9 some of the gains need to be set with a '''negative sign''': ''ALTITUDE_PGAIN'', ''AUTO_THROTTLE_PGAIN'', ''AUTO_PITCH_PGAIN'', ''''&lt;br /&gt;
&lt;br /&gt;
''NOTE'': [[Units|automatic unit conversion]] using &amp;lt;tt&amp;gt;unit=&amp;quot;deg&amp;quot;&amp;lt;/tt&amp;gt; is supported since v3.9, if you have an older version set it in radians or using &amp;lt;tt&amp;gt;value=&amp;quot;RadOfDeg(20)&amp;quot;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[Control_Loops#Fixed-wing_autopilot|graphical representation of the control loops]] can help you to visualize the effect of each gain.&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;NOMINAL_AIRSPEED&amp;quot;    value =&amp;quot;12.0&amp;quot; unit=&amp;quot;m/s&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CONTROL_RATE&amp;quot;        value=&amp;quot;60&amp;quot;    unit=&amp;quot;Hz&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CARROT&amp;quot;              value=&amp;quot;5.0&amp;quot;   unit=&amp;quot;s&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;KILL_MODE_DISTANCE&amp;quot;  value=&amp;quot;(1.5*MAX_DIST_FROM_HOME)&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* The &amp;quot;NOMINAL_AIRSPEED&amp;quot; is mainly used in the simulator.&lt;br /&gt;
* &amp;quot;CARROT&amp;quot; gives the distance (in seconds, so ground speed is taken into account) between the carrot and the aircraft.&lt;br /&gt;
* &amp;quot;KILL_MODE_DISTANCE&amp;quot; is the threshold distance to switch the autopilot into KILL mode (defined descent with no throttle)&lt;br /&gt;
* &amp;quot;CONTROL_RATE&amp;quot; is the rate of the low level control loops in Hertz (60 or 20).&lt;br /&gt;
&lt;br /&gt;
=== Simu ===&lt;br /&gt;
Values from this section can be used to tweak the software in the loop (SITL) simulation.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;SIMU&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;WEIGHT&amp;quot; value =&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;YAW_RESPONSE_FACTOR&amp;quot;  value =&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;ROLL_RESPONSE_FACTOR&amp;quot; value =&amp;quot;15.&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* &amp;quot;YAW_RESPONSE_FACTOR&amp;quot; adapts the aircraft's turn rate corresponding to a bank angle; a larger value increases the turn radius&lt;br /&gt;
* &amp;quot;ROLL_RESPONSE_FACTOR&amp;quot; is basically your aileron efficiency; a higher value increases roll agility&lt;br /&gt;
&lt;br /&gt;
If you want to use JSBSim as SITL simulator, you have to make some definitions in this section as well; see [[Simulation#JSBSim|here]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:User_Documentation]] [[Category:Airframe_Configuration]]&lt;/div&gt;</summary>
		<author><name>Tobias</name></author>
	</entry>
</feed>