<?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=Mundhra</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=Mundhra"/>
	<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/wiki/Special:Contributions/Mundhra"/>
	<updated>2026-04-26T18:08:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=8164</id>
		<title>Airframe Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=8164"/>
		<updated>2010-12-05T05:16:00Z</updated>

		<summary type="html">&lt;p&gt;Mundhra: /* Gyro */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The airframe configuration file is located in &amp;lt;tt&amp;gt;conf/airframes&amp;lt;/tt&amp;gt; and contains&lt;br /&gt;
all the hardware and software settings for an aircraft. This is an [http://en.wikipedia.org/wiki/Xml XML] document containing some [http://en.wikipedia.org/wiki/Makefile Makefile] code at the bottom. All gains, trims, and behavior settings are defined with standard XML elements. The hardware definitions such as processor type, modem protocol, servo driver, etc. are contained in the makefile raw section.&lt;br /&gt;
&lt;br /&gt;
== Selecting the Airframe File ==&lt;br /&gt;
Each airframe file must be assigned a name, unique ID, flight plan, etc. in [[Conf.xml|&amp;lt;tt&amp;gt;conf/conf.xml&amp;lt;/tt&amp;gt;]] as follows:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;conf&amp;gt;&lt;br /&gt;
  &amp;lt;aircraft &lt;br /&gt;
    name=&amp;quot;Twin1&amp;quot;&lt;br /&gt;
    ac_id=&amp;quot;1&amp;quot;&lt;br /&gt;
    airframe=&amp;quot;airframes/twinstar1.xml&amp;quot; &lt;br /&gt;
    radio=&amp;quot;radios/mc3030.xml&amp;quot; &lt;br /&gt;
    flight_plan=&amp;quot;flight_plans/mav05_cw.xml&amp;quot;&lt;br /&gt;
    telemetry=&amp;quot;telemetry/default.xml&amp;quot;&lt;br /&gt;
    gui_color=&amp;quot;blue&amp;quot;&lt;br /&gt;
  /&amp;gt;&lt;br /&gt;
  &amp;lt;aircraft &lt;br /&gt;
    name=&amp;quot;Plaster&amp;quot;&lt;br /&gt;
    ac_id=&amp;quot;2&amp;quot;&lt;br /&gt;
    airframe=&amp;quot;airframes/plaster1.xml&amp;quot; &lt;br /&gt;
    radio=&amp;quot;radios/cockpitMM.xml&amp;quot; &lt;br /&gt;
    telemetry=&amp;quot;telemetry/default.xml&amp;quot;&lt;br /&gt;
    flight_plan=&amp;quot;flight_plans/dummy.xml&amp;quot;&lt;br /&gt;
  /&amp;gt;&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  &amp;lt;/conf&amp;gt;&lt;br /&gt;
Then, to compile and flash the airframe settings and associated flight plan to your autopilot, simply select the appropriate A/C and target in the [[Paparazzi_Center|Paparazzi Center]] or specify your airframe name in the flash command typed from the prompt:&lt;br /&gt;
 make AIRCRAFT=&amp;lt;b&amp;gt;Twin1&amp;lt;/b&amp;gt; ap.upload&lt;br /&gt;
More information can be found on the [[Conf.xml|conf.xml]] page&lt;br /&gt;
&lt;br /&gt;
Note that the airframe XML document always begins with a &amp;lt;!DOCTYPE airframe SYSTEM &amp;quot;airframe.dtd&amp;quot;&amp;gt; line--[[User:Openuas|OpenUAS]] 14:32, 22 March 2010 (CET).&lt;br /&gt;
&lt;br /&gt;
== XML Parameters ==&lt;br /&gt;
&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;commands&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; lists the abstract commands you need to control the aircraft. In our example, we have only three:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;commands&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;THROTTLE&amp;quot; failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;ROLL&amp;quot;     failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;PITCH&amp;quot;    failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/commands&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each command is also associated with a failsafe value which will be used if no controller is active, for example during initialization of the autopilot board. The range of these values is [-9600:9600]. For &amp;lt;tt&amp;gt;&amp;quot;THROTTLE&amp;quot;&amp;lt;/tt&amp;gt;, the range is [0, 9600] and in the corresponding &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servo&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; definition the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;neutral&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;min&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; are usually the same (see below). Note that these commands do not necessarily match the servo actuators. For example, the &amp;lt;tt&amp;gt;&amp;quot;ROLL&amp;quot;&amp;lt;/tt&amp;gt; command is typically linked to two aileron actuators.&lt;br /&gt;
&lt;br /&gt;
=== Servos ===&lt;br /&gt;
&lt;br /&gt;
The above commands get translated to the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; here. In the example below we use two elevons and a motor. ([http://en.wikipedia.org/wiki/Elevon ''Elevons''] are surfaces used for both pitch and roll as on a flying wing.) These servos are listed in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;servos&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;THROTTLE&amp;quot;         no=&amp;quot;0&amp;quot; min=&amp;quot;1000&amp;quot; neutral=&amp;quot;1000&amp;quot; max=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;ELEVON_LEFTSIDE&amp;quot;  no=&amp;quot;1&amp;quot; min=&amp;quot;2000&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;1000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;ELEVON_RIGHTSIDE&amp;quot; no=&amp;quot;2&amp;quot; min=&amp;quot;1000&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/servos&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Names are associated to the corresponding '''real physical connector''' to which a servo is connected '''on the autopilot board'''. For example no=&amp;quot;2&amp;quot; means connector two on the board. Also the servo neutral value, total range and direction are defined.  Min/max/neutral values are expressed in milliseconds. The direction of travel can be reversed by exchanging min with max (as in &amp;lt;tt&amp;gt;&amp;quot;ELEVON_LEFTSIDE&amp;quot;&amp;lt;/tt&amp;gt;, above).  The ''standard'' travel for a hobby servo is 1000ms - 2000ms with a 1500ms neutral. Trim can be added by changing this neutral value. Absolute servo travel limits can be increased or reduced with the min/max values.  The &amp;lt;tt&amp;gt;&amp;quot;THROTTLE&amp;quot;&amp;lt;/tt&amp;gt; servo typically has the same value for the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;neutral&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;min&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
Note the following important tips:&lt;br /&gt;
* Reverse the servo direction by exchanging min/max&lt;br /&gt;
* Trim should always be adjusted mechanically if possible to avoid asymmetrical travel&lt;br /&gt;
* Any reduction of the total travel range should be done mechanically to maintain precision&lt;br /&gt;
* Many servos will respond well to values slightly outside the normal 1000-2000ms range but experiment carefully as the servo may not operate reliably outside this range and may even suffer permanent damage.&lt;br /&gt;
* Board connector numbering starts with zero(0) not with one&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; are then linked to the commands in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;command_laws&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;command_laws&amp;gt;&lt;br /&gt;
  &amp;lt;let var=&amp;quot;aileron&amp;quot;            value=&amp;quot;@ROLL  * 0.3&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;let var=&amp;quot;elevator&amp;quot;           value=&amp;quot;@PITCH * 0.7&amp;quot;/&amp;gt;  &lt;br /&gt;
  &amp;lt;set servo=&amp;quot;THROTTLE&amp;quot;         value=&amp;quot;@THROTTLE&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;set servo=&amp;quot;ELEVON_LEFTSIDE&amp;quot;  value=&amp;quot;$elevator + $aileron&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;set servo=&amp;quot;ELEVON_RIGHTSIDE&amp;quot; value=&amp;quot;$elevator - $aileron&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/command_laws&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:airframe_sign_conventions.jpg|thumb|Sign conventions for flight dynamics]]&lt;br /&gt;
where the third line is the simplest: the throttle servo value equals throttle command value. The other lines define and control the pitch/roll mixing.  Elevon values are computed with a combination of two commands, '''ROLL''' and '''PITCH'''. This ''mixer'' is defined with two intermediate variables '''aileron''' and '''elevator''' introduced with the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;let&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; element.  The '''@''' symbol is used to reference a command value in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; attribute of the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;set&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;let&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; elements.  In the above example, the servos are limited to +/- 70% of their full travel for pitch and 30% for roll, only in combination can the servos reach 100% deflection.  Note that these numbers ''should add up 100% or more, never less''.  For example, you may want 100% travel available for pitch - this means if a roll is commanded along with maximum pitch only one servo will respond to the roll command as the other has already reached its mechanical limit.  If you find after tuning that these numbers add to less than 100% consider reducing the surface travel mechanically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the signs used in the description follow the standard convention.&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;
&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;
&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;
&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;
&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;
&lt;br /&gt;
 &amp;lt;auto_rc_commands&amp;gt;&lt;br /&gt;
 &amp;lt;/auto_rc_commands&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;
&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;
&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;tt&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;RadOfDeg(35)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_PITCH&amp;quot; value=&amp;quot;RadOfDeg(35)&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADC === &lt;br /&gt;
'''Please remove the &amp;quot;adc&amp;quot; section as well as the adc part in the &amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt; section and [[User/AirborneCodeReorg| Update To Use Subsystems]].'''&lt;br /&gt;
This is now configured in the [[Airframe_Configuration#Infrared|Infrared]] subsystem directly.&lt;br /&gt;
&lt;br /&gt;
Formerly the &amp;quot;adc&amp;quot; section looked like this, remove it:&lt;br /&gt;
 &amp;lt;section name=&amp;quot;adc&amp;quot; prefix=&amp;quot;ADC_CHANNEL_&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR1&amp;quot; value=&amp;quot;ADC_1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR2&amp;quot; value=&amp;quot;ADC_2&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR_TOP&amp;quot; value=&amp;quot;ADC_0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
And in the &amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt; section remove:&lt;br /&gt;
&lt;br /&gt;
 ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2&lt;br /&gt;
 ap.srcs += $(SRC_ARCH)/adc_hw.c&lt;br /&gt;
&lt;br /&gt;
==== ADC Generic ====&lt;br /&gt;
&lt;br /&gt;
In addition, if you want to receive the value of some ADC channel, you can use the &amp;quot;ADC Generic&amp;quot; service. When activated, the aircraft sends 2 values corresponding to the selected ADC channels. They can be read from the &amp;quot;Messages&amp;quot; application.&lt;br /&gt;
Add the adc generic subsystem to your firmware:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;adc&amp;quot;           type=&amp;quot;generic&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;param name=&amp;quot;ADC_GENERIC1&amp;quot; value=&amp;quot;ADC_3&amp;quot;/&amp;gt; &amp;lt;!-- e.g. current sensor --&amp;gt;&lt;br /&gt;
      &amp;lt;param name=&amp;quot;ADC_GENERIC2&amp;quot; value=&amp;quot;ADC_4&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/subsystem&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Formerly this was defined in the &amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt; section, please remove this.&lt;br /&gt;
  ap.CFLAGS += -DUSE_ADC_GENERIC -DUSE_ADC_3 -DADC_CHANNEL_GENERIC1=ADC_3 -DUSE_ADC_4 -DADC_CHANNEL_GENERIC2=ADC_4&lt;br /&gt;
  ap.srcs += adc_generic.c&lt;br /&gt;
In this example, the ADC channels 3 and 4 are read and sent by telemetry at 4Hz:&lt;br /&gt;
  &amp;lt;message name=&amp;quot;ADC_GENERIC&amp;quot; ID=&amp;quot;18&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;field name=&amp;quot;val1&amp;quot; type=&amp;quot;uint16&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;field name=&amp;quot;val2&amp;quot; type=&amp;quot;uint16&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/message&amp;gt;&lt;br /&gt;
Only two channels can be defined. If only one is activated, 0 will send for the second value.&lt;br /&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.&lt;br /&gt;
&lt;br /&gt;
The first definitions are relative to 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;
&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;
&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;
The next lines define the installation of the horizontal and vertical sensors. The vertical sensor must  give a positive value when the temperature under the aircraft is higher than the temperature above. The two channels of the horizontal sensor must give positive values when it is warmer on the right side and the rear side. To adjust these signs, use the following declarations:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR1_SIGN&amp;quot; value=&amp;quot;-1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR2_SIGN&amp;quot; value=&amp;quot;-1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;TOP_SIGN&amp;quot; value=&amp;quot;-1&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, define how the horizontal sensor is connected to the airframe, orientation '''aligned''' or '''tilted'''. In the aligned case, ir'''1''' is along the lateral axis (The axis that passes through the plane from wingtip to wingtip) and ir'''2''' along the longitudinal one. In the '''tilted''' case, the sensors are tilted by 45 degrees; ir'''1''' is along rear-left -- front-right, and ir'''2''' along rear-right -- front-left. The parameter &amp;quot;value&amp;quot; in the aligned and tilted definition has no effect! If the airframe construction allows choose an aligned sensor orientation since this gives the best stabilization response results.&lt;br /&gt;
&lt;br /&gt;
For help with orientation of '''Previous Versions of Infrared Sensor Boards''' try here : http://paparazzi.enac.fr/wiki/Previous_Infrared_Sensors&lt;br /&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;
  or&lt;br /&gt;
   &amp;lt;define name=&amp;quot;HORIZ_SENSOR_TILTED&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The three axis must give similar values for similar contrasts. The following factors can be used to scale these values. For example with an horizontal tilted sensor, the following ratios are usually needed:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;LATERAL_CORRECTION&amp;quot; value=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;LONGITUDINAL_CORRECTION&amp;quot; value=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;VERTICAL_CORRECTION&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
Default values are 1.&lt;br /&gt;
&lt;br /&gt;
It may be hard to align the horizontal sensor with the aircraft. A tuning in flight will be needed to adjust the following neutrals. Adjust the roll neutral to fly straight. Adjust the pitch neutral to fly level with the desired throttle.&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ROLL_NEUTRAL_DEFAULT&amp;quot; value=&amp;quot;-2.5&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;PITCH_NEUTRAL_DEFAULT&amp;quot; value=&amp;quot;6&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An asymmetric (left/right, front/rear) correction can be added with a last set of factors.&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_UP&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_DOWN&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_LEFT&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_RIGHT&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
These corrections are set on the angles.&lt;br /&gt;
You don't have to set these as they are set to 1. per default, but adjust them if needed.&lt;br /&gt;
&lt;br /&gt;
=== Gyro === &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;
&lt;br /&gt;
 &amp;lt;tt&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;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Bat === &lt;br /&gt;
This section give characteristics for the monitoring of the main power battery. &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MILLIAMP_AT_FULL_THROTTLE&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; represents the actual current (in mA) when full THROTTLE is applied. It is used to compute the &amp;lt;tt&amp;gt;energy&amp;lt;/tt&amp;gt; value of the &amp;lt;tt&amp;gt;BAT&amp;lt;/tt&amp;gt; message when no [[Current_sensor|Current sensor]] is mounted in the airframe. This value can also be used in flight plans. For example, if at full throttle your motor consumes 10 Amps, use a value of 10000. At 50% throttle it is likely to use about 5 Amps so the autopilot can have a better idea how much energy is remaining. You can &amp;quot;tweak&amp;quot; this number after a few flights to match the capacity of your battery. If upon landing your bat.energy messages says that you used 2500 mAh while the battery has only 2000 mAh capacity, you could reduce the MILLIAMP_AT_FULL_THROTTLE value by 20% to match your in-flight current consumption.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;CATASTROPHIC_BAT_LEVEL&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; (was previously &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;LOW_BATTERY&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;) value defines the voltage at which the autopilot will lock the throttle at 0% in autonomous mode (kill_throttle mode). This value is also used by the ground server to issue a '''CATASTROPHIC''' alarm message on the bus (this message will be displayed in the console of the GCS).  &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;CRITIC&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;LOW&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; values will also used as threshold for '''CRITIC''' and '''WARNING''' alarms. They are optional and the respective defaults are 10.0 and 10.5V.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MAX_BAT_LEVEL&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; may be specified to improve the display of the battery gauge in the strip or in &amp;quot;papgets&amp;quot;. Note that this definition is optional, with a default value of 12.5V.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;BAT&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MILLIAMP_AT_FULL_THROTTLE&amp;quot; value=&amp;quot;12000&amp;quot; unit=&amp;quot;mA&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VOLTAGE_ADC_A&amp;quot; value=&amp;quot;0.0177531&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VOLTAGE_ADC_B&amp;quot; value=&amp;quot;0.173626&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VoltageOfAdc(adc)&amp;quot; value =&amp;quot;(VOLTAGE_ADC_A * adc + VOLTAGE_ADC_B)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CATASTROPHIC_BAT_LEVEL&amp;quot; value=&amp;quot;6.0&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CRITIC_BAT_LEVEL&amp;quot; value=&amp;quot;6.5&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;LOW_BAT_LEVEL&amp;quot; value=&amp;quot;7.0&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_BAT_LEVEL&amp;quot; value=&amp;quot;8.4&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Find more in depth information on how to [[Current_sensor|get a separate current sensor working by clicking here]]&lt;br /&gt;
&lt;br /&gt;
=== Horizontal Control ===&lt;br /&gt;
 &amp;lt;tt&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;0.35&amp;quot; unit=&amp;quot;radians&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;/tt&amp;gt;&lt;br /&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;
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;
&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;
These lines are associated with vertical control loops contained in ./sw/airborne/fw_v_ctl.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;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_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;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;
&lt;br /&gt;
These lines are associated with vertical rate control loops contained in ./sw/airborne/fw_v_ctl.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;
&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;0.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_MIN_PITCH&amp;quot; value=&amp;quot;-0.5&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These lines are associated with vertical control loops contained in ./sw/airborne/fw_v_ctl.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;
&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;
THROTTLE_SLEW_LIMITER is the required time is seconds to change throttle from 0% to 100%.&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;tt&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.&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CARROT&amp;quot; value=&amp;quot;5.&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;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;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&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 SITL simulation.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&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;/tt&amp;gt;&lt;br /&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;
=== Modules ===&lt;br /&gt;
The [[Modules|modules]] allow to add new code in a flexible way with initialisation, periodic and event functions without modifying the main AP loop.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;modules main_freq=&amp;quot;60&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;load name=&amp;quot;demo_module.xml&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/modules&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The main_freq parameter (in Hz) allows to specify the frequency of the main loop. Default is 60 Hz&lt;br /&gt;
&lt;br /&gt;
== Firmware and Hardware definitions ==&lt;br /&gt;
&lt;br /&gt;
=== Select your Board ===&lt;br /&gt;
The airframe file must include the description of the controller board and it's low-level settings.&lt;br /&gt;
This is done in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;firmware&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section by specifying the ''board'' attribute for the ''target'' &amp;quot;ap&amp;quot; (autopilot).&lt;br /&gt;
&lt;br /&gt;
Select the appropriate board:&lt;br /&gt;
&amp;quot;twog_1.0&amp;quot;, &amp;quot;tiny_2.11&amp;quot;, &amp;quot;tiny_2.1&amp;quot;, &amp;quot;tiny_1.1&amp;quot;, &amp;quot;tiny_0.99&amp;quot;, &amp;quot;booz_1.0&amp;quot;, &amp;quot;lisa_l_1.0&amp;quot;, &amp;quot;pc&amp;quot;&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;pre&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;&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;
     .&lt;br /&gt;
     .&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Radio Control ===&lt;br /&gt;
The Paparazzi autopilot can interface directly with the PWM signal from any standard hobby R/C receiver.  Signal decoding configuration settings for this are stored in the [[Radio_Control|Radio Control]] file.&lt;br /&gt;
&lt;br /&gt;
Proper Spektrum support is on the way.&lt;br /&gt;
&lt;br /&gt;
Just specify the appropriate subsystem in your firmware section:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;pre&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;&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;
     .&lt;br /&gt;
     .&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;radio_control&amp;quot;     type=&amp;quot;ppm&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Telemetry (Modem) ===&lt;br /&gt;
The modem protocol and baud rate must be set in both the airframe file and ground station.  Any standard baud rate can be used, with 9600 being adequate and 57600 recommended for most users to allow high speed telemetry for more detailed flight data analysis.  The actual data rate is determined by the number of messages being sent and the period of each message as defined in &amp;lt;tt&amp;gt;conf/telemetry/default.xml&amp;lt;/tt&amp;gt;.  Those wishing to experiment with &amp;quot;alternative&amp;quot; modems can reduce the number and period of each telemetry message to fit within most any bandwidth constraint.&lt;br /&gt;
&lt;br /&gt;
Paparazzi supports the following modem protocols:&lt;br /&gt;
* Standard transparent serial (pprz) - this is compatible with all modems and can be used to connect the autopilot directly to a PC for testing without a modem.&lt;br /&gt;
* Maxstream API protocol (xbee) - compatible with all Maxstream modems including the 9XTend and Zigbee.  This protocol enables hardware addressing, allowing multiple aircraft to be managed from a single ground modem.&lt;br /&gt;
&lt;br /&gt;
Just specify the appropriate subsystem in your firmware section. You can currently choose between the types '''transparent''' and '''xbee_api'''.&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;pre&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;
     .&lt;br /&gt;
     .&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;telemetry&amp;quot;     type=&amp;quot;transparent&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The correct UART is already defined by default according to your board.&lt;br /&gt;
The default modem baudrate is 57600baud.&lt;br /&gt;
&lt;br /&gt;
If you use different baud rates set the according parameters, e.g.&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;pre&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;
     .&lt;br /&gt;
     .&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;telemetry&amp;quot;     type=&amp;quot;transparent&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;param name=&amp;quot;MODEM_BAUD&amp;quot;          value=&amp;quot;B9600&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/subsystem&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Configuring The Serial Protocol ====&lt;br /&gt;
New users are advised to start with the standard serial protocol before attempting to setup an addressed API link. There are no real reasons for the novice user to use the xbee protocol over the standard PPRZTransport. Even if you are using a Maxstream modem you should still start out with the standard. Lastly it should be pointed out that using a single UAV there is no disadvantage and that the [http://www.engr.usu.edu/wiki/index.php/OSAM OSAM] Paparazzi Team at UAS 2008 took second place using the STANDARD protocol. The serial protocol works with virtually any modem as well as direct cable connections.  The baud rates of the airborne modem, autopilot, ground modem, and PC must be configured correctly.  The PC and autopilot serial ports do not need to be set to the same baud rate, i.e. when running multiple aircraft from a single ground modem, the ground modem may require a higher baud rate than any of the airborne modems in order to stream the data from multiple simultaneous sources.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;DATALINK&amp;quot; prefix=&amp;quot;DATALINK_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_TYPE&amp;quot; value=&amp;quot;PPRZ&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_ADDRESS&amp;quot; value=&amp;quot;....&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example tells the autopilot to send and receive data in standard serial form.&lt;br /&gt;
&lt;br /&gt;
==== Configuring The Maxstream API Protocol ====&lt;br /&gt;
The optional API protocol enables hardware addressing so that multiple aircraft can be managed from a single ground modem, or multiple aircraft and multiple ground stations can work simultaneously without interference from one another.  API mode is enabled by sending an escape sequence (+++) followed by AT commands, this can be done automatically at each boot or can be permanently configured with the &amp;quot;ATWR&amp;quot; command for greater reliability.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;define name=&amp;quot;XBEE_INIT&amp;quot; value=&amp;quot;\&amp;quot;ATPL2\rATRN1\rATTT80\r\ATBD6\rATWR\r\&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
 &amp;lt;/section&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example will program the Maxstream to API mode, 100mW power (ATPL2), 57600 baud (ATBD6), and permanently store the changes (ATWR).  After flashing allow 30 seconds for the modem to store the changes, then disable the init string by adding the line &amp;lt;tt&amp;gt;&amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt; (the parameter &amp;quot;value&amp;quot; has no effect), update the baud rate as needed, and re-flash the autopilot.  The modem and autopilot serial port baud rates must match each other at all times.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notes: &lt;br /&gt;
* Maxtream modems are factory configured for 9600 baud, in order to change baud rates, first configure the autopilot serial port to match the modem (DUART0_BAUD=B9600), boot the system so that the baud rate change command is sent to the modem (ATBD6) and permanently saved (ATWR), allow 30 seconds for the modem configuration to complete, then reprogram the autopilot with the new baud rate (DUART0_BAUD=B57600) and disabled modem configuration string &amp;lt;tt&amp;gt;&amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt; &amp;lt;/tt&amp;gt;.&lt;br /&gt;
* The ac_id defined in &amp;lt;tt&amp;gt;conf/conf.xml&amp;lt;/tt&amp;gt; is permanently programmed into the modem so this procedure would need to be re-run if the modem is moved to another plane.&lt;br /&gt;
* For temporary boot-time API configuration remove any baud rate changes, remove &amp;lt;tt&amp;gt;ATWR\r&amp;lt;/tt&amp;gt; from the end of the string.&lt;br /&gt;
* Upgrade your Maxstream firmware to the latest version before attempting API mode operation.&lt;br /&gt;
&lt;br /&gt;
=====Alternate Method=====&lt;br /&gt;
This is the way it is done in funjet1.xml and has been tested to work by Danstah&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;define name=&amp;quot;XBEE_INIT&amp;quot; value=&amp;quot;\&amp;quot;ATPL2\rATRN1\rATTT80\r\&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;!--    &amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt; --&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
 &amp;lt;/section&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Also use this&lt;br /&gt;
{{Box Code|conf/airframes/funjet1.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;section name=&amp;quot;DATALINK&amp;quot; prefix=&amp;quot;DATALINK_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_TYPE&amp;quot; value=&amp;quot;XBEE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_ADDRESS&amp;quot; value=&amp;quot;....&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Keep in mind that the ground modem baud rate and aircraft modem baud rate do not have to match. What does need to match however is the baud rate of your modem build into the aircraft and the rate defined in the airframe file. For example if this aircraft modem is set to 9600Baud, this modem can connect with a ground modem configured set to 57600Baud.&lt;br /&gt;
Also for multiple UAS, a good way to configure them is to use 9600Baud for the Autopilot board and use a ground modem configured to 57600Baud. After your aircrafts are working well, set your configuration to use minimal telemetry.&lt;br /&gt;
&lt;br /&gt;
==== Set GCS baud rate ====&lt;br /&gt;
Set can set the baudrate for the link in the GCS by specifying ''-s 57600'' as a parameter to link. Then just save your session so you won't have to change it again next time.&lt;br /&gt;
&lt;br /&gt;
You can also manually write a session:&lt;br /&gt;
{{Box Code|conf/control_panel.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;session name=&amp;quot;USB&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;program name=&amp;quot;link&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-d&amp;quot; constant=&amp;quot;/dev/ttyUSB0&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;!--&amp;lt;arg flag=&amp;quot;-transport&amp;quot; constant=&amp;quot;xbee&amp;quot;/&amp;gt;--&amp;gt;&amp;lt;!-- uncomment this line for XBee API mode --&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-uplink&amp;quot; constant=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-s&amp;quot; constant=&amp;quot;57600&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/program&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
 &amp;lt;/session&amp;gt;&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Use this constant /dev/paparazzi/ttyUSB0 when using either the ftdi cable or a Maxstream USB ground modem.. Otherwise use /dev/ttyUSB0 (the ttyUSB0 being the device that you are using. Note: it might not always be ttyUSB0). This paparazzi directory in the dev folder is created when setting the udev rules. [http://paparazzi.enac.fr/wiki/Installation#Setting_access_rights_for_USB_download Setting Udev rules]&lt;br /&gt;
&lt;br /&gt;
=== GPS ===&lt;br /&gt;
The serial port settings must match that of the GPS and are configured here along with the necessary files to interpret the u-blox UBX binary protocol:&lt;br /&gt;
&lt;br /&gt;
Just specify the appropriate subsystem in your firmware section. You can currently choose between the types '''ublox_lea5h''' and '''ublox_lea4p'''.&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;pre&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;
     .&lt;br /&gt;
     .&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;gps&amp;quot;               type=&amp;quot;ublox_lea5h&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The correct UART is already defined by default according to your board.&lt;br /&gt;
The default modem baudrate is 38400baud.&lt;br /&gt;
&lt;br /&gt;
If you use different baud rates set the according parameters, e.g.&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;pre&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;
     .&lt;br /&gt;
     .&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;gps&amp;quot;               type=&amp;quot;ublox_lea4p&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;param name=&amp;quot;GPS_BAUD&amp;quot;          value=&amp;quot;B9600&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/subsystem&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Note:'''&lt;br /&gt;
* u-blox GPS modules are factory configured for 9600 baud, 38,400 baud is recommended along with the other required changes.  The GPS can be accessed directly thrugh the [[Compiling#USB_flashing|UART Tunnel]] and [[GPS#GPS_configuration_using_U-Center|Configured with u-center]]&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 largely independent groups : the vertical ones and the horizontal ones (standard files sw/airborne/fw_h_ctl.c and sw/airborne/fw_v_ctl.c ). Those loops can be commanded at different levels by either the R/C transmitter or the autonomous navigation routine.&lt;br /&gt;
&lt;br /&gt;
Just specify the appropriate subsystem in your firmware section. You can currently choose between no type (see below) and the types '''adaptive''' and '''new'''.&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;pre&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;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Hardware definitions - Makefile - obsolete ==&lt;br /&gt;
&lt;br /&gt;
'''Please [[User/AirborneCodeReorg| Update To Use Firmware with Subsystems]].'''&lt;br /&gt;
&lt;br /&gt;
'''This is now configured as a xml &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;firmware&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; element with &amp;lt;tt&amp;gt;subsystems&amp;lt;/tt&amp;gt;.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The airframe file must include the description of the controller board and it's low-level settings.  This is done in one &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section starting with the autopilot model and flashing mode:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;makefile&amp;gt;&lt;br /&gt;
  include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;FLASH_MODE=IAP&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS +=  -DFBW -DAP -DBOARD_CONFIG=\&amp;quot;tiny.h\&amp;quot; -DLED -DTIME_LED=1&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
 &amp;lt;/makefile&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Please note that -DCONFIG was changed to -DBOARD_CONFIG on 18 July 2009.&lt;br /&gt;
&lt;br /&gt;
Below this are the definintions and configuration of the peripherals and interfaces.&lt;br /&gt;
&lt;br /&gt;
=== Radio Control ===&lt;br /&gt;
The Paparazzi autpilot can interface directly with the PWM signal from any standard hobby R/C receiver.  Signal decoding configuration settings for this are stored in the [[Radio_Control|Radio Control]] file.&lt;br /&gt;
&lt;br /&gt;
If you have a Tiny v1.1 Autopilot:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DACTUATORS=\&amp;quot;servos_4015_MAT_hw.h\&amp;quot; -DSERVOS_4015_MAT&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.srcs += $(SRC_ARCH)/servos_4015_MAT_hw.c actuators.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DRADIO_CONTROL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
If you have a Tiny v2 or TWOG v1 Autopilot:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DACTUATORS=\&amp;quot;servos_4017_hw.h\&amp;quot; -DSERVOS_4017&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.srcs += $(SRC_ARCH)/servos_4017_hw.c actuators.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DRADIO_CONTROL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
If you want to output standard PPM to a R/C receiver:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DACTUATORS=\&amp;quot;servos_ppm_hw.h\&amp;quot; -DSERVOS_PPM_MAT&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.srcs += $(SRC_ARCH)/servos_ppm_hw.c actuators.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DRADIO_CONTROL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
This is used in the case where you want to directly drive a receiver which has a microcontroller to do the decoding and driving of the servos (not a 4015 or 4017 decoder chip). The PPM is output on the SERV_CLK pin. The PPM frame rate, pulse width, and number of channels can be adjusted in the &amp;quot;servos_ppm_hw.h&amp;quot; file to suit your particular receiver. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you have a Classix Autopilot:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DRADIO_CONTROL&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.EXTRA_SRCS += radio_control.c $(SRC_ARCH)/ppm_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DACTUATORS=\&amp;quot;servos_direct_hw.h\&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.EXTRA_SRCS += $(SRC_ARCH)/servos_direct_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
For the Classix, you must specify which pins to use for PWM by adding &amp;quot;-DPWM_SERVO_0, etc.&amp;quot; to the line fbw.CFLAGS. This activate the PWM channel. &lt;br /&gt;
  &amp;lt;tt&amp;gt;wiring on classix PWM connector&lt;br /&gt;
  connector   LPC   shared         port &lt;br /&gt;
  PWM1        PWM5  AD1_6  CAP1_3  P0.21&lt;br /&gt;
  PWM2        PWM3  RXD0   EINT0   P0.1&lt;br /&gt;
  PWM3        PWM1  TXD0           P0.0&lt;br /&gt;
  PWM4        PWM6  RXD1   EINT3   P0.9&lt;br /&gt;
  PWM5        PWM4  TXD1   AD1_1   P0.8&lt;br /&gt;
  PWM6        PWM2  SSEL0  EINT2   P0.7&amp;lt;/tt&amp;gt;&lt;br /&gt;
PWM1 and PWM6 should be safe. PWM4 and PWM5 should be OK if you're not using UART1 on the FBW processor - same for PWM2 and PWM3 if you're not using UART0 (disable FBW telemetry for that ).&lt;br /&gt;
&lt;br /&gt;
=== Modem ===&lt;br /&gt;
Here the obsolete way to configure your modem:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml - makefile section at the bottom|&lt;br /&gt;
 # Serial modem &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example configures the autopilot serial port (Uart0) to 57,600 baud and calls the serial transport protocol (pprz_transport.c).  Use the &amp;quot;#&amp;quot; symbol to comment lines in this section of the airframe file. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note:&lt;br /&gt;
* Remember Tiny 13 v1.1 uses UART0 for serial modem while Tiny 2 uses UART1.  Make the appropriate changes.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;gt;&lt;br /&gt;
{{Box Code|confAgain/airframes/myplane.xml - makefile section at the bottom|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# Maxstream API protocol&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B57600&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}} &lt;br /&gt;
The above example configures the autopilot serial port (Uart0) to 57,600 baud and calls the Maxstream transport protocol (xbee.c).  Use the &amp;quot;#&amp;quot; symbol to comment lines in this section of the airframe file.&lt;br /&gt;
&lt;br /&gt;
=== GPS ===&lt;br /&gt;
The serial port settings must match that of the GPS and are configured here along with the necessary files to interpret the u-blox UBX binary protocol:&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += gps_ubx.c gps.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
'''Note:'''&lt;br /&gt;
* Tiny 13 v1.1 uses UART1 while Tiny 2 uses UART0 for GPS&lt;br /&gt;
* u-blox GPS modules are factory configured for 9600 baud, 38,400 baud is recommended along with the other required changes.  The GPS can be accessed directly thrugh the [[Compiling#USB_flashing|UART Tunnel]] and [[GPS#GPS_configuration_using_U-Center|Configured with u-center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If using the u-blox LEA-5H, add the flag -DGPS_USE_LATLONG in the makefile section of the airframe xml file in the gps section. This flag must be inserted above &amp;quot;ap.srcs += gps_ubx.c gps.c&amp;quot; for proper operation.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DUSE_GPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400 -DGPS_USE_LATLONG&lt;br /&gt;
ap.srcs += gps_ubx.c gps.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Mundhra</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Simulation&amp;diff=4996</id>
		<title>Simulation</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Simulation&amp;diff=4996"/>
		<updated>2009-04-20T11:26:14Z</updated>

		<summary type="html">&lt;p&gt;Mundhra: /* Compiling and starting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page describes the steps needed to run a flight simulation.&lt;br /&gt;
&lt;br /&gt;
==Compiling and starting==&lt;br /&gt;
&lt;br /&gt;
From the [[Paparazzi_Center|Paparazzi Center]] select the MJ5 aircraft (from the '''A/C''' combo box) which is configured with the &amp;lt;tt&amp;gt;basic.xml&amp;lt;/tt&amp;gt; flight plan. From the '''Target''' combo box, select &amp;lt;tt&amp;gt;sim&amp;lt;/tt&amp;gt; and click the '''Build''' button to compile the airbone code to be run on your Linux box. From the '''Session''' combo box, select &amp;lt;tt&amp;gt;Simulation&amp;lt;/tt&amp;gt; entry and click '''Execute''' to start the simulation. It will start &lt;br /&gt;
three processes which are listed in the window below:&lt;br /&gt;
* '''MJ5''' is the interface of a simulator program. It runs the same code as the one for the autopilot processor plus a rudimentary flight dynamic model. it allows you to test the interactions with the UAV and the flight plan execution.&lt;br /&gt;
* '''GCS''' ([[GCS|Ground Control Station]]) is the main window. It displays the track of the aircraft, as well as informations about the execution of its flight plans. This program provide menus for the datalink functions and is able to edit a flight plan.&lt;br /&gt;
* '''Server''' is a hidden process which won't be described here (see [[Overview|the architecture of the system]])&lt;br /&gt;
&lt;br /&gt;
== Start the Simulation ==&lt;br /&gt;
&lt;br /&gt;
The aircraft has automatically been booted, as if the autopilot board had been powered. Its position and its flight parameters are displayed in the GCS window.&lt;br /&gt;
&lt;br /&gt;
The map widget is able use many map formats and display them according to many projections. To make things simple, we start by using images from [http://maps.google.com Google]. From the toolbar in theUnder the GCS, click the Google Earth icon ('''Google maps fill'''). The program attempts to download the required satellite images from the Google servers. If it succeeds, you should now see the nice countryside of Muret (a city close to Toulouse, France). Navigation and other features of the map are described on the [[GCS#map|GCS]] page.&lt;br /&gt;
&lt;br /&gt;
The lower part of the GCS displays the flight plan in a tree view. You see that the current flight plan is composed of several ''blocks'':&lt;br /&gt;
* '''wait GPS''' and '''geo init''' which are instructions to run this flight plan anywhere in the world, by translating the waypoints around the current location of aircraft as soon as it is reported by the GPS.&lt;br /&gt;
* '''Holding point''' (it  should be the current active block) which instructs the autopilot to wait for launch.  &lt;br /&gt;
* '''Takeoff''' which will instruct the aircraft to climb full throttle to a security altitude&lt;br /&gt;
* '''Standby''' which is a simple circle around the '''STDBY''' waypoint.&lt;br /&gt;
&lt;br /&gt;
Switch to the '''Takeoff''' block by a double click on the line or using the corresponding button (an icon figuring an airway) on the left side of the strip.&lt;br /&gt;
&lt;br /&gt;
== Fly ==&lt;br /&gt;
&lt;br /&gt;
In the Simulator ('''MJ5''' window), press the '''Launch''' button to simulate a hand launch or click the launch button in the GCS (the green aircraft icon). The autopilot detects the launch by monitoring the groundspeed. The flight time (in the aircraft label on the GCS) then starts to count.&lt;br /&gt;
&lt;br /&gt;
Position of the aircraft is displayed on the map: the aircraft goes to the '''CLIMB''' waypoint (to the norht-west) and then around the '''STDBY''' waypoint. Current block also changes accordingly in the flight plan display.&lt;br /&gt;
&lt;br /&gt;
The orange triangle (the carrot) on the map is the point that the aircraft is navigating toward.&lt;br /&gt;
&lt;br /&gt;
== Line ==&lt;br /&gt;
&lt;br /&gt;
Jump to this block with double-click on the &amp;lt;tt&amp;gt;Line 1-2&amp;lt;/tt&amp;gt; line in the flight plan or using the corresponding button in the strip (figuring a blue line between two white points). The aircraft will try to follow a line joining the waypoints '''1''' and '''2''', doing nice U-turns at both ends.&lt;br /&gt;
&lt;br /&gt;
=== Move waypoints ===&lt;br /&gt;
&lt;br /&gt;
While the aircraft is flying (or here while the simulator is integrating differential equations), you can move the waypoints on the GCS interface by cliking and dragging (with the left button). When the mouse button is released, a popup window allows you to change the altitude of the waypoint. After validation, the waypoint changes are sent to the autopilot and the followed track is changed accordingly.&lt;br /&gt;
&lt;br /&gt;
=== Coming back around ===&lt;br /&gt;
&lt;br /&gt;
Select the '''Standby''' block (the ''home'' blue icon) to instruct the aircraft to fly around the '''STDBY''' waypoint.&lt;br /&gt;
&lt;br /&gt;
== Fly too far ==&lt;br /&gt;
&lt;br /&gt;
If you unzoom the map (using the PageDown key or he mouse wheel), you will see a large circle around the waypoints. This circle show the allowed flying zone that the autopilot must not leave or it will enter an emergency navigation mode and circles the '''HOME''' waypoint until the further direction is received.&lt;br /&gt;
&lt;br /&gt;
Move the waypoint '''2''' out of this circle (close to the circle in the north-east corner) and switch back to the 'Line 1-2''' block to force the plane to get out of this safety zone.&lt;br /&gt;
&lt;br /&gt;
The aircraft flies to the '''2''' waypoint, cross the protection enveloppe and switches to ''home'' mode: the AP mode in the aircraft strip switches from '''AUTO2''' to '''HOME'''.&lt;br /&gt;
&lt;br /&gt;
To get out of this mode and switch back to the default '''AUTO2''', click on the '''AUTO2''' button in the aircraft strip. The aircraft then flies again towards '''too far''' and again swithes to '''HOME''' mode.&lt;br /&gt;
&lt;br /&gt;
== Change the environment ==&lt;br /&gt;
&lt;br /&gt;
Launch the '''Environment Simulator''' from the '''Tools' menu in the '''Paparazzi Center'''.&lt;br /&gt;
&lt;br /&gt;
This interface (also called'''Gaia''') allows the user to change:&lt;br /&gt;
* The wind: Set up a wind speed of 5m/s and observe the trajectory and the speed evolution (in the aircraft strip and in the '''PFD''' page of the notebook).&lt;br /&gt;
* The GPS coverage: Shut down the GPS ('''GPS OFF''') and observe the resulting mode ('''NO_GPS''') and trajectory. In this mode, the autopilot uses the failsafe roll, pitch and throttle settings defined in the airframe file. Note that in a real flight, an aircraft without GPS won't be able to send its position ... The simulation is cheating here !&lt;br /&gt;
* The time scale: If you are in a hurry ... Do not use a time higher than 2 for this first demonstration.&lt;br /&gt;
&lt;br /&gt;
== Other navigation patterns ==&lt;br /&gt;
&lt;br /&gt;
Using the buttons in the strip, you can play with other navigation patterns: eigh figure, oval, survey of a rectangle (with a north-south sweeping), ''Turn around here'' (which sets a waypoint to the current location of the plane and flies a circle around).&lt;br /&gt;
&lt;br /&gt;
== Landing ==&lt;br /&gt;
&lt;br /&gt;
To automatically land the aircraft:&lt;br /&gt;
* Set the '''TD''' (Touch Down) waypoint where you want to land. Be sure that the waypoint is on the ground (185m in Muret)&lt;br /&gt;
* Set the '''AF''' (Approach Fix) waypoint where you want to start the final descent (the ''glide''). If you have set some wind with Gaia, you probably want to fly '''AF-TD''' upwind (an estimation of the wind experienced by the aircraft is displayed in the left-upper corner of the map).&lt;br /&gt;
* Switch to the '''Land right''' or the '''Land left''' block (icons in the strip) according to the direction of the last turn you want to do (for example, if '''AF''' is on the east side of '''TD''' and you want to maneuvre from the north, choose a '''Land right''') &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== View the simulation in Flight Gear ==&lt;br /&gt;
&lt;br /&gt;
To view the simulation in Flight Gear, do the following:&lt;br /&gt;
* In Paparazzi Center, add to the simulator command the &amp;lt;tt&amp;gt;-fg&amp;lt;/tt&amp;gt; option plus the IP address of the machine running flightgear:&lt;br /&gt;
 .../sw/simulator/launchsitl -a TJ1 -fg 127.0.0.1 -boot -norc&lt;br /&gt;
* Launch Flight Gear with the following command:&lt;br /&gt;
 fgfs --fdm=null --native-gui=socket,in,30,,5501,udp&lt;br /&gt;
&lt;br /&gt;
=== Why is it night in Flight Gear, if my sim is flying during the day? ===&lt;br /&gt;
The time that is sent to Flight Gear is hard coded into the code, so if you try to view the output of the simulation and your simulated flight is located far from France, in Flight Gear, everything may be dark. If your simulated flight is in France, then you will always have daylight in Flight Gear. To fix this, do the following (you will need to have paparazzi-dev installed to do this):&lt;br /&gt;
&lt;br /&gt;
* Get the Unix time during your '''local daylight hours''' by running the following command in your terminal:&lt;br /&gt;
 date +%s&lt;br /&gt;
* In the file: paparazzi3/sw/simulator/fg.c find the line(line 44):&lt;br /&gt;
 msg.cur_time = 3213092700ul;//time(NULL);&lt;br /&gt;
* Paste the output from &amp;quot;date +%s&amp;quot; in place of &amp;quot;3213092700&amp;quot;&lt;br /&gt;
* Now you will have to rebuild paparazzi, so in the terminal change to the paparazzi3 directory and run:&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
* In Paparazzi Center clean and rebuild your simulation&lt;br /&gt;
* Launch the simulation and Flight Gear, and Flight Gear should be flying in daylight.&lt;/div&gt;</summary>
		<author><name>Mundhra</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Users&amp;diff=4387</id>
		<title>Users</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Users&amp;diff=4387"/>
		<updated>2009-01-28T13:09:32Z</updated>

		<summary type="html">&lt;p&gt;Mundhra: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Please add yourself to this list if you wish to share who you are and what you are doing with Paparazzi&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;background:black; color:blue&amp;quot;&lt;br /&gt;
|+ Asia&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Location !! Hardware !! Joined !! Current activities / project status&lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| New User || 1 || 2 ||| 3 || 4 &lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| [mailto:mundhra@gmail.com M Mundhra] || India || Tiny 1.3 ||| 2007 || Gain tuning on a flying wing configuration airframe &lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| [mailto:ngkiangloong_at_hopetechnik.com Jianlun]|| Singapore || TWOG V1 ||| 2008 || trying to get TWOG onto an EasyStar. very much a newbie! &lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;background:black; color:blue&amp;quot;&lt;br /&gt;
|+ Europe&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Location !! Hardware !! Joined !! Current activities / project status&lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| [mailto:silas_at_silas.hu SilaS] || Budapest || Tiny 1.3 ||| 2007 || Applied tiny to GWS Estarter, finished long travels in AUTO2. Now transfert it to a Twinstar and working on pairing tiny with FPV. &lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| [mailto:st.jr_at_gmx.at TomS] || Graz || Tiny 2.11 ||| 2008 || Starting to complete the wiring for the tiny and then trying to apply it to my TwinStar II. &lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| [mailto:markggriffin_at_gmail.com MarkG] || Geneva, Switzerland || Modified Tiny 2.11, EeePC as GCS, Multiplex FunJet  ||| 2008 || Many successful flights. &lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| [mailto:x-microdrones@2007.polytechnique.org X-MicroDrones] || Paris, France || Tiny 2.11, Quad-Tilt-Rotor VTOL  ||| 2008 || Wiring completed, first flights soon... We're trying to adapt Paparazzi to a Quad-Tilt-Rotor VTOL able to perform both airplane-like and helicopter-like flights. Working on inertial measurement units implementation. &lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| [[User:MarcusWolschon|Marcus Wolschon]] || Freiburg, Germany || Gumstix, Paraplane  ||| 2008 || Porting Paparazzi to Linux-Userland with UDP-communication using mesh-networking.&lt;br /&gt;
UDP-Downlink working, GPS via GPSD working, Pararazzi in Linux working, Hardware still RC-only due to sensor-soldering-issues&lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| [mailto:spam1_at_marzer.com CedricM] || Geneva, Switzerland || Tiny 2.11, Multiplex FunJet with video camera  ||| 2008 || Many successful flights working on an osd module and weather probes. &lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| [mailto:hendrix_at_vivodinet.gr Chris Efstathiou] || Piraeus Hellas || tiny 2.11 on a Mpx EasyGlider, TWOG 1.3 on a Boomerang turbine jet ||| 2008 || The Easyglider is fully operational, still working on the jet which had his first flight with the TWOG at 25/1/2009  &lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| New User || 1 || 2 ||| 3 || 4 &lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;background:black; color:blue&amp;quot;&lt;br /&gt;
|+ North America&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Location !! Hardware !! Joined !! Current activities / project status&lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| [mailto:pauldanielcox_at_gmail_dot_com Paul Cox]  &lt;br /&gt;
|Vancouver, WA [http://maps.google.com/maps?f=q&amp;amp;source=s_q&amp;amp;hl=en&amp;amp;geocode=&amp;amp;q=98663&amp;amp;sll=37.0625,-95.677068&amp;amp;sspn=64.664844,101.953125&amp;amp;ie=UTF8&amp;amp;ll=45.606112,-122.643471&amp;amp;spn=0.222411,0.398254&amp;amp;z=12 &amp;lt;span title=&amp;quot;Google Map of 98663&amp;quot;&amp;gt;98663&amp;lt;/span&amp;gt;] &lt;br /&gt;
|    Tiny v2.11  ||  Nov. 2008 || Getting geared up for a maiden flight soon hopefully. Skype: pauldanielcox Gtalk: [use email] &lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| [mailto:quill_at_u.washington.edu John Burt] || Portland, Oregon || Tiny v2.11 from PPZUAV, Multiplex Cularis, 9Xtend modems, T7CAP TX, ground station: EEE PC701 and/or Nokia N810 ||| Jan 2009 || Debugging Tiny-GCS interface. Possibly first test flights in late Jan 09. &lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| [mailto:bmw330i@me.com David Conger] || San Diego (Ramona), California || Tiny1.3 (PPZUAV)  ||| Sept 2007 || Flying Wing MAV with onboard video. Test platform for the new 900mhz XBPro 900 RF modems.&lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| USU AggieAir Remote Sensing || Logan, UT || TWOG (PPZUAV)  ||| January 2009 || Building 72&amp;quot; Flying Wings which will be used for remote sensing&lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| [http://www.engr.usu.edu/wiki/index.php/OSAM USU OSAM-UAV] || Logan, UT || TWOG (PPZUAV)  ||| June 2007 || 2x72&amp;quot; 5x48&amp;quot; 1x60&amp;quot; Flying Wings. Research backyard for AggieAir Remote Sensing&lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| New User || 1 || 2 ||| 3 || 4 &lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;background:black; color:blue&amp;quot;&lt;br /&gt;
|+ Central America&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Location !! Hardware !! Joined !! Current activities / project status&lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| [mailto:joschau@comcast.net Joekadet] || David Panama' || Tiny v2.11/LEA-4P (PPZUAV) No RF Modems yet.  Multiplex Mentor  ||| 2008 || Working on Airframe build. Paparazzi AP is wired and working awaiting integration into airframe. First flight hopefully end of February.&lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| New User || 1 || 2 ||| 3 || 4 &lt;br /&gt;
|}&lt;br /&gt;
----&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;background:black; color:blue&amp;quot;&lt;br /&gt;
|+ Australia&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Location !! Hardware !! Joined !! Current activities / project status&lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| [mailto:todd_soaring@yahoo.com.au Todd Sandercock] || Adelaide, SA || Tiny v2.11, Multiplex Twinjet, 9Xtend modems ||| Jan 2008 || Completed successful flight testing. Now designing new airframe.  &lt;br /&gt;
|- style=&amp;quot;background:bisque; color:black&amp;quot;&lt;br /&gt;
| New User || 1 || 2 ||| 3 || 4 &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Mundhra</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Get_Hardware&amp;diff=4162</id>
		<title>Get Hardware</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Get_Hardware&amp;diff=4162"/>
		<updated>2008-11-25T02:58:03Z</updated>

		<summary type="html">&lt;p&gt;Mundhra: /* HALFBASE removed by Anton on 10/07/2008. Multiple people have claimed fraud. No delivery of product confirmed yet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As an open-source project, all source code and hardware plans are [http://cvs.savannah.gnu.org/viewvc/paparazzi/paparazzi3/hw/ freely available on the CVS Server] for anyone to produce, use, modify, and redistribute in accordance with the [http://www.gnu.org/licenses/gpl.txt GPL License Agreement] which requires only that the open-source nature of the project be maintained by all who redistribute it.&lt;br /&gt;
&lt;br /&gt;
We encourage the distribution of hardware for profit or otherwise and invite any users with paparazzi-related hardware to post links and purchasing information on this page.  Please use the [[Talk:Get_Hardware&amp;amp;action=edit|Discussion Tab]] to describe your experiences with any of these vendors.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
= [http://www.fmadirect.com FMA Direct] =&lt;br /&gt;
[[image:1888.gif|thumb|400px|FMA Direct]]&lt;br /&gt;
FMA is a good source of low cost IR sensors.&lt;br /&gt;
* [http://www.fmadirect.com/Detail.htm?item=1778&amp;amp;section=20 X-Y Sensor]&lt;br /&gt;
* [http://www.fmadirect.com/Detail.htm?item=1888&amp;amp;section=47 Z-Sensor]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
= HALFBASE removed by Anton on 10/07/2008. Multiple people have claimed fraud. No delivery of product confirmed yet =&lt;br /&gt;
 Some people have had problems with Halfbase. For more information see [http://lists.gnu.org/archive/cgi-bin/namazu.cgi?query=%22Order+from+HALFBASE%22&amp;amp;submit=Search&amp;amp;idxname=paparazzi-devel this thread] in the mailing list.&lt;br /&gt;
 '''PLEASE READ BEFORE ORDERING'''.&lt;br /&gt;
There is more than 80% received their Products, in which 50% have received in timely Manner!  &lt;br /&gt;
~ Most importantly, No fraud indeed!  ~&lt;br /&gt;
Please contact BAE systems (  Global defence and aerospace, for military )  &lt;br /&gt;
Blake, Alex - Alex.Blake@baesystems.com ( Would offer you reference about me!)&lt;br /&gt;
&lt;br /&gt;
Jeffrey Szeto&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is no proof for the 80% he is claiming. If you are still very willing to order from HALFBASE because of their attractive low prices then do have a look at the thread, the link of which is mentioned above. There is hardly anyone in there who has recieved the order from HALFBASE, also after they get your money, they just stop responding back. I am still waiting for my order from last 5 Months.&lt;br /&gt;
&lt;br /&gt;
Mohit Mundhra&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= [http://mantiselec.com/paparazzi.html Mantis Electronics] =&lt;br /&gt;
[[image:lot1.jpg|thumb|400px|Mantis Electronics]]&lt;br /&gt;
Mantis Electronics is pleased to offer assembled Tiny 2.11, IR boards, GPS modules, USB-TTL interface boards, 3-Axis I2C/SPI accelerometer boards, and accessories for immediate order.&lt;br /&gt;
Our boards are solder paste stencilled, reflow soldered and 100% tested.&lt;br /&gt;
&amp;lt;h3&amp;gt;Our Items:&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Tiny 2.11 assembled with LEA-4P and GPS antenna: &amp;lt;b&amp;gt;$250&amp;lt;/b&amp;gt; ($260 with Molex Picoblade connectors)&lt;br /&gt;
&amp;lt;li&amp;gt;2-Axis IR board with IR sensors: &amp;lt;b&amp;gt;$75&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;1-Axis IR board with IR sensors: &amp;lt;b&amp;gt;$55&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;u-blox LEA-4P GPS module: &amp;lt;b&amp;gt;$75&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;USB&amp;lt;-&amp;gt;TTL Serial board: &amp;lt;b&amp;gt;$15&amp;lt;/b&amp;gt; (useful for programming and telemetry)&lt;br /&gt;
&amp;lt;li&amp;gt;3-Axis I2C/SPI accelerometer board: &amp;lt;b&amp;gt;$35&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;MLX90247 IR sensors: &amp;lt;b&amp;gt;$12&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Tiny 2.11 bare PCB: &amp;lt;b&amp;gt;$10&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;2-Axis IR bare PCB: &amp;lt;b&amp;gt;$5&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;1-Axis IR bare PCB: &amp;lt;b&amp;gt;$5&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
Current lead time for orders is 3 weeks.  USA shipping is $6. International shipping is $15.&lt;br /&gt;
&amp;lt;br&amp;gt;Please see our website [http://mantiselec.com/paparazzi.html http://mantiselec.com/paparazzi.html] to order.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
= [http://www.olimex.com/pcb/ Olimex] =&lt;br /&gt;
[[image:pcb-green.jpg|thumb|400px|Olimex PCBs]]&lt;br /&gt;
Fast PCB Prototypes&lt;br /&gt;
[http://www.olimex.com/pcb/ www.olimex.com/pcb]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
= [http://www.ppzuav.com/ PPZUAV] Get it now without issues. =&lt;br /&gt;
[[image:BUNDLE2BASIC.jpg|thumb|400px|PPZUAV]]&lt;br /&gt;
&amp;lt;h3&amp;gt;Our Items&amp;lt;/h3&amp;gt;&lt;br /&gt;
*[http://ppzuav.com/osc/catalog/product_info.php?products_id=59 Tiny2.11 Autopilot]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://ppzuav.com/osc/catalog/product_info.php?products_id=60 TWOG Autopilot]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://ppzuav.com/osc/catalog/product_info.php?products_id=74 Paparazzi design external GPS units]&amp;lt;br&amp;gt;&lt;br /&gt;
*[http://ppzuav.com/osc/catalog/index.php?cPath=12 RF modems]&amp;lt;br&amp;gt;&lt;br /&gt;
Confused what to buy? We have bundles ([http://ppzuav.com/osc/catalog/product_info.php?products_id=68 Tiny2.11 Bundle] and [http://ppzuav.com/osc/catalog/product_info.php?products_id=71 TWOG bundle]) to make it easier for you to get what you need quickly. &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;We know it's hard to decide what to get, what you need to do etc. so we do quite a bit to help ensure when your parts arrive they are pre-programmed and include cables you'll need. These steps include:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;We load the bootloader&lt;br /&gt;
&amp;lt;li&amp;gt;configure the GPS module (LEA-5H Tiny2.11 we also update the GPS Firmware to the latest from u-blox)&lt;br /&gt;
&amp;lt;li&amp;gt;We load a sample tiny2.11 program into it. &lt;br /&gt;
&amp;lt;li&amp;gt;We verify it runs the program (LED1/RED flashes) &lt;br /&gt;
&amp;lt;li&amp;gt;Then acquires a 3D fix (LED2/GREEN flashes).&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
* For TWOG orders we load the USB Boot Loader for you before shipping.&amp;lt;br&amp;gt;&lt;br /&gt;
* For Paparazzi GPS orders we update the u-blox firmware and load the Paparazzi GPS configuration file AND include the cable to connect it to the TWOG&amp;lt;br&amp;gt;&lt;br /&gt;
Our goal is for you to focus on learning paparazzi not trying to determine if your autopilot is working. This means you can use the USB programming cable (included) and load your aircraft configuration as soon as you receive your Autopilot. &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Please eMail '''sales@ppzuav.com''' with any questions or special requests before you place your orders. We return emails as quickly as possible. If it's an easy question within hours. More complex or longer explanation requests may take some time to read then write your answer so be patient.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
[http://www.ppzuav.com/osc/catalog Visit the PPZUAV WebStore to see the latest offerings.]&lt;br /&gt;
-----&lt;br /&gt;
Important Information about [[PPZUAV_SHIPPING]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= [http://www.sparkfun.com Sparkfun] =&lt;br /&gt;
[[image:P1030095.jpg|thumb|400px|Sparkfun]]&lt;br /&gt;
Sparkfun is a great source of miscelaneous electronics like:&lt;br /&gt;
* Gyros&lt;br /&gt;
* Accelerometers&lt;br /&gt;
* Pressure sensors&lt;br /&gt;
* Ultrasonic distance sensors&lt;br /&gt;
* Temperature/humidity sensors&lt;br /&gt;
* USB to Serial converters&lt;br /&gt;
* LEDs&lt;br /&gt;
* Etc.&lt;/div&gt;</summary>
		<author><name>Mundhra</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=3342</id>
		<title>Airframe Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=3342"/>
		<updated>2008-03-28T08:11:51Z</updated>

		<summary type="html">&lt;p&gt;Mundhra: /* Bat */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The airframe configuration file is located in &amp;lt;tt&amp;gt;conf/airframes&amp;lt;/tt&amp;gt; and contains&lt;br /&gt;
all the hardware and software settings for an aircraft. This is an [http://en.wikipedia.org/wiki/Xml XML] file containing some [http://en.wikipedia.org/wiki/Makefile Makefile] code at the bottom. All gains, trims, and behavior settings are defined with standard XML elements. The hardware definitions such as processor type, modem protocol, servo driver, etc. are contained in the makefile raw section.&lt;br /&gt;
&lt;br /&gt;
== Selecting the Airframe File ==&lt;br /&gt;
Each airframe file must be assigned a name, unique ID, flight plan, etc. in [[Conf.xml|&amp;lt;tt&amp;gt;conf/conf.xml&amp;lt;/tt&amp;gt;]] as follows:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;conf&amp;gt;&lt;br /&gt;
  &amp;lt;aircraft &lt;br /&gt;
    name=&amp;quot;Twin1&amp;quot;&lt;br /&gt;
    ac_id=&amp;quot;1&amp;quot;&lt;br /&gt;
    airframe=&amp;quot;airframes/twinstar1.xml&amp;quot; &lt;br /&gt;
    radio=&amp;quot;radios/mc3030.xml&amp;quot; &lt;br /&gt;
    flight_plan=&amp;quot;flight_plans/mav05_cw.xml&amp;quot;&lt;br /&gt;
    telemetry=&amp;quot;telemetry/default.xml&amp;quot;&lt;br /&gt;
    gui_color=&amp;quot;blue&amp;quot;&lt;br /&gt;
  /&amp;gt;&lt;br /&gt;
  &amp;lt;aircraft &lt;br /&gt;
    name=&amp;quot;Plaster&amp;quot;&lt;br /&gt;
    ac_id=&amp;quot;2&amp;quot;&lt;br /&gt;
    airframe=&amp;quot;airframes/plaster1.xml&amp;quot; &lt;br /&gt;
    radio=&amp;quot;radios/cockpitMM.xml&amp;quot; &lt;br /&gt;
    telemetry=&amp;quot;telemetry/default.xml&amp;quot;&lt;br /&gt;
    flight_plan=&amp;quot;flight_plans/dummy.xml&amp;quot;&lt;br /&gt;
  /&amp;gt;&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  &amp;lt;/conf&amp;gt;&lt;br /&gt;
Then, to compile and flash the airframe settings and associated flight plan to your autopilot, simply select the appropriate A/C and target in the [[Paparazzi_Center|Paparazzi Center]] or specify your airframe name in the flash command typed from the prompt:&lt;br /&gt;
 make AIRCRAFT=&amp;lt;b&amp;gt;Twin1&amp;lt;/b&amp;gt; ap.upload&lt;br /&gt;
More information can be found on the [[Conf.xml|conf.xml]] page&lt;br /&gt;
&lt;br /&gt;
== XML Parameters ==&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;commands&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; lists the abstract commands you need to control the aircraft. In our example, we have only three:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;commands&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;THROTTLE&amp;quot; failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;ROLL&amp;quot;     failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;PITCH&amp;quot;    failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/commands&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Each command is associated with a failsafe value which will be used if no controller is active (during initialization for example). The range of these values is [-9600:9600]. Note that these commands do not necessarily match the servo actuators. For example, the ROLL command is typically linked to two aileron actuators.&lt;br /&gt;
&lt;br /&gt;
=== Servos ===&lt;br /&gt;
&lt;br /&gt;
The above commands get translated to the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; here.  In this example we use two ailevons (surfaces used for both pitch and roll as on a flying wing) and a motor. These are listed in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;servos&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;THROTTLE&amp;quot;      no=&amp;quot;0&amp;quot; min=&amp;quot;1000&amp;quot; neutral=&amp;quot;1000&amp;quot; max=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;AILEVON_LEFT&amp;quot;  no=&amp;quot;1&amp;quot; min=&amp;quot;2000&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;1000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;AILEVON_RIGHT&amp;quot; no=&amp;quot;2&amp;quot; min=&amp;quot;1000&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/servos&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where names are associated to the corresponding servo channel number on the autopilot and the neutral value, total range and direction are defined.  Min/max/neutral values are expressed in milliseconds and the direction of travel can be reversed by exchanging min with max (as in &amp;lt;tt&amp;gt;&amp;quot;AILEVON_LEFT&amp;quot;&amp;lt;/tt&amp;gt;, above).  The ''standard'' travel for a hobby servo is 1000ms - 2000ms with a 1500ms neutral.  Trim can be added by changing this neutral value, and absolute travel limits can be increased or reduced with the min/max values.  The &amp;lt;tt&amp;gt;&amp;quot;THROTTLE&amp;quot;&amp;lt;/tt&amp;gt; servo typically has the same value for the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;neutral&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;min&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;.  Note the following tips:&lt;br /&gt;
* Reverse the servo direction by exchanging min/max&lt;br /&gt;
* Trim should always be adjusted mechanically if possible to avoid asymetrical travel&lt;br /&gt;
* Any reduction of the total travel range should be done mechanically to maintain precision&lt;br /&gt;
* Many servos will respond well to values slightly outside the normal 1000-2000ms range but experiment carefully as the servo may not operate reliably outside this range and may even suffer permanent damage.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; are then linked to the commands in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;command_laws&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;command_laws&amp;gt;&lt;br /&gt;
  &amp;lt;let var=&amp;quot;aileron&amp;quot;         value=&amp;quot;@ROLL  * 0.3&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;let var=&amp;quot;elevator&amp;quot;        value=&amp;quot;@PITCH * 0.7&amp;quot;/&amp;gt;  &lt;br /&gt;
  &amp;lt;set servo=&amp;quot;THROTTLE&amp;quot;      value=&amp;quot;@THROTTLE&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;set servo=&amp;quot;AILEVON_LEFT&amp;quot;  value=&amp;quot;$elevator + $aileron&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;set servo=&amp;quot;AILEVON_RIGHT&amp;quot; value=&amp;quot;$elevator - $aileron&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/command_laws&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
[[Image:airframe_sign_conventions.jpg|thumb|Sign conventions for flight dynamics]]&lt;br /&gt;
where the third line is the simplest: the throttle servo value equals throttle command value. The other lines define and control the pitch/roll mixing.  Ailevon values are computed with a combination of two commands, '''ROLL''' and '''PITCH'''. This ''mixer'' is defined with two intermediate variables '''aileron''' and '''elevator''' introduced with the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;let&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; element.  The '''@''' symbol is used to reference a command value in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; attribute of the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;set&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;let&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; elements.  In the above example, the servos are limited to +/- 70% of their full travel for pitch and 30% for roll, only in combination can the servos reach 100% deflection.  Note that these numbers ''should add up 100% or more, never less''.  For example, you may want 100% travel available for pitch - this means if a roll is commanded along with maximum pitch only one servo will respond to the roll command as the other has already reached its mechanical limit.  If you find after tuning that these numbers add to less than 100% consider reducing the surface travel mechanically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the signs used in the description follow the standard convention.&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;
&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;
&lt;br /&gt;
This example looks trivial since the channel values have the same name than the commands.&lt;br /&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;tt&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;RadOfDeg(35)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_PITCH&amp;quot; value=&amp;quot;RadOfDeg(35)&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ADC === &lt;br /&gt;
In the &amp;quot;adc&amp;quot; section, you will find the correspondance between arguments and their assigned pins on the autopilot board.&lt;br /&gt;
 &amp;lt;section name=&amp;quot;adc&amp;quot; prefix=&amp;quot;ADC_CHANNEL_&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR1&amp;quot; value=&amp;quot;ADC_1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR2&amp;quot; value=&amp;quot;ADC_2&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR_TOP&amp;quot; value=&amp;quot;ADC_0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
'''Important note''': To ''activate'' an ADC entry, a flag must be defined in the &amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt; section. For the previous example, we would have to write:&lt;br /&gt;
&lt;br /&gt;
 ap.CFLAGS += -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2&lt;br /&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.&lt;br /&gt;
&lt;br /&gt;
The first definitions are relative to 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;
&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;
&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;
The next lines define the installation of the horizontal and vertical sensors. The vertical sensor must  give a positive value when the temperature under the aircraft is higher than the temperature above. The two channels of the horizontal sensor must give positive values when it is warmer on the right side and the rear side. To adjust these signs, use the following declarations:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;IR2_SIGN&amp;quot; value=&amp;quot;-1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;TOP_SIGN&amp;quot; value=&amp;quot;-1&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, define the orientation of the horizontal sensor, &amp;lt;tt&amp;gt;TILTED&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;ALIGNED&amp;lt;/tt&amp;gt;:&lt;br /&gt;
   &amp;lt;define name=&amp;quot;HORIZ_SENSOR_TILTED&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The three axis must give similar values for similar contrasts. The following factors can be used to scale these values. For example with an horizontal tilted sensor, the following ratios are usually needed:&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;define name=&amp;quot;LATERAL_CORRECTION&amp;quot; value=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;LONGITUDINAL_CORRECTION&amp;quot; value=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;VERTICAL_CORRECTION&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
Default values are 1.&lt;br /&gt;
&lt;br /&gt;
It may be hard to align the horizontal sensor with the aircraft. A tuning in flight will be needed to adjust the following neutrals. Adjust the roll neutral to fly straight. Adjust the pitch neutral to fly level with the desired throttle.&lt;br /&gt;
   &amp;lt;define name=&amp;quot;ROLL_NEUTRAL_DEFAULT&amp;quot; value=&amp;quot;-2.5&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;PITCH_NEUTRAL_DEFAULT&amp;quot; value=&amp;quot;6&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, an asymmetric (left/right, front/rear) correction can be added with a last set of factors.&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_UP&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_DOWN&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_LEFT&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;CORRECTION_RIGHT&amp;quot; value=&amp;quot;1.&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
These corrections are set on the angles.&lt;br /&gt;
&lt;br /&gt;
=== Gyro === &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;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;GYRO&amp;quot; prefix=&amp;quot;GYRO_&amp;quot;&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;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Bat === &lt;br /&gt;
This section give characteristics for the monitoring of the main power battery. &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MILLIAMP_PER_PERCENT&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; represents the consumption (in mA) for one percent of THROTTLE and for one time unit. It is used to compute the &amp;lt;tt&amp;gt;energy&amp;lt;/tt&amp;gt; value of the &amp;lt;tt&amp;gt;BAT&amp;lt;/tt&amp;gt; message.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;CATASTROPHIC_BAT_LEVEL&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; (was previously &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;LOW_BATTERY&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;) value defines the voltage at which the autopilot will lock the throttle at 0% in autonomous mode (kill_throttle mode). This value is also used by the ground server to issue a '''CATASTROPHIC''' alarm message on the bus (this message will be displayed in the console of the GCS).  &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;CRITIC&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;LOW&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; values will also used as threshold for '''CRITIC''' and '''WARNING''' alarms. They are optional and the respective defaults are 10.0 and 10.5V.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MAX_BAT_LEVEL&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; may be specified to improve the display of the battery gauge in the strip. This definition is optional with a default value of 12.5V.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;BAT&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MILLIAMP_PER_PERCENT&amp;quot; value=&amp;quot;0.86&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VOLTAGE_ADC_A&amp;quot; value=&amp;quot;0.0177531&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VOLTAGE_ADC_B&amp;quot; value=&amp;quot;0.173626&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;VoltageOfAdc(adc)&amp;quot; value =&amp;quot;(VOLTAGE_ADC_A * adc + VOLTAGE_ADC_B)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CATASTROPHIC_BAT_LEVEL&amp;quot; value=&amp;quot;6.0&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CRITIC_BAT_LEVEL&amp;quot; value=&amp;quot;6.5&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;LOW_BAT_LEVEL&amp;quot; value=&amp;quot;7.0&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;MAX_BAT_LEVEL&amp;quot; value=&amp;quot;8.4&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Horizontal Control ===&lt;br /&gt;
 &amp;lt;tt&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;0.35&amp;quot; unit=&amp;quot;radians&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;/tt&amp;gt;&lt;br /&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;
===Vertical Control===&lt;br /&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.065&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;/&amp;gt;&lt;br /&gt;
These lines are associated with vertical control loops contained in ./sw/airborne/fw_v_ctl.c.  These are outer loop parameters that calculate a desired climb rate based on altitude error. 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;define name=&amp;quot;AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE&amp;quot; value=&amp;quot;0.65&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;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_MAX_CRUISE_THROTTLE&amp;quot; value=&amp;quot;1&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;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_THROTTLE_DASH_TRIM&amp;quot; value=&amp;quot;-2500&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;define name=&amp;quot;AUTO_THROTTLE_PGAIN&amp;quot; value=&amp;quot;-0.008&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;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These lines are associated with vertical rate control loops contained in ./sw/airborne/fw_v_ctl.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;
&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;0.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO_PITCH_MIN_PITCH&amp;quot; value=&amp;quot;-0.5&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These lines are associated with vertical control loops contained in ./sw/airborne/fw_v_ctl.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;
&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;
THROTTLE_SLEW_LIMITER is the required time is seconds to change throttle from 0% to 100%.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
 &amp;lt;tt&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.&amp;quot; unit=&amp;quot;m/s&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;define name=&amp;quot;CARROT&amp;quot; value=&amp;quot;5.&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;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;/section&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&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;
== Hardware definitions - Makefile ==&lt;br /&gt;
&lt;br /&gt;
The airframe file must include the description of the controller board and it's low-level settings.  This is done in one &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;makefile&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section starting with the autopilot model and flashing mode:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;makefile&amp;gt;&lt;br /&gt;
  include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;FLASH_MODE=IAP&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
  .&lt;br /&gt;
 &amp;lt;/makefile&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Below this are the definintions and configuration of the peripherals and interfaces.&lt;br /&gt;
&lt;br /&gt;
=== R/C ===&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.EXTRA_SRCS += radio_control.c $(SRC_ARCH)/ppm_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DACTUATORS=\&amp;quot;servos_direct_hw.h\&amp;quot;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
  &amp;lt;nowiki&amp;gt;ap.EXTRA_SRCS += $(SRC_ARCH)/servos_direct_hw.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can set RADIO_CONTROL_TYPE to RC_FUTABA, for falling edge PPM, or RC_JR for rising edge PPM.&lt;br /&gt;
&lt;br /&gt;
For the classix, you must specify which pins to use for PWM by adding &amp;quot;-DPWM_SERVO_0, etc.&amp;quot; to the line fbw.CFLAGS. This activate the PWM channel. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;tt&amp;gt;wiring on classix PWM connector&lt;br /&gt;
  connector   LPC   shared         port &lt;br /&gt;
  PWM1        PWM5  AD1_6  CAP1_3  P0.21&lt;br /&gt;
  PWM2        PWM3  RXD0   EINT0   P0.1&lt;br /&gt;
  PWM3        PWM1  TXD0           P0.0&lt;br /&gt;
  PWM4        PWM6  RXD1   EINT3   P0.9&lt;br /&gt;
  PWM5        PWM4  TXD1   AD1_1   P0.8&lt;br /&gt;
  PWM6        PWM2  SSEL0  EINT2   P0.7&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
PWM1 and PWM6 should be safe. PWM4 and PWM5 should be OK if you're not using UART1 on the FBW processor - same for PWM2 and PWM3 if you're not using UART0 (disable FBW telemetry for that ).&lt;br /&gt;
&lt;br /&gt;
=== Modem ===&lt;br /&gt;
The modem protocol and baud rate must be set in both the airframe file and ground station.  Any standard baud rate can be used, with 9600 being adequate and 57600 recommended for most users to allow high speed telemetry for more detailed flight data analysis.  The actual data rate is determined by the number of messages being sent and the period of each message as defined in &amp;lt;tt&amp;gt;conf/telemetry/default.xml&amp;lt;/tt&amp;gt;.  Those wishing to experiment with &amp;quot;alternative&amp;quot; modems can reduce the number and period of each telemetry message to fit within most any bandwidth constraint.&lt;br /&gt;
&lt;br /&gt;
Paparazzi supports the following modem protocols:&lt;br /&gt;
* Standard transparent serial (pprz) - this is compatible with all modems and can be used to connect the autopilot directly to a PC for testing without a modem.&lt;br /&gt;
* Maxstream API protocol (xbee) - compatible with all Maxstream modems including the 9XTend and Zigbee.  This protocol enables hardware addressing, allowing multiple aircraft to be managed from a single ground modem.&lt;br /&gt;
* Coronis Wavecard - necessary for operation with the unusual Coronis Wavecard modem.&lt;br /&gt;
Select the baud/protocol in the airframe file by commenting/uncommenting the appropriate section as follows:&lt;br /&gt;
==== Configuring The Serial Protocol ====&lt;br /&gt;
Users are advised to start with the standard serial protocol before attempting to setup an addressed API link.  The serial protocol works with virtually any modem as well as direct cable connections.  The baud rates of the airborne modem, autopilot, ground modem, and PC must be configured correctly.  The PC and autopilot serial ports do not need to be set to the same baud rate, i.e. when running multiple aircraft from a single ground modem, the ground modem may require a higher baud rate than any of the airborne modems in order to stream the data from multiple simultaneous sources.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;DATALINK&amp;quot; prefix=&amp;quot;DATALINK_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_TYPE&amp;quot; value=&amp;quot;PPRZ&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DEVICE_ADDRESS&amp;quot; value=&amp;quot;....&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example tells the autopilot to send and recieve data in standard serial form.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml - makefile section at the bottom|&lt;br /&gt;
 # Serial modem &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B57600&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example configures the autopilot serial port (Uart0) to 57,600 baud and calls the serial transport protocol (pprz_transport.c).  Use the &amp;quot;#&amp;quot; symbol to comment lines in this section of the airframe file. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Note:&lt;br /&gt;
* The autopilot and modem serial port baud rates must match at all times, check your modem documentation to find the default baud rate and configure a different rate as needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that the ground station is using the same protocol and an equal or higher baud rate:&lt;br /&gt;
{{Box Code|conf/control_panel.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;session name=&amp;quot;USB&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;program name=&amp;quot;link&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-d&amp;quot; constant=&amp;quot;/dev/paparazzi/ttyUSB0&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;!-- &amp;lt;arg flag=&amp;quot;-transport&amp;quot; constant=&amp;quot;xbee&amp;quot;/&amp;gt; Comment this line for standard serial protocol --&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-uplink&amp;quot; constant=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-s&amp;quot; constant=&amp;quot;57600&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/program&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
 &amp;lt;/session&amp;gt;&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Configuring The Maxstream API Protocol ====&lt;br /&gt;
The optional API protocol enables hardware addressing so that multiple aircraft can be managed from a single ground modem, or multiple aircraft and multiple ground stations can work simultaneously without interference from one another.  API mode is enabled by sending an escape sequence (+++) followed by AT commands, this can be done automatically at each boot or can be permanently configured with the &amp;quot;ATWR&amp;quot; command for greater reliability.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;define name=&amp;quot;XBEE_INIT&amp;quot; value=&amp;quot;\&amp;quot;ATPL2\rATRN1\rATTT80\r\ATBD6\rATWR\r\&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;FALSE&amp;quot;/&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
 &amp;lt;/section&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The above example will program the Maxstream to API mode, 100mW power (ATPL2), 57600 baud (ATBD6), and permanently store the changes (ATWR).  After flashing allow 30 seconds for the modem to store the changes, then disable the init string &amp;lt;tt&amp;gt;&amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;&amp;lt;b&amp;gt;TRUE&amp;lt;/b&amp;gt;&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;, update the baud rate as needed, and re-flash the autopilot.  The modem and autopilot serial port baud rates must match eachother at all times.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Notes: &lt;br /&gt;
* Maxtream modems are factory configured for 9600 baud, in order to change baud rates, first configure the autopilot serial port to match the modem (DUART0_BAUD=B9600), boot the system so that the baud rate change command is sent to the modem (ATBD6) and permanently saved (ATWR), allow 30 seconds for the modem configuration to complete, then reprogram the autopilot with the new baud rate (DUART0_BAUD=B57600) and disabled modem configuration string &amp;lt;tt&amp;gt;&amp;lt;define name=&amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;&amp;lt;b&amp;gt;TRUE&amp;lt;/b&amp;gt;&amp;quot;/&amp;gt; &amp;lt;/tt&amp;gt;.&lt;br /&gt;
* The ac_id defined in &amp;lt;tt&amp;gt;conf/conf.xml&amp;lt;/tt&amp;gt; is permanently programmed into the modem so this procedure would need to be re-run if the modem is moved to another plane.&lt;br /&gt;
* For temporary boot-time API configuration remove any baud rate changes, remove &amp;lt;tt&amp;gt;ATWR\r&amp;lt;/tt&amp;gt; from the end of the string and keep &amp;quot;NO_XBEE_API_INIT&amp;quot; value=&amp;quot;FALSE&amp;quot;.&lt;br /&gt;
* Upgrade your Maxstream firmware to the latest version before attempting API mode operation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml - makefile section at the bottom|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;# Maxstream API protocol&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B57600&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c xbee.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}} &lt;br /&gt;
The above example configures the autopilot serial port (Uart0) to 57,600 baud and calls the Maxstream transport protocol (xbee.c).  Use the &amp;quot;#&amp;quot; symbol to comment lines in this section of the airframe file.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ensure that the ground station is using the same protocol and an equal or higher baud rate:&lt;br /&gt;
{{Box Code|conf/control_panel.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;session name=&amp;quot;USB&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;program name=&amp;quot;link&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-d&amp;quot; constant=&amp;quot;/dev/paparazzi/ttyUSB0&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-transport&amp;quot; constant=&amp;quot;xbee&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-uplink&amp;quot; constant=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;arg flag=&amp;quot;-s&amp;quot; constant=&amp;quot;57600&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/program&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
 &amp;lt;/session&amp;gt;&lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== GPS ===&lt;br /&gt;
The serial port settings must match that of the GPS and are configured here along with the necessary files to interpret the u-blox UBX binary protocol:&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.CFLAGS += -DGPS -DUBX -DUSE_UART1 -DGPS_LINK=Uart1 -DUART1_BAUD=B38400&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += gps_ubx.c gps.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
'''Note:'''&lt;br /&gt;
* u-blox GPS modules are factory configured for 9600 baud, 38,400 baud is recommended along with the other required changes.  The GPS can be accessed directly thru the [[Compiling#USB_flashing|UART Tunnel]] and [[GPS#GPS_configuration_using_U-Center Configured with|u-center]]&lt;br /&gt;
&lt;br /&gt;
=== Sensors ===&lt;br /&gt;
&lt;br /&gt;
=== Control loops ===&lt;br /&gt;
&lt;br /&gt;
The control loops can be divided in two largely independent groups : the vertical ones and the horizontal ones (files sw/airborne/fw_h_ctl.c and sw/airborne/fw_v_ctl.c ). Those loops can be commanded at different levels by either the R/C transmitter or the autonomous navigation routine.&lt;br /&gt;
&lt;br /&gt;
First the horizontal loop:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;ap.srcs += fw_h_ctl.c&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Radio Control ==&lt;br /&gt;
The Paparazzi autpilot interfaces directly with the PWM signal from any standard hobby R/C receiver.  Signal decoding configuration settings for this are stored in the [[Radio_Control|Radio Control]] file.&lt;/div&gt;</summary>
		<author><name>Mundhra</name></author>
	</entry>
</feed>