<?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=Alexisld</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=Alexisld"/>
	<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/wiki/Special:Contributions/Alexisld"/>
	<updated>2026-04-08T19:32:34Z</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=2822</id>
		<title>Airframe Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=2822"/>
		<updated>2007-11-05T00:07:43Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: /* R/C */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The airframe configuration file is located in &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;conf/airframes/&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and contains all the hardware and software settings for a particular aircraft.  This is a hybrid file containing [http://en.wikipedia.org/wiki/Xml xml] in the first half with [http://en.wikipedia.org/wiki/Makefile C Makefile] code at the bottom.  All gains, trims, and behavior settings are in the top XML section and the hardware definitions such as processor type, modem protocol, servo driver, etc. are contained in the makefile.&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 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 servo 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].&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;
=== 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;br&amp;gt;&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. It is necessary to calibrate them in order to obtain the neutral values. As the X-Y sensor pairs are usually installed with a 45 degree rotation, combining roll and pitch we have a formula to separate roll from pitch and adjust the output accordingly:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;linear name=&amp;quot;RollOfIrs&amp;quot; arity=&amp;quot;2&amp;quot; coeff1=&amp;quot;-0.7&amp;quot; coeff2=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;linear name=&amp;quot;PitchOfIrs&amp;quot; arity=&amp;quot;2&amp;quot; coeff1=&amp;quot;-0.7&amp;quot; coeff2=&amp;quot;-0.7&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pitch and roll directions are defined here with the &amp;quot;-&amp;quot; sign on some of the 4 &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;coeff&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; values.  Some trial and error is usually needed to get the directions correct.&lt;br /&gt;
&lt;br /&gt;
Note that the roll angle is positive when the right wing low while pitch is positive when the nose is up.&lt;br /&gt;
&amp;lt;br&amp;gt;&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 for the monitoring the main power battery. The allowed voltage range for this aircraft is 9-12.5V. &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. The &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.&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 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;LOW_BATTERY&amp;quot; value&amp;quot;9.3&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_PGAIN&amp;quot; value=&amp;quot;5000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AILERON_OF_THROTTLE&amp;quot; value=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &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;
=== 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>Alexisld</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=2821</id>
		<title>Airframe Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=2821"/>
		<updated>2007-11-05T00:03:57Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: /* R/C */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The airframe configuration file is located in &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;conf/airframes/&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and contains all the hardware and software settings for a particular aircraft.  This is a hybrid file containing [http://en.wikipedia.org/wiki/Xml xml] in the first half with [http://en.wikipedia.org/wiki/Makefile C Makefile] code at the bottom.  All gains, trims, and behavior settings are in the top XML section and the hardware definitions such as processor type, modem protocol, servo driver, etc. are contained in the makefile.&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 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 servo 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].&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;
=== 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;br&amp;gt;&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. It is necessary to calibrate them in order to obtain the neutral values. As the X-Y sensor pairs are usually installed with a 45 degree rotation, combining roll and pitch we have a formula to separate roll from pitch and adjust the output accordingly:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;linear name=&amp;quot;RollOfIrs&amp;quot; arity=&amp;quot;2&amp;quot; coeff1=&amp;quot;-0.7&amp;quot; coeff2=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;linear name=&amp;quot;PitchOfIrs&amp;quot; arity=&amp;quot;2&amp;quot; coeff1=&amp;quot;-0.7&amp;quot; coeff2=&amp;quot;-0.7&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pitch and roll directions are defined here with the &amp;quot;-&amp;quot; sign on some of the 4 &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;coeff&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; values.  Some trial and error is usually needed to get the directions correct.&lt;br /&gt;
&lt;br /&gt;
Note that the roll angle is positive when the right wing low while pitch is positive when the nose is up.&lt;br /&gt;
&amp;lt;br&amp;gt;&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 for the monitoring the main power battery. The allowed voltage range for this aircraft is 9-12.5V. &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. The &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.&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 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;LOW_BATTERY&amp;quot; value&amp;quot;9.3&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_PGAIN&amp;quot; value=&amp;quot;5000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AILERON_OF_THROTTLE&amp;quot; value=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &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;
=== 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;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;wiring on classix PWM connector&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&amp;lt;nowiki&amp;gt;connector   LPC   shared         port &amp;lt;/nowiki&amp;gt;&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&lt;br /&gt;
&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>Alexisld</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=2820</id>
		<title>Airframe Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=2820"/>
		<updated>2007-11-05T00:00:17Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: /* R/C */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The airframe configuration file is located in &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;conf/airframes/&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and contains all the hardware and software settings for a particular aircraft.  This is a hybrid file containing [http://en.wikipedia.org/wiki/Xml xml] in the first half with [http://en.wikipedia.org/wiki/Makefile C Makefile] code at the bottom.  All gains, trims, and behavior settings are in the top XML section and the hardware definitions such as processor type, modem protocol, servo driver, etc. are contained in the makefile.&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 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 servo 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].&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;
=== 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;br&amp;gt;&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. It is necessary to calibrate them in order to obtain the neutral values. As the X-Y sensor pairs are usually installed with a 45 degree rotation, combining roll and pitch we have a formula to separate roll from pitch and adjust the output accordingly:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;linear name=&amp;quot;RollOfIrs&amp;quot; arity=&amp;quot;2&amp;quot; coeff1=&amp;quot;-0.7&amp;quot; coeff2=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;linear name=&amp;quot;PitchOfIrs&amp;quot; arity=&amp;quot;2&amp;quot; coeff1=&amp;quot;-0.7&amp;quot; coeff2=&amp;quot;-0.7&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pitch and roll directions are defined here with the &amp;quot;-&amp;quot; sign on some of the 4 &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;coeff&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; values.  Some trial and error is usually needed to get the directions correct.&lt;br /&gt;
&lt;br /&gt;
Note that the roll angle is positive when the right wing low while pitch is positive when the nose is up.&lt;br /&gt;
&amp;lt;br&amp;gt;&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 for the monitoring the main power battery. The allowed voltage range for this aircraft is 9-12.5V. &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. The &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.&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 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;LOW_BATTERY&amp;quot; value&amp;quot;9.3&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_PGAIN&amp;quot; value=&amp;quot;5000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AILERON_OF_THROTTLE&amp;quot; value=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &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;
=== 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;
{{Box Code|&lt;br /&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&lt;br /&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>Alexisld</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=2819</id>
		<title>Airframe Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=2819"/>
		<updated>2007-11-05T00:00:04Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: /* R/C */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The airframe configuration file is located in &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;conf/airframes/&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and contains all the hardware and software settings for a particular aircraft.  This is a hybrid file containing [http://en.wikipedia.org/wiki/Xml xml] in the first half with [http://en.wikipedia.org/wiki/Makefile C Makefile] code at the bottom.  All gains, trims, and behavior settings are in the top XML section and the hardware definitions such as processor type, modem protocol, servo driver, etc. are contained in the makefile.&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 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 servo 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].&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;
=== 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;br&amp;gt;&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. It is necessary to calibrate them in order to obtain the neutral values. As the X-Y sensor pairs are usually installed with a 45 degree rotation, combining roll and pitch we have a formula to separate roll from pitch and adjust the output accordingly:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;linear name=&amp;quot;RollOfIrs&amp;quot; arity=&amp;quot;2&amp;quot; coeff1=&amp;quot;-0.7&amp;quot; coeff2=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;linear name=&amp;quot;PitchOfIrs&amp;quot; arity=&amp;quot;2&amp;quot; coeff1=&amp;quot;-0.7&amp;quot; coeff2=&amp;quot;-0.7&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pitch and roll directions are defined here with the &amp;quot;-&amp;quot; sign on some of the 4 &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;coeff&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; values.  Some trial and error is usually needed to get the directions correct.&lt;br /&gt;
&lt;br /&gt;
Note that the roll angle is positive when the right wing low while pitch is positive when the nose is up.&lt;br /&gt;
&amp;lt;br&amp;gt;&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 for the monitoring the main power battery. The allowed voltage range for this aircraft is 9-12.5V. &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. The &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.&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 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;LOW_BATTERY&amp;quot; value&amp;quot;9.3&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_PGAIN&amp;quot; value=&amp;quot;5000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AILERON_OF_THROTTLE&amp;quot; value=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &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;
=== 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;
{{Box Code&lt;br /&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&lt;br /&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>Alexisld</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=2818</id>
		<title>Airframe Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=2818"/>
		<updated>2007-11-04T23:58:58Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: /* R/C */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The airframe configuration file is located in &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;conf/airframes/&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and contains all the hardware and software settings for a particular aircraft.  This is a hybrid file containing [http://en.wikipedia.org/wiki/Xml xml] in the first half with [http://en.wikipedia.org/wiki/Makefile C Makefile] code at the bottom.  All gains, trims, and behavior settings are in the top XML section and the hardware definitions such as processor type, modem protocol, servo driver, etc. are contained in the makefile.&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 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 servo 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].&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;
=== 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;br&amp;gt;&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. It is necessary to calibrate them in order to obtain the neutral values. As the X-Y sensor pairs are usually installed with a 45 degree rotation, combining roll and pitch we have a formula to separate roll from pitch and adjust the output accordingly:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;linear name=&amp;quot;RollOfIrs&amp;quot; arity=&amp;quot;2&amp;quot; coeff1=&amp;quot;-0.7&amp;quot; coeff2=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;linear name=&amp;quot;PitchOfIrs&amp;quot; arity=&amp;quot;2&amp;quot; coeff1=&amp;quot;-0.7&amp;quot; coeff2=&amp;quot;-0.7&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pitch and roll directions are defined here with the &amp;quot;-&amp;quot; sign on some of the 4 &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;coeff&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; values.  Some trial and error is usually needed to get the directions correct.&lt;br /&gt;
&lt;br /&gt;
Note that the roll angle is positive when the right wing low while pitch is positive when the nose is up.&lt;br /&gt;
&amp;lt;br&amp;gt;&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 for the monitoring the main power battery. The allowed voltage range for this aircraft is 9-12.5V. &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. The &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.&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 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;LOW_BATTERY&amp;quot; value&amp;quot;9.3&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_PGAIN&amp;quot; value=&amp;quot;5000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AILERON_OF_THROTTLE&amp;quot; value=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &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;
=== 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;
/*&lt;br /&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&lt;br /&gt;
&lt;br /&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>Alexisld</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=2817</id>
		<title>Airframe Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=2817"/>
		<updated>2007-11-04T23:56:57Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: /* R/C */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The airframe configuration file is located in &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;conf/airframes/&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and contains all the hardware and software settings for a particular aircraft.  This is a hybrid file containing [http://en.wikipedia.org/wiki/Xml xml] in the first half with [http://en.wikipedia.org/wiki/Makefile C Makefile] code at the bottom.  All gains, trims, and behavior settings are in the top XML section and the hardware definitions such as processor type, modem protocol, servo driver, etc. are contained in the makefile.&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 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 servo 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].&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;
=== 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;br&amp;gt;&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. It is necessary to calibrate them in order to obtain the neutral values. As the X-Y sensor pairs are usually installed with a 45 degree rotation, combining roll and pitch we have a formula to separate roll from pitch and adjust the output accordingly:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;linear name=&amp;quot;RollOfIrs&amp;quot; arity=&amp;quot;2&amp;quot; coeff1=&amp;quot;-0.7&amp;quot; coeff2=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;linear name=&amp;quot;PitchOfIrs&amp;quot; arity=&amp;quot;2&amp;quot; coeff1=&amp;quot;-0.7&amp;quot; coeff2=&amp;quot;-0.7&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pitch and roll directions are defined here with the &amp;quot;-&amp;quot; sign on some of the 4 &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;coeff&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; values.  Some trial and error is usually needed to get the directions correct.&lt;br /&gt;
&lt;br /&gt;
Note that the roll angle is positive when the right wing low while pitch is positive when the nose is up.&lt;br /&gt;
&amp;lt;br&amp;gt;&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 for the monitoring the main power battery. The allowed voltage range for this aircraft is 9-12.5V. &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. The &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.&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 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;LOW_BATTERY&amp;quot; value&amp;quot;9.3&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_PGAIN&amp;quot; value=&amp;quot;5000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AILERON_OF_THROTTLE&amp;quot; value=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &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;
=== 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: &lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&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&lt;br /&gt;
&lt;br /&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 ). Then the makefile section should look like this in your airframe file: &lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
fbw.CFLAGS += -DACTUATORS=\&amp;quot;servos_direct_hw.h\&amp;quot; -DPWM_SERVO_0 etc....&lt;br /&gt;
fbw.srcs += $(SRC_ARCH)/servos_direct_hw.c&lt;br /&gt;
}}&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>Alexisld</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Radio_Control&amp;diff=2776</id>
		<title>Radio Control</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Radio_Control&amp;diff=2776"/>
		<updated>2007-10-14T22:54:14Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This XML file, usually located in the &amp;lt;tt&amp;gt;conf/radios&amp;lt;/tt&amp;gt; directory, contains a description of the radio control transmitter PPM signal. It should follow the grammar described in &amp;lt;tt&amp;gt;radio.dtd&amp;lt;/tt&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
The contents are an '''ordered''' sequence of elements describing each channel with its name and its range:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!DOCTYPE radio SYSTEM &amp;quot;radio.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;radio name=&amp;quot;cockpitMM&amp;quot; data_min=&amp;quot;900&amp;quot; data_max=&amp;quot;2100&amp;quot; sync_min =&amp;quot;5000&amp;quot; sync_max =&amp;quot;15000&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;channel ctl=&amp;quot;D&amp;quot; function=&amp;quot;ROLL&amp;quot;     min=&amp;quot;2000&amp;quot; neutral=&amp;quot;1498&amp;quot; max=&amp;quot;1000&amp;quot; average=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;channel ctl=&amp;quot;E&amp;quot; function=&amp;quot;MODE&amp;quot;     min=&amp;quot;2000&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;1000&amp;quot; average=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/radio&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
The order of the channels must be the order of the pulses in the PPM signal.&lt;br /&gt;
&lt;br /&gt;
Among the top attributes, we find&lt;br /&gt;
* &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt;: used only in debug traces.&lt;br /&gt;
* &amp;lt;tt&amp;gt;data_min&amp;lt;/tt&amp;gt; (resp. &amp;lt;tt&amp;gt;_max&amp;lt;/tt&amp;gt;): the minimum (resp. max) width (in microseconds) used to code one channel of the PPM signal.&lt;br /&gt;
* &amp;lt;tt&amp;gt;sync_min&amp;lt;/tt&amp;gt; (resp. &amp;lt;tt&amp;gt;_max&amp;lt;/tt&amp;gt;): the minimum (resp. max) width (in microseconds) between two impulses set of the PPM signal.&lt;br /&gt;
&lt;br /&gt;
Each channel is described with its transmitter name (&amp;lt;tt&amp;gt;ctl&amp;lt;/tt&amp;gt;), its &amp;lt;tt&amp;gt;function&amp;lt;/tt&amp;gt; name, its range in microseconds and its neutral value in microseconds.&lt;br /&gt;
These values are used by the autopilot to compute a normalized input from the PPM signal (this file is preprocessed and the produced code is included in the airborne code). Note that the &amp;lt;tt&amp;gt;min&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;max&amp;lt;/tt&amp;gt; attributes can be exchanged to reverse the direction of the command.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;average&amp;lt;/tt&amp;gt; attribute must be set to '''1''' for ''discrete'' channels for which a trivial averaging filter will be applied. The neutral of a discrete channel need to be halfway through the min and max values. Otherwise it won't be mapped properly by the filter. &lt;br /&gt;
&lt;br /&gt;
Wrong attributes of the &amp;quot;radio&amp;quot; element will prevent the decoder to recognize any PPM frame; same for a wrong number or channels. &lt;br /&gt;
&lt;br /&gt;
== Measuring the PPM time values ==&lt;br /&gt;
&lt;br /&gt;
[[Image:RC_Receiver_Timing_Diagram.jpg|thumb|R/C receiver timing diagram]]&lt;br /&gt;
There are two common ways to measure the time characteristics of the PPM signal:&lt;br /&gt;
# Using an oscilloscope: easy to achieve with a high level digital scope with capture and measure facilities.&lt;br /&gt;
# Using the telemetry of the autopilot: the '''PPM''' message (defined in &amp;lt;tt&amp;gt;conf/messages.xml&amp;lt;/tt&amp;gt;) contains the sequence of a (recently) received PPM signal. Two important notes:&lt;br /&gt;
#: With the default telemetry configuration file (&amp;lt;tt&amp;gt;conf/telemetry/default.xml&amp;lt;/tt&amp;gt;), this message is '''not''' sent in the '''default''' mode (numbered 0). This mode can be changed to '''debug''' (numbered 1) in the airframe file by setting the '''TELEMETRY_MODE_FBW''' constant: &amp;lt;tt&amp;gt;&amp;lt;define name=&amp;quot;TELEMETRY_MODE_FBW&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
#: The time unit used in this '''PPM''' message is hardware dependent:&lt;br /&gt;
#:* On the obsolete AVR hardware, 1 microsecond = 16 units (because the crystal is running at 16MHz)&lt;br /&gt;
#:* on the LPC hardware, 1 microsecond = 15 units (because the cristal is running at 12MHz)&lt;br /&gt;
#:*:(&amp;lt;tt&amp;gt;conf/autopilot/tiny.h&amp;lt;/tt&amp;gt;), the CPU clock is 5 times more, the peripheral bus is 4 times less, and the timer is not prescaled (&amp;lt;tt&amp;gt;sw/airborne/arm7/sys_time_hw.h&amp;lt;/tt&amp;gt;) !!!)&lt;/div&gt;</summary>
		<author><name>Alexisld</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=2775</id>
		<title>Airframe Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=2775"/>
		<updated>2007-10-14T21:32:25Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: /* R/C */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The airframe configuration file is located in &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;conf/airframes/&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and contains all the hardware and software settings for a particular aircraft.  This is a hybrid file containing [http://en.wikipedia.org/wiki/Xml xml] in the first half with [http://en.wikipedia.org/wiki/Makefile C Makefile] code at the bottom.  All gains, trims, and behavior settings are in the top XML section and the hardware definitions such as processor type, modem protocol, servo driver, etc. are contained in the makefile.&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 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 servo 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].&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;
=== 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;br&amp;gt;&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. It is necessary to calibrate them in order to obtain the neutral values. As the X-Y sensor pairs are usually installed with a 45 degree rotation, combining roll and pitch we have a formula to separate roll from pitch and adjust the output accordingly:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;tt&amp;gt;&lt;br /&gt;
 &amp;lt;linear name=&amp;quot;RollOfIrs&amp;quot; arity=&amp;quot;2&amp;quot; coeff1=&amp;quot;-0.7&amp;quot; coeff2=&amp;quot;0.7&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;linear name=&amp;quot;PitchOfIrs&amp;quot; arity=&amp;quot;2&amp;quot; coeff1=&amp;quot;-0.7&amp;quot; coeff2=&amp;quot;-0.7&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pitch and roll directions are defined here with the &amp;quot;-&amp;quot; sign on some of the 4 &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;coeff&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; values.  Some trial and error is usually needed to get the directions correct.&lt;br /&gt;
&lt;br /&gt;
Note that the roll angle is positive when the right wing low while pitch is positive when the nose is up.&lt;br /&gt;
&amp;lt;br&amp;gt;&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 for the monitoring the main power battery. The allowed voltage range for this aircraft is 9-12.5V. &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. The &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.&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 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;LOW_BATTERY&amp;quot; value&amp;quot;9.3&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_PGAIN&amp;quot; value=&amp;quot;5000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AILERON_OF_THROTTLE&amp;quot; value=&amp;quot;0.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &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;
=== 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;
=== 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>Alexisld</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Classix&amp;diff=2774</id>
		<title>Classix</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Classix&amp;diff=2774"/>
		<updated>2007-10-14T21:30:06Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: /* Pinout */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Classix autopilot was designed for advanced applications.  Dual processors provide a true hardware segregation of critical code for reliability - allowing the user to run experimental navigation or payload control software without fear of a processor crash causing a total loss of control.  A [http://www.gumstix.com Gumstix] header is included so that the autopilot can be directly interfaced with this small onboard Linux PC for advanced video processing, sensor management, or sophisticated navigation routines such as sense-and-avoid or target following.&lt;br /&gt;
&lt;br /&gt;
== Classix Control Board ==&lt;br /&gt;
&lt;br /&gt;
[[Image:classix_proto1_top_small.jpg|thumb|left|300px|Classix autopilot with Gumstix daughterboard]]&lt;br /&gt;
[[Image:classix_proto1_bot_small.jpg|thumb|left|300px|Classix Dual MCUs]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Dual LPC2148 MCUs&lt;br /&gt;
* 14 ADC channels&lt;br /&gt;
* 2 UARTs&lt;br /&gt;
* 6 PWM outputs&lt;br /&gt;
* 2 R/C Receiver inputs&lt;br /&gt;
* 2 combined USB clients&lt;br /&gt;
* 2 [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface SPI] busses&lt;br /&gt;
* 2 [http://en.wikipedia.org/wiki/I2c I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C]&lt;br /&gt;
* Connector to dock with a [http://www.gumstix.com Gumstix] board&lt;br /&gt;
* 5V input&lt;br /&gt;
* 3.3V linear regulator &amp;amp; 3.7V linear regulator (for Gumstix)&lt;br /&gt;
* Audio (for data downlink without a modem)&lt;br /&gt;
* 2 LEDs (status display)&lt;br /&gt;
* 12 grams&lt;br /&gt;
* 89 x 30mm&lt;br /&gt;
&lt;br /&gt;
The Classix Control Board use 2 Philips LPC2148 ARM7 based microcontroller.&lt;br /&gt;
The [http://www.arm.com/products/CPUs/families/ARM7Family.html ARM7] is a low-power 32-bit RISC processor core and the [http://www.standardics.philips.com/products/lpc2000/ Philips LPC2148] has 512KB on-chip Flash ROM, 40KB RAM and can be clocked at 60MHz.&lt;br /&gt;
&lt;br /&gt;
With 2 MCUs this system is very robust, 1 MCU can handle all critical code, fly-by-wire and such, and the other can handle all autonomous processing.  In the case of autonomous code error, the aircraft may be saved via manual control and the fbw MCU.&lt;br /&gt;
&lt;br /&gt;
The ability to dock with a [http://www.gumstix.com Gumstix] board would allow for image processing, heavy communications, or payload support.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Classix_Architecture.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Pinout ==&lt;br /&gt;
[[Image:Classix_v099_pinout.jpg]]&lt;br /&gt;
&lt;br /&gt;
# Note that FOO2 is used for PPM_in ...&lt;br /&gt;
&lt;br /&gt;
== BOM ==&lt;br /&gt;
&lt;br /&gt;
The materials list can be produced from the Eagle CAD files on the [[Downloads|downloads]] page.&lt;br /&gt;
&lt;br /&gt;
== Assembly == &lt;br /&gt;
Here are a few observation from my Classix assembly/programming (see Tiny_Assembly for more info): &lt;br /&gt;
&lt;br /&gt;
* check the polarity of all parts, compare to a picture of a working reference board&lt;br /&gt;
* use a microscope or a magnifying glass to check for short circuits&lt;br /&gt;
* use a power supply for first tests, not a battery, limit the current to about 100mA, use a voltage of about 5V&lt;br /&gt;
* the 5V should not drop due to current limiting, measure the 3.7V and the 3.3V supply on the board&lt;br /&gt;
-&amp;gt; wrong voltages: check the parts around the power supply&lt;br /&gt;
* measure the current, it should be around 40mA at 5V with the LPC running and no code loaded &lt;br /&gt;
* attach one reset to GND, current should reduce to 30mA at 5V&lt;br /&gt;
-&amp;gt; check if reset signal can be measured at the LPC reset pin 57&lt;br /&gt;
* check the 12MHz at LPC pin 61, XTAL2 (XTAL_out)&lt;br /&gt;
* connect TXD and RXD of either AP_Serial or FBW_Serial to the serial port of your PC through a 3.3V-USB-RS232 converter (LPC_TXD_0 - PC_RX, LPC_RX_0 - PC_TX), attach LPC_P0.14 to ground or connect to a pushbutton and reset the board&lt;br /&gt;
* run the serial ROM loader lpc21isp to flash USB bootloader with&lt;br /&gt;
 make upload_bl PROC=GENERIC&lt;br /&gt;
-&amp;gt; check the rx/tx pins for data if flashing does not succeed&lt;br /&gt;
* deattach the LPC_P0.14, reset the board, current should be around 160 mA @ 5V when both AP and FWB are programmed&lt;br /&gt;
* the USB bootloader outputs debug information with 115200 8N1 on the serial port&lt;br /&gt;
 picocom -b 115200 /dev/ttyUSB0&lt;br /&gt;
* connect USB+ (D+), USB- (D-), and GND of AP or FBW with your PC, reset the board. Note that there is no connection to P0.23 on the Classix v0.99 and thus you will get a &amp;quot;Broken Pipe&amp;quot; error at the end of the programming. Furthermore, if you don't always connect it to ground, the code won't always start after a reset! &lt;br /&gt;
* the PC will detect a new USB device, check with &amp;quot;dmesg&amp;quot; and &amp;quot;lsusb&amp;quot; - they should both show a USB device with VID/PID 7070:1234&lt;br /&gt;
-&amp;gt; if a new USB device is detected but does not accept new address, the USBconnect worked, but not the communication, check USB+ and USB-&lt;br /&gt;
* flash the autopilot with&lt;br /&gt;
 make AIRCRAFT=myplane clean_ac ap.upload&lt;br /&gt;
 (where myplane is the name of your airframe as defined in conf/conf.xml... Try with AIRCRAFT=TJ1 if you don't know what to use)&lt;br /&gt;
* check telemetry through serial port, messages should be displayed&lt;br /&gt;
* test A/D converters for supply voltage and IR sensors&lt;br /&gt;
* check modem, connect tx, rx, gnd and supply&lt;br /&gt;
* try to aquire sats outside&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
As noted in the IRC channel the clasix lacks certain &amp;quot;conveniences&amp;quot; of the tiny&lt;br /&gt;
&lt;br /&gt;
* No onboard CD4015B for a servo driver&lt;br /&gt;
* No onboard 5V VR 2A VR for Servos&lt;br /&gt;
* No onboard GPS&lt;br /&gt;
* No connection to P0.23... result in random behavior of the USB Bootloader and a &amp;quot;Broken Pipe&amp;quot; error message when programming, even if the programming is successfull! &lt;br /&gt;
&lt;br /&gt;
The above being said , the first 2 items should be easily fixed by modifying the schematic(s) for the classix and regenerating the board layout in eagle(adding the necessary lines etc) or generating a servo driver and  5v VR board to interface with the classix for now till the above is completed. The last one is clearly a bug!!&lt;/div&gt;</summary>
		<author><name>Alexisld</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Radio_Control&amp;diff=2757</id>
		<title>Radio Control</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Radio_Control&amp;diff=2757"/>
		<updated>2007-10-12T22:35:39Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This XML file, usually located in the &amp;lt;tt&amp;gt;conf/radios&amp;lt;/tt&amp;gt; directory, contains a description of the radio control transmitter PPM signal. It should follow the grammar described in &amp;lt;tt&amp;gt;radio.dtd&amp;lt;/tt&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
The contents are an '''ordered''' sequence of elements describing each channel with its name and its range:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!DOCTYPE radio SYSTEM &amp;quot;radio.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;radio name=&amp;quot;cockpitMM&amp;quot; data_min=&amp;quot;900&amp;quot; data_max=&amp;quot;2100&amp;quot; sync_min =&amp;quot;5000&amp;quot; sync_max =&amp;quot;15000&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;channel ctl=&amp;quot;D&amp;quot; function=&amp;quot;ROLL&amp;quot;     min=&amp;quot;2000&amp;quot; neutral=&amp;quot;1498&amp;quot; max=&amp;quot;1000&amp;quot; average=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;channel ctl=&amp;quot;E&amp;quot; function=&amp;quot;MODE&amp;quot;     min=&amp;quot;2000&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;1000&amp;quot; average=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;/radio&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
The order of the channels must be the order of the pulses in the PPM signal.&lt;br /&gt;
&lt;br /&gt;
Among the top attributes, we find&lt;br /&gt;
* &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt;: used only in debug traces.&lt;br /&gt;
* &amp;lt;tt&amp;gt;data_min&amp;lt;/tt&amp;gt; (resp. &amp;lt;tt&amp;gt;_max&amp;lt;/tt&amp;gt;): the minimum (resp. max) width (in microseconds) used to code one channel of the PPM signal.&lt;br /&gt;
* &amp;lt;tt&amp;gt;sync_min&amp;lt;/tt&amp;gt; (resp. &amp;lt;tt&amp;gt;_max&amp;lt;/tt&amp;gt;): the minimum (resp. max) width (in microseconds) between two impulses set of the PPM signal.&lt;br /&gt;
&lt;br /&gt;
Each channel is described with its transmitter name (&amp;lt;tt&amp;gt;ctl&amp;lt;/tt&amp;gt;), its &amp;lt;tt&amp;gt;function&amp;lt;/tt&amp;gt; name, its range in microseconds and its neutral value in microseconds.&lt;br /&gt;
These values are used by the autopilot to compute a normalized input from the PPM signal (this file is preprocessed and the produced code is included in the airborne code). Note that the &amp;lt;tt&amp;gt;min&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;max&amp;lt;/tt&amp;gt; attributes can be exchanged to reverse the direction of the command.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;average&amp;lt;/tt&amp;gt; attribute must be set to '''1''' for ''discrete'' channels for which a trivial averaging filter will be applied.&lt;br /&gt;
&lt;br /&gt;
Wrong attributes of the &amp;quot;radio&amp;quot; element will prevent the decoder to recognize any PPM frame; same for a wrong number or channels. &lt;br /&gt;
&lt;br /&gt;
== Measuring the PPM time values ==&lt;br /&gt;
&lt;br /&gt;
[[Image:RC_Receiver_Timing_Diagram.jpg|thumb|R/C receiver timing diagram]]&lt;br /&gt;
There are two common ways to measure the time characteristics of the PPM signal:&lt;br /&gt;
# Using an oscilloscope: easy to achieve with a high level digital scope with capture and measure facilities.&lt;br /&gt;
# Using the telemetry of the autopilot: the '''PPM''' message (defined in &amp;lt;tt&amp;gt;conf/messages.xml&amp;lt;/tt&amp;gt;) contains the sequence of a (recently) received PPM signal. Two important notes:&lt;br /&gt;
#: With the default telemetry configuration file (&amp;lt;tt&amp;gt;conf/telemetry/default.xml&amp;lt;/tt&amp;gt;), this message is '''not''' sent in the '''default''' mode (numbered 0). This mode can be changed to '''debug''' (numbered 1) in the airframe file by setting the '''TELEMETRY_MODE_FBW''' constant: &amp;lt;tt&amp;gt;&amp;lt;define name=&amp;quot;TELEMETRY_MODE_FBW&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
#: The time unit used in this '''PPM''' message is hardware dependent:&lt;br /&gt;
#:* On the obsolete AVR hardware, 1 microsecond = 16 units (because the crystal is running at 16MHz)&lt;br /&gt;
#:* on the LPC hardware, 1 microsecond = 15 units (because the cristal is running at 12MHz)&lt;br /&gt;
#:*:(&amp;lt;tt&amp;gt;conf/autopilot/tiny.h&amp;lt;/tt&amp;gt;), the CPU clock is 5 times more, the peripheral bus is 4 times less, and the timer is not prescaled (&amp;lt;tt&amp;gt;sw/airborne/arm7/sys_time_hw.h&amp;lt;/tt&amp;gt;) !!!)&lt;/div&gt;</summary>
		<author><name>Alexisld</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Classix&amp;diff=2674</id>
		<title>Classix</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Classix&amp;diff=2674"/>
		<updated>2007-09-18T17:50:38Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: /* Assembly */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Classix autopilot was designed for advanced applications.  Dual processors provide a true hardware segregation of critical code for reliability - allowing the user to run experimental navigation or payload control software without fear of a processor crash causing a total loss of control.  A [http://www.gumstix.com Gumstix] header is included so that the autopilot can be directly interfaced with this small onboard Linux PC for advanced video processing, sensor management, or sophisticated navigation routines such as sense-and-avoid or target following.&lt;br /&gt;
&lt;br /&gt;
== Classix Control Board ==&lt;br /&gt;
&lt;br /&gt;
[[Image:classix_proto1_top_small.jpg|thumb|left|300px|Classix autopilot with Gumstix daughterboard]]&lt;br /&gt;
[[Image:classix_proto1_bot_small.jpg|thumb|left|300px|Classix Dual MCUs]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Dual LPC2148 MCUs&lt;br /&gt;
* 14 ADC channels&lt;br /&gt;
* 2 UARTs&lt;br /&gt;
* 6 PWM outputs&lt;br /&gt;
* 2 R/C Receiver inputs&lt;br /&gt;
* 2 combined USB clients&lt;br /&gt;
* 2 [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface SPI] busses&lt;br /&gt;
* 2 [http://en.wikipedia.org/wiki/I2c I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C]&lt;br /&gt;
* Connector to dock with a [http://www.gumstix.com Gumstix] board&lt;br /&gt;
* 5V input&lt;br /&gt;
* 3.3V linear regulator &amp;amp; 3.7V linear regulator (for Gumstix)&lt;br /&gt;
* Audio (for data downlink without a modem)&lt;br /&gt;
* 2 LEDs (status display)&lt;br /&gt;
* 12 grams&lt;br /&gt;
* 89 x 30mm&lt;br /&gt;
&lt;br /&gt;
The Classix Control Board use 2 Philips LPC2148 ARM7 based microcontroller.&lt;br /&gt;
The [http://www.arm.com/products/CPUs/families/ARM7Family.html ARM7] is a low-power 32-bit RISC processor core and the [http://www.standardics.philips.com/products/lpc2000/ Philips LPC2148] has 512KB on-chip Flash ROM, 40KB RAM and can be clocked at 60MHz.&lt;br /&gt;
&lt;br /&gt;
With 2 MCUs this system is very robust, 1 MCU can handle all critical code, fly-by-wire and such, and the other can handle all autonomous processing.  In the case of autonomous code error, the aircraft may be saved via manual control and the fbw MCU.&lt;br /&gt;
&lt;br /&gt;
The ability to dock with a [http://www.gumstix.com Gumstix] board would allow for image processing, heavy communications, or payload support.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Classix_Architecture.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Pinout ==&lt;br /&gt;
[[Image:Classix_v099_pinout.jpg]]&lt;br /&gt;
&lt;br /&gt;
== BOM ==&lt;br /&gt;
&lt;br /&gt;
The materials list can be produced from the Eagle CAD files on the [[Downloads|downloads]] page.&lt;br /&gt;
&lt;br /&gt;
== Assembly == &lt;br /&gt;
Here are a few observation from my Classix assembly/programming (see Tiny_Assembly for more info): &lt;br /&gt;
&lt;br /&gt;
* check the polarity of all parts, compare to a picture of a working reference board&lt;br /&gt;
* use a microscope or a magnifying glass to check for short circuits&lt;br /&gt;
* use a power supply for first tests, not a battery, limit the current to about 100mA, use a voltage of about 5V&lt;br /&gt;
* the 5V should not drop due to current limiting, measure the 3.7V and the 3.3V supply on the board&lt;br /&gt;
-&amp;gt; wrong voltages: check the parts around the power supply&lt;br /&gt;
* measure the current, it should be around 40mA at 5V with the LPC running and no code loaded &lt;br /&gt;
* attach one reset to GND, current should reduce to 30mA at 5V&lt;br /&gt;
-&amp;gt; check if reset signal can be measured at the LPC reset pin 57&lt;br /&gt;
* check the 12MHz at LPC pin 61, XTAL2 (XTAL_out)&lt;br /&gt;
* connect TXD and RXD of either AP_Serial or FBW_Serial to the serial port of your PC through a 3.3V-USB-RS232 converter (LPC_TXD_0 - PC_RX, LPC_RX_0 - PC_TX), attach LPC_P0.14 to ground or connect to a pushbutton and reset the board&lt;br /&gt;
* run the serial ROM loader lpc21isp to flash USB bootloader with&lt;br /&gt;
 make upload_bl PROC=GENERIC&lt;br /&gt;
-&amp;gt; check the rx/tx pins for data if flashing does not succeed&lt;br /&gt;
* deattach the LPC_P0.14, reset the board, current should be around 160 mA @ 5V when both AP and FWB are programmed&lt;br /&gt;
* the USB bootloader outputs debug information with 115200 8N1 on the serial port&lt;br /&gt;
 picocom -b 115200 /dev/ttyUSB0&lt;br /&gt;
* connect USB+ (D+), USB- (D-), and GND of AP or FBW with your PC, reset the board. Note that there is no connection to P0.23 on the Classix v0.99 and thus you will get a &amp;quot;Broken Pipe&amp;quot; error at the end of the programming. Furthermore, if you don't always connect it to ground, the code won't always start after a reset! &lt;br /&gt;
* the PC will detect a new USB device, check with &amp;quot;dmesg&amp;quot; and &amp;quot;lsusb&amp;quot; - they should both show a USB device with VID/PID 7070:1234&lt;br /&gt;
-&amp;gt; if a new USB device is detected but does not accept new address, the USBconnect worked, but not the communication, check USB+ and USB-&lt;br /&gt;
* flash the autopilot with&lt;br /&gt;
 make AIRCRAFT=myplane clean_ac ap.upload&lt;br /&gt;
 (where myplane is the name of your airframe as defined in conf/conf.xml... Try with AIRCRAFT=TJ1 if you don't know what to use)&lt;br /&gt;
* check telemetry through serial port, messages should be displayed&lt;br /&gt;
* test A/D converters for supply voltage and IR sensors&lt;br /&gt;
* check modem, connect tx, rx, gnd and supply&lt;br /&gt;
* try to aquire sats outside&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
As noted in the IRC channel the clasix lacks certain &amp;quot;conveniences&amp;quot; of the tiny&lt;br /&gt;
&lt;br /&gt;
* No onboard CD4015B for a servo driver&lt;br /&gt;
* No onboard 5V VR 2A VR for Servos&lt;br /&gt;
* No onboard GPS&lt;br /&gt;
* No connection to P0.23... result in random behavior of the USB Bootloader and a &amp;quot;Broken Pipe&amp;quot; error message when programming, even if the programming is successfull! &lt;br /&gt;
&lt;br /&gt;
The above being said , the first 2 items should be easily fixed by modifying the schematic(s) for the classix and regenerating the board layout in eagle(adding the necessary lines etc) or generating a servo driver and  5v VR board to interface with the classix for now till the above is completed. The last one is clearly a bug!!&lt;/div&gt;</summary>
		<author><name>Alexisld</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Classix&amp;diff=2673</id>
		<title>Classix</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Classix&amp;diff=2673"/>
		<updated>2007-09-18T17:48:24Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: /* TODO */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Classix autopilot was designed for advanced applications.  Dual processors provide a true hardware segregation of critical code for reliability - allowing the user to run experimental navigation or payload control software without fear of a processor crash causing a total loss of control.  A [http://www.gumstix.com Gumstix] header is included so that the autopilot can be directly interfaced with this small onboard Linux PC for advanced video processing, sensor management, or sophisticated navigation routines such as sense-and-avoid or target following.&lt;br /&gt;
&lt;br /&gt;
== Classix Control Board ==&lt;br /&gt;
&lt;br /&gt;
[[Image:classix_proto1_top_small.jpg|thumb|left|300px|Classix autopilot with Gumstix daughterboard]]&lt;br /&gt;
[[Image:classix_proto1_bot_small.jpg|thumb|left|300px|Classix Dual MCUs]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Dual LPC2148 MCUs&lt;br /&gt;
* 14 ADC channels&lt;br /&gt;
* 2 UARTs&lt;br /&gt;
* 6 PWM outputs&lt;br /&gt;
* 2 R/C Receiver inputs&lt;br /&gt;
* 2 combined USB clients&lt;br /&gt;
* 2 [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface SPI] busses&lt;br /&gt;
* 2 [http://en.wikipedia.org/wiki/I2c I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C]&lt;br /&gt;
* Connector to dock with a [http://www.gumstix.com Gumstix] board&lt;br /&gt;
* 5V input&lt;br /&gt;
* 3.3V linear regulator &amp;amp; 3.7V linear regulator (for Gumstix)&lt;br /&gt;
* Audio (for data downlink without a modem)&lt;br /&gt;
* 2 LEDs (status display)&lt;br /&gt;
* 12 grams&lt;br /&gt;
* 89 x 30mm&lt;br /&gt;
&lt;br /&gt;
The Classix Control Board use 2 Philips LPC2148 ARM7 based microcontroller.&lt;br /&gt;
The [http://www.arm.com/products/CPUs/families/ARM7Family.html ARM7] is a low-power 32-bit RISC processor core and the [http://www.standardics.philips.com/products/lpc2000/ Philips LPC2148] has 512KB on-chip Flash ROM, 40KB RAM and can be clocked at 60MHz.&lt;br /&gt;
&lt;br /&gt;
With 2 MCUs this system is very robust, 1 MCU can handle all critical code, fly-by-wire and such, and the other can handle all autonomous processing.  In the case of autonomous code error, the aircraft may be saved via manual control and the fbw MCU.&lt;br /&gt;
&lt;br /&gt;
The ability to dock with a [http://www.gumstix.com Gumstix] board would allow for image processing, heavy communications, or payload support.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Classix_Architecture.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Pinout ==&lt;br /&gt;
[[Image:Classix_v099_pinout.jpg]]&lt;br /&gt;
&lt;br /&gt;
== BOM ==&lt;br /&gt;
&lt;br /&gt;
The materials list can be produced from the Eagle CAD files on the [[Downloads|downloads]] page.&lt;br /&gt;
&lt;br /&gt;
== Assembly == &lt;br /&gt;
Here are a few observation from my Classix assembly/programming (see Tiny_Assembly for more info): &lt;br /&gt;
&lt;br /&gt;
* check the polarity of all parts, compare to a picture of a working reference board&lt;br /&gt;
* use a microscope or a magnifying glass to check for short circuits&lt;br /&gt;
* use a power supply for first tests, not a battery, limit the current to about 100mA, use a voltage of about 5V&lt;br /&gt;
* the 5V should not drop due to current limiting, measure the 3.7V and the 3.3V supply on the board&lt;br /&gt;
-&amp;gt; wrong voltages: check the parts around the power supply&lt;br /&gt;
* measure the current, it should be around 40mA at 5V with the LPC running and no code loaded &lt;br /&gt;
* attach one reset to GND, current should reduce to 30mA at 5V&lt;br /&gt;
-&amp;gt; check if reset signal can be measured at the LPC reset pin 57&lt;br /&gt;
* check the 12MHz at LPC pin 61, XTAL2 (XTAL_out)&lt;br /&gt;
* connect TXD and RXD of either AP_Serial or FBW_Serial to the serial port of your PC through a 3.3V-USB-RS232 converter (LPC_TXD_0 - PC_RX, LPC_RX_0 - PC_TX), attach LPC_P0.14 to ground or connect to a pushbutton and reset the board&lt;br /&gt;
* run the serial ROM loader lpc21isp to flash USB bootloader with&lt;br /&gt;
 make upload_bl PROC=GENERIC&lt;br /&gt;
-&amp;gt; check the rx/tx pins for data if flashing does not succeed&lt;br /&gt;
* deattach the LPC_P0.14, reset the board, current should be around 160 mA @ 5V when both AP and FWB are programmed&lt;br /&gt;
* the USB bootloader outputs debug information with 115200 8N1 on the serial port&lt;br /&gt;
 picocom -b 115200 /dev/ttyUSB0&lt;br /&gt;
* connect USB+ (D+), USB- (D-), and GND of AP or FBW with your PC, reset the board&lt;br /&gt;
* the PC will detect a new USB device, check with &amp;quot;dmesg&amp;quot; and &amp;quot;lsusb&amp;quot; - they should both show a USB device with VID/PID 7070:1234&lt;br /&gt;
-&amp;gt; if a new USB device is detected but does not accept new address, the USBconnect worked, but not the communication, check USB+ and USB-&lt;br /&gt;
* flash the autopilot with&lt;br /&gt;
 make AIRCRAFT=myplane clean_ac ap.upload&lt;br /&gt;
 (where myplane is the name of your airframe as defined in conf/conf.xml... Try with AIRCRAFT=TJ1 if you don't know what to use)&lt;br /&gt;
* check telemetry through serial port, messages should be displayed&lt;br /&gt;
* test A/D converters for supply voltage and IR sensors&lt;br /&gt;
* check modem, connect tx, rx, gnd and supply&lt;br /&gt;
* try to aquire sats outside&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
As noted in the IRC channel the clasix lacks certain &amp;quot;conveniences&amp;quot; of the tiny&lt;br /&gt;
&lt;br /&gt;
* No onboard CD4015B for a servo driver&lt;br /&gt;
* No onboard 5V VR 2A VR for Servos&lt;br /&gt;
* No onboard GPS&lt;br /&gt;
* No connection to P0.23... result in random behavior of the USB Bootloader and a &amp;quot;Broken Pipe&amp;quot; error message when programming, even if the programming is successfull! &lt;br /&gt;
&lt;br /&gt;
The above being said , the first 2 items should be easily fixed by modifying the schematic(s) for the classix and regenerating the board layout in eagle(adding the necessary lines etc) or generating a servo driver and  5v VR board to interface with the classix for now till the above is completed. The last one is clearly a bug!!&lt;/div&gt;</summary>
		<author><name>Alexisld</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Installation/Linux&amp;diff=2645</id>
		<title>Installation/Linux</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Installation/Linux&amp;diff=2645"/>
		<updated>2007-09-04T18:15:02Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: /* Extra for Ubuntu 7.04 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Precompiled binaries can be downloaded and executed with the ''paparazzi-bin'' package but to maintain the power and flexibility of open-source code, most operations within Paparazzi involve recompilation of autopilot and/or ground station code.  Therefore the typical installation requires all of the necessary C, OCAML, and Perl compilers as well as some XML and Ivy handlers.&lt;br /&gt;
&lt;br /&gt;
== Setting your Environment Variables ==&lt;br /&gt;
Before launching the GCS or compiling anything you must have the Paparazzi source and home environment variables set correctly in your shell.  These variables can be automatically set in your shell by adding the following lines to your .bashrc file:&lt;br /&gt;
{{Box Code|/home/your_username/.bashrc|&lt;br /&gt;
 export PAPARAZZI_HOME&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;/home/''your_username''/paparazzi3&lt;br /&gt;
 export PAPARAZZI_SRC&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;/home/''your_username''/paparazzi3&lt;br /&gt;
}}&lt;br /&gt;
If you wish to manually set the env variables (i.e. when compiling a backup copy of your code in a different folder) execute the following command from the folder you wish to set as your active paparazzi folder:&lt;br /&gt;
 export PAPARAZZI_HOME=`pwd`;export PAPARAZZI_SRC=`pwd`&lt;br /&gt;
Verify that your variables are set correctly with the following command:&lt;br /&gt;
 env | grep PAPARAZZI&lt;br /&gt;
which should return the following:&lt;br /&gt;
 PAPARAZZI_HOME&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;/home/''your_username''/paparazzi3&lt;br /&gt;
 PAPARAZZI_SRC&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;/home/''your_username''/paparazzi3&lt;br /&gt;
&lt;br /&gt;
== Installation on Debian ==&lt;br /&gt;
&lt;br /&gt;
Paparazzi is packaged for Debian as well as all of its dependencies. The [http://www.recherche.enac.fr/paparazzi/debian repository] hosted at ENAC holds their latest version.&lt;br /&gt;
&lt;br /&gt;
=== Installation from the Command Line===&lt;br /&gt;
Just add the following line(s) to your repository list (&amp;lt;b&amp;gt;/etc/apt/sources.list&amp;lt;/b&amp;gt;).  Note: etch users must include ''both'' sarge and etch lines.&lt;br /&gt;
{{Box Code|/etc/apt/sources.list|&lt;br /&gt;
 deb &amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian&amp;lt;/nowiki&amp;gt; sarge main&lt;br /&gt;
 #if needed deb &amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian etch main&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Then, update your sources and install the precompiled binaries as well as the dependencies needed for recompiling:&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install paparazzi-bin&lt;br /&gt;
 apt-get install paparazzi-base&lt;br /&gt;
 apt-get install paparazzi-dev&lt;br /&gt;
 apt-get install paparazzi-arm7&lt;br /&gt;
&lt;br /&gt;
=== Installation thru Synaptic Package Manager ===&lt;br /&gt;
* Launch ''Synaptic Package Manager'' (''Applications/System'' Tools Menu)&lt;br /&gt;
* In '''Settings/Repositories''', add a new repository on URI = '''&amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian&amp;lt;/nowiki&amp;gt;''', Distribution = '''sarge''', Section = '''main'''&lt;br /&gt;
* Users of current linux versions must also add '''&amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian&amp;lt;/nowiki&amp;gt;''', Distribution = '''etch''', Section = '''main''' (both Sarge and Etch are needed)&lt;br /&gt;
* Search for paparazzi-bin, paparazzi-base, paparazzi-dev, and paparazzi-arm7 packages (use the ''Search'' button)&lt;br /&gt;
* Mark them for installation (right-click on package names)&lt;br /&gt;
* Left-click on ''Apply''&lt;br /&gt;
&lt;br /&gt;
=== Optional/Obsolete Packages ===&lt;br /&gt;
Users of older AVR based boards will also need the paparazzi-avr package.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Source Code ===&lt;br /&gt;
After the dependency packages are installed the complete source code should be downloaded from the CVS.  See the [http://savannah.nongnu.org/cvs/?group=paparazzi project page] at Savannah for more details.  From /home/''your_username''/ type:&lt;br /&gt;
 cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/paparazzi co paparazzi3&lt;br /&gt;
This will download all of the code and install it into /home/''your_username''/paparazzi3/&lt;br /&gt;
&lt;br /&gt;
If you cannot use the CVS install, occasionally updated tarballs can also be fetched from the [[Downloads|Downloads]] page.&lt;br /&gt;
&lt;br /&gt;
=== Extra for Ubuntu 7.04 ===&lt;br /&gt;
&lt;br /&gt;
The Braille TTY driver interferes with FTDI USB Serial adapters and should be removed:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get remove brltty&lt;br /&gt;
&lt;br /&gt;
You need permission to access the &amp;quot;raw&amp;quot; USB bus. You should be member of the dialout group and tell the system to allow access by copying the file &amp;quot;10-paparazzi.rules&amp;quot; as root from $PAPARAZZI_HOME/conf/system/udev/rules/ to /etc/udev/rules.d and adding the line &lt;br /&gt;
&lt;br /&gt;
 BUS==&amp;quot;usb&amp;quot;,  SYSFS{idVendor}==&amp;quot;7070&amp;quot;, GROUP=&amp;quot;dialout&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Launching the Software ==&lt;br /&gt;
Make sure your [[Installation#Setting_your_Environment_Variables|environment variables]] are set correctly and launch the software from /home/''your_username''/paparazzi3/ with:&lt;br /&gt;
&lt;br /&gt;
 ./paparazzi&lt;br /&gt;
&lt;br /&gt;
== Recompiling ==&lt;br /&gt;
After any CVS update or source code modification the code can be recompiled from /home/''your_username''/paparazzi3/ with the following command:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
The ''make'' command will only recompile portions of the software where changed have been detected.  If it does not behave as expected you can deleted all compiled files and recompile from scratch with the following commands:&lt;br /&gt;
&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
See the [[Compiling]] page for more info.&lt;br /&gt;
&lt;br /&gt;
== Manual Installation of Individual Packages ==&lt;br /&gt;
Users of Ubuntu or other Linux flavors or anyone needing manual control of each individual package can install them independently.  The list of dependencies of the Debian package is located in the &amp;lt;tt&amp;gt;debian/control&amp;lt;/tt&amp;gt; file and may help users of other distributions.&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian/dists/sarge/main/binary-i386/libsubject-perl_2.00_all.deb&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian/dists/etch/main/binary-i386/xml-light-ocaml_2.1-2_i386.deb&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http://www.tls.cena.fr/products/ivy/download/packages/ivy-perl_4.21_all.deb&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http://www.tls.cena.fr/products/ivy/download/packages/ivy-c_3.9.2-1_i386.deb&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http://www.tls.cena.fr/products/ivy/download/packages/ivy-c-dev_3.9.2-1_i386.deb&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian/dists/etch/main/binary-i386/ivy-ocaml_1.1-2_i386.deb&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian/dists/etch/main/binary-i386/paparazzi-base_3.1-2_i386.deb&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian/dists/etch/main/binary-i386/paparazzi-bin_3.1-2_i386.deb&amp;lt;/nowiki&amp;gt; &lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian/dists/etch/main/binary-i386/paparazzi-dev_3.1-2_i386.deb&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 sudo dpkg -i libsubject-perl_2.00_all.deb&lt;br /&gt;
 sudo dpkg -i xml-light-ocaml_2.1-2_i386.deb&lt;br /&gt;
 sudo dpkg -i ivy-ocaml_1.1-2_i386.deb&lt;br /&gt;
 sudo dpkg -i ivy-perl_4.21_all.deb&lt;br /&gt;
 sudo apt-get install perl-tk&lt;br /&gt;
 sudo apt-get -f install&lt;br /&gt;
 sudo dpkg -i paparazzi-base_3.1-2_i386.deb&lt;br /&gt;
 sudo dpkg -i paparazzi-bin_3.1-2_i386.deb&lt;br /&gt;
 sudo dpkg -i paparazzi-dev_3.1-2_i386.deb&lt;br /&gt;
 mkdir -p $USER/paparazzi3/conf/&lt;br /&gt;
 paparazzi&lt;br /&gt;
Then follow the source install installation instructions above with cvs and after building the cvs paparazzi execute the ./paparazzi in the cvs distribution to get paparazzi-center as above.  Note: compiling and loading the AP will fail on ubuntu unless you have installed an arm-elf-gcc cross tool chain.  NEW Paparazzi users who are also new to Debian, may prefer the Ubuntu distribution (based on Debian) as it allows an easier entry to paparazzi goodness then a &amp;quot;pure&amp;quot; debian distribution for the novice while allowing access to all of Debian's wizardry as you become more experienced.&lt;br /&gt;
&lt;br /&gt;
== Software Updates ==&lt;br /&gt;
Paparazzi is a very rapidly evolving project and as such, you will find that variables and functions are frequently added, changed, or removed.  Update your software with care and caution, and always test the functionality on the ground and in the air as some updates will affect tuning parameters.  Your airframe file will not be updated by the CVS system and therefore any new or modified variable names will need to be added manually.  The compiler will usually identify the problem variables at which point you can look at some of the most recent airframe files on the CVS to find the proper syntax.  See the [[Compiling]] page for more help if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
That said, keeping your software up to date is easy with the CVS system.  The system will compare all source code files with the server and update any that are needed, automatically merging any minor changes that you have incorporated along the way.&lt;br /&gt;
&lt;br /&gt;
To download and automatically merge any updated source files, run the following command from your Paparazzi directory&lt;br /&gt;
 cvs update -d&lt;br /&gt;
where the &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; is needed to get any new directories.&lt;br /&gt;
&lt;br /&gt;
Users making changes to their code structure may prefer to have more control over the updating and merging process and may wish to install and use '''tkcvs''' instead which provides highlighted comparisons of any files that differ between your code and the CVS server and allows for a file by file update.&lt;br /&gt;
&lt;br /&gt;
To update your Linux distribution as well as any dependencies of Paparazzi (seldom necessary), run the following as root:&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt get upgrade&lt;br /&gt;
&lt;br /&gt;
== LiveCd ==&lt;br /&gt;
&lt;br /&gt;
The LiveCD is an easy way to test Paparazzi: no installation is required and no changes are made to your computer.  Simply burn the image as a boot CD and reboot!  The LiveCD includes Linux and the complete paparazzi binary package (code source, tools and cross compilers).  It is intended for demonstration only and not frequently updated but it contains the complete system and can store changed files on a pen drive or compressed file on your hard drive so that it can compile, flash, and operate any aircraft, albeit slowly.  &lt;br /&gt;
 &lt;br /&gt;
The CD image is available from the [[Downloads|Downloads]] page.&lt;br /&gt;
&lt;br /&gt;
The Paparazzi demo is launchable on the Live CD from the Paparazzi icon.&lt;br /&gt;
&lt;br /&gt;
Knoppix allows for all the user data to be saved on a hard disk partition (most file systems are supported) or on a removable device (typically a USB pendrive). Note that this action is not destructive: the user data tree is compressed and stored on your file system as a single file (&amp;lt;tt&amp;gt;knoppix.img&amp;lt;/tt&amp;gt;).&lt;br /&gt;
* From the Knoppix menu (second from bottom left), choose '''Configure''', '''Create a persistent KNOPPIX disk image'''&lt;br /&gt;
* Choose your media (be sure to connect your USB pendrive before booting!)&lt;br /&gt;
* Choose if you want an encrypted filesystem (to protect your flight plan designed for the next MAV competition :-) )&lt;br /&gt;
* Choose the size of your home directory (100Mb is recommended)&lt;br /&gt;
On the next reboot, this saved state will be automatically located and loaded.&lt;br /&gt;
&lt;br /&gt;
Using this persistent feature, the Paparazzix Live CD can really be used to configure, simulate and fly an aircraft with the Paparazzi system.&lt;br /&gt;
&lt;br /&gt;
The Live CD can also be used to install a Debian system on the hard disk, using the &amp;lt;tt&amp;gt;knoppix-installer&amp;lt;/tt&amp;gt; command. Be sure to backup the hard disk before trying ...&lt;/div&gt;</summary>
		<author><name>Alexisld</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Installation/Linux&amp;diff=2644</id>
		<title>Installation/Linux</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Installation/Linux&amp;diff=2644"/>
		<updated>2007-09-04T18:14:32Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: /* Installation on Debian */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Precompiled binaries can be downloaded and executed with the ''paparazzi-bin'' package but to maintain the power and flexibility of open-source code, most operations within Paparazzi involve recompilation of autopilot and/or ground station code.  Therefore the typical installation requires all of the necessary C, OCAML, and Perl compilers as well as some XML and Ivy handlers.&lt;br /&gt;
&lt;br /&gt;
== Setting your Environment Variables ==&lt;br /&gt;
Before launching the GCS or compiling anything you must have the Paparazzi source and home environment variables set correctly in your shell.  These variables can be automatically set in your shell by adding the following lines to your .bashrc file:&lt;br /&gt;
{{Box Code|/home/your_username/.bashrc|&lt;br /&gt;
 export PAPARAZZI_HOME&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;/home/''your_username''/paparazzi3&lt;br /&gt;
 export PAPARAZZI_SRC&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;/home/''your_username''/paparazzi3&lt;br /&gt;
}}&lt;br /&gt;
If you wish to manually set the env variables (i.e. when compiling a backup copy of your code in a different folder) execute the following command from the folder you wish to set as your active paparazzi folder:&lt;br /&gt;
 export PAPARAZZI_HOME=`pwd`;export PAPARAZZI_SRC=`pwd`&lt;br /&gt;
Verify that your variables are set correctly with the following command:&lt;br /&gt;
 env | grep PAPARAZZI&lt;br /&gt;
which should return the following:&lt;br /&gt;
 PAPARAZZI_HOME&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;/home/''your_username''/paparazzi3&lt;br /&gt;
 PAPARAZZI_SRC&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;/home/''your_username''/paparazzi3&lt;br /&gt;
&lt;br /&gt;
== Installation on Debian ==&lt;br /&gt;
&lt;br /&gt;
Paparazzi is packaged for Debian as well as all of its dependencies. The [http://www.recherche.enac.fr/paparazzi/debian repository] hosted at ENAC holds their latest version.&lt;br /&gt;
&lt;br /&gt;
=== Installation from the Command Line===&lt;br /&gt;
Just add the following line(s) to your repository list (&amp;lt;b&amp;gt;/etc/apt/sources.list&amp;lt;/b&amp;gt;).  Note: etch users must include ''both'' sarge and etch lines.&lt;br /&gt;
{{Box Code|/etc/apt/sources.list|&lt;br /&gt;
 deb &amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian&amp;lt;/nowiki&amp;gt; sarge main&lt;br /&gt;
 #if needed deb &amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian etch main&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
Then, update your sources and install the precompiled binaries as well as the dependencies needed for recompiling:&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install paparazzi-bin&lt;br /&gt;
 apt-get install paparazzi-base&lt;br /&gt;
 apt-get install paparazzi-dev&lt;br /&gt;
 apt-get install paparazzi-arm7&lt;br /&gt;
&lt;br /&gt;
=== Installation thru Synaptic Package Manager ===&lt;br /&gt;
* Launch ''Synaptic Package Manager'' (''Applications/System'' Tools Menu)&lt;br /&gt;
* In '''Settings/Repositories''', add a new repository on URI = '''&amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian&amp;lt;/nowiki&amp;gt;''', Distribution = '''sarge''', Section = '''main'''&lt;br /&gt;
* Users of current linux versions must also add '''&amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian&amp;lt;/nowiki&amp;gt;''', Distribution = '''etch''', Section = '''main''' (both Sarge and Etch are needed)&lt;br /&gt;
* Search for paparazzi-bin, paparazzi-base, paparazzi-dev, and paparazzi-arm7 packages (use the ''Search'' button)&lt;br /&gt;
* Mark them for installation (right-click on package names)&lt;br /&gt;
* Left-click on ''Apply''&lt;br /&gt;
&lt;br /&gt;
=== Optional/Obsolete Packages ===&lt;br /&gt;
Users of older AVR based boards will also need the paparazzi-avr package.&lt;br /&gt;
&lt;br /&gt;
=== Installing the Source Code ===&lt;br /&gt;
After the dependency packages are installed the complete source code should be downloaded from the CVS.  See the [http://savannah.nongnu.org/cvs/?group=paparazzi project page] at Savannah for more details.  From /home/''your_username''/ type:&lt;br /&gt;
 cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/paparazzi co paparazzi3&lt;br /&gt;
This will download all of the code and install it into /home/''your_username''/paparazzi3/&lt;br /&gt;
&lt;br /&gt;
If you cannot use the CVS install, occasionally updated tarballs can also be fetched from the [[Downloads|Downloads]] page.&lt;br /&gt;
&lt;br /&gt;
=== Extra for Ubuntu 7.04 ===&lt;br /&gt;
&lt;br /&gt;
The Braille TTY driver interferes with FTDI USB Serial adapters and should be removed:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get remove brltty&lt;br /&gt;
&lt;br /&gt;
You need permission to access the &amp;quot;raw&amp;quot; USB bus. You should be member of the dialout group and tell the system to allow access by copying the file &amp;quot;10-paparazzi.rules&amp;quot; as root from $PAPARAZZI_HOME/conf/system/udev/rules/ to /etc/udev/rules.d and adding the line &lt;br /&gt;
&lt;br /&gt;
BUS==&amp;quot;usb&amp;quot;,  SYSFS{idVendor}==&amp;quot;7070&amp;quot;, GROUP=&amp;quot;dialout&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Launching the Software ==&lt;br /&gt;
Make sure your [[Installation#Setting_your_Environment_Variables|environment variables]] are set correctly and launch the software from /home/''your_username''/paparazzi3/ with:&lt;br /&gt;
&lt;br /&gt;
 ./paparazzi&lt;br /&gt;
&lt;br /&gt;
== Recompiling ==&lt;br /&gt;
After any CVS update or source code modification the code can be recompiled from /home/''your_username''/paparazzi3/ with the following command:&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
The ''make'' command will only recompile portions of the software where changed have been detected.  If it does not behave as expected you can deleted all compiled files and recompile from scratch with the following commands:&lt;br /&gt;
&lt;br /&gt;
 make clean&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
See the [[Compiling]] page for more info.&lt;br /&gt;
&lt;br /&gt;
== Manual Installation of Individual Packages ==&lt;br /&gt;
Users of Ubuntu or other Linux flavors or anyone needing manual control of each individual package can install them independently.  The list of dependencies of the Debian package is located in the &amp;lt;tt&amp;gt;debian/control&amp;lt;/tt&amp;gt; file and may help users of other distributions.&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian/dists/sarge/main/binary-i386/libsubject-perl_2.00_all.deb&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian/dists/etch/main/binary-i386/xml-light-ocaml_2.1-2_i386.deb&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http://www.tls.cena.fr/products/ivy/download/packages/ivy-perl_4.21_all.deb&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http://www.tls.cena.fr/products/ivy/download/packages/ivy-c_3.9.2-1_i386.deb&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http://www.tls.cena.fr/products/ivy/download/packages/ivy-c-dev_3.9.2-1_i386.deb&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian/dists/etch/main/binary-i386/ivy-ocaml_1.1-2_i386.deb&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian/dists/etch/main/binary-i386/paparazzi-base_3.1-2_i386.deb&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian/dists/etch/main/binary-i386/paparazzi-bin_3.1-2_i386.deb&amp;lt;/nowiki&amp;gt; &lt;br /&gt;
 wget &amp;lt;nowiki&amp;gt;http://www.recherche.enac.fr/paparazzi/debian/dists/etch/main/binary-i386/paparazzi-dev_3.1-2_i386.deb&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 sudo dpkg -i libsubject-perl_2.00_all.deb&lt;br /&gt;
 sudo dpkg -i xml-light-ocaml_2.1-2_i386.deb&lt;br /&gt;
 sudo dpkg -i ivy-ocaml_1.1-2_i386.deb&lt;br /&gt;
 sudo dpkg -i ivy-perl_4.21_all.deb&lt;br /&gt;
 sudo apt-get install perl-tk&lt;br /&gt;
 sudo apt-get -f install&lt;br /&gt;
 sudo dpkg -i paparazzi-base_3.1-2_i386.deb&lt;br /&gt;
 sudo dpkg -i paparazzi-bin_3.1-2_i386.deb&lt;br /&gt;
 sudo dpkg -i paparazzi-dev_3.1-2_i386.deb&lt;br /&gt;
 mkdir -p $USER/paparazzi3/conf/&lt;br /&gt;
 paparazzi&lt;br /&gt;
Then follow the source install installation instructions above with cvs and after building the cvs paparazzi execute the ./paparazzi in the cvs distribution to get paparazzi-center as above.  Note: compiling and loading the AP will fail on ubuntu unless you have installed an arm-elf-gcc cross tool chain.  NEW Paparazzi users who are also new to Debian, may prefer the Ubuntu distribution (based on Debian) as it allows an easier entry to paparazzi goodness then a &amp;quot;pure&amp;quot; debian distribution for the novice while allowing access to all of Debian's wizardry as you become more experienced.&lt;br /&gt;
&lt;br /&gt;
== Software Updates ==&lt;br /&gt;
Paparazzi is a very rapidly evolving project and as such, you will find that variables and functions are frequently added, changed, or removed.  Update your software with care and caution, and always test the functionality on the ground and in the air as some updates will affect tuning parameters.  Your airframe file will not be updated by the CVS system and therefore any new or modified variable names will need to be added manually.  The compiler will usually identify the problem variables at which point you can look at some of the most recent airframe files on the CVS to find the proper syntax.  See the [[Compiling]] page for more help if needed.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
That said, keeping your software up to date is easy with the CVS system.  The system will compare all source code files with the server and update any that are needed, automatically merging any minor changes that you have incorporated along the way.&lt;br /&gt;
&lt;br /&gt;
To download and automatically merge any updated source files, run the following command from your Paparazzi directory&lt;br /&gt;
 cvs update -d&lt;br /&gt;
where the &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; is needed to get any new directories.&lt;br /&gt;
&lt;br /&gt;
Users making changes to their code structure may prefer to have more control over the updating and merging process and may wish to install and use '''tkcvs''' instead which provides highlighted comparisons of any files that differ between your code and the CVS server and allows for a file by file update.&lt;br /&gt;
&lt;br /&gt;
To update your Linux distribution as well as any dependencies of Paparazzi (seldom necessary), run the following as root:&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt get upgrade&lt;br /&gt;
&lt;br /&gt;
== LiveCd ==&lt;br /&gt;
&lt;br /&gt;
The LiveCD is an easy way to test Paparazzi: no installation is required and no changes are made to your computer.  Simply burn the image as a boot CD and reboot!  The LiveCD includes Linux and the complete paparazzi binary package (code source, tools and cross compilers).  It is intended for demonstration only and not frequently updated but it contains the complete system and can store changed files on a pen drive or compressed file on your hard drive so that it can compile, flash, and operate any aircraft, albeit slowly.  &lt;br /&gt;
 &lt;br /&gt;
The CD image is available from the [[Downloads|Downloads]] page.&lt;br /&gt;
&lt;br /&gt;
The Paparazzi demo is launchable on the Live CD from the Paparazzi icon.&lt;br /&gt;
&lt;br /&gt;
Knoppix allows for all the user data to be saved on a hard disk partition (most file systems are supported) or on a removable device (typically a USB pendrive). Note that this action is not destructive: the user data tree is compressed and stored on your file system as a single file (&amp;lt;tt&amp;gt;knoppix.img&amp;lt;/tt&amp;gt;).&lt;br /&gt;
* From the Knoppix menu (second from bottom left), choose '''Configure''', '''Create a persistent KNOPPIX disk image'''&lt;br /&gt;
* Choose your media (be sure to connect your USB pendrive before booting!)&lt;br /&gt;
* Choose if you want an encrypted filesystem (to protect your flight plan designed for the next MAV competition :-) )&lt;br /&gt;
* Choose the size of your home directory (100Mb is recommended)&lt;br /&gt;
On the next reboot, this saved state will be automatically located and loaded.&lt;br /&gt;
&lt;br /&gt;
Using this persistent feature, the Paparazzix Live CD can really be used to configure, simulate and fly an aircraft with the Paparazzi system.&lt;br /&gt;
&lt;br /&gt;
The Live CD can also be used to install a Debian system on the hard disk, using the &amp;lt;tt&amp;gt;knoppix-installer&amp;lt;/tt&amp;gt; command. Be sure to backup the hard disk before trying ...&lt;/div&gt;</summary>
		<author><name>Alexisld</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Classix&amp;diff=2643</id>
		<title>Classix</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Classix&amp;diff=2643"/>
		<updated>2007-09-03T21:09:02Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: /* Assembly */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Classix autopilot was designed for advanced applications.  Dual processors provide a true hardware segregation of critical code for reliability - allowing the user to run experimental navigation or payload control software without fear of a processor crash causing a total loss of control.  A [http://www.gumstix.com Gumstix] header is included so that the autopilot can be directly interfaced with this small onboard Linux PC for advanced video processing, sensor management, or sophisticated navigation routines such as sense-and-avoid or target following.&lt;br /&gt;
&lt;br /&gt;
== Classix Control Board ==&lt;br /&gt;
&lt;br /&gt;
[[Image:classix_proto1_top_small.jpg|thumb|left|300px|Classix autopilot with Gumstix daughterboard]]&lt;br /&gt;
[[Image:classix_proto1_bot_small.jpg|thumb|left|300px|Classix Dual MCUs]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Dual LPC2148 MCUs&lt;br /&gt;
* 14 ADC channels&lt;br /&gt;
* 2 UARTs&lt;br /&gt;
* 6 PWM outputs&lt;br /&gt;
* 2 R/C Receiver inputs&lt;br /&gt;
* 2 combined USB clients&lt;br /&gt;
* 2 [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface SPI] busses&lt;br /&gt;
* 2 [http://en.wikipedia.org/wiki/I2c I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C]&lt;br /&gt;
* Connector to dock with a [http://www.gumstix.com Gumstix] board&lt;br /&gt;
* 5V input&lt;br /&gt;
* 3.3V linear regulator &amp;amp; 3.7V linear regulator (for Gumstix)&lt;br /&gt;
* Audio (for data downlink without a modem)&lt;br /&gt;
* 2 LEDs (status display)&lt;br /&gt;
* 12 grams&lt;br /&gt;
* 89 x 30mm&lt;br /&gt;
&lt;br /&gt;
The Classix Control Board use 2 Philips LPC2148 ARM7 based microcontroller.&lt;br /&gt;
The [http://www.arm.com/products/CPUs/families/ARM7Family.html ARM7] is a low-power 32-bit RISC processor core and the [http://www.standardics.philips.com/products/lpc2000/ Philips LPC2148] has 512KB on-chip Flash ROM, 40KB RAM and can be clocked at 60MHz.&lt;br /&gt;
&lt;br /&gt;
With 2 MCUs this system is very robust, 1 MCU can handle all critical code, fly-by-wire and such, and the other can handle all autonomous processing.  In the case of autonomous code error, the aircraft may be saved via manual control and the fbw MCU.&lt;br /&gt;
&lt;br /&gt;
The ability to dock with a [http://www.gumstix.com Gumstix] board would allow for image processing, heavy communications, or payload support.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Classix_Architecture.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Pinout ==&lt;br /&gt;
[[Image:Classix_v099_pinout.jpg]]&lt;br /&gt;
&lt;br /&gt;
== BOM ==&lt;br /&gt;
&lt;br /&gt;
The materials list can be produced from the Eagle CAD files on the [[Downloads|downloads]] page.&lt;br /&gt;
&lt;br /&gt;
== Assembly == &lt;br /&gt;
Here are a few observation from my Classix assembly/programming (see Tiny_Assembly for more info): &lt;br /&gt;
&lt;br /&gt;
* check the polarity of all parts, compare to a picture of a working reference board&lt;br /&gt;
* use a microscope or a magnifying glass to check for short circuits&lt;br /&gt;
* use a power supply for first tests, not a battery, limit the current to about 100mA, use a voltage of about 5V&lt;br /&gt;
* the 5V should not drop due to current limiting, measure the 3.7V and the 3.3V supply on the board&lt;br /&gt;
-&amp;gt; wrong voltages: check the parts around the power supply&lt;br /&gt;
* measure the current, it should be around 40mA at 5V with the LPC running and no code loaded &lt;br /&gt;
* attach one reset to GND, current should reduce to 30mA at 5V&lt;br /&gt;
-&amp;gt; check if reset signal can be measured at the LPC reset pin 57&lt;br /&gt;
* check the 12MHz at LPC pin 61, XTAL2 (XTAL_out)&lt;br /&gt;
* connect TXD and RXD of either AP_Serial or FBW_Serial to the serial port of your PC through a 3.3V-USB-RS232 converter (LPC_TXD_0 - PC_RX, LPC_RX_0 - PC_TX), attach LPC_P0.14 to ground or connect to a pushbutton and reset the board&lt;br /&gt;
* run the serial ROM loader lpc21isp to flash USB bootloader with&lt;br /&gt;
 make upload_bl PROC=GENERIC&lt;br /&gt;
-&amp;gt; check the rx/tx pins for data if flashing does not succeed&lt;br /&gt;
* deattach the LPC_P0.14, reset the board, current should be around 160 mA @ 5V when both AP and FWB are programmed&lt;br /&gt;
* the USB bootloader outputs debug information with 115200 8N1 on the serial port&lt;br /&gt;
 picocom -b 115200 /dev/ttyUSB0&lt;br /&gt;
* connect USB+ (D+), USB- (D-), and GND of AP or FBW with your PC, reset the board&lt;br /&gt;
* the PC will detect a new USB device, check with &amp;quot;dmesg&amp;quot; and &amp;quot;lsusb&amp;quot; - they should both show a USB device with VID/PID 7070:1234&lt;br /&gt;
-&amp;gt; if a new USB device is detected but does not accept new address, the USBconnect worked, but not the communication, check USB+ and USB-&lt;br /&gt;
* flash the autopilot with&lt;br /&gt;
 make AIRCRAFT=myplane clean_ac ap.upload&lt;br /&gt;
 (where myplane is the name of your airframe as defined in conf/conf.xml... Try with AIRCRAFT=TJ1 if you don't know what to use)&lt;br /&gt;
* check telemetry through serial port, messages should be displayed&lt;br /&gt;
* test A/D converters for supply voltage and IR sensors&lt;br /&gt;
* check modem, connect tx, rx, gnd and supply&lt;br /&gt;
* try to aquire sats outside&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
As noted in the IRC channel the clasix lacks certain &amp;quot;conveniences&amp;quot; of the tiny&lt;br /&gt;
&lt;br /&gt;
* No onboard CD4015B for a servo driver&lt;br /&gt;
* No onboard 5V VR 2A VR for Servos&lt;br /&gt;
* No onboard GPS&lt;br /&gt;
&lt;br /&gt;
The above being said , the first 2 items should be easily fixed by modifying the schematic(s) for the classix and regenerating the board layout in eagle(adding the necessary lines etc) or generating a servo driver and  5v VR board to interface with the classix for now till the above is completed.&lt;/div&gt;</summary>
		<author><name>Alexisld</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Classix&amp;diff=2642</id>
		<title>Classix</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Classix&amp;diff=2642"/>
		<updated>2007-09-03T20:39:46Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: /* Assembly */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Classix autopilot was designed for advanced applications.  Dual processors provide a true hardware segregation of critical code for reliability - allowing the user to run experimental navigation or payload control software without fear of a processor crash causing a total loss of control.  A [http://www.gumstix.com Gumstix] header is included so that the autopilot can be directly interfaced with this small onboard Linux PC for advanced video processing, sensor management, or sophisticated navigation routines such as sense-and-avoid or target following.&lt;br /&gt;
&lt;br /&gt;
== Classix Control Board ==&lt;br /&gt;
&lt;br /&gt;
[[Image:classix_proto1_top_small.jpg|thumb|left|300px|Classix autopilot with Gumstix daughterboard]]&lt;br /&gt;
[[Image:classix_proto1_bot_small.jpg|thumb|left|300px|Classix Dual MCUs]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Dual LPC2148 MCUs&lt;br /&gt;
* 14 ADC channels&lt;br /&gt;
* 2 UARTs&lt;br /&gt;
* 6 PWM outputs&lt;br /&gt;
* 2 R/C Receiver inputs&lt;br /&gt;
* 2 combined USB clients&lt;br /&gt;
* 2 [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface SPI] busses&lt;br /&gt;
* 2 [http://en.wikipedia.org/wiki/I2c I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C]&lt;br /&gt;
* Connector to dock with a [http://www.gumstix.com Gumstix] board&lt;br /&gt;
* 5V input&lt;br /&gt;
* 3.3V linear regulator &amp;amp; 3.7V linear regulator (for Gumstix)&lt;br /&gt;
* Audio (for data downlink without a modem)&lt;br /&gt;
* 2 LEDs (status display)&lt;br /&gt;
* 12 grams&lt;br /&gt;
* 89 x 30mm&lt;br /&gt;
&lt;br /&gt;
The Classix Control Board use 2 Philips LPC2148 ARM7 based microcontroller.&lt;br /&gt;
The [http://www.arm.com/products/CPUs/families/ARM7Family.html ARM7] is a low-power 32-bit RISC processor core and the [http://www.standardics.philips.com/products/lpc2000/ Philips LPC2148] has 512KB on-chip Flash ROM, 40KB RAM and can be clocked at 60MHz.&lt;br /&gt;
&lt;br /&gt;
With 2 MCUs this system is very robust, 1 MCU can handle all critical code, fly-by-wire and such, and the other can handle all autonomous processing.  In the case of autonomous code error, the aircraft may be saved via manual control and the fbw MCU.&lt;br /&gt;
&lt;br /&gt;
The ability to dock with a [http://www.gumstix.com Gumstix] board would allow for image processing, heavy communications, or payload support.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Classix_Architecture.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Pinout ==&lt;br /&gt;
[[Image:Classix_v099_pinout.jpg]]&lt;br /&gt;
&lt;br /&gt;
== BOM ==&lt;br /&gt;
&lt;br /&gt;
The materials list can be produced from the Eagle CAD files on the [[Downloads|downloads]] page.&lt;br /&gt;
&lt;br /&gt;
== Assembly == &lt;br /&gt;
Here are a few observation from my Classix assembly/programming (see Tiny_Assembly for more info): &lt;br /&gt;
&lt;br /&gt;
* check the polarity of all parts, compare to a picture of a working reference board&lt;br /&gt;
* use a microscope or a magnifying glass to check for short circuits&lt;br /&gt;
* use a power supply for first tests, not a battery, limit the current to about 100mA, use a voltage of about 5V&lt;br /&gt;
* the 5V should not drop due to current limiting, measure the 3.7V and the 3.3V supply on the board&lt;br /&gt;
-&amp;gt; wrong voltages: check the parts around the power supply&lt;br /&gt;
* measure the current, it should be around 40mA at 5V with the LPC running and no code loaded &lt;br /&gt;
* attach one reset to GND, current should reduce to 30mA at 5V&lt;br /&gt;
-&amp;gt; check if reset signal can be measured at the LPC reset pin 57&lt;br /&gt;
* check the 12MHz at LPC pin 61, XTAL2 (XTAL_out)&lt;br /&gt;
* connect TXD and RXD of either AP_Serial or FBW_Serial to the serial port of your PC through a 3.3V-USB-RS232 converter (LPC_TXD_0 - PC_RX, LPC_RX_0 - PC_TX), attach LPC_P0.14 to ground or connect to a pushbutton and reset the board&lt;br /&gt;
* run the serial ROM loader lpc21isp to flash USB bootloader with&lt;br /&gt;
 make upload_bl PROC=GENERIC&lt;br /&gt;
-&amp;gt; check the rx/tx pins for data if flashing does not succeed&lt;br /&gt;
* deattach the LPC_P0.14, reset the board, current should be around 160 mA @ 5V when both AP and FWB are programmed&lt;br /&gt;
* the USB bootloader outputs debug information with 115200 8N1 on the serial port&lt;br /&gt;
 picocom -b 115200 /dev/ttyUSB0&lt;br /&gt;
* connect USB+ (D+), USB- (D-), and GND of AP or FBW with your PC, reset the board&lt;br /&gt;
* the PC will detect a new USB device, check with &amp;quot;dmesg&amp;quot; and &amp;quot;lsusb&amp;quot; - they should both show a USB device with VID/PID 7070:1234&lt;br /&gt;
-&amp;gt; if a new USB device is detected but does not accept new address, the USBconnect worked, but not the communication, check USB+ and USB-&lt;br /&gt;
* flash the autopilot with&lt;br /&gt;
 make AIRCRAFT=myplane clean_ac ap.upload&lt;br /&gt;
 (where myplane is the name of your airframe as defined in conf/conf.xml)&lt;br /&gt;
* check telemetry through serial port, messages should be displayed&lt;br /&gt;
* test A/D converters for supply voltage and IR sensors&lt;br /&gt;
* check modem, connect tx, rx, gnd and supply&lt;br /&gt;
* try to aquire sats outside&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
As noted in the IRC channel the clasix lacks certain &amp;quot;conveniences&amp;quot; of the tiny&lt;br /&gt;
&lt;br /&gt;
* No onboard CD4015B for a servo driver&lt;br /&gt;
* No onboard 5V VR 2A VR for Servos&lt;br /&gt;
* No onboard GPS&lt;br /&gt;
&lt;br /&gt;
The above being said , the first 2 items should be easily fixed by modifying the schematic(s) for the classix and regenerating the board layout in eagle(adding the necessary lines etc) or generating a servo driver and  5v VR board to interface with the classix for now till the above is completed.&lt;/div&gt;</summary>
		<author><name>Alexisld</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Classix&amp;diff=2641</id>
		<title>Classix</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Classix&amp;diff=2641"/>
		<updated>2007-09-03T20:38:26Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: /* Assembly */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Classix autopilot was designed for advanced applications.  Dual processors provide a true hardware segregation of critical code for reliability - allowing the user to run experimental navigation or payload control software without fear of a processor crash causing a total loss of control.  A [http://www.gumstix.com Gumstix] header is included so that the autopilot can be directly interfaced with this small onboard Linux PC for advanced video processing, sensor management, or sophisticated navigation routines such as sense-and-avoid or target following.&lt;br /&gt;
&lt;br /&gt;
== Classix Control Board ==&lt;br /&gt;
&lt;br /&gt;
[[Image:classix_proto1_top_small.jpg|thumb|left|300px|Classix autopilot with Gumstix daughterboard]]&lt;br /&gt;
[[Image:classix_proto1_bot_small.jpg|thumb|left|300px|Classix Dual MCUs]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Dual LPC2148 MCUs&lt;br /&gt;
* 14 ADC channels&lt;br /&gt;
* 2 UARTs&lt;br /&gt;
* 6 PWM outputs&lt;br /&gt;
* 2 R/C Receiver inputs&lt;br /&gt;
* 2 combined USB clients&lt;br /&gt;
* 2 [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface SPI] busses&lt;br /&gt;
* 2 [http://en.wikipedia.org/wiki/I2c I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C]&lt;br /&gt;
* Connector to dock with a [http://www.gumstix.com Gumstix] board&lt;br /&gt;
* 5V input&lt;br /&gt;
* 3.3V linear regulator &amp;amp; 3.7V linear regulator (for Gumstix)&lt;br /&gt;
* Audio (for data downlink without a modem)&lt;br /&gt;
* 2 LEDs (status display)&lt;br /&gt;
* 12 grams&lt;br /&gt;
* 89 x 30mm&lt;br /&gt;
&lt;br /&gt;
The Classix Control Board use 2 Philips LPC2148 ARM7 based microcontroller.&lt;br /&gt;
The [http://www.arm.com/products/CPUs/families/ARM7Family.html ARM7] is a low-power 32-bit RISC processor core and the [http://www.standardics.philips.com/products/lpc2000/ Philips LPC2148] has 512KB on-chip Flash ROM, 40KB RAM and can be clocked at 60MHz.&lt;br /&gt;
&lt;br /&gt;
With 2 MCUs this system is very robust, 1 MCU can handle all critical code, fly-by-wire and such, and the other can handle all autonomous processing.  In the case of autonomous code error, the aircraft may be saved via manual control and the fbw MCU.&lt;br /&gt;
&lt;br /&gt;
The ability to dock with a [http://www.gumstix.com Gumstix] board would allow for image processing, heavy communications, or payload support.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Classix_Architecture.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Pinout ==&lt;br /&gt;
[[Image:Classix_v099_pinout.jpg]]&lt;br /&gt;
&lt;br /&gt;
== BOM ==&lt;br /&gt;
&lt;br /&gt;
The materials list can be produced from the Eagle CAD files on the [[Downloads|downloads]] page.&lt;br /&gt;
&lt;br /&gt;
== Assembly == &lt;br /&gt;
Here are a few observation from my Classix assembly/programming (see Tiny_Assembly for more info): &lt;br /&gt;
&lt;br /&gt;
* check the polarity of all parts, compare to a picture of a working reference board&lt;br /&gt;
* use a microscope or a magnifying glass to check for short circuits&lt;br /&gt;
* use a power supply for first tests, not a battery, limit the current to about 100mA, use a voltage of about 5V&lt;br /&gt;
* the 5V should not drop due to current limiting, measure the 3.7V and the 3.3V supply on the board&lt;br /&gt;
-&amp;gt; wrong voltages: check the parts around the power supply&lt;br /&gt;
* measure the current, it should be around 40mA at 5V with the LPC running and no code loaded &lt;br /&gt;
* attach one reset to GND, current should reduce to 30mA at 5V&lt;br /&gt;
-&amp;gt; check if reset signal can be measured at the LPC reset pin 57&lt;br /&gt;
* check the 12MHz at LPC pin 61, XTAL2 (XTAL_out)&lt;br /&gt;
* connect TXD and RXD of either AP_Serial or FBW_Serial to the serial port of your PC through a 3.3V-USB-RS232 converter (LPC_TXD_0 - PC_RX, LPC_RX_0 - PC_TX), attach LPC_P0.14 to ground or connect to a pushbutton and reset the board&lt;br /&gt;
* run the serial ROM loader lpc21isp to flash USB bootloader with&lt;br /&gt;
 make upload_bl PROC=GENERIC&lt;br /&gt;
-&amp;gt; check the rx/tx pins for data if flashing does not succeed&lt;br /&gt;
* deattach the LPC_P0.14, reset the board, current should be around 160 mA @ 5V when both AP and FWB are programmed&lt;br /&gt;
* the USB bootloader outputs debug information with 115200 8N1 on the serial port&lt;br /&gt;
* connect USB+ (D+), USB- (D-), and GND of AP or FBW with your PC, reset the board&lt;br /&gt;
* the PC will detect a new USB device, check with &amp;quot;dmesg&amp;quot; and &amp;quot;lsusb&amp;quot; - they should both show a USB device with VID/PID 7070:1234&lt;br /&gt;
-&amp;gt; if a new USB device is detected but does not accept new address, the USBconnect worked, but not the communication, check USB+ and USB-&lt;br /&gt;
* flash the autopilot with&lt;br /&gt;
 make AIRCRAFT=myplane clean_ac ap.upload&lt;br /&gt;
 (where myplane is the name of your airframe as defined in conf/conf.xml)&lt;br /&gt;
* check telemetry through serial port, messages should be displayed&lt;br /&gt;
* test A/D converters for supply voltage and IR sensors&lt;br /&gt;
* check modem, connect tx, rx, gnd and supply&lt;br /&gt;
* try to aquire sats outside&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
As noted in the IRC channel the clasix lacks certain &amp;quot;conveniences&amp;quot; of the tiny&lt;br /&gt;
&lt;br /&gt;
* No onboard CD4015B for a servo driver&lt;br /&gt;
* No onboard 5V VR 2A VR for Servos&lt;br /&gt;
* No onboard GPS&lt;br /&gt;
&lt;br /&gt;
The above being said , the first 2 items should be easily fixed by modifying the schematic(s) for the classix and regenerating the board layout in eagle(adding the necessary lines etc) or generating a servo driver and  5v VR board to interface with the classix for now till the above is completed.&lt;/div&gt;</summary>
		<author><name>Alexisld</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Classix&amp;diff=2640</id>
		<title>Classix</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Classix&amp;diff=2640"/>
		<updated>2007-09-03T20:20:17Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Classix autopilot was designed for advanced applications.  Dual processors provide a true hardware segregation of critical code for reliability - allowing the user to run experimental navigation or payload control software without fear of a processor crash causing a total loss of control.  A [http://www.gumstix.com Gumstix] header is included so that the autopilot can be directly interfaced with this small onboard Linux PC for advanced video processing, sensor management, or sophisticated navigation routines such as sense-and-avoid or target following.&lt;br /&gt;
&lt;br /&gt;
== Classix Control Board ==&lt;br /&gt;
&lt;br /&gt;
[[Image:classix_proto1_top_small.jpg|thumb|left|300px|Classix autopilot with Gumstix daughterboard]]&lt;br /&gt;
[[Image:classix_proto1_bot_small.jpg|thumb|left|300px|Classix Dual MCUs]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Dual LPC2148 MCUs&lt;br /&gt;
* 14 ADC channels&lt;br /&gt;
* 2 UARTs&lt;br /&gt;
* 6 PWM outputs&lt;br /&gt;
* 2 R/C Receiver inputs&lt;br /&gt;
* 2 combined USB clients&lt;br /&gt;
* 2 [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface SPI] busses&lt;br /&gt;
* 2 [http://en.wikipedia.org/wiki/I2c I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C]&lt;br /&gt;
* Connector to dock with a [http://www.gumstix.com Gumstix] board&lt;br /&gt;
* 5V input&lt;br /&gt;
* 3.3V linear regulator &amp;amp; 3.7V linear regulator (for Gumstix)&lt;br /&gt;
* Audio (for data downlink without a modem)&lt;br /&gt;
* 2 LEDs (status display)&lt;br /&gt;
* 12 grams&lt;br /&gt;
* 89 x 30mm&lt;br /&gt;
&lt;br /&gt;
The Classix Control Board use 2 Philips LPC2148 ARM7 based microcontroller.&lt;br /&gt;
The [http://www.arm.com/products/CPUs/families/ARM7Family.html ARM7] is a low-power 32-bit RISC processor core and the [http://www.standardics.philips.com/products/lpc2000/ Philips LPC2148] has 512KB on-chip Flash ROM, 40KB RAM and can be clocked at 60MHz.&lt;br /&gt;
&lt;br /&gt;
With 2 MCUs this system is very robust, 1 MCU can handle all critical code, fly-by-wire and such, and the other can handle all autonomous processing.  In the case of autonomous code error, the aircraft may be saved via manual control and the fbw MCU.&lt;br /&gt;
&lt;br /&gt;
The ability to dock with a [http://www.gumstix.com Gumstix] board would allow for image processing, heavy communications, or payload support.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Classix_Architecture.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Pinout ==&lt;br /&gt;
[[Image:Classix_v099_pinout.jpg]]&lt;br /&gt;
&lt;br /&gt;
== BOM ==&lt;br /&gt;
&lt;br /&gt;
The materials list can be produced from the Eagle CAD files on the [[Downloads|downloads]] page.&lt;br /&gt;
&lt;br /&gt;
== Assembly == &lt;br /&gt;
Here are a few observation from my Classix assembly/programming (see Tiny_Assembly for more info): &lt;br /&gt;
* On first power up (no code in the LPC) I got 0.04 amp @ 5V&lt;br /&gt;
* Once both LPC uploaded with the USB bootloader I got 0.16 amp @ 5V&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
As noted in the IRC channel the clasix lacks certain &amp;quot;conveniences&amp;quot; of the tiny&lt;br /&gt;
&lt;br /&gt;
* No onboard CD4015B for a servo driver&lt;br /&gt;
* No onboard 5V VR 2A VR for Servos&lt;br /&gt;
* No onboard GPS&lt;br /&gt;
&lt;br /&gt;
The above being said , the first 2 items should be easily fixed by modifying the schematic(s) for the classix and regenerating the board layout in eagle(adding the necessary lines etc) or generating a servo driver and  5v VR board to interface with the classix for now till the above is completed.&lt;/div&gt;</summary>
		<author><name>Alexisld</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Classix&amp;diff=2639</id>
		<title>Classix</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Classix&amp;diff=2639"/>
		<updated>2007-09-03T20:19:53Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: /* Assembly */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Classix autopilot was designed for advanced applications.  Dual processors provide a true hardware segregation of critical code for reliability - allowing the user to run experimental navigation or payload control software without fear of a processor crash causing a total loss of control.  A [http://www.gumstix.com Gumstix] header is included so that the autopilot can be directly interfaced with this small onboard Linux PC for advanced video processing, sensor management, or sophisticated navigation routines such as sense-and-avoid or target following.&lt;br /&gt;
&lt;br /&gt;
== Classix Control Board ==&lt;br /&gt;
&lt;br /&gt;
[[Image:classix_proto1_top_small.jpg|thumb|left|300px|Classix autopilot with Gumstix daughterboard]]&lt;br /&gt;
[[Image:classix_proto1_bot_small.jpg|thumb|left|300px|Classix Dual MCUs]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Dual LPC2148 MCUs&lt;br /&gt;
* 14 ADC channels&lt;br /&gt;
* 2 UARTs&lt;br /&gt;
* 6 PWM outputs&lt;br /&gt;
* 2 R/C Receiver inputs&lt;br /&gt;
* 2 combined USB clients&lt;br /&gt;
* 2 [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface SPI] busses&lt;br /&gt;
* 2 [http://en.wikipedia.org/wiki/I2c I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C]&lt;br /&gt;
* Connector to dock with a [http://www.gumstix.com Gumstix] board&lt;br /&gt;
* 5V input&lt;br /&gt;
* 3.3V linear regulator &amp;amp; 3.7V linear regulator (for Gumstix)&lt;br /&gt;
* Audio (for data downlink without a modem)&lt;br /&gt;
* 2 LEDs (status display)&lt;br /&gt;
* 12 grams&lt;br /&gt;
* 89 x 30mm&lt;br /&gt;
&lt;br /&gt;
The Classix Control Board use 2 Philips LPC2148 ARM7 based microcontroller.&lt;br /&gt;
The [http://www.arm.com/products/CPUs/families/ARM7Family.html ARM7] is a low-power 32-bit RISC processor core and the [http://www.standardics.philips.com/products/lpc2000/ Philips LPC2148] has 512KB on-chip Flash ROM, 40KB RAM and can be clocked at 60MHz.&lt;br /&gt;
&lt;br /&gt;
With 2 MCUs this system is very robust, 1 MCU can handle all critical code, fly-by-wire and such, and the other can handle all autonomous processing.  In the case of autonomous code error, the aircraft may be saved via manual control and the fbw MCU.&lt;br /&gt;
&lt;br /&gt;
The ability to dock with a [http://www.gumstix.com Gumstix] board would allow for image processing, heavy communications, or payload support.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Classix_Architecture.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Pinout ==&lt;br /&gt;
[[Image:Classix_v099_pinout.jpg]]&lt;br /&gt;
&lt;br /&gt;
== BOM ==&lt;br /&gt;
&lt;br /&gt;
The materials list can be produced from the Eagle CAD files on the [[Downloads|downloads]] page.&lt;br /&gt;
&lt;br /&gt;
== Assembly == &lt;br /&gt;
Here are a few observation from my Classix assembly/programming (see Tiny_Assembly for more info): &lt;br /&gt;
 On first power up (no code in the LPC) I got 0.04 amp @ 5V&lt;br /&gt;
 Once both LPC uploaded with the USB bootloader I got 0.16 amp @ 5V&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
As noted in the IRC channel the clasix lacks certain &amp;quot;conveniences&amp;quot; of the tiny&lt;br /&gt;
&lt;br /&gt;
* No onboard CD4015B for a servo driver&lt;br /&gt;
* No onboard 5V VR 2A VR for Servos&lt;br /&gt;
* No onboard GPS&lt;br /&gt;
&lt;br /&gt;
The above being said , the first 2 items should be easily fixed by modifying the schematic(s) for the classix and regenerating the board layout in eagle(adding the necessary lines etc) or generating a servo driver and  5v VR board to interface with the classix for now till the above is completed.&lt;/div&gt;</summary>
		<author><name>Alexisld</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Classix&amp;diff=2638</id>
		<title>Classix</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Classix&amp;diff=2638"/>
		<updated>2007-09-03T20:19:22Z</updated>

		<summary type="html">&lt;p&gt;Alexisld: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Classix autopilot was designed for advanced applications.  Dual processors provide a true hardware segregation of critical code for reliability - allowing the user to run experimental navigation or payload control software without fear of a processor crash causing a total loss of control.  A [http://www.gumstix.com Gumstix] header is included so that the autopilot can be directly interfaced with this small onboard Linux PC for advanced video processing, sensor management, or sophisticated navigation routines such as sense-and-avoid or target following.&lt;br /&gt;
&lt;br /&gt;
== Classix Control Board ==&lt;br /&gt;
&lt;br /&gt;
[[Image:classix_proto1_top_small.jpg|thumb|left|300px|Classix autopilot with Gumstix daughterboard]]&lt;br /&gt;
[[Image:classix_proto1_bot_small.jpg|thumb|left|300px|Classix Dual MCUs]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* Dual LPC2148 MCUs&lt;br /&gt;
* 14 ADC channels&lt;br /&gt;
* 2 UARTs&lt;br /&gt;
* 6 PWM outputs&lt;br /&gt;
* 2 R/C Receiver inputs&lt;br /&gt;
* 2 combined USB clients&lt;br /&gt;
* 2 [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface SPI] busses&lt;br /&gt;
* 2 [http://en.wikipedia.org/wiki/I2c I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C]&lt;br /&gt;
* Connector to dock with a [http://www.gumstix.com Gumstix] board&lt;br /&gt;
* 5V input&lt;br /&gt;
* 3.3V linear regulator &amp;amp; 3.7V linear regulator (for Gumstix)&lt;br /&gt;
* Audio (for data downlink without a modem)&lt;br /&gt;
* 2 LEDs (status display)&lt;br /&gt;
* 12 grams&lt;br /&gt;
* 89 x 30mm&lt;br /&gt;
&lt;br /&gt;
The Classix Control Board use 2 Philips LPC2148 ARM7 based microcontroller.&lt;br /&gt;
The [http://www.arm.com/products/CPUs/families/ARM7Family.html ARM7] is a low-power 32-bit RISC processor core and the [http://www.standardics.philips.com/products/lpc2000/ Philips LPC2148] has 512KB on-chip Flash ROM, 40KB RAM and can be clocked at 60MHz.&lt;br /&gt;
&lt;br /&gt;
With 2 MCUs this system is very robust, 1 MCU can handle all critical code, fly-by-wire and such, and the other can handle all autonomous processing.  In the case of autonomous code error, the aircraft may be saved via manual control and the fbw MCU.&lt;br /&gt;
&lt;br /&gt;
The ability to dock with a [http://www.gumstix.com Gumstix] board would allow for image processing, heavy communications, or payload support.&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Classix_Architecture.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Pinout ==&lt;br /&gt;
[[Image:Classix_v099_pinout.jpg]]&lt;br /&gt;
&lt;br /&gt;
== BOM ==&lt;br /&gt;
&lt;br /&gt;
The materials list can be produced from the Eagle CAD files on the [[Downloads|downloads]] page.&lt;br /&gt;
&lt;br /&gt;
== Assembly == &lt;br /&gt;
Here are a few observation from my Classix assembly/programming (see Tiny_Assembly for more info): &lt;br /&gt;
- On first power up (no code in the LPC) I got 0.04 amp @ 5V&lt;br /&gt;
- Once both LPC uploaded with the USB bootloader I got 0.16 amp @ 5V&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
As noted in the IRC channel the clasix lacks certain &amp;quot;conveniences&amp;quot; of the tiny&lt;br /&gt;
&lt;br /&gt;
* No onboard CD4015B for a servo driver&lt;br /&gt;
* No onboard 5V VR 2A VR for Servos&lt;br /&gt;
* No onboard GPS&lt;br /&gt;
&lt;br /&gt;
The above being said , the first 2 items should be easily fixed by modifying the schematic(s) for the classix and regenerating the board layout in eagle(adding the necessary lines etc) or generating a servo driver and  5v VR board to interface with the classix for now till the above is completed.&lt;/div&gt;</summary>
		<author><name>Alexisld</name></author>
	</entry>
</feed>