<?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=IHaveADrone</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=IHaveADrone"/>
	<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/wiki/Special:Contributions/IHaveADrone"/>
	<updated>2026-05-07T05:26:37Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Tunnel&amp;diff=23920</id>
		<title>Tunnel</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Tunnel&amp;diff=23920"/>
		<updated>2017-11-22T18:46:25Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: XML coloring&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| align=right&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Firmware&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The Tunnel is serial-to-serial pass-through. It connects  an autopilot serial port, e.g. from the GPS,  directly to the modem serial port or a USB-to-serial connection. This I/O in turn can go to your development PC for example. There are other uses no doubt, but this in the most common use. &lt;br /&gt;
&lt;br /&gt;
The Tunnel completely replaces the normal autopilot code, leaving the USB bootloader intact). Use this for example to gain direct access to the GPS for debugging or testing. Also for configuration with [[GPS#GPS_configuration_using_U-Center|U-Center]] it will be quite useful.&lt;br /&gt;
&lt;br /&gt;
You can either use a serial UART tunnel or USB tunnel:&lt;br /&gt;
&lt;br /&gt;
You have to add the tunnel targets to your airframe file. The tunnel targets must be part of a firmware section of &amp;lt;code&amp;gt;name=&amp;quot;setup&amp;quot;&amp;lt;/code&amp;gt;. If it doesn't already exist in your airframe file, just add it.&lt;br /&gt;
&lt;br /&gt;
An example on a Lisa M autopilot board&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;setup&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;tunnel&amp;quot; board=&amp;quot;lisa_m_2.0&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;usb_tunnel_0&amp;quot; board=&amp;quot;lisa_m_2.0&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note, that you must replace the value of &amp;lt;code&amp;gt;board&amp;lt;/code&amp;gt; with your board name.&lt;br /&gt;
&lt;br /&gt;
At the current state of the code only '''UART1''' goes to '''UART2''' and Vice versa and is sadly not configurable. Due to the opensource nature of PPRZ this can be made so ofcourse, you are welcomed to enhance the arch/uart_tunnel.c to add more and better functionality flexible tunnel port configuration.&lt;br /&gt;
&lt;br /&gt;
Note that UART1 TX has no simple Physical connection on a Lisa/M&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== UART tunnel ==&lt;br /&gt;
&lt;br /&gt;
Use this if you have a serial cable to connect. The LEDs will blink when data is transferred. Type the following command from your paparazzi folder, substituting the name of your airframe and paying attention to case sensitivity:&lt;br /&gt;
 make AIRCRAFT=''myplane'' tunnel.upload&lt;br /&gt;
Connect the USB cable and power on the autopilot to receive the code.&lt;br /&gt;
&lt;br /&gt;
This can be done without the USB bootloader by appending ''FLASH_MODE=ISP'' to the command line (specifying ISP serial loading).  This will require a serial cable connection (i.e. FTDI USB-to-TTL). '''WARNING!''' Installing tunnel code with the ISP method will erase any USB bootloader code. Make sure you are able to install a bootloader yourself.&lt;br /&gt;
&lt;br /&gt;
== USB tunnel ==&lt;br /&gt;
&lt;br /&gt;
This can be done without a serial cable just by having USB. The LEDs will blink when data is transferred. It can connect to either serial port on the autopilot (for Tiny 2.11: uart0=gps, uart1=modem). To connect USB to the gps type the following command from your paparazzi folder, substituting the name of your airframe and paying attention to case sensitivity:&lt;br /&gt;
 make AIRCRAFT=''myplane'' usb_tunnel_0.upload&lt;br /&gt;
Connect the usb cable and power on the autopilot to receive the code. The code will switch the USB to emulate a serial port that you can access at '''/dev/ttyACMx'''. Windows user can extract the usbser.sys file from .cab file in C:\WINDOWS\Driver Cache\i386 and store it somewhere (C:\temp is a good place) along with the [[Media:Usbser.zip|usbser.inf]] file. Windows then creates an extra COMx port that you can use in a terminal program or with ucenter.&lt;br /&gt;
To use the USB tunnel make sure you first power the autopilot before connecting USB not to end up in the USB bootloader.&lt;br /&gt;
&lt;br /&gt;
Required Cables: &lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;USB cable&lt;br /&gt;
&amp;lt;li&amp;gt;USB to 8-pin Molex Picoblade Male-connector cable (optional, can use wireless link)&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
Steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Connect USB Cable + 8-pin Molex adapter to USB on your laptop&lt;br /&gt;
&amp;lt;li&amp;gt;Connect 8-pin Molex Connector on the Adapter cable to &amp;quot;usb&amp;quot; on Tiny2.11&lt;br /&gt;
&amp;lt;li&amp;gt;Power on Tiny2.11&lt;br /&gt;
&amp;lt;li&amp;gt;Enter this command in a terminal: make AIRCRAFT=Twinjet tunnel.upload&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Success will show this in the last lines of the terminal window&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Found USB device&lt;br /&gt;
BootROM code: 2.12&lt;br /&gt;
Part ID: 0x0402FF25 (LPC2148, 512k Flash, 32k+8k RAM)&lt;br /&gt;
BootLoader version: 1.3&lt;br /&gt;
#&lt;br /&gt;
Starting software at 0x00004000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Now your Tiny2.11 will tunnel UART1 from the GPS direct to the serial connector on the board. So, using the 8-pin Molex to FTDI cable adapter (or use the wireless link e.g. XBee) you can use your computer to interact with the GPS module. One example is using u-blox u-center program to configure your GPS module. Like the bootloader if you bought your Tiny2.11 assembled check with your 3rd party vendors configured your GPS. Good chance you won't need to use the tunnel or configure the GPS module.&amp;lt;/p&amp;gt; The required cable may included with 3rd party vendors!&lt;br /&gt;
&lt;br /&gt;
[[Category:Firmware]] [[Category:User_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=AspirinIMU&amp;diff=23714</id>
		<title>AspirinIMU</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=AspirinIMU&amp;diff=23714"/>
		<updated>2017-07-11T15:58:41Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: /* Downloads */  fixed github link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float: right; width: 45%; overflow: hidden&amp;quot;&amp;gt;[[Image:Aspirin_2.1_imu_front.jpg|right|200px|Aspirin V2.1 top view]]&amp;lt;/div&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Aspirin IMU ==&lt;br /&gt;
&lt;br /&gt;
The next generation flat multi degree of freedom inertial measurement unit. It uses digital 3-axis sensors which allow for a very small size and price. Other features include onboard voltage regulators, EEPROM for storing calibration data and extra sensors such as a barometer.&lt;br /&gt;
&lt;br /&gt;
== Hardware Revision History ==&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;6&amp;quot;&lt;br /&gt;
!''Version #''!!''Release Date''!!''Release Notes''&lt;br /&gt;
|-&lt;br /&gt;
|v2.2(current)||09/2012||2nd Gen Revision&lt;br /&gt;
|-&lt;br /&gt;
|v2.1r1||08/2012||2nd Gen Minor Revision&lt;br /&gt;
|-&lt;br /&gt;
|v2.1||03/2012||2nd Gen Production Release&lt;br /&gt;
|-&lt;br /&gt;
|v2.0||11/2011||2nd Gen Prototype&lt;br /&gt;
|-&lt;br /&gt;
|v1.5||04/2011||Updated Production Release&lt;br /&gt;
|-&lt;br /&gt;
|v1.4||03/2011||Prototype Update&lt;br /&gt;
|-&lt;br /&gt;
|v1.3||08/2010||Initial Production Release&lt;br /&gt;
|-&lt;br /&gt;
|v1.2||07/2010||Prototype Update&lt;br /&gt;
|-&lt;br /&gt;
|v1.1||07/2010||Prototype Update&lt;br /&gt;
|-&lt;br /&gt;
|v1.0||07/2010||Initial Prototype&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
* 3-axis accelerometer&lt;br /&gt;
* 3-axis gyroscope&lt;br /&gt;
* 3-axis magnetometer&lt;br /&gt;
* Onboard voltage regulation&lt;br /&gt;
* Onboard I2C EEPROM&lt;br /&gt;
* Onboard barometer (''v2.1'')&lt;br /&gt;
* Standard footprint across versions&lt;br /&gt;
* Single PCB flat form-factor&lt;br /&gt;
* Fits directly onto [[Lisa/M]], carriers for [[Booz]] and [[Lisa/L]], or for [[Autopilots|LPC21xx]] integration&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''Aspirin Feature Matrix'''&lt;br /&gt;
!width=&amp;quot;6%&amp;quot;|''Version''!!width=&amp;quot;10%&amp;quot;|''Accelerometer''!!width=&amp;quot;10%&amp;quot;|''Gyroscope''!!width=&amp;quot;10%&amp;quot;|''Magnetometer''!!width=&amp;quot;10%&amp;quot;|''Barometer''!!width=&amp;quot;15%&amp;quot;|''Regulators''!!width=&amp;quot;10%&amp;quot;|''EEPROM''!!''Comments''&lt;br /&gt;
|-&lt;br /&gt;
|v2.2||MPU-6000||MPU-6000||HMC5883||MS5611||1x 3.3V (LP2992)||yes||MS5611 is connected directly to the SPI bus&lt;br /&gt;
|-&lt;br /&gt;
|v2.1||MPU-6000||MPU-6000||HMC5883||MS5611||1x 3.3V (LP2992)||yes||MS5611 is connected to the aux I2C of the MPU6000&lt;br /&gt;
|-&lt;br /&gt;
|v2.0||MPU-6000||MPU-6000||HMC5883||none||1x 3.3V (LP2992)||yes||&lt;br /&gt;
|-&lt;br /&gt;
|v1.5||ADXL345||IMU-3000||HMC5883||none||2x 3.3V (LP2992)||yes||&lt;br /&gt;
|-&lt;br /&gt;
|v1.4||ADXL345||IMU-3000||HMC5883||none||2x 3.3V (LP2992)||yes||&lt;br /&gt;
|-&lt;br /&gt;
|v1.3||ADXL345||ITG-3200||HMC5843||none||2x 3.3V (LP2992)||yes||&lt;br /&gt;
|-&lt;br /&gt;
|v1.2||ADXL345||ITG-3200||HMC5843||none||2x 3.3V (LP2992)||yes||&lt;br /&gt;
|-&lt;br /&gt;
|v1.1||ADXL345||ITG-3200||HMC5843||none||2x 3.3V (LP2992)||yes||&lt;br /&gt;
|-&lt;br /&gt;
|v1.0||ADXL345||ITG-3200||HMC5843||none||2x 3.3V (LP2992)||yes||Also has SC18IS600 SPI-I2C interface&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Aspirin 2.1 comes in several population versions. The current version available at http://transition-robotics.com has the MPU-6000, HMC5843, and MS5611-01BA03 mounted. You can find the list of fitted sensors on Aspirin 2.1 in the eeprom block 4.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=170px heights=120px&amp;gt;&lt;br /&gt;
Image:Aspirin imu front.jpg|Aspirin V1.3 IMU front&lt;br /&gt;
&amp;lt;!--Image:Aspirin imu front with scale.jpg|Aspirin IMU front with scale--&amp;gt;&lt;br /&gt;
Image:Aspirin imu back.jpg|Aspirin V1.3 IMU back&lt;br /&gt;
Image:Aspirin imu on carrier.JPG|Aspirin V1.3 IMU on [[Lisa/L]] compatible carrier board&lt;br /&gt;
Image:LisaL_Aspirin_Flat_Carrier.jpg|Aspirin flat carrier board for [[Lisa/L]] (without IMU mounted)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=220px heights=150px&amp;gt;&lt;br /&gt;
Image:Aspirin_2.1_bottom.jpg|Aspirin IMU 2.1 bottom side&lt;br /&gt;
Image:Aspirin_2.1_top.jpg|Aspirin IMU 2.1 top side&lt;br /&gt;
Image:Aspirin_2.1_nobaro_top.jpg|Aspirin IMU 2.1 top side no barometer mounted&lt;br /&gt;
Image:Aspirin_2.1_nomag_nobaro_top.jpg|Aspirin IMU 2.1 top side no barometer and no magnetometer mounted&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pinout ==&lt;br /&gt;
&lt;br /&gt;
Note that Aspirin uses a standard footprint and pinout across all versions, with certain exceptions. The chip select (CS) and interrupt (Int) pins are not always assigned to the same devices. A good example is with the introduction of the MPU-6000 device. Check the schematics for details.&lt;br /&gt;
&lt;br /&gt;
'''Warning:''' When mounting Aspirin on Lisa/M note that the pin labeled GND on Aspirin (in the right upper corner on the following picture) is connected on Lisa/M to GYRO_SS. To prevent a software error induced shorting of the Lisa/M GYRO_SS pin to ground, remove the castellation or remove the connection on that pad.&lt;br /&gt;
&lt;br /&gt;
In the v2.1r1 versions of Aspirin (&amp;quot;R1&amp;quot; silkscreened onto PCB) the right upper GND pad was changed to Not Connected, (marked RESV in the below image), resolving the issue.&lt;br /&gt;
&lt;br /&gt;
[[Image:Aspirin IMU documented.jpg|300px|Aspirin IMU with documented IO connections.]]&lt;br /&gt;
[[Image:Aspirin_booz_carrier_legend.jpg|300px|Aspirin IMU on booz/breakout carrier with documented IO connections.]]&lt;br /&gt;
[[Image:Aspirin_flat_carrier_legend.jpg|300px|Aspirin IMU on flat carrier with documented IO connections.]]&lt;br /&gt;
&lt;br /&gt;
Note that the 12-pin connector pinout of the Booz/breakout carrier (center) is reversed with respect to the Lisa/L flat carrier (right). This is because the Booz carrier mounts to Lisa/L with the Aspirin underneath the carrier (e.g., Z axis pointing toward Lisa/L), and the flat carrier mounts to Lisa/L with the Aspirin on top (e.g., Z axis pointing away from Lisa/L).&lt;br /&gt;
&lt;br /&gt;
=== Breakout board ===&lt;br /&gt;
&lt;br /&gt;
In case you have some Aspirin lying around and you want to use the on a non Lisa Board, like the TWOG, here pictures of how to patch the breakoutboard. Then connect to TWOG and add the correct defines to your airframe configuration document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Aspirin_v1.5_via_AsCa_v1.0_to_TWOG_03.jpg |Aspirin v1.5 via AsCa v1.0 to TWOG&lt;br /&gt;
Image:Aspirin_v1.5_via_confboard_to_TWOG_01.jpg |Aspirin v1.5 via confboard to TWOG&lt;br /&gt;
Image:Aspirin_v1.5_via_confboard_to_TWOG_02.jpg |Aspirin v1.5 via confboard to TWOG bottom&lt;br /&gt;
Image:Aspirin_v1.5_via_Patching_the_Breakout_Board.jpg |Aspirin v1.5 via Patching the Breakout Board&lt;br /&gt;
Image:Aspirin_v1.5_Connector_To_TWOG_Board.jpg |Aspirin v1.5 Connector To TWOG Board&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Block Diagrams ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=300px heights=300px&amp;gt;&lt;br /&gt;
Image:Aspirin-1_x-stm32-block_diagram.png|Aspirin 1.x to STM32 protocol connections&lt;br /&gt;
Image:Aspirin-2_x-stm32-slave_i2c-block_diagram.png|Aspirin 2.x to STM32 default protocol connections (MPU-6000 slave I2C)&lt;br /&gt;
Image:Aspirin-2_x-stm32-direct_i2c-block_diagram.png|Aspirin 2.x to STM32 alternative protocol connections (STM32 direct I2C)&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Schematics ==&lt;br /&gt;
&lt;br /&gt;
Schematics are available under {{CC-BY-SA-3.0}} license. For additional intermediate schematics see [[AspirinIMU#Downloads|Downloads]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=200px heights=137px&amp;gt;&lt;br /&gt;
Image:Aspirin_imu_schematic_V1_3.png|Aspirin IMU V1.3 schematic&lt;br /&gt;
Image:Aspirin_imu_schematic_V1_5.png|Aspirin IMU V1.5 schematic&lt;br /&gt;
Image:Aspirin_imu_schematic_V2_1.png|Aspirin IMU V2.1 schematic&lt;br /&gt;
Image:Aspirin_imu_schematic_V2_2.png|Aspirin IMU V2.2 schematic&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Drivers and Support ==&lt;br /&gt;
&lt;br /&gt;
Please see the [[Subsystem/imu|IMU subsystem]] page for details on configuring Paparazzi for using an Aspirin IMU.&lt;br /&gt;
&lt;br /&gt;
The drivers for this IMU are available in the [https://github.com/paparazzi/paparazzi/blob/master/sw/airborne/subsystems/imu/imu_aspirin.c Paparazzi GitHub repository].&lt;br /&gt;
&lt;br /&gt;
== PCB and assembled boards suppliers ==&lt;br /&gt;
&lt;br /&gt;
Aspirin IMU is available in the [http://thequadshot.com/collections/all Transition Robotics/Quadshot Online Shop].&lt;br /&gt;
&lt;br /&gt;
There are three options of Aspirin IMU:&lt;br /&gt;
* [http://thequadshot.com/products/aspirin-imu Without a carrier board]&lt;br /&gt;
* [http://thequadshot.com/products/aspirin-imu With Booz carrier board]&lt;br /&gt;
* [http://thequadshot.com/products/aspirin-imu With next generation flat carrier board]&lt;br /&gt;
** [http://thequadshot.com/products/lisa-l-aspirin-flat-carrier The flat carrier board can be purchased separately as well]&lt;br /&gt;
&lt;br /&gt;
== Mechanical Dimensions ==&lt;br /&gt;
&lt;br /&gt;
[[Image:Aspirin_top_mechanical.png|500px|Aspirin Footprint Mechanical Dimensions]]&lt;br /&gt;
&lt;br /&gt;
The overall height of the board is about 3mm.&lt;br /&gt;
&lt;br /&gt;
== Downloads ==&lt;br /&gt;
&lt;br /&gt;
'''Source files'''&lt;br /&gt;
:*download available on GitHub: ''[https://github.com/paparazzi/paparazzi-hardware/tree/master/sensors/imu/aspirin Aspirin IMU and Carrier Board Cadsoft Eagle 6 Design]''&lt;br /&gt;
'''Gerber &amp;amp; Drill files'''&lt;br /&gt;
:*download ''NOT YET AVAILABLE'' Need generated gerbers and drill files&lt;br /&gt;
'''Assembly files'''&lt;br /&gt;
:*download ''NOT YET AVAILABLE'' Need Aspirin Components layouts (pdf)&lt;br /&gt;
:*download ''NOT YET AVAILABLE'' Need Aspirin Bill Of Material&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]] [[Category:User_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Rotorcraft_Configuration&amp;diff=23677</id>
		<title>Rotorcraft Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Rotorcraft_Configuration&amp;diff=23677"/>
		<updated>2017-04-26T18:36:14Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: /* Motor Mixing */  XML &amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Airframe_Configuration&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
This page describes configuration options &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;lt;b&amp;gt;specific to the rotorcraft firmware&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt; in the [[Airframe_Configuration|airframe file]].&lt;br /&gt;
&lt;br /&gt;
== Firmware and Hardware definitions ==&lt;br /&gt;
&lt;br /&gt;
This is one example of a pretty standard quadcopter firmware definition:&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;nps&amp;quot; board=&amp;quot;pc&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;subsystem name=&amp;quot;fdm&amp;quot;   type=&amp;quot;jsbsim&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/target&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot; board=&amp;quot;lisa_m_1.0&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;radio_control&amp;quot; type=&amp;quot;ppm&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;telemetry&amp;quot;     type=&amp;quot;transparent&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;actuators&amp;quot;     type=&amp;quot;mkk&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;imu&amp;quot;           type=&amp;quot;aspirin_v1.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;gps&amp;quot;           type=&amp;quot;ublox&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ahrs&amp;quot;          type=&amp;quot;int_cmpl_quat&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;stabilization&amp;quot; type=&amp;quot;int_quat&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Select your Board ===&lt;br /&gt;
Make sure you use the &amp;lt;b&amp;gt;rotorcraft [[Airframe_Configuration#Firmware|firmware]]&amp;lt;/b&amp;gt; and choose the correct board, e.g.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;sim&amp;quot; 	board=&amp;quot;pc&amp;quot;/&amp;gt;       &amp;lt;!-- For simulation --&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot; 	board=&amp;quot;lisa_m_2.0&amp;quot;/&amp;gt; &amp;lt;!-- Select your board here --&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The ap board name can be found in /conf/boards.&lt;br /&gt;
&lt;br /&gt;
=== Actuators ===&lt;br /&gt;
You have to specify which ESCs you have by adding the appropriate [[Subsystem/actuators|actuators subsystem.]]&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot; board=&amp;quot;booz_1.0&amp;quot;/&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;actuators&amp;quot; type=&amp;quot;mkk&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Control Loops ===&lt;br /&gt;
See the [[Subsystem/stabilization|stabilization subsystem]] page to choose which attitude control algorithm to use and how to configure them.&lt;br /&gt;
&lt;br /&gt;
The [[Control Loops]] page has some diagrams.&lt;br /&gt;
&lt;br /&gt;
=== INS ===&lt;br /&gt;
The INS (Integrated Navigation System) subsystem contains estimations filter to e.g. fuse GPS and IMU data for better position and speed estimates.&lt;br /&gt;
The INS subsystem is optional in &amp;lt;= v4.2.&lt;br /&gt;
&lt;br /&gt;
Since v4.9x the INS subsystem is mandatory, to use the same as in v4.2 omit the type.&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot; board=&amp;quot;booz_1.0&amp;quot;/&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ins&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
You can also compensate for GPS lag in hff (horizontal filter float) if it is known (in seconds):&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot; board=&amp;quot;booz_1.0&amp;quot;/&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ins&amp;quot; type=&amp;quot;hff&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;define name=&amp;quot;GPS_LAG=0.2&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/subsystem&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Motor Arming ==&lt;br /&gt;
By default the motors are armed with zero-throttle and full yaw. The motors are never started if AHRS is not aligned (disable it with AUTOPILOT_DISABLE_AHRS_KILL).&lt;br /&gt;
&lt;br /&gt;
Other arming sequences can be configured:&lt;br /&gt;
* USE_KILL_SWITCH_FOR_MOTOR_ARMING defined (to 1):&lt;br /&gt;
** switch kill switch off to arm the motors&lt;br /&gt;
** if kill switch is off during startup, you need to kill again first, then unkill to start&lt;br /&gt;
** throttle needs to be down, other sticks centered to start motors&lt;br /&gt;
** need to be in manual mode to start the motors&lt;br /&gt;
&lt;br /&gt;
* USE_THROTTLE_FOR_MOTOR_ARMING defined (to 1):&lt;br /&gt;
** automatically start motors when applying throttle&lt;br /&gt;
** if throttle was not down at startup, you need to put throttle down again first&lt;br /&gt;
** other sticks need to be centered to start motors&lt;br /&gt;
** need to be in manual mode to start the motors&lt;br /&gt;
&lt;br /&gt;
== Autopilot modes ==&lt;br /&gt;
For rotorcrafts we have a lot of different modes that can be mapped to your 3-position switch (Manual, Auto1, Auto2).&lt;br /&gt;
The horizontal and vertical mode can be set differently as the following possible modes indicate (in parenthesis are the abbreviations displayed in the [[GCS#Strips|GCS]] strip).&lt;br /&gt;
&lt;br /&gt;
'''Limiting max thrust via RC'''&amp;lt;br&amp;gt;&lt;br /&gt;
Modes with 'automatic' thrust control (e.g. x_Z_HOLD and NAV) let you limit the maximum thrust via RC by default. So you should push your throttle stick up after entering such a mode so the vertical controller has some &amp;quot;room&amp;quot; to stabilize the altitude. Should something weird happen you can limit the max thrust by taking throttle back.&amp;lt;br&amp;gt; You can turn this behavior off by defining '''NO_RC_THRUST_LIMIT'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_FAILSAFE (SAFE) :&lt;br /&gt;
This is a failsafe mode that gets triggered if:&lt;br /&gt;
* RC signal is lost (and you are not in KILL or NAV mode)&lt;br /&gt;
* GPS and RC is lost in NAV mode&lt;br /&gt;
The standard behaviour is that autopilot will level the rotorcraft out (setpoints to zero pitch and roll angles) and descend at 0.5m/s downwards. But this behavior can also be changed to something else ofcourse.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_KILL (KILL) :&lt;br /&gt;
Motors are simply switched off.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_RATE_DIRECT (RATE) :&lt;br /&gt;
This is basically the &amp;quot;most&amp;quot; manual mode you can get. You control not the attitude (roll and pitch angles) but the rotation rate. You also set the throttle directly with your RC.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_ATTITUDE_DIRECT (ATT) :&lt;br /&gt;
You control the attitude (roll, pitch and yaw angles), but the throttle is directly proportional to your stick position.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_RATE_RC_CLIMB (R_RCC) :&lt;br /&gt;
You control the rotation rate and the vertical speed according to your throttle stick position.&amp;lt;br&amp;gt;If you have your throttle stick in the middle position, the altitude is kept, down goes down at a speed proportional to your stick position (same for up). In this mode it makes sense to mount the spring for your throttle stick so it can recenter itself.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_ATTITUDE_RC_CLIMB (A_RCC) :&lt;br /&gt;
You control the attitude (roll, pitch and yaw angles) and the vertical speed according to your throttle stick position.&amp;lt;br&amp;gt;If you have your throttle stick in the middle position the altitude is kept, if you move the stick down it goes down at a speed proportional to your stick position (same for up). In this mode it makes sense to mount the spring for your throttle stick so it recenter itself.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_ATTITUDE_CLIMB (ATT_C) :&lt;br /&gt;
You control the attitude (roll, pitch and yaw angles) and the vertical speed. The vertical speed is set via fms (e.g. joystick).&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_RATE_Z_HOLD (R_ZH) :&lt;br /&gt;
You control the rotation rate and it holds the altitude you were at when entering this mode.&amp;lt;br&amp;gt;Your throttle stick position still limits the max throttle authority unless disabled with NO_RC_THRUST_LIMIT.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_ATTITUDE_Z_HOLD (A_ZH) :&lt;br /&gt;
You control the attitude (roll, pitch and yaw angles) and it holds the altitude you were at when entering this mode.&amp;lt;br&amp;gt;Your throttle stick position still limits the max throttle authority unless disabled with NO_RC_THRUST_LIMIT.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_HOVER_DIRECT (HOVER) :&lt;br /&gt;
The rotorcraft hovers at the horizontal position you were at when entering this mode (position control). You still set the throttle directly with your RC. Yaw command on the RC allows for heading change. If USE_SPEED_REF=1 then pitch and roll commands in the RC control speed according to max speed set with REF_MAX_SPEED in the GUIDANCE_H section of airframe file.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_HOVER_CLIMB (HOV_C) :&lt;br /&gt;
The rotorcraft hovers at the position you were at when entering this mode (position control). RC commands work the same as in HOVER mode. The vertical speed is set via fms (e.g. joystick).&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_HOVER_Z_HOLD (H_ZH):&lt;br /&gt;
The rotorcraft hovers at the 3D position you were at when entering this mode (position and altitude control).  RC commands work the same as in HOVER mode. &amp;lt;br&amp;gt;Your throttle stick position still limits the max throttle authority unless disabled with NO_RC_THRUST_LIMIT.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_NAV (NAV) :&lt;br /&gt;
Full navigation mode. The rotorcraft follows your flightplan.&amp;lt;br&amp;gt;If you have a valid RC signal, your throttle stick position still limits the max throttle authority unless disabled with NO_RC_THRUST_LIMIT.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_RC_DIRECT (RC_D) :&lt;br /&gt;
Safety pilot direct commands for helicopter.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_CARE_FREE_DIRECT (CF):&lt;br /&gt;
Same as AP_MODE_ATTITUDE_DIRECT, but the roll and pitch commands are based on the yaw angle when entering this mode.&lt;br /&gt;
&lt;br /&gt;
== XML Parameters ==&lt;br /&gt;
&lt;br /&gt;
=== Mode ===&lt;br /&gt;
In the mode section you can set the autopilot modes associated with your 3-way mode switch on your RC.&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MODE&amp;quot; prefix=&amp;quot;MODE_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MANUAL&amp;quot; value=&amp;quot;AP_MODE_ATTITUDE_DIRECT&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO1&amp;quot; value=&amp;quot;AP_MODE_ATTITUDE_Z_HOLD&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO2&amp;quot; value=&amp;quot;AP_MODE_NAV&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;commands&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; lists the abstract commands you need to control the aircraft. For most multicopter you just need:&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;commands&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;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;YAW&amp;quot; failsafe_value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;axis name=&amp;quot;THRUST&amp;quot; failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/commands&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Each command is also associated with a failsafe value which will be used if no controller is active, for example during initialization of the autopilot board.&lt;br /&gt;
&lt;br /&gt;
=== Motor Mixing ===&lt;br /&gt;
&lt;br /&gt;
This section describes the &amp;quot;mixing&amp;quot; used for your particular multirotor configuration. This section is needed for all ESCs except &amp;quot;asctec_v1&amp;quot; wich do their mixing themselves.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
Used since '''v5.0''', for previous version see [[Rotorcraft_Configuration#Supervision|Supervision]].&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;Differences with the older supervision (used prior to '''v4.9_devel-164-gdb0d004'''):&lt;br /&gt;
* names: SUPERVISION -&amp;gt; MOTOR_MIXING&lt;br /&gt;
* independent of the actuators, needs to be loaded in the subsystems and call in the command_laws section&lt;br /&gt;
* internal values have '''pprz''' format (int16, between [-9600; 9600])&lt;br /&gt;
* min and max are not needed, coming from the servos definition&lt;br /&gt;
* trim are renamed with more explicit names&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This subsystem takes ''roll'', ''pitch'', ''yaw'' and ''thrust'' commands as inputs and &amp;quot;mixes&amp;quot; them to get the final commands for your individual motors according to the layout of them. See [[RotorcraftMixing]] for the details behind this.&lt;br /&gt;
&lt;br /&gt;
Note that after mixing the separate motor commands can &amp;quot;saturate&amp;quot;, meaning you can't simply give negative thrust or more than the maximum. If a saturation is reached (desired motor command outside of possible MIN_MOTOR/MAX_MOTOR range), a saturation offset is applied to all motors in order to give attitude commands a higher priority than thrust. This offset is limited to ''MOTOR_MIXING_MAX_SATURATION_OFFSET'' (default is 10% of maximum command).&lt;br /&gt;
&lt;br /&gt;
See also [https://github.com/paparazzi/paparazzi/issues/385 issue #385].&lt;br /&gt;
&lt;br /&gt;
In '''firmware''' section:&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;motor_mixing&amp;quot;/&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Configuration of the motor mixing:&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TRIM_ROLL&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TRIM_PITCH&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TRIM_YAW&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MAX_SATURATION_OFFSET&amp;quot;	value=&amp;quot;MAX_PPRZ/10&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NB_MOTOR&amp;quot; value=&amp;quot;4&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;SCALE&amp;quot; value=&amp;quot;256&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_COEF&amp;quot;   value=&amp;quot;{  0  ,    0,  256, -256 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_COEF&amp;quot;  value=&amp;quot;{  256, -256,    0,    0 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_COEF&amp;quot;    value=&amp;quot;{ -256, -256,  256,  256 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;THRUST_COEF&amp;quot; value=&amp;quot;{  256,  256,  256,  256 }&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
; ''TRIM_ROLL'' : trim added to roll command&lt;br /&gt;
; ''TRIM_PITCH'' : trim added to pitch command&lt;br /&gt;
; ''TRIM_YAW'' : trim added to yaw command&lt;br /&gt;
; ''MAX_SATURATION_OFFSET'' : set at &amp;quot;MAX_PPRZ/10&amp;quot; by default&lt;br /&gt;
; x''_COEF'' : roll/pitch/yaw/thrust coefficients, see [[RotorcraftMixing]] for details or the examples below&lt;br /&gt;
&lt;br /&gt;
In '''command_laws''' section (placed after section MIXING):&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;command_laws&amp;gt;&lt;br /&gt;
    &amp;lt;call fun=&amp;quot;motor_mixing_run(autopilot_motors_on, FALSE, values)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;set servo=&amp;quot;FRONT&amp;quot; value=&amp;quot;motor_mixing.commands[0]&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;set servo=&amp;quot;BACK&amp;quot;  value=&amp;quot;motor_mixing.commands[1]&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;set servo=&amp;quot;RIGHT&amp;quot; value=&amp;quot;motor_mixing.commands[2]&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;set servo=&amp;quot;LEFT&amp;quot;  value=&amp;quot;motor_mixing.commands[3]&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/command_laws&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Mixing Examples ====&lt;br /&gt;
&lt;br /&gt;
Hint: If your rotors are spinning '''opposite''' to the '''direction''' shown in the picture, '''reverse signs''' in the YAW_COEF line.&lt;br /&gt;
&lt;br /&gt;
; Plus Cross : [[Image:cross_plus_simple.png|200px]]&lt;br /&gt;
Assuming that the order of motors, described in the &amp;quot;servos&amp;quot; section is FRONT, RIGHT, BACK, LEFT.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NB_MOTOR&amp;quot; value=&amp;quot;4&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;SCALE&amp;quot; value=&amp;quot;256&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_COEF&amp;quot;   value=&amp;quot;{    0, -256,    0,  256 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_COEF&amp;quot;  value=&amp;quot;{  256,    0, -256,    0 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_COEF&amp;quot;    value=&amp;quot;{ -128,  128, -128,  128 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;THRUST_COEF&amp;quot; value=&amp;quot;{  256,  256,  256,  256 }&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is equivalent to (available since v5.5_devel-602-g0129d3e):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TYPE&amp;quot; value=&amp;quot;QUAD_PLUS&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Time Cross : [[Image:cross_time_simple.png|200px]]&lt;br /&gt;
Assuming that the order of motors, described in the &amp;quot;servos&amp;quot; section is NW, NE, SE, SW.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NB_MOTOR&amp;quot; value=&amp;quot;4&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;SCALE&amp;quot; value=&amp;quot;256&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_COEF&amp;quot;   value=&amp;quot;{  181, -181, -181,  181 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_COEF&amp;quot;  value=&amp;quot;{  181,  181, -181, -181 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_COEF&amp;quot;    value=&amp;quot;{  128, -128,  128,  128 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;THRUST_COEF&amp;quot; value=&amp;quot;{  256,  256,  256,  256 }&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is equivalent to (available since v5.5_devel-602-g0129d3e):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TYPE&amp;quot; value=&amp;quot;QUAD_X_CCW&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is equivalent to (available since v5.9_devel):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TYPE&amp;quot; value=&amp;quot;QUAD_X&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;REVERSE&amp;quot; value=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Hex (Time Cross) : [[Image:Hex_cross_layout.png|200px]]&lt;br /&gt;
Assuming that the order of motors, described in the &amp;quot;servos&amp;quot; section is FRONT_LEFT, FRONT_RIGHT, RIGHT, BACK_RIGHT, BACK_LEFT, LEFT.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NB_MOTOR&amp;quot; value=&amp;quot;6&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;SCALE&amp;quot; value=&amp;quot;256&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_COEF&amp;quot;   value=&amp;quot;{  128, -128,  -256,  -128,  128, 256 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_COEF&amp;quot;  value=&amp;quot;{  222,  222,     0,  -222, -222,   0 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_COEF&amp;quot;    value=&amp;quot;{ -128,  128,  -128,   128, -128, 128 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;THRUST_COEF&amp;quot; value=&amp;quot;{  256,  256,   256,   256,  256, 256 }&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is equivalent to (available since v5.5_devel-602-g0129d3e):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TYPE&amp;quot; value=&amp;quot;HEXA_X&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Octo (time cross): [[Image:octo.jpg|border|200px]]&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NB_MOTOR&amp;quot; value=&amp;quot;8&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;SCALE&amp;quot; value=&amp;quot;256&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_COEF&amp;quot;   value=&amp;quot;{   98,  -98, -237, -237,  -98,   98,  237,  237 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_COEF&amp;quot;  value=&amp;quot;{  237,  237,   98,  -98, -237, -237,  -98,   98 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_COEF&amp;quot;    value=&amp;quot;{ -128,  128, -128,  128, -128,  128, -128,  128 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;THRUST_COEF&amp;quot; value=&amp;quot;{  256,  256,  256,  256,  256,  256,  256,  256 }&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is equivalent to (available since v5.5_devel-602-g0129d3e):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TYPE&amp;quot; value=&amp;quot;OCTO_X&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Octo (plus cross): [[Image:Octo_plus_motor_layout.png|border|200px]]&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NB_MOTOR&amp;quot; value=&amp;quot;8&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;SCALE&amp;quot; value=&amp;quot;256&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_COEF&amp;quot;   value=&amp;quot;{    0, -181, -256, -181,    0,  181,  256,  181 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_COEF&amp;quot;  value=&amp;quot;{  256,  181,    0, -181, -256, -181,    0,  181 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_COEF&amp;quot;    value=&amp;quot;{ -128,  128, -128,  128, -128,  128, -128,  128 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;THRUST_COEF&amp;quot; value=&amp;quot;{  256,  256,  256,  256,  256,  256,  256,  256 }&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is equivalent to (available since v5.5_devel-602-g0129d3e):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TYPE&amp;quot; value=&amp;quot;OCTO_PLUS&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to compute mixing for a special configuration, please see the [[RotorcraftMixing]] page.&lt;br /&gt;
&lt;br /&gt;
=== Supervision ===&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
Prior to '''v5.0''' motor mixing was called supervision. Click expand to see the details.&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Valid before '''v4.9_devel-164-gdb0d004'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;SUPERVISION&amp;quot; prefix=&amp;quot;SUPERVISION_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;STOP_MOTOR&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt; &amp;lt;!-- this defaults to zero, set to a different value if needed, e.g. for pwm controllers --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MIN_MOTOR&amp;quot; value=&amp;quot;3&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MAX_MOTOR&amp;quot; value=&amp;quot;200&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TRIM_A&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TRIM_E&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TRIM_R&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NB_MOTOR&amp;quot; value=&amp;quot;4&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;SCALE&amp;quot; value=&amp;quot;256&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_COEF&amp;quot;   value=&amp;quot;{  0  ,    0,  256, -256 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_COEF&amp;quot;  value=&amp;quot;{  256, -256,    0,    0 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_COEF&amp;quot;    value=&amp;quot;{ -256, -256,  256,  256 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;THRUST_COEF&amp;quot; value=&amp;quot;{  256,  256,  256,  256 }&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ''STOP_MOTOR'' : actuator specific command value to stop the motors&lt;br /&gt;
; ''MIN_MOTOR'' : actuator specific command value for idling motors&lt;br /&gt;
; ''MAX_MOTOR'' : actuator specific command value for maximum power&lt;br /&gt;
; ''TRIM_A'' : trim added to roll command&lt;br /&gt;
; ''TRIM_E'' : trim added to pitch command&lt;br /&gt;
; ''TRIM_R'' : trim added to yaw command&lt;br /&gt;
; x''_COEF'' : roll/pitch/yaw/thrust coefficients, see [[RotorcraftMixing]] for details or the examples in the above Motor Mixing section&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Guidance ===&lt;br /&gt;
There are two sets of parameters for guidance: vertical (altitude) and horizontal (position).&lt;br /&gt;
&lt;br /&gt;
==== vertical guidance ====&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;GUIDANCE_V&amp;quot; prefix=&amp;quot;GUIDANCE_V_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;HOVER_KP&amp;quot;    value=&amp;quot;150&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;HOVER_KD&amp;quot;    value=&amp;quot;80&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;HOVER_KI&amp;quot;    value=&amp;quot;20&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- optional parameters --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NOMINAL_HOVER_THROTTLE&amp;quot; value=&amp;quot;0.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ADAPT_THROTTLE_ENABLED&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;REF_MIN_ZD&amp;quot; value=&amp;quot;-3.0&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;REF_MAX_ZD&amp;quot; value=&amp;quot;3.0&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MAX_RC_CLIMB_SPEED&amp;quot; value=&amp;quot;-3.0&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MAX_RC_DESCENT_SPEED&amp;quot; value=&amp;quot;3.0&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
; ''HOVER_K''x : PID parameters for vertical hover control loop&lt;br /&gt;
; ''NOMINAL_HOVER_THROTTLE'' : expected throttle percentage needed for hovering (default is 0.4 = 40%)&lt;br /&gt;
; ''ADAPT_THROTTLE_ENABLED'' : enable adaptive nominal hover throttle estimation (default is TRUE, set to FALSE to disable)&lt;br /&gt;
; ''REF_MIN_ZD'' : vertical speed reference lower limit (since z-down is positive -&amp;gt; max speed upwards) (default -3.0m/s)&lt;br /&gt;
; ''REF_MAX_ZD'' : vertical speed reference upper limit (since z-down is positive -&amp;gt; max speed downwards) (default 3.0m/s)&lt;br /&gt;
; ''MAX_RC_CLIMB_SPEED'' : climb speed at max RC input in RC_CLIMB mode (default is ''REF_MIN_ZD'')&lt;br /&gt;
; ''MAX_RC_DESCENT_SPEED'' : descent speed at max RC input in RC_CLIMB mode (default is ''REF_MAX_ZD'')&lt;br /&gt;
&lt;br /&gt;
==== horizontal guidance ====&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;GUIDANCE_H&amp;quot; prefix=&amp;quot;GUIDANCE_H_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PGAIN&amp;quot; value=&amp;quot;50&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DGAIN&amp;quot; value=&amp;quot;100&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;IGAIN&amp;quot; value=&amp;quot;20&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- optional parameters --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AGAIN&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;VGAIN&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MAX_BANK&amp;quot; value=&amp;quot;20&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;USE_SPEED_REF&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;REF_MAX_SPEED&amp;quot; value=&amp;quot;5.0&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;REF_MAX_ACCEL&amp;quot; value=&amp;quot;5.66&amp;quot; unit=&amp;quot;m/s2&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;REF_OMEGA&amp;quot; value=&amp;quot;67&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;REF_ZETA&amp;quot; value=&amp;quot;0.85&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;REF_TAU&amp;quot; value=&amp;quot;0.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;APPROX_FORCE_BY_THRUST&amp;quot; value=&amp;quot;FALSE&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
; [PID]''GAIN'' : PID gains for horizontal control&lt;br /&gt;
; ''AGAIN'' : acceleration feedforward gain (default 0)&lt;br /&gt;
; ''VGAIN'' : velocity feedforward gain (default 0)&lt;br /&gt;
; ''MAX_BANK'' : maximum roll/pitch angle that is set from horizontal guidance (default 20deg, max 40deg)&lt;br /&gt;
; ''USE_SPEED_REF'' : since v5.1, give velocity commands via RC in GUIDANCE_H_MODE_HOVER (default: TRUE)&lt;br /&gt;
; ''REF_MAX_SPEED'' : maximum reference horizontal speed in m/s (default 5.0m/s)&lt;br /&gt;
; ''REF_MAX_ACCEL'' : maximum reference horizontal acceleration in m/s² (default tanf(RadOfDeg(30.))*9.81 = 5.66)&lt;br /&gt;
; ''REF_OMEGA'' : second order model natural frequency&lt;br /&gt;
; ''REF_ZETA'' : second order model damping&lt;br /&gt;
; ''REF_TAU'' : first order time constant&lt;br /&gt;
; ''APPROX_FORCE_BY_THRUST'' : try to better approximate force commands by taking thrust into account (default FALSE, set to TRUE to use it)&lt;br /&gt;
&lt;br /&gt;
=== Simulation ===&lt;br /&gt;
See [[NPS]] (New Paparazzi Sim).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Airframe_Configuration]] [[Category:User_Documentation]] [[Category:Rotorcraft]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Rotorcraft_Configuration&amp;diff=23676</id>
		<title>Rotorcraft Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Rotorcraft_Configuration&amp;diff=23676"/>
		<updated>2017-04-26T18:22:39Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: /* Commands */  XML syntax typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Airframe_Configuration&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
This page describes configuration options &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;lt;b&amp;gt;specific to the rotorcraft firmware&amp;lt;/b&amp;gt;&amp;lt;/span&amp;gt; in the [[Airframe_Configuration|airframe file]].&lt;br /&gt;
&lt;br /&gt;
== Firmware and Hardware definitions ==&lt;br /&gt;
&lt;br /&gt;
This is one example of a pretty standard quadcopter firmware definition:&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;nps&amp;quot; board=&amp;quot;pc&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;subsystem name=&amp;quot;fdm&amp;quot;   type=&amp;quot;jsbsim&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/target&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot; board=&amp;quot;lisa_m_1.0&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;radio_control&amp;quot; type=&amp;quot;ppm&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;telemetry&amp;quot;     type=&amp;quot;transparent&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;actuators&amp;quot;     type=&amp;quot;mkk&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;imu&amp;quot;           type=&amp;quot;aspirin_v1.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;gps&amp;quot;           type=&amp;quot;ublox&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ahrs&amp;quot;          type=&amp;quot;int_cmpl_quat&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;stabilization&amp;quot; type=&amp;quot;int_quat&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Select your Board ===&lt;br /&gt;
Make sure you use the &amp;lt;b&amp;gt;rotorcraft [[Airframe_Configuration#Firmware|firmware]]&amp;lt;/b&amp;gt; and choose the correct board, e.g.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;sim&amp;quot; 	board=&amp;quot;pc&amp;quot;/&amp;gt;       &amp;lt;!-- For simulation --&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot; 	board=&amp;quot;lisa_m_2.0&amp;quot;/&amp;gt; &amp;lt;!-- Select your board here --&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The ap board name can be found in /conf/boards.&lt;br /&gt;
&lt;br /&gt;
=== Actuators ===&lt;br /&gt;
You have to specify which ESCs you have by adding the appropriate [[Subsystem/actuators|actuators subsystem.]]&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot; board=&amp;quot;booz_1.0&amp;quot;/&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;actuators&amp;quot; type=&amp;quot;mkk&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Control Loops ===&lt;br /&gt;
See the [[Subsystem/stabilization|stabilization subsystem]] page to choose which attitude control algorithm to use and how to configure them.&lt;br /&gt;
&lt;br /&gt;
The [[Control Loops]] page has some diagrams.&lt;br /&gt;
&lt;br /&gt;
=== INS ===&lt;br /&gt;
The INS (Integrated Navigation System) subsystem contains estimations filter to e.g. fuse GPS and IMU data for better position and speed estimates.&lt;br /&gt;
The INS subsystem is optional in &amp;lt;= v4.2.&lt;br /&gt;
&lt;br /&gt;
Since v4.9x the INS subsystem is mandatory, to use the same as in v4.2 omit the type.&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot; board=&amp;quot;booz_1.0&amp;quot;/&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ins&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
You can also compensate for GPS lag in hff (horizontal filter float) if it is known (in seconds):&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot; board=&amp;quot;booz_1.0&amp;quot;/&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ins&amp;quot; type=&amp;quot;hff&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;define name=&amp;quot;GPS_LAG=0.2&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/subsystem&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Motor Arming ==&lt;br /&gt;
By default the motors are armed with zero-throttle and full yaw. The motors are never started if AHRS is not aligned (disable it with AUTOPILOT_DISABLE_AHRS_KILL).&lt;br /&gt;
&lt;br /&gt;
Other arming sequences can be configured:&lt;br /&gt;
* USE_KILL_SWITCH_FOR_MOTOR_ARMING defined (to 1):&lt;br /&gt;
** switch kill switch off to arm the motors&lt;br /&gt;
** if kill switch is off during startup, you need to kill again first, then unkill to start&lt;br /&gt;
** throttle needs to be down, other sticks centered to start motors&lt;br /&gt;
** need to be in manual mode to start the motors&lt;br /&gt;
&lt;br /&gt;
* USE_THROTTLE_FOR_MOTOR_ARMING defined (to 1):&lt;br /&gt;
** automatically start motors when applying throttle&lt;br /&gt;
** if throttle was not down at startup, you need to put throttle down again first&lt;br /&gt;
** other sticks need to be centered to start motors&lt;br /&gt;
** need to be in manual mode to start the motors&lt;br /&gt;
&lt;br /&gt;
== Autopilot modes ==&lt;br /&gt;
For rotorcrafts we have a lot of different modes that can be mapped to your 3-position switch (Manual, Auto1, Auto2).&lt;br /&gt;
The horizontal and vertical mode can be set differently as the following possible modes indicate (in parenthesis are the abbreviations displayed in the [[GCS#Strips|GCS]] strip).&lt;br /&gt;
&lt;br /&gt;
'''Limiting max thrust via RC'''&amp;lt;br&amp;gt;&lt;br /&gt;
Modes with 'automatic' thrust control (e.g. x_Z_HOLD and NAV) let you limit the maximum thrust via RC by default. So you should push your throttle stick up after entering such a mode so the vertical controller has some &amp;quot;room&amp;quot; to stabilize the altitude. Should something weird happen you can limit the max thrust by taking throttle back.&amp;lt;br&amp;gt; You can turn this behavior off by defining '''NO_RC_THRUST_LIMIT'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_FAILSAFE (SAFE) :&lt;br /&gt;
This is a failsafe mode that gets triggered if:&lt;br /&gt;
* RC signal is lost (and you are not in KILL or NAV mode)&lt;br /&gt;
* GPS and RC is lost in NAV mode&lt;br /&gt;
The standard behaviour is that autopilot will level the rotorcraft out (setpoints to zero pitch and roll angles) and descend at 0.5m/s downwards. But this behavior can also be changed to something else ofcourse.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_KILL (KILL) :&lt;br /&gt;
Motors are simply switched off.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_RATE_DIRECT (RATE) :&lt;br /&gt;
This is basically the &amp;quot;most&amp;quot; manual mode you can get. You control not the attitude (roll and pitch angles) but the rotation rate. You also set the throttle directly with your RC.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_ATTITUDE_DIRECT (ATT) :&lt;br /&gt;
You control the attitude (roll, pitch and yaw angles), but the throttle is directly proportional to your stick position.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_RATE_RC_CLIMB (R_RCC) :&lt;br /&gt;
You control the rotation rate and the vertical speed according to your throttle stick position.&amp;lt;br&amp;gt;If you have your throttle stick in the middle position, the altitude is kept, down goes down at a speed proportional to your stick position (same for up). In this mode it makes sense to mount the spring for your throttle stick so it can recenter itself.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_ATTITUDE_RC_CLIMB (A_RCC) :&lt;br /&gt;
You control the attitude (roll, pitch and yaw angles) and the vertical speed according to your throttle stick position.&amp;lt;br&amp;gt;If you have your throttle stick in the middle position the altitude is kept, if you move the stick down it goes down at a speed proportional to your stick position (same for up). In this mode it makes sense to mount the spring for your throttle stick so it recenter itself.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_ATTITUDE_CLIMB (ATT_C) :&lt;br /&gt;
You control the attitude (roll, pitch and yaw angles) and the vertical speed. The vertical speed is set via fms (e.g. joystick).&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_RATE_Z_HOLD (R_ZH) :&lt;br /&gt;
You control the rotation rate and it holds the altitude you were at when entering this mode.&amp;lt;br&amp;gt;Your throttle stick position still limits the max throttle authority unless disabled with NO_RC_THRUST_LIMIT.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_ATTITUDE_Z_HOLD (A_ZH) :&lt;br /&gt;
You control the attitude (roll, pitch and yaw angles) and it holds the altitude you were at when entering this mode.&amp;lt;br&amp;gt;Your throttle stick position still limits the max throttle authority unless disabled with NO_RC_THRUST_LIMIT.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_HOVER_DIRECT (HOVER) :&lt;br /&gt;
The rotorcraft hovers at the horizontal position you were at when entering this mode (position control). You still set the throttle directly with your RC. Yaw command on the RC allows for heading change. If USE_SPEED_REF=1 then pitch and roll commands in the RC control speed according to max speed set with REF_MAX_SPEED in the GUIDANCE_H section of airframe file.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_HOVER_CLIMB (HOV_C) :&lt;br /&gt;
The rotorcraft hovers at the position you were at when entering this mode (position control). RC commands work the same as in HOVER mode. The vertical speed is set via fms (e.g. joystick).&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_HOVER_Z_HOLD (H_ZH):&lt;br /&gt;
The rotorcraft hovers at the 3D position you were at when entering this mode (position and altitude control).  RC commands work the same as in HOVER mode. &amp;lt;br&amp;gt;Your throttle stick position still limits the max throttle authority unless disabled with NO_RC_THRUST_LIMIT.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_NAV (NAV) :&lt;br /&gt;
Full navigation mode. The rotorcraft follows your flightplan.&amp;lt;br&amp;gt;If you have a valid RC signal, your throttle stick position still limits the max throttle authority unless disabled with NO_RC_THRUST_LIMIT.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_RC_DIRECT (RC_D) :&lt;br /&gt;
Safety pilot direct commands for helicopter.&lt;br /&gt;
&lt;br /&gt;
; AP_MODE_CARE_FREE_DIRECT (CF):&lt;br /&gt;
Same as AP_MODE_ATTITUDE_DIRECT, but the roll and pitch commands are based on the yaw angle when entering this mode.&lt;br /&gt;
&lt;br /&gt;
== XML Parameters ==&lt;br /&gt;
&lt;br /&gt;
=== Mode ===&lt;br /&gt;
In the mode section you can set the autopilot modes associated with your 3-way mode switch on your RC.&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MODE&amp;quot; prefix=&amp;quot;MODE_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MANUAL&amp;quot; value=&amp;quot;AP_MODE_ATTITUDE_DIRECT&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO1&amp;quot; value=&amp;quot;AP_MODE_ATTITUDE_Z_HOLD&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AUTO2&amp;quot; value=&amp;quot;AP_MODE_NAV&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;commands&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; lists the abstract commands you need to control the aircraft. For most multicopter you just need:&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;commands&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;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;YAW&amp;quot; failsafe_value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;axis name=&amp;quot;THRUST&amp;quot; failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/commands&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Each command is also associated with a failsafe value which will be used if no controller is active, for example during initialization of the autopilot board.&lt;br /&gt;
&lt;br /&gt;
=== Motor Mixing ===&lt;br /&gt;
&lt;br /&gt;
This section describes the &amp;quot;mixing&amp;quot; used for your particular multirotor configuration. This section is needed for all ESCs except &amp;quot;asctec_v1&amp;quot; wich do their mixing themselves.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
Used since '''v5.0''', for previous version see [[Rotorcraft_Configuration#Supervision|Supervision]].&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;Differences with the older supervision (used prior to '''v4.9_devel-164-gdb0d004'''):&lt;br /&gt;
* names: SUPERVISION -&amp;gt; MOTOR_MIXING&lt;br /&gt;
* independent of the actuators, needs to be loaded in the subsystems and call in the command_laws section&lt;br /&gt;
* internal values have '''pprz''' format (int16, between [-9600; 9600])&lt;br /&gt;
* min and max are not needed, coming from the servos definition&lt;br /&gt;
* trim are renamed with more explicit names&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This subsystem takes ''roll'', ''pitch'', ''yaw'' and ''thrust'' commands as inputs and &amp;quot;mixes&amp;quot; them to get the final commands for your individual motors according to the layout of them. See [[RotorcraftMixing]] for the details behind this.&lt;br /&gt;
&lt;br /&gt;
Note that after mixing the separate motor commands can &amp;quot;saturate&amp;quot;, meaning you can't simply give negative thrust or more than the maximum. If a saturation is reached (desired motor command outside of possible MIN_MOTOR/MAX_MOTOR range), a saturation offset is applied to all motors in order to give attitude commands a higher priority than thrust. This offset is limited to ''MOTOR_MIXING_MAX_SATURATION_OFFSET'' (default is 10% of maximum command).&lt;br /&gt;
&lt;br /&gt;
See also [https://github.com/paparazzi/paparazzi/issues/385 issue #385].&lt;br /&gt;
&lt;br /&gt;
In '''firmware''' section:&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;motor_mixing&amp;quot;/&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Configuration of the motor mixing:&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TRIM_ROLL&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TRIM_PITCH&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TRIM_YAW&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MAX_SATURATION_OFFSET&amp;quot;	value=&amp;quot;MAX_PPRZ/10&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NB_MOTOR&amp;quot; value=&amp;quot;4&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;SCALE&amp;quot; value=&amp;quot;256&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_COEF&amp;quot;   value=&amp;quot;{  0  ,    0,  256, -256 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_COEF&amp;quot;  value=&amp;quot;{  256, -256,    0,    0 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_COEF&amp;quot;    value=&amp;quot;{ -256, -256,  256,  256 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;THRUST_COEF&amp;quot; value=&amp;quot;{  256,  256,  256,  256 }&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
; ''TRIM_ROLL'' : trim added to roll command&lt;br /&gt;
; ''TRIM_PITCH'' : trim added to pitch command&lt;br /&gt;
; ''TRIM_YAW'' : trim added to yaw command&lt;br /&gt;
; ''MAX_SATURATION_OFFSET'' : set at &amp;quot;MAX_PPRZ/10&amp;quot; by default&lt;br /&gt;
; x''_COEF'' : roll/pitch/yaw/thrust coefficients, see [[RotorcraftMixing]] for details or the examples below&lt;br /&gt;
&lt;br /&gt;
In '''command_laws''' section (placed after section MIXING):&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;command_laws&amp;gt;&lt;br /&gt;
    &amp;lt;call fun=&amp;quot;motor_mixing_run(autopilot_motors_on, FALSE, values)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;set servo=&amp;quot;FRONT&amp;quot; value=&amp;quot;motor_mixing.commands[0]/&amp;gt;&lt;br /&gt;
    &amp;lt;set servo=&amp;quot;BACK&amp;quot;  value=&amp;quot;motor_mixing.commands[1]/&amp;gt;&lt;br /&gt;
    &amp;lt;set servo=&amp;quot;RIGHT&amp;quot; value=&amp;quot;motor_mixing.commands[2]/&amp;gt;&lt;br /&gt;
    &amp;lt;set servo=&amp;quot;LEFT&amp;quot;  value=&amp;quot;motor_mixing.commands[3]/&amp;gt;&lt;br /&gt;
  &amp;lt;/command_laws&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Mixing Examples ====&lt;br /&gt;
&lt;br /&gt;
Hint: If your rotors are spinning '''opposite''' to the '''direction''' shown in the picture, '''reverse signs''' in the YAW_COEF line.&lt;br /&gt;
&lt;br /&gt;
; Plus Cross : [[Image:cross_plus_simple.png|200px]]&lt;br /&gt;
Assuming that the order of motors, described in the &amp;quot;servos&amp;quot; section is FRONT, RIGHT, BACK, LEFT.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NB_MOTOR&amp;quot; value=&amp;quot;4&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;SCALE&amp;quot; value=&amp;quot;256&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_COEF&amp;quot;   value=&amp;quot;{    0, -256,    0,  256 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_COEF&amp;quot;  value=&amp;quot;{  256,    0, -256,    0 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_COEF&amp;quot;    value=&amp;quot;{ -128,  128, -128,  128 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;THRUST_COEF&amp;quot; value=&amp;quot;{  256,  256,  256,  256 }&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is equivalent to (available since v5.5_devel-602-g0129d3e):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TYPE&amp;quot; value=&amp;quot;QUAD_PLUS&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; Time Cross : [[Image:cross_time_simple.png|200px]]&lt;br /&gt;
Assuming that the order of motors, described in the &amp;quot;servos&amp;quot; section is NW, NE, SE, SW.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NB_MOTOR&amp;quot; value=&amp;quot;4&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;SCALE&amp;quot; value=&amp;quot;256&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_COEF&amp;quot;   value=&amp;quot;{  181, -181, -181,  181 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_COEF&amp;quot;  value=&amp;quot;{  181,  181, -181, -181 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_COEF&amp;quot;    value=&amp;quot;{  128, -128,  128,  128 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;THRUST_COEF&amp;quot; value=&amp;quot;{  256,  256,  256,  256 }&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is equivalent to (available since v5.5_devel-602-g0129d3e):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TYPE&amp;quot; value=&amp;quot;QUAD_X_CCW&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is equivalent to (available since v5.9_devel):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TYPE&amp;quot; value=&amp;quot;QUAD_X&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;REVERSE&amp;quot; value=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Hex (Time Cross) : [[Image:Hex_cross_layout.png|200px]]&lt;br /&gt;
Assuming that the order of motors, described in the &amp;quot;servos&amp;quot; section is FRONT_LEFT, FRONT_RIGHT, RIGHT, BACK_RIGHT, BACK_LEFT, LEFT.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NB_MOTOR&amp;quot; value=&amp;quot;6&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;SCALE&amp;quot; value=&amp;quot;256&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_COEF&amp;quot;   value=&amp;quot;{  128, -128,  -256,  -128,  128, 256 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_COEF&amp;quot;  value=&amp;quot;{  222,  222,     0,  -222, -222,   0 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_COEF&amp;quot;    value=&amp;quot;{ -128,  128,  -128,   128, -128, 128 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;THRUST_COEF&amp;quot; value=&amp;quot;{  256,  256,   256,   256,  256, 256 }&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is equivalent to (available since v5.5_devel-602-g0129d3e):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TYPE&amp;quot; value=&amp;quot;HEXA_X&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Octo (time cross): [[Image:octo.jpg|border|200px]]&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NB_MOTOR&amp;quot; value=&amp;quot;8&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;SCALE&amp;quot; value=&amp;quot;256&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_COEF&amp;quot;   value=&amp;quot;{   98,  -98, -237, -237,  -98,   98,  237,  237 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_COEF&amp;quot;  value=&amp;quot;{  237,  237,   98,  -98, -237, -237,  -98,   98 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_COEF&amp;quot;    value=&amp;quot;{ -128,  128, -128,  128, -128,  128, -128,  128 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;THRUST_COEF&amp;quot; value=&amp;quot;{  256,  256,  256,  256,  256,  256,  256,  256 }&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is equivalent to (available since v5.5_devel-602-g0129d3e):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TYPE&amp;quot; value=&amp;quot;OCTO_X&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
; Octo (plus cross): [[Image:Octo_plus_motor_layout.png|border|200px]]&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NB_MOTOR&amp;quot; value=&amp;quot;8&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;SCALE&amp;quot; value=&amp;quot;256&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_COEF&amp;quot;   value=&amp;quot;{    0, -181, -256, -181,    0,  181,  256,  181 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_COEF&amp;quot;  value=&amp;quot;{  256,  181,    0, -181, -256, -181,    0,  181 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_COEF&amp;quot;    value=&amp;quot;{ -128,  128, -128,  128, -128,  128, -128,  128 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;THRUST_COEF&amp;quot; value=&amp;quot;{  256,  256,  256,  256,  256,  256,  256,  256 }&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This is equivalent to (available since v5.5_devel-602-g0129d3e):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MIXING&amp;quot; prefix=&amp;quot;MOTOR_MIXING_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TYPE&amp;quot; value=&amp;quot;OCTO_PLUS&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to compute mixing for a special configuration, please see the [[RotorcraftMixing]] page.&lt;br /&gt;
&lt;br /&gt;
=== Supervision ===&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
Prior to '''v5.0''' motor mixing was called supervision. Click expand to see the details.&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;&lt;br /&gt;
Valid before '''v4.9_devel-164-gdb0d004'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;SUPERVISION&amp;quot; prefix=&amp;quot;SUPERVISION_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;STOP_MOTOR&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt; &amp;lt;!-- this defaults to zero, set to a different value if needed, e.g. for pwm controllers --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MIN_MOTOR&amp;quot; value=&amp;quot;3&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MAX_MOTOR&amp;quot; value=&amp;quot;200&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TRIM_A&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TRIM_E&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TRIM_R&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NB_MOTOR&amp;quot; value=&amp;quot;4&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;SCALE&amp;quot; value=&amp;quot;256&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ROLL_COEF&amp;quot;   value=&amp;quot;{  0  ,    0,  256, -256 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PITCH_COEF&amp;quot;  value=&amp;quot;{  256, -256,    0,    0 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;YAW_COEF&amp;quot;    value=&amp;quot;{ -256, -256,  256,  256 }&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;THRUST_COEF&amp;quot; value=&amp;quot;{  256,  256,  256,  256 }&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; ''STOP_MOTOR'' : actuator specific command value to stop the motors&lt;br /&gt;
; ''MIN_MOTOR'' : actuator specific command value for idling motors&lt;br /&gt;
; ''MAX_MOTOR'' : actuator specific command value for maximum power&lt;br /&gt;
; ''TRIM_A'' : trim added to roll command&lt;br /&gt;
; ''TRIM_E'' : trim added to pitch command&lt;br /&gt;
; ''TRIM_R'' : trim added to yaw command&lt;br /&gt;
; x''_COEF'' : roll/pitch/yaw/thrust coefficients, see [[RotorcraftMixing]] for details or the examples in the above Motor Mixing section&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Guidance ===&lt;br /&gt;
There are two sets of parameters for guidance: vertical (altitude) and horizontal (position).&lt;br /&gt;
&lt;br /&gt;
==== vertical guidance ====&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;GUIDANCE_V&amp;quot; prefix=&amp;quot;GUIDANCE_V_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;HOVER_KP&amp;quot;    value=&amp;quot;150&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;HOVER_KD&amp;quot;    value=&amp;quot;80&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;HOVER_KI&amp;quot;    value=&amp;quot;20&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- optional parameters --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NOMINAL_HOVER_THROTTLE&amp;quot; value=&amp;quot;0.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ADAPT_THROTTLE_ENABLED&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;REF_MIN_ZD&amp;quot; value=&amp;quot;-3.0&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;REF_MAX_ZD&amp;quot; value=&amp;quot;3.0&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MAX_RC_CLIMB_SPEED&amp;quot; value=&amp;quot;-3.0&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MAX_RC_DESCENT_SPEED&amp;quot; value=&amp;quot;3.0&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
; ''HOVER_K''x : PID parameters for vertical hover control loop&lt;br /&gt;
; ''NOMINAL_HOVER_THROTTLE'' : expected throttle percentage needed for hovering (default is 0.4 = 40%)&lt;br /&gt;
; ''ADAPT_THROTTLE_ENABLED'' : enable adaptive nominal hover throttle estimation (default is TRUE, set to FALSE to disable)&lt;br /&gt;
; ''REF_MIN_ZD'' : vertical speed reference lower limit (since z-down is positive -&amp;gt; max speed upwards) (default -3.0m/s)&lt;br /&gt;
; ''REF_MAX_ZD'' : vertical speed reference upper limit (since z-down is positive -&amp;gt; max speed downwards) (default 3.0m/s)&lt;br /&gt;
; ''MAX_RC_CLIMB_SPEED'' : climb speed at max RC input in RC_CLIMB mode (default is ''REF_MIN_ZD'')&lt;br /&gt;
; ''MAX_RC_DESCENT_SPEED'' : descent speed at max RC input in RC_CLIMB mode (default is ''REF_MAX_ZD'')&lt;br /&gt;
&lt;br /&gt;
==== horizontal guidance ====&lt;br /&gt;
{{Box Code|conf/airframes/myrotorcraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;GUIDANCE_H&amp;quot; prefix=&amp;quot;GUIDANCE_H_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;PGAIN&amp;quot; value=&amp;quot;50&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DGAIN&amp;quot; value=&amp;quot;100&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;IGAIN&amp;quot; value=&amp;quot;20&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- optional parameters --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AGAIN&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;VGAIN&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MAX_BANK&amp;quot; value=&amp;quot;20&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;USE_SPEED_REF&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;REF_MAX_SPEED&amp;quot; value=&amp;quot;5.0&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;REF_MAX_ACCEL&amp;quot; value=&amp;quot;5.66&amp;quot; unit=&amp;quot;m/s2&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;REF_OMEGA&amp;quot; value=&amp;quot;67&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;REF_ZETA&amp;quot; value=&amp;quot;0.85&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;REF_TAU&amp;quot; value=&amp;quot;0.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;APPROX_FORCE_BY_THRUST&amp;quot; value=&amp;quot;FALSE&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
; [PID]''GAIN'' : PID gains for horizontal control&lt;br /&gt;
; ''AGAIN'' : acceleration feedforward gain (default 0)&lt;br /&gt;
; ''VGAIN'' : velocity feedforward gain (default 0)&lt;br /&gt;
; ''MAX_BANK'' : maximum roll/pitch angle that is set from horizontal guidance (default 20deg, max 40deg)&lt;br /&gt;
; ''USE_SPEED_REF'' : since v5.1, give velocity commands via RC in GUIDANCE_H_MODE_HOVER (default: TRUE)&lt;br /&gt;
; ''REF_MAX_SPEED'' : maximum reference horizontal speed in m/s (default 5.0m/s)&lt;br /&gt;
; ''REF_MAX_ACCEL'' : maximum reference horizontal acceleration in m/s² (default tanf(RadOfDeg(30.))*9.81 = 5.66)&lt;br /&gt;
; ''REF_OMEGA'' : second order model natural frequency&lt;br /&gt;
; ''REF_ZETA'' : second order model damping&lt;br /&gt;
; ''REF_TAU'' : first order time constant&lt;br /&gt;
; ''APPROX_FORCE_BY_THRUST'' : try to better approximate force commands by taking thrust into account (default FALSE, set to TRUE to use it)&lt;br /&gt;
&lt;br /&gt;
=== Simulation ===&lt;br /&gt;
See [[NPS]] (New Paparazzi Sim).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Airframe_Configuration]] [[Category:User_Documentation]] [[Category:Rotorcraft]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Modems/xbee&amp;diff=23459</id>
		<title>Modems/xbee</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Modems/xbee&amp;diff=23459"/>
		<updated>2017-02-08T17:48:51Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: ttttttypo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Paparazzi supports the following modem protocols:&lt;br /&gt;
* Standard transparent serial (pprz protocol, AT mode) - compatible with all modems and can be used to connect the autopilot directly to a PC for testing without a modem.&lt;br /&gt;
* Digi (formerly Maxstream) API protocol (xbee) - compatible with all Digi modems including the 9XTend and Zigbee. This protocol enables hardware addressing through API mode, allowing multiple aircraft to be managed from a single ground modem.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Installation of X-CTU ===&lt;br /&gt;
The simplest way to configure the XBee modems is to use the [http://www.digi.com/support/productdetail?pid=3352 X-CTU] software from Digi. It runs natively under MacOS X, Windows and Linux.&lt;br /&gt;
To use versions before X-CTU 6 under Linux, use Wine.&lt;br /&gt;
&lt;br /&gt;
==== Installation using Wine ====&lt;br /&gt;
'''X-CTU versions 6 and up are available natively for Linux''', so using Wine is only needed for older versions.&lt;br /&gt;
&lt;br /&gt;
Under Wine make sure you have the USB serial link connecting to XBee mapped to a com port (please consult [[Installation/Linux/udev | paparazzi linux device naming]]):&lt;br /&gt;
&lt;br /&gt;
* First of all you should install wine.&lt;br /&gt;
* Then install winetricks (X-CTU requires MS Visual C++ Redistributable package so winetricks will make things much easier to get installed).&lt;br /&gt;
* Then ('''!important''') run wine configuration before doing something else, so wine can create ~/.wine&lt;br /&gt;
* Make symlink to your modem device.&lt;br /&gt;
&lt;br /&gt;
 $ sudo ln -s /dev/paparazzi/xbee ~/.wine/dosdevices/com4&lt;br /&gt;
&lt;br /&gt;
* Set permissions for COM port (if you are not root):&lt;br /&gt;
 &lt;br /&gt;
 $ sudo ls -l /dev/paparazzi/xbee&lt;br /&gt;
 lrwxrwxrwx 1 root root 10 june 14 19:00 /dev/paparazzi/xbee -&amp;gt; /dev/ttyUSB0&lt;br /&gt;
 $ sudo chown &amp;lt;your_user_name_here&amp;gt; /dev/ttyUSB0&lt;br /&gt;
&lt;br /&gt;
* Run X-CTU setup and install it.&lt;br /&gt;
* Then run installed application. When window opens switch to &amp;quot;User Com Ports&amp;quot; tab and add com port &amp;quot;COM4. Note: This procedure have to be made every time you start X-CTU on Linux.&lt;br /&gt;
* Click &amp;quot;Test/Query&amp;quot; button. If you get some modem information (like serial, etc.) after a little time, then you have modem link established.&lt;br /&gt;
&lt;br /&gt;
If X-CTU complains on com port connectivity, try adding these strings to ~/.wine/system.reg&lt;br /&gt;
 [hardware\\DEVICEMAP\\SERIALCOMM]&lt;br /&gt;
 &amp;quot;COM1&amp;quot;=&amp;quot;COM1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If your X-CTU does not update its firmware correctly from the web, follow the steps described in the chapter &amp;quot;Manually Update the X-CTU firmware files&amp;quot; of [http://wiki.openpilot.org/display/Doc/Configure+Xbee+via+Linux this page].&lt;br /&gt;
&lt;br /&gt;
=== Configuring XBee AT mode using X-CTU ===&lt;br /&gt;
This is the recommended way to start. With this firmware the modems basically act as a serial link replacement and don't do any mesh networking. The pprz protocol is based on this mode.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Basic approach:&lt;br /&gt;
# Connect your XBee to your PC. There are several vendors of [[Modems#GCS_Adaptation|USB boards]].&lt;br /&gt;
# Start the X-CTU program and go to the modem configuration.&lt;br /&gt;
# Click on READ&lt;br /&gt;
# Select the appropriate function set with AT command set.&lt;br /&gt;
# set PAN ID, etc... depending on which XBee you use&lt;br /&gt;
# Set the baudrate you want to use. 57600 is the maximum baudrate setting for bidirectional transfers to work correctly. At a higher baudrate setting, transmission can only be done in one direction.&lt;br /&gt;
# Then write the firmware to the module.&lt;br /&gt;
If X-CTU asks you to reset the XBee, you have to connect the RST pin (5) to the GND pin (10) of the XBee. You can do this manually using tweezers or a short wire.&lt;br /&gt;
&lt;br /&gt;
=== Configuring XBee using a terminal emulator ===&lt;br /&gt;
&lt;br /&gt;
Alternatively you can configure your XBee using a text-based modem control and terminal emulation program, such as [http://en.wikipedia.org/wiki/Minicom Minicom] for Linux or [http://freeware.the-meiers.org CoolTerm] for Linux, Mac OSX, or Windows.&lt;br /&gt;
&lt;br /&gt;
The xBee modules can be set to the following baud rates:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;6&amp;quot;&lt;br /&gt;
!''Baud Code''!!''Baud Rate''!!''Notes''&lt;br /&gt;
|-&lt;br /&gt;
|0||1200||&lt;br /&gt;
|-&lt;br /&gt;
|1||2400||&lt;br /&gt;
|-&lt;br /&gt;
|2||4800||&lt;br /&gt;
|-&lt;br /&gt;
|3||9600||&lt;br /&gt;
|-&lt;br /&gt;
|4||19200|| Use with fixedwing aircraft and their GCSs&lt;br /&gt;
|-&lt;br /&gt;
|5||38400||&lt;br /&gt;
|-&lt;br /&gt;
|6||57600|| Use with rotorcraft or transitioning aircraft and their GCSs&lt;br /&gt;
|-&lt;br /&gt;
|7||115200||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Quick, I'm in a rush''':&lt;br /&gt;
 $ sudo screen /dev/ttyUSB0 9600&lt;br /&gt;
 +++&lt;br /&gt;
 ATBD6&amp;lt;enter&amp;gt;&lt;br /&gt;
 ATAP1&amp;lt;enter&amp;gt;&lt;br /&gt;
 ATWR&amp;lt;enter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Minicom Instructions''':&lt;br /&gt;
* Connect XBee to your computer&lt;br /&gt;
* Setup minicom (by default XBee modems come set up for 9600 baud) 8-N-1 &lt;br /&gt;
* Type Ctrl-A A in minicom this will set it up to add linefeeds to the stream&lt;br /&gt;
* Type three '+' in quick succession resulting in &amp;quot;+++&amp;quot; string (you have 10s to type your next command otherwise the modem will revert back to transparent mode). Do NOT press enter.&lt;br /&gt;
** you get a confirmation: 'OK'&lt;br /&gt;
* Type &amp;quot;AT&amp;lt;enter&amp;gt;&amp;quot;&lt;br /&gt;
** you get a confirmation: 'OK'&lt;br /&gt;
* Type &amp;quot;ATBD&amp;lt;enter&amp;gt;&amp;quot;&lt;br /&gt;
** you get the current baudrate code: '3'&lt;br /&gt;
* To set another baudrate select one from the above table and type &amp;quot;ATBD &amp;lt;baud code&amp;gt;&amp;lt;enter&amp;gt;&amp;quot;:&lt;br /&gt;
* Type &amp;quot;ATAP 0 or 1 for API mode or not&amp;lt;enter&amp;gt;&amp;quot;&lt;br /&gt;
* To store the new baudrate in the rom type &amp;quot;ATWR&amp;lt;enter&amp;gt;&amp;quot;&lt;br /&gt;
* Now you can close minicom&lt;br /&gt;
* Reconnect modem&lt;br /&gt;
* Restart minicom with the new baudrate&lt;br /&gt;
* Test that the modem is setup correctly by typing &amp;quot;+++&amp;quot; and getting &amp;quot;OK&amp;quot; confirmation&lt;br /&gt;
&lt;br /&gt;
'''CoolTerm Instructions''':&lt;br /&gt;
* Connect xBee to your computer&lt;br /&gt;
* Open CoolTerm and click 'Options.' From the 'Serial Port' tab select:&lt;br /&gt;
**Port: USB Serial (or as appropriate for your xBee carrier board)&lt;br /&gt;
**Baudrate: 9600&lt;br /&gt;
**Data Bits: 8&lt;br /&gt;
**Parity: None&lt;br /&gt;
**Stop Bits 1&lt;br /&gt;
*From the 'Terminal' tab enable Local Echo&lt;br /&gt;
*Click OK&lt;br /&gt;
*Click Connect&lt;br /&gt;
* Type three '+' in quick succession resulting in &amp;quot;+++&amp;quot; string (you have 10s to type your next command otherwise the modem will revert back to transparent mode). Do NOT press enter.&lt;br /&gt;
** you get a confirmation: 'OK'&lt;br /&gt;
* Type &amp;quot;AT&amp;lt;enter&amp;gt;&amp;quot;&lt;br /&gt;
** you get a confirmation: 'OK'&lt;br /&gt;
* Type &amp;quot;ATBD&amp;lt;enter&amp;gt;&amp;quot;&lt;br /&gt;
** you get the current baudrate code: '3'&lt;br /&gt;
* To set another baudrate select one from the above table and type &amp;quot;ATBD &amp;lt;baud code&amp;gt;&amp;lt;enter&amp;gt;&amp;quot;:&lt;br /&gt;
* To store the new baudrate in the rom type &amp;quot;ATWR&amp;lt;enter&amp;gt;&amp;quot;&lt;br /&gt;
* Now you can close CoolTerm.&lt;br /&gt;
* Reconnect modem&lt;br /&gt;
* Restart CoolTerm, change options to new baudrate, and connect&lt;br /&gt;
* Test that the modem is setup correctly by typing &amp;quot;+++&amp;quot; and getting &amp;quot;OK&amp;quot; confirmation&lt;br /&gt;
&lt;br /&gt;
== XBee Pro ZB (AT command set) ==&lt;br /&gt;
This 2.4GHz modem uses ZigBee PRO Feature Set and is compatible with devices from other vendors using the ZigBee PRO Feature Set.&lt;br /&gt;
&lt;br /&gt;
=== Flashing the airborne module ===&lt;br /&gt;
# Connect your XBee, start X-CTU, click READ&lt;br /&gt;
# Select the function set '''ZIGBEE END DEVICE AT''' (or ZIGBEE ROUTER AT).&lt;br /&gt;
# Set the PAN ID to any number, must be the same as the pan id of the coordinator (Ground Station).&lt;br /&gt;
# Set the Node Identifier (NI) to your aircraft name or any other appropriate name.&lt;br /&gt;
# Set the baudrate you want to use. 57600 is the maximum baudrate setting for bidirectional transfers to work correctly.&lt;br /&gt;
# Then write the firmware to the module.&lt;br /&gt;
&lt;br /&gt;
=== Flashing the ground station module ===&lt;br /&gt;
# Connect your XBee, start X-CTU, click READ&lt;br /&gt;
# Select the function set '''ZIGBEE COORDINATOR AT'''.&lt;br /&gt;
# Set the PAN ID to any number, must be the same as the pan id of the end device (aircraft).&lt;br /&gt;
# Set the Node Identifier (NI) to PPRZ_GROUND or any other appropriate name.&lt;br /&gt;
# Set the baudrate you want to use. 57600 is the maximum baudrate setting for bidirectional transfers to work correctly.&lt;br /&gt;
# Then write the firmware to the module.&lt;br /&gt;
&lt;br /&gt;
=== Pairing your Modems ===&lt;br /&gt;
&lt;br /&gt;
For maximum performance you can pair the ground modem to the airborne modem. Set the &amp;quot;DH - Destination Address High&amp;quot; and &amp;quot;DL - Destination Address Low&amp;quot; to the unique serial number &amp;quot;SH - Serial Number High&amp;quot; and &amp;quot;SL - Serial Number Low&amp;quot; of the other modem. Do so both on the ground modem and on the airborne modem. Failing to properly pair your modems will likely result in poor throughput and data loss between your airframe and your ground control station. If this is the case you may see errors on the Paparazzi Center console like &amp;lt;tt&amp;gt;Failure(&amp;quot;Pprz.values_of_payload, wrong argument: 00 08 &amp;quot;)&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Failure(&amp;quot;Pprz.values_of_payload, too many bytes in message PONG: 00 03 02 2a 00 00 00 00 00 00 00 00 00 00 00 00 &amp;quot;)&amp;lt;/tt&amp;gt;. Pairing does help and the error messages will disappear. &lt;br /&gt;
&lt;br /&gt;
=== Reviving a non-responding Xbee Pro ===&lt;br /&gt;
&lt;br /&gt;
To bring an apparently dead XBee Pro Series 2 back to life, do the following:&lt;br /&gt;
&lt;br /&gt;
#Connect the USB device that holds the XBee to your laptop/desktop (without the XBee connected).&lt;br /&gt;
#Open X-CTU.&lt;br /&gt;
#In the tab used to program the device, select the proper modem (normally you would do a READ to get the values).&lt;br /&gt;
#Choose the option you want to program (i.e., &amp;quot;END DEVICE&amp;quot; or &amp;quot;COORDINATOR&amp;quot;) as if you were programming it.&lt;br /&gt;
#With the XBee not in the device, click &amp;quot;WRITE&amp;quot;. It will hang, timeout, and bring up a dialog box.&lt;br /&gt;
#Before you click OK to the dialog box, plug in the XBee module (carefully).&lt;br /&gt;
#Click OK to clear the message and it should start programming automatically.&lt;br /&gt;
&lt;br /&gt;
=== Other tutorials ===&lt;br /&gt;
&lt;br /&gt;
[http://pixhawk.ethz.ch/tutorials/how_to_configure_xbee PixHawk: HowTo configure XBee]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.openpilot.org/display/Doc/Configure+Xbee+via+Linux openpilot: XBee RF modems]&lt;br /&gt;
&lt;br /&gt;
== XBee Pro ZNet 2.5 (AT command set) ==&lt;br /&gt;
These are legacy modems and not recommended/sold by Digi anymore.&lt;br /&gt;
It is recommended to upgrade these to XBee Pro ZB with the [ftp://ftp1.digi.com/support/images/ZNet%202.5%20to%20ZB%20Conversion%20Kit.zip ZNet 2.5 to ZB Conversion Kit] from Digi.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
If you want to use ZNet 2.5 feature set nevertheless, here is how to configure it:&lt;br /&gt;
&lt;br /&gt;
=== Flashing the airborne module ===&lt;br /&gt;
# Connect your XBee, start X-CTU, click READ&lt;br /&gt;
# Select the function set '''ZNET 2.5 ROUTER/END DEVICE AT'''.&lt;br /&gt;
# Set the PAN ID to any number, must be the same as the pan id of the coordinator (Ground Station).&lt;br /&gt;
# Set the Node Identifier (NI) to your aircraft name or any other appropriate name.&lt;br /&gt;
# Set the baudrate you want to use. 57600 is the maximum baudrate setting for bidirectional transfers to work correctly.&lt;br /&gt;
# Then write the firmware to the module.&lt;br /&gt;
&lt;br /&gt;
=== Flashing the ground station module ===&lt;br /&gt;
# Connect your XBee, start X-CTU, click READ&lt;br /&gt;
# Select the function set '''ZNET 2.5 COORDINATOR DEVICE AT'''.&lt;br /&gt;
# Set the Destination Address Low (DL) to FFFF.&lt;br /&gt;
# Set the PAN ID to any number, must be the same as the pan id of the end device (aircraft).&lt;br /&gt;
# Set the Node Identifier (NI) to PPRZ_GROUND or any other appropriate name.&lt;br /&gt;
# Set the baudrate you want to use. 57600 is the maximum baudrate setting for bidirectional transfers to work correctly.&lt;br /&gt;
# Then write the firmware to the module.&lt;br /&gt;
&lt;br /&gt;
=== Setup ===&lt;br /&gt;
&lt;br /&gt;
For the ZigBee ZNet 2.5 and ZB modules to work one of the modules has to be flashed with the coordinator firmware. All the others in the same PAN can either run as routers or end-devices.&lt;br /&gt;
* Flash one module (ground station) with the coordinator AT firmware&lt;br /&gt;
* Flash aircraft module with router or end-device AT firmware&lt;br /&gt;
To allow modules to join any PAN set the PAN ID to zero (default setting). Then the coordinator will generate a random PAN ID and routers and end-devices will join the first PAN they find.&lt;br /&gt;
&lt;br /&gt;
If you operate in an environment with multiple zigbee PANs it is recommended to set the PAN ID explicitly:&lt;br /&gt;
* Set PAN ID to some unique (but same) ID on both modules&lt;br /&gt;
* Set a Node Identifier for each module (e.g. ground, aircraft)&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== XBee Pro DigiMesh / 802.15.4 (&amp;quot;Series 1&amp;quot;) ==&lt;br /&gt;
&lt;br /&gt;
=== Flashing the airborne module ===&lt;br /&gt;
# Connect your XBee, start X-CTU, click READ&lt;br /&gt;
# Leave the function set on '''XBEE PRO 802.15.4'''.&lt;br /&gt;
# Set the PAN ID to any number, must be the same as the pan id of the coordinator (Ground Station).&lt;br /&gt;
# Set the Node Identifier (NI) to your aircraft name or any other appropriate name.&lt;br /&gt;
# Set the baudrate you want to use. 57600 is the maximum baudrate setting for bidirectional transfers to work correctly.&lt;br /&gt;
# Then write the firmware to the module.&lt;br /&gt;
&lt;br /&gt;
=== Flashing the ground station module ===&lt;br /&gt;
# Connect your XBee, start X-CTU, click READ&lt;br /&gt;
# Leave the function set on '''XBEE PRO 802.15.4'''.&lt;br /&gt;
# '''Set Coordinator Enable to &amp;quot;1 - COORDINATOR&amp;quot;.'''&lt;br /&gt;
# Set the PAN ID to any number, must be the same as the pan id of the end device (aircraft).&lt;br /&gt;
# Set the Node Identifier (NI) to PPRZ_GROUND or any other appropriate name.&lt;br /&gt;
# Set the baudrate you want to use. 57600 is the maximum baudrate setting for bidirectional transfers to work correctly.&lt;br /&gt;
# Then write the firmware to the module.&lt;br /&gt;
&lt;br /&gt;
(Tested on XBP24 Firmwareversion 10E6)&lt;br /&gt;
&lt;br /&gt;
== XBee Pro 868 MHZ ==&lt;br /&gt;
&lt;br /&gt;
=== Getting Them Working ===&lt;br /&gt;
Even with the xbee868.xml telemetry file, XBee868s will not last over 6 minutes. There is a special 868 build flag (in slayer1.xml), and matching option for the datalink but I could not get this to work. Eventually, I got them to work for about 20 minutes, which happily is the flight endurance of a heavily overloaded GWS Formosa.&lt;br /&gt;
&lt;br /&gt;
I did this using a command window, but you could use X-CTU if you are a wuss or have Windows handy.&lt;br /&gt;
&lt;br /&gt;
#Attach Xbee and start serial comm program (I use &amp;lt;code&amp;gt;screen /dev/ttyUSB0 &amp;amp;lt;baud rate, just a number, no angled brackets&amp;amp;gt;&amp;lt;/code&amp;gt;, you can also use pico- or microcom)&lt;br /&gt;
#Type AT and enter. You should get an OK back.&lt;br /&gt;
#ATMT and enter. You should get a number&amp;amp;mdash;this represents the number of extra times each packet will be broadcast. We now need to change this to zero.&lt;br /&gt;
#ATMT0 and enter =&amp;gt; OK&lt;br /&gt;
#ATRR and enter. This number is the number of retries that will be sent if an ACK is not received. Disabling this will also have the side effect of disabling ACKs, giving us more packets to play with.&lt;br /&gt;
#ATRR0 and enter =&amp;gt; OK&lt;br /&gt;
#Type ATWR to store the new stuff in the firmware. You should get an OK.&lt;br /&gt;
#Set the datalink to transparent mode both in your airframe file and on the datalink.&lt;br /&gt;
&lt;br /&gt;
You may also want to drop the power level to 1mW for testing, or it won't actually work - they are just too damn powerful to talk to each other at a range of a couple of feet. I also used 1mW for flying - never lost the link, even after a mile. Didn't get round to range testing them though. &lt;br /&gt;
&lt;br /&gt;
You probably want to do this to both XBees (at least I did). I personally had the baud rate at 57600 for legacy reasons, but it should work just as well at any other baud rate. '''Thanks to CheBuzz for this info''', and for helping me work all this out at 11pm the night before EMAV09.&lt;br /&gt;
&lt;br /&gt;
== XBee 868LF ==&lt;br /&gt;
&lt;br /&gt;
These relatively new modems use the whole spectrum allowed in your country to avoid Duty Cycle restrictions.&lt;br /&gt;
&lt;br /&gt;
== XBee Pro XSC (900MHZ) ==&lt;br /&gt;
&lt;br /&gt;
== Configuring XBee API mode (xbee protocol) ==&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]] [[Category:User_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=New_Gaia&amp;diff=23432</id>
		<title>New Gaia</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=New_Gaia&amp;diff=23432"/>
		<updated>2017-01-05T21:12:38Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;(Webpage currently incomplete)&lt;br /&gt;
&lt;br /&gt;
New Gaia is an update of the current gaia agent.&lt;br /&gt;
&lt;br /&gt;
This system has been developed by an ENAC team of 4 students from the IENAC10S promo. It enables one to generate a complex environment with several meteorological phenomena.&lt;br /&gt;
&lt;br /&gt;
= Presentation =&lt;br /&gt;
&lt;br /&gt;
== Functionalities ==&lt;br /&gt;
&lt;br /&gt;
Fully connected to the Paparazzi simulator through the IVY middleware, New Gaia allows the user to add elements of a realistic meteorological environment to the current simulation thanks to an adapted GUI. The initial version of the program proposes three meteorological phenomena : thermal columns, turbulences and a vertical profile. Also are all the parameters of the simulation taken into account in order to offer the most complete customization capability : several UAVs, geographic coordinates, the background map, etc.&lt;br /&gt;
&lt;br /&gt;
The models of the phenomena have been chosen based on two characteristics that are the way they can represent reality and a low resources need. For more details, please check the documentation.&lt;br /&gt;
&lt;br /&gt;
Finally some misc have been implemented to reuse the functionalities of the current gaia agent like the simulation speed control.&lt;br /&gt;
&lt;br /&gt;
== The project ==&lt;br /&gt;
&lt;br /&gt;
It has been a two-month long project proposed by the ENAC micro-drones lab to the 2nd year of the IENAC S formation, and designed within the ENAC infrastructures in Toulouse. To know more about us, please check [[New_Gaia#About_us]].&lt;br /&gt;
&lt;br /&gt;
= How to get New Gaia ? =&lt;br /&gt;
&lt;br /&gt;
The installation described here is for debian-like systems (typically Ubuntu). Thank you for sharing your experience on others systems!&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
In order to compile the files with the included makefile, you need JDK 1.6.0_24. And in order to run the file, you need the JRE 1.6.0_24 (included in the JDK). They can be found at [http://www.oracle.com/technetwork/java/javase/downloads/jdk6-downloads-1637591.html].&lt;br /&gt;
&lt;br /&gt;
Please note that New_Gaia uses JDOM version 2.0.1 to generate XML files and the ivy package designed for java. They are included as jar files in the application, so you don't have to download them.&lt;br /&gt;
&lt;br /&gt;
== The source code ==&lt;br /&gt;
Get the [https://github.com/paparazzi/new_gaia source code] from our Github repository.&lt;br /&gt;
&lt;br /&gt;
== Compilation ==&lt;br /&gt;
To compile the files, we wrote a makefile for you. Simply enter &amp;quot;make&amp;quot; to do so.&lt;br /&gt;
&lt;br /&gt;
= How to use New Gaia ? =&lt;br /&gt;
&lt;br /&gt;
== Finding the maps files ==&lt;br /&gt;
New_Gaia can display a background that helps (a lot) to set the thermal columns where one wants. To do so, New_Gaia uses the same files that Paparazzi. That's why the background must be filled thanks to Paparazzi before it can be used by New_Gaia. (These .jpg files are located in the /var/maps directory of Paparazzi)&lt;br /&gt;
&lt;br /&gt;
== Finding the SRTM files ==&lt;br /&gt;
The SRTM files used to determine the influence of the terrain on the meteorological phenomena can be found at [http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/]&lt;br /&gt;
&lt;br /&gt;
== Executing the application ==&lt;br /&gt;
Once the application is compiled, you can run it with the command &amp;quot;make run&amp;quot;. As a student project, this application doesn't appear in the &amp;quot;Tools&amp;quot; menu of Paparazzi, that's why it's necessary to run it manually in a terminal.&lt;br /&gt;
&lt;br /&gt;
New_Gaia handles three main meteorological phenomena : thermal columns, the wind and turbulences. Each phenomenon can be customized thanks to the interface :&lt;br /&gt;
&lt;br /&gt;
[[File:Phenomenes.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Thermal Columns ===&lt;br /&gt;
&lt;br /&gt;
Let's begin with the thermal columns. To create a thermal column, click on the appropriate button and click somewhere on the map : a column with its initial parameters is created.&lt;br /&gt;
As you can see on the properties panel on the right, a lateral view of the column is displayed. Two areas are shown : a gray one, in which up-wind blows and a white one in which down-wind blows. Please note that the &amp;quot;radius&amp;quot; of a column refers to the radius of its up-wind area.&lt;br /&gt;
&lt;br /&gt;
[[File:Thermal_column.png|900px]]&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Maximum Vertical Speed&amp;quot; property refers to the speed of the wind at the center of the thermal column, this speed decreases then and becomes negative (down-wind area).&lt;br /&gt;
&lt;br /&gt;
You can set the radius of the thermal column thanks to the handler on the left of the column. The height of the column is then calculated : the larger the column is, the higher it is.&lt;br /&gt;
&lt;br /&gt;
=== Vertical Profile ===&lt;br /&gt;
&lt;br /&gt;
The second meteorological phenomenon that can be set to customize the state of the weather is the vertical profile. It represents the speed and direction of the wind functions of height.&lt;br /&gt;
&lt;br /&gt;
[[File:Vertical profile1.png|900px]]&lt;br /&gt;
&lt;br /&gt;
The wind speed consists in a polylinear function linking the highest point (or handler), the lowest point and the points you may create. Each point represents a height, a speed and a direction used to determine the wind functions of the heigth.&lt;br /&gt;
To create a new point, simply left click in the vertical profile area. To erase a point, right click on it. Please note that the highest and lowest points can't be erased. Except of the highest point, a point's height can't be modified. If the height of a point doesn't satisfy you, erase it and create a new one. Nevertheless, a point's speed can be modified. To do so, move the point with a drag'n'drop.&lt;br /&gt;
&lt;br /&gt;
[[File:Vertical profile2.png|900px]]&lt;br /&gt;
&lt;br /&gt;
Finally, the layer of the atmosphere between 0 and 150m is influenced by the terrain and thus can't be modified.&lt;br /&gt;
&lt;br /&gt;
The following image is an example of a wind turning along the altitude from East to West :&lt;br /&gt;
&lt;br /&gt;
[[File:Vertical profile3.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Turbulences ===&lt;br /&gt;
&lt;br /&gt;
The last meteorological phenomenon represents turbulences. This one is quite simple : it consists in random components added to the wind on the three axis. The level of turbulences is depicted by 4 values :&lt;br /&gt;
&lt;br /&gt;
*  0 = no turbulences&lt;br /&gt;
*  1 = low turbulences&lt;br /&gt;
*  2 = medium turbulences&lt;br /&gt;
*  3 = severe turbulences&lt;br /&gt;
&lt;br /&gt;
[[File:Turbulences.png|900px]]&lt;br /&gt;
&lt;br /&gt;
= About us =&lt;br /&gt;
&lt;br /&gt;
The team is composed by four students from the IENAC10S promo :&lt;br /&gt;
&lt;br /&gt;
* BENREJEB Ons, developer,&lt;br /&gt;
* OTT Alexandra, developer,&lt;br /&gt;
* CARRIERE Sébastien, developer,&lt;br /&gt;
* EBRO Hugo, project lead, developer.&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Lisa/M_v2.0&amp;diff=23429</id>
		<title>Lisa/M v2.0</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Lisa/M_v2.0&amp;diff=23429"/>
		<updated>2017-01-05T18:50:43Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: pin naming fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float: right; width: 15%&amp;quot;&amp;gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Autopilots&amp;lt;/categorytree&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right; width: 45%; overflow: hidden&amp;quot;&amp;gt;[[Image:LisaM_V2_0_TopView.JPG|right|500px|Lisa/M V2.0 top view]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right; width: 40%&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lisa/M is a small, general purpose autopilot designed with flexibility across multiple applications in mind. Small weight and size, with (optional) integrated [[AspirinIMU | Aspirin IMU]] and full size 0.1&amp;quot; servo headers make the Lisa/M suitable for both fixed-wing and rotorcraft vehicles. This autopilot is based on a STM32 processor for extensive peripheral connection and faster processing.&lt;br /&gt;
&lt;br /&gt;
A number of tutorials are being prepared for getting started with Lisa/M:&lt;br /&gt;
* [[Lisa/M/Tutorial/FixedWing|Fixedwing tutorial]]&lt;br /&gt;
* [[Lisa/M/Tutorial/RotorCraft|Rotorcraft tutorial]]&lt;br /&gt;
&lt;br /&gt;
Please join us in our quest to make the getting started information even more, eh... informative, by adjusting those pages with your own improvements.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
Lisa/M is based on the 64 pins STM32F105RCT6 [http://www.st.com/internet/mcu/product/221023.jsp connectivity line family] processor featuring 64k of RAM and 256k of FLASH. All the pins are exposed, providing access to the complete set of the STM32 peripherals.&lt;br /&gt;
NOTE: This MCU is different from LISA/L. Lisa/L is based on the 64 pins STM32F103RE processor featuring 64k of RAM and 512k of FLASH, which is part of the [http://www.st.com/internet/mcu/product/164485.jsp high-density performance line family].&lt;br /&gt;
&lt;br /&gt;
* STM32 microcontroller [http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00220364.pdf STM32F105RCT6 datasheet] with 256kB flash and 64kB RAM&lt;br /&gt;
* Pressure sensor [http://www.bosch-sensortec.com/content/language1/html/3477.htm BMP085] (optional as of 08/2012)&lt;br /&gt;
* 7 x Analog input channels&lt;br /&gt;
* 3 x Generic digital in-/out-puts&lt;br /&gt;
* 2 x 3.3V TTL UART (5V tolerant)&lt;br /&gt;
* 8 x Servo PPM outputs (only 6 if second I2C (I2C1) bus in use)&lt;br /&gt;
* 1 x CAN bus&lt;br /&gt;
* 1 x [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface SPI] bus&lt;br /&gt;
* 1 x [http://en.wikipedia.org/wiki/I2c I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C] bus (2 x when using only the first 6 Servo PPM outputs)&lt;br /&gt;
* 1 x Micro USB&lt;br /&gt;
* 4 x status LEDs with attached test point&lt;br /&gt;
* 10.8 grams (0.4 oz) (with Aspirin IMU mounted)&lt;br /&gt;
* 9.9 grams (0.35 oz) (without Aspirin IMU mounted)&lt;br /&gt;
* ~34mm x ~60mm x ~10mm&lt;br /&gt;
* 4 layers PCB design&lt;br /&gt;
&lt;br /&gt;
With mounted Aspirin IMU has the following additional sensors on board:&lt;br /&gt;
&lt;br /&gt;
* 3 Axis Gyroscope&lt;br /&gt;
* 3 Axis Accelerometer&lt;br /&gt;
* 3 Axis Magnetometer&lt;br /&gt;
* Barometer MS5611 (as of Aspirin v2.1)&lt;br /&gt;
&lt;br /&gt;
NOTE:&lt;br /&gt;
'''Lisa/M has pads for the BMP085 pressure sensor. Lias/M 2 boards made before August 2012 had the BMP085 sensor mounted. Boards made after August 2012 do not have the sensor mounted as they are designed to be used with Aspirin 2.1 which has the new MS5611-01BA03 barometric pressure sensor.'''&lt;br /&gt;
&lt;br /&gt;
So, except for a GPS unit you have all necessary sensors for full attitude and altitude stabilization in an extremely small package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=200px heights=200px&amp;gt;&lt;br /&gt;
Image:LisaM_V2_0_TopView.JPG|Lisa/M V2.0 top view&lt;br /&gt;
Image:LisaM_V2_0_BottomView.JPG|Lisa/M V2.0 bottom view&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pinout ==&lt;br /&gt;
Pins Name and Type are specified with respect to the Autopilot Board.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right; width: 100%&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:LisaM_V2_0_top_labeled.png|900px]]&lt;br /&gt;
[[Image:LisaM_warning_label.png|200px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''SERVO1/2/3/4/5/6/7/8'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||SERVOx||OUT||Servo signal (PWM)(See Note 1 below)||style=&amp;quot;background:Yellow; color:black&amp;quot;|Yellow&lt;br /&gt;
|-&lt;br /&gt;
|2||SV||PWR||Servo Bus Voltage Rail (conf w/ JP1)||style=&amp;quot;background:red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|3||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''JTAG'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||N/A||N/A||JTAG Debug Header (Pin 1 is +3V3)||style=&amp;quot;background:white; color:black&amp;quot;|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''UART3'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|2||V_IN||PWR||UART Voltage (conf w/ JP6 and JP7)||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|3||TX||OUT||USART3 Serial Output (3.3V level)||style=&amp;quot;background:Yellow; color:black&amp;quot;|Yellow&lt;br /&gt;
|-&lt;br /&gt;
|4||RX||IN||USART3 Serial Input (3.3V level)(Pullup to Pin 2 voltage)(5V tolerant)||style=&amp;quot;background:Orange; color:white&amp;quot;|Orange&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''UART1/5'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|2|| +3V3||PWR||3.3V Rail from autopilot (conf w/ JP8 and JP9)||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|3||RX1||IN||USART1 Serial Input (3.3V level)(Pullup to Pin 2 voltage)(5V tolerant)||style=&amp;quot;background:Orange; color:white&amp;quot;|Orange&lt;br /&gt;
|-&lt;br /&gt;
|4||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|5|| +3V3||PWR||3.3V Rail from autopilot (conf w/ JP8 and JP9)||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|6||RX5||IN||UART5 Serial Input (3.3V level)(Pullup to Pin 5 voltage)(5V tolerant)||style=&amp;quot;background:Orange; color:white&amp;quot;|Orange&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''GPIO'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|2|| +3V3||PWR||3.3V Rail from autopilot||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|4||PC12||I/O||GPIO, connected to PC12 (5V tolerant)||style=&amp;quot;background:#FDC579; color:black&amp;quot;|Dark Tan&lt;br /&gt;
|-&lt;br /&gt;
|5||TRST||I/O||JTAG_TRST (also connected to LED1 cathode)||style=&amp;quot;background:#FED6B1; color:black&amp;quot;|Light Tan&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''ANALOG2'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|2|| +3V3||PWR||3.3V Rail from autopilot||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|3|| +5V||PWR||5V Rail from autopilot||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|4||ADC4||I/O||by default connected to LED_4 cathode (Remove LED/resistor to use as ADC4)||style=&amp;quot;background:magenta; color:white&amp;quot;|Magenta&lt;br /&gt;
|-&lt;br /&gt;
|5||ADC6||I/O||by default connected to LED_3 cathode (Remove LED/resistor to use as ADC6)||style=&amp;quot;background:#FFA1B2; color:black&amp;quot;|Pink&lt;br /&gt;
|-&lt;br /&gt;
|6||BOOT0||I/O||BOOT0||style=&amp;quot;background:grey; color:black&amp;quot;|Grey&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''USB'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||N/A||N/A||USB (The USB connections are also available as 0.05&amp;quot; (1.27mm) through hole pads underneath the GPIO header)||style=&amp;quot;background:white; color:black&amp;quot;|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''I2C1 CAN'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|2|| V_BATT||PWR||V_BATT Bus on autopilot, voltage divider for V_BAT_MEAS, (conf w/ JP2 to connect to V_IN)||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|3|| V_IN||PWR||Connected to autopilot voltage regulator inputs (conf w/ JP1, JP2 and JP3)||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|4||CANL||I/O||CANL (5V level)||style=&amp;quot;background:orange; color:white&amp;quot;|Orange&lt;br /&gt;
|-&lt;br /&gt;
|5||CANH||I/O||CANH (5V level)||style=&amp;quot;background:yellow; color:black&amp;quot;|Yellow&lt;br /&gt;
|-&lt;br /&gt;
|6||SCL||I/O||SCL (5V level)(See Note 1 below)||style=&amp;quot;background:green; color:white&amp;quot;|Green&lt;br /&gt;
|-&lt;br /&gt;
|7||SDA||I/O||SDA (5V level)(See Note 1 below)||style=&amp;quot;background:blue; color:white&amp;quot;|Blue&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''SPI1'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|2|| +3V3||PWR||3.3V Rail from autopilot||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|3||MOSI||Out||MOSI||style=&amp;quot;background:orange; color:white&amp;quot;|Orange&lt;br /&gt;
|-&lt;br /&gt;
|4||MISO||In||MISO||style=&amp;quot;background:yellow; color:black&amp;quot;|Yellow&lt;br /&gt;
|-&lt;br /&gt;
|5||SCK||Out||SCK||style=&amp;quot;background:green; color:white&amp;quot;|Green&lt;br /&gt;
|-&lt;br /&gt;
|6||SS||Out||SS||style=&amp;quot;background:blue; color:white&amp;quot;|Blue&lt;br /&gt;
|-&lt;br /&gt;
|7||DRDY||I/O||DRDY||style=&amp;quot;background:#FDC579; color:black&amp;quot;|Dark Tan&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''ANALOG1'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|2|| +3V3||PWR||3.3V Rail from autopilot||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|3|| +5V||PWR||5V Rail from autopilot||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|4||ADC1||In||ADC1 (or LED_6 if populated)||style=&amp;quot;background:green; color:white&amp;quot;|Green&lt;br /&gt;
|-&lt;br /&gt;
|5||ADC2||In||ADC2 (or LED_7 if populated)||style=&amp;quot;background:blue; color:white&amp;quot;|Blue&lt;br /&gt;
|-&lt;br /&gt;
|6||ADC3||In||ADC3 (or LED_8 if populated)||style=&amp;quot;background:#FED6B1; color:black&amp;quot;|Light Tan&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''UART2'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|2|| +3V3||PWR||UART Voltage (conf w/ JP4 and JP5)||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|3||TX||OUT||USART2 Serial Output (3.3V level)||style=&amp;quot;background:Yellow; color:black&amp;quot;|Yellow&lt;br /&gt;
|-&lt;br /&gt;
|4||RX||IN||USART2 Serial Input (3.3V level)('''NOT 5V TOLERANT''')(Pullup to Pin 2 voltage)||style=&amp;quot;background:Orange; color:white&amp;quot;|Orange&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''I2C2'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|2|| +3V3||PWR||3.3V Rail from autopilot||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|3||SCL||I/O||SCL (3.3V level)||style=&amp;quot;background:green; color:white&amp;quot;|Green&lt;br /&gt;
|-&lt;br /&gt;
|4||SDA||I/O||SDA (3.3V level)||style=&amp;quot;background:blue; color:white&amp;quot;|Blue&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE 1''': SERVO7 and SERVO8 are directly connected to I2C1_SCL and I2C1_SDA lines. Therefore one has to choose, either use SERVO7 and SERVO8 '''OR''' have the I2C1 bus available, if that one needs to be used for whatever reason alongside the I2C2 bus. To use the servos 7 and 8 just set the  &amp;lt;define name=&amp;quot;USE_SERVOS_7AND8&amp;quot;/&amp;gt;  in your airframe file and you are good to go. For this to work one must make sure to have the latest Paparazzi sourcecode.&lt;br /&gt;
&lt;br /&gt;
=== LEDs ===&lt;br /&gt;
Lisa/M 2.0 has 5 LEDS (+1 power LED). There are 3 additional LEDs (LED_6, LED_7, LED_8) that are not populated by default (in favor of using ADC1-3 on the ANALOG1 connector).&lt;br /&gt;
By default the LEDs are use for:&lt;br /&gt;
; LED_1, red: ''SYS_TIME_LED'': blinks with 1Hz&lt;br /&gt;
; LED_2, green : ''AHRS_ALIGNER_LED'': blinks until the AHRS is aligned (gyro bias initialized) and then stays on&lt;br /&gt;
; LED_3, green : ''GPS_LED'': blinking if trying to get a fix, on if 3D fix&lt;br /&gt;
; LED_4, red : ''RADIO_CONTROL_LED'': on if RC signal is ok&lt;br /&gt;
; LED_5, green : not set to anything by default&lt;br /&gt;
&lt;br /&gt;
=== Jumper Configuration ===&lt;br /&gt;
There are a number of jumpers on Lisa/M used to configure voltage levels and power input.&lt;br /&gt;
&lt;br /&gt;
The default configuration is UART3 VCC at V_IN, UART1/2/5 VCC at +3V3, with the V_SERVO servo voltage rail NOT connected to the autopilot V_IN rail, allowing one to power the autopilot and servos separately. The +5V regulator is NOT bypassed, allowing a regulated +5V on listed headers and for the CAN transceiver and I2C level shifter. The V_BATT connector is NOT connected to V_IN, so one can attach a battery voltage to the V_BATT pin to measure the battery voltage, if so desired.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=380px heights=205px&amp;gt;&lt;br /&gt;
Image:LisaM_V2_0_top_jumpers_and_leds.png | Lisa/M v2.0 Top Jumpers and LEDs&lt;br /&gt;
Image:LisaM_V2_0_bottom_jumpers.png | Lisa/M v2.0 Bottom Jumpers&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''Power Jumper Configuration'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Jumper''!!width=&amp;quot;20%&amp;quot;|''Bus Connection''!!width=&amp;quot;7%&amp;quot;|''Default''!!''Description''&lt;br /&gt;
|-&lt;br /&gt;
|JP1||SERVO_BUS to V_IN||OPEN||If closed then connects servo header voltage rail SERVO_BUS to autopilot input voltage V_IN rail&lt;br /&gt;
|-&lt;br /&gt;
|JP2||V_BATT to V_IN||OPEN||If closed then connects I2C1/CAN rail V_BATT to autopilot input voltage V_IN rail&lt;br /&gt;
|-&lt;br /&gt;
|JP3||V_IN to +5V||OPEN||If closed then connects autopilot input voltage V_IN rail to autopilot +5V rail, bypassing onboard 5V supply&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''UART3 VCC Configuration'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Jumper''!!width=&amp;quot;20%&amp;quot;|''Bus Connection''!!width=&amp;quot;7%&amp;quot;|''Default''!!''Description''&lt;br /&gt;
|-&lt;br /&gt;
|JP6||UART3_VCC to V_IN||style=&amp;quot;background:black; color:white&amp;quot;|CLOSED||Connects UART3 connector VCC to autopilot input voltage V_IN rail&lt;br /&gt;
|-&lt;br /&gt;
|JP7||UART3_VCC to +3V3||OPEN||If closed then connects UART3 connector VCC to autopilot +3V3 rail&lt;br /&gt;
|}&lt;br /&gt;
'''WARNING: UART3 GPS Connector is connected to V_IN, check your GPS input voltage before connecting!!!'''&lt;br /&gt;
&lt;br /&gt;
'''WARNING: DO NOT CLOSE BOTH JP6 AND JP7 SIMULTANEOUSLY!!!'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''UART2 VCC Configuration'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Jumper''!!width=&amp;quot;20%&amp;quot;|''Bus Connection''!!width=&amp;quot;7%&amp;quot;|''Default''!!''Description''&lt;br /&gt;
|-&lt;br /&gt;
|JP4||UART2_VCC to V_IN||OPEN||If closed then connects UART2 connector VCC to autopilot input voltage V_IN rail '''SEE WARNING BELOW'''&lt;br /&gt;
|-&lt;br /&gt;
|JP5||UART2_VCC to +3V3||style=&amp;quot;background:black; color:white&amp;quot;|CLOSED||If closed then connects UART2 connector VCC to autopilot +3V3 rail&lt;br /&gt;
|}&lt;br /&gt;
'''WARNING: UART2 RX is NOT 5V TOLERANT. Thus, while possible to connect UART2_VCC to V_IN, DO NOT ATTEMPT THIS. Only use JP5 (the default).&lt;br /&gt;
&lt;br /&gt;
'''WARNING: DO NOT CLOSE BOTH JP4 AND JP5 SIMULTANEOUSLY!!!'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''UART1 and UART5 VCC Configuration'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Jumper''!!width=&amp;quot;20%&amp;quot;|''Bus Connection''!!width=&amp;quot;7%&amp;quot;|''Default''!!''Description''&lt;br /&gt;
|-&lt;br /&gt;
|JP8||UART1&amp;amp;5_VCC to V_IN||OPEN||If closed then connects UART1 and UART5 connector VCC to autopilot input voltage V_IN rail&lt;br /&gt;
|-&lt;br /&gt;
|JP9||UART1&amp;amp;5_VCC to +3V3||style=&amp;quot;background:black; color:white&amp;quot;|CLOSED||If closed then connects UART1 and UART5 connector VCC to autopilot +3V3 rail&lt;br /&gt;
|}&lt;br /&gt;
'''WARNING: DO NOT CLOSE BOTH JP8 AND JP9 SIMULTANEOUSLY!!!'''&lt;br /&gt;
&lt;br /&gt;
There are additional jumpers on the board for expert or developer configurations, please see [[Lisa/M_v20#Schematic|schematic]] and [[Lisa/M_v20#Downloads|layout]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Powering the Board ===&lt;br /&gt;
&lt;br /&gt;
[[Image:LisaM_warning_label.png|right|200px]]&lt;br /&gt;
&lt;br /&gt;
The 3.3V regulator on Lisa/M is a [http://www.micrel.com/page.do?page=/product-info/products/mic5209.shtml MIC5209-3.3YM] capable of delivering up to 500mA. While it is possible to power this regulator with up to 16V, '''DO NOT''' do this. By default, the UART3 RX pin is pulled up to the input voltage V_IN. For this reason, 5V is the maximum input voltage. Note that the UART3 GPS Connector is connected to V_IN, check your GPS input voltage before connecting. If one desires to have V_IN at a higher voltage, the jumpers should be adjusted accordingly. As noted, this regulator can handle up to 16V, though experience has shown that this regulator can become very hot in operation with high input voltages, resulting in potential thermal shutdown while in flight. Depending on the expected current draw, it is best to power this regulator with a lower voltage. 5V is the perfect choice. &lt;br /&gt;
&lt;br /&gt;
The onboard 5V regulator on Lisa/M is a [http://www.national.com/pf/LP/LP2992.html LP2992], a low-noise, low-dropout linear regulator capable of delivering up to 250mA. This regulator can be bypassed with JP3, connecting the autopilot V_IN bus directly to the autopilot 5V bus if, for example, one is using an external 5V regulated supply, and a higher current is needed. Unless external use of 5V is required on the ANALOG1 and ANALOG2 headers, the only 5V usage onboard is for the CAN transceiver and the I2C1 level shifter.&lt;br /&gt;
&lt;br /&gt;
When measuring the supply voltage of a battery with the V_BATT pin (could be connected to V_IN through JP2), it is important to note the maximum voltage limit. The voltage divider on the board for measuring with a 3.3V ADC is --'''V_BAT'''--/\/\'''10k'''/\/\--'''V_BAT_MEAS'''--/\/\'''2k2'''/\/\--'''GND'''--. This means that the maximum allowable voltage on V_BATT is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\_BAT_{max} = 3.3V*\frac{10k}{2.2k} = 15V&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a higher voltage measurement is desired, another voltage divider is required off-board. Alternatively, one could modify the existing voltage divider (e.g. change 10k resistor to 22k to get 33V maximum). When checking if voltage exceeds the maximum, make sure to consider maximum battery voltage, not nominal voltage (e.g. 4.22V or so for a single lithium cell, not 3.7V nominal, so the maximum number of cells in series is 3, like a 3S LiPo pack).&lt;br /&gt;
&lt;br /&gt;
== Schematic ==&lt;br /&gt;
&amp;lt;gallery widths=250px heights=168px&amp;gt;&lt;br /&gt;
Image:Lisa_m_v2_0_sheet_1.png | LisaM V2.0 Schematic Sheet 1/3&lt;br /&gt;
Image:Lisa_m_v2_0_sheet_2.png | LisaM V2.0 Schematic Sheet 2/3&lt;br /&gt;
Image:Lisa_m_v2_0_sheet_3.png | LisaM V2.0 Schematic Sheet 3/3&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;gallery widths=250px heights=168px&amp;gt;&lt;br /&gt;
Image:Lisa_m_v2_1_r3_sheet_1.png | Lisa/M V2.1 R3 Schematic Sheet 1/2&lt;br /&gt;
Image:Lisa_m_v2_1_r3_sheet_2.png | Lisa/M V2.1 R3 Schematic Sheet 1/2&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples of Airborne Equipment Electrical Connections ==&lt;br /&gt;
&lt;br /&gt;
=== Quadrocopter, Spektrum Satellite Receivers, PWM Motor Controllers (ESC) and dedicated avionics Battery Elimination Circuit (BEC) ===&lt;br /&gt;
&lt;br /&gt;
[[File:LisaM_V2_0_wiring_quadrocopter_spektrum_bec_pwmesc.png|700px]]&lt;br /&gt;
&lt;br /&gt;
This is a recommended powering configuration. It eliminates the balancing issues of the built in BECs into the ESCs.&lt;br /&gt;
&lt;br /&gt;
The dotted lines from the BEC show the alternative wiring that does not require closing the VS jumper on the Lisa/M. The disadvantage is that you have to wire/crimp the BEC output wires into the picoblade molex connector providing the battery voltage reference. Usually it is easier to just use the existing &amp;quot;servo&amp;quot; connector on the BEC and closing the jumper instead.&lt;br /&gt;
&lt;br /&gt;
=== Quadrocopter, Spektrum Satellite Receivers and PWM Motor Controllers (ESC) ===&lt;br /&gt;
&lt;br /&gt;
[[File:LisaM_v2_0_wiring_quadrocopter_spektrum_pwmesc.png|700px]]&lt;br /&gt;
&lt;br /&gt;
This configuration assumes the ESCs have a battery eliminator circuit (BEC) function and provide 5 volts on their 5V pins. Closing JP1 powers Lisa/M and the attached accessories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Warning:&amp;lt;/span&amp;gt; The built in BECs on the ESCs are usually linear voltage regulators, they are fairly inefficient compared to dedicated BECs that are usually implemented as switching DC/DC converters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Warning:&amp;lt;/span&amp;gt; Due to manufacturing differences of BECs, connecting more then one BEC in parallel will likely cause one of the BECs to take majority of the load and dissipate most of the drop down voltage. ([https://en.wikipedia.org/wiki/Linear_regulator Read on how linear voltage regulators work.]) As in this example the BECs are part of the ESCs, one of the ESCs will get warmer than the others, which in turn may lead to reliability issues.&lt;br /&gt;
&lt;br /&gt;
[[File:LisaM_V2_0_wiring_quadrocopter_spektrum_pwmesc_shunts.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;Tip:&amp;lt;/span&amp;gt; To improve balancing between the ESC built in BECs you can add a 1Ohm resistor in the +5V line coming from the motor controller. This will cause some pre-loading of the voltage regulator and improve the load sharing between the BECs while decreasing the efficiency of the supply.&lt;br /&gt;
&lt;br /&gt;
When using cheap ATMega or SiLabs-based PWM motor controllers consider replacing their firmware with either [https://github.com/sim-/tgy Simon Kirby] or [https://github.com/bitdump/BLHeli BLHeli] firmware respectively to get useful performance of your multicopter! You can find a firmware compatibility list [https://docs.google.com/spreadsheet/ccc?key=0AhR02IDNb7_MdEhfVjk3MkRHVzhKdjU1YzdBQkZZRlE here].&lt;br /&gt;
&lt;br /&gt;
=== Quadrocopter, Spektrum Satellite Receivers and I2C Motor Controllers (ESC) ===&lt;br /&gt;
&lt;br /&gt;
[[File:LisaM_V2_0_quadrocopter_spektrum_i2c_esc_wiring.png|700px]]&lt;br /&gt;
&lt;br /&gt;
This diagram &amp;quot;should&amp;quot; be the same for AscTec as well as Mikrokopter motor controller based airframes.&lt;br /&gt;
&lt;br /&gt;
=== Fixedwing, Spektrum Satellite Receivers and Elevons Only ===&lt;br /&gt;
&lt;br /&gt;
[[File:LisaM_V2_0_wiring_fixedwing_spektrum_elevons.png|700px]]&lt;br /&gt;
&lt;br /&gt;
This configuration assumes the ESC has a BEC and provides 5 volts on its 5V pin. Closing JP1 powers Lisa/M and the attached accessories.&lt;br /&gt;
&lt;br /&gt;
=== Fixedwing, Spektrum Satellite Receivers ===&lt;br /&gt;
&lt;br /&gt;
[[File:LisaM_V2_0_wiring_fixedwing_spektrum.png|700px]]&lt;br /&gt;
&lt;br /&gt;
This configuration assumes the ESC has a BEC and provides 5 volts on its 5V pin. Closing JP1 powers Lisa/M and the attached accessories.&lt;br /&gt;
&lt;br /&gt;
=== Transitioning [http://wiki.thequadshot.com Quadshot] Using Spektrum Receivers ===&lt;br /&gt;
&lt;br /&gt;
[[File:LisaM_V2_0_wiring_quadshot_spektrum.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The ESCs have BECs and provide 5 volts on their 5V pins. Closing JP1 powers Lisa/M and the attached accessories.&lt;br /&gt;
&lt;br /&gt;
Still need: Large Fixed-wing with advanced power system and/or IC engine, PPM example&lt;br /&gt;
&lt;br /&gt;
== R/C Receivers ==&lt;br /&gt;
&lt;br /&gt;
One can use [[Subsystem/radio_control#Spektrum|Spektrum]] DSM2 or compatible receivers as well as traditional PPM receivers.  It is even possible to [[Subsystem/radio_control#Spektrum|connect two Spectrum or compatible satellite receivers]] for better redundancy or to improve RC signal reception. Connecting a RC receiver for flying your aircraft in manual mode during setup and test phase is 99% of the cases a must. Therefore the Paparazzi team made it easy to connect one.&lt;br /&gt;
&lt;br /&gt;
===  Using a Spektrum DSM receiver ===&lt;br /&gt;
&lt;br /&gt;
==== Physically connecting ====&lt;br /&gt;
&lt;br /&gt;
Wiring up a Spektrum or compatible satellite receiver is not all to difficult to do. Note however that it is very important to make absolutely sure the connectors are properly made. Not being precise in this step can mean full RC loss and loss of airframe in the first tuning testflights. &lt;br /&gt;
&lt;br /&gt;
A spektrum satellite receiver should be connected to the UART1 connector on the autopilot board. Make sure the voltage on the AP board UART1 + pin is not to high, or to low for your receiver.&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
# Connect the minus(-) of the receiver to GND of UART1&lt;br /&gt;
# The receiver plus(+) to the UART1 Plus(+) &lt;br /&gt;
# Data out signal of the receiver to the RX pin on the UART1&lt;br /&gt;
&lt;br /&gt;
==== Binding ====&lt;br /&gt;
&lt;br /&gt;
To get a receiver and transmitter to work together you must perform a binding process. &lt;br /&gt;
&lt;br /&gt;
It is important to '''bind''' your Spectrum DSM receiver to your transmitter '''via''' your '''Lisa board''', not in any other way!&lt;br /&gt;
&lt;br /&gt;
The way to bind is by temporary connecting via fiddly small molex pins. &lt;br /&gt;
It is advised to make a small bind plug out of a molex connector for this purpose. &lt;br /&gt;
Before you start make sure you have your airframe configuration already uploaded either via USB or a JTAG cable.&lt;br /&gt;
&lt;br /&gt;
The bind procedure:&lt;br /&gt;
&lt;br /&gt;
# On the connector '''ANALOG1''' have a wire between the GND and ADC1 pin, located in the middle of the board&lt;br /&gt;
# Power up your autopilot board&lt;br /&gt;
# Hold the bind button on your '''transmitter''', while '''keeping it pressed''' switch on your transmitter&lt;br /&gt;
#:Wait...! All lights of the receiver blink and then go steady&lt;br /&gt;
# Let go of your transmitter bind button&lt;br /&gt;
# Power off your Lisa Board&lt;br /&gt;
# Remove the wire connecting the GND and ADC1 pins on the ANALOG1 connector&lt;br /&gt;
# Repower your board, if you have servos connected and wiggle the RC transmitter sticks some servos should move&lt;br /&gt;
&lt;br /&gt;
That is all, you are done. &lt;br /&gt;
The bind procedure only needs to be done '''once''' for your receiver.&lt;br /&gt;
&lt;br /&gt;
===  Using a CPPM receiver ===&lt;br /&gt;
&lt;br /&gt;
Using a CPPM receiver, a so called '''PPM sum stream''' input is possible. [[RC_Receivers_and_Radios#PPM_Based_Systems | To make it work, you need a CPPM a.k.a. PPM sum, stream out capable receiver. Find out more following this link]]  &lt;br /&gt;
&lt;br /&gt;
==== Connecting ====&lt;br /&gt;
&lt;br /&gt;
Connect the CPPM out signal to the RX pin of UART1.&lt;br /&gt;
&lt;br /&gt;
Make sure put this in your airframe file in your AP target section.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing or rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;radio_control&amp;quot; type=&amp;quot;ppm&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;configure name=&amp;quot;RADIO_CONTROL_PPM_PIN&amp;quot; value=&amp;quot;UART1_RX&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/subsystem&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Alternative =====&lt;br /&gt;
&lt;br /&gt;
However if in the case you want to use the UART1 port for something else, there is an option to connect the receiver to a servo pin. Yes, that's right, a servo connector is used for receiving a CPPM stream '''input'''.  If you want to walk that path, the default pin number to capture the CPPM datastream is via servo connector SERVO6&lt;br /&gt;
&lt;br /&gt;
If you connect the CPPM out capable receiver that way make sure to put this in your airframe file in your AP target section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing or rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;radio_control&amp;quot; type=&amp;quot;ppm&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;configure name=&amp;quot;RADIO_CONTROL_PPM_PIN&amp;quot; value=&amp;quot;SERVO6&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/subsystem&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you do not have or cannot modify a receiver to a ''CPPM out'' able receiver, a [[PPM_Encoder | PPM encoder board]] can be used to avoid opening your receiver for PPM out modification. However with the very low prices of Spectrum DSMX CPPM out, lat time we looked you could have one starting from EUR 10,-&lt;br /&gt;
&lt;br /&gt;
===Using a S-Bus receiver===&lt;br /&gt;
&lt;br /&gt;
There is a third option, connect a receiver with S-Bus signal output. For this with regular Futaba receiver an inverter my be needed.&lt;br /&gt;
&lt;br /&gt;
== Extras ==&lt;br /&gt;
&lt;br /&gt;
=== UART I/O ===&lt;br /&gt;
&lt;br /&gt;
UART pins can also be used as general purpose I/O, this might come in handy in case all other inputs or your AP board are in use.&lt;br /&gt;
&lt;br /&gt;
===  USB as UART1TX + hardware flow control===&lt;br /&gt;
&lt;br /&gt;
[[File:Lisam-usb-uart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
The USB_VBUS on the Lisa/M 2.0 can be used as UART1 TX. To do this, a diode has to be removed. Make sure to include a series resistor of 100-3000 Ohm to protect the microcontroller from overcurrents. The 2nd and 3th pin of the USB pads are CTS and RTS respectively. It is recommended to include a series resistor in the RTS line, as this is an outgoing line. &lt;br /&gt;
&lt;br /&gt;
If you want to enable flow control in the software, but don't want to use flow control when no cable is connected to the CTS/RTS, a pulldown resistor of 10 kOhm has to be added between the CTS and the GND. If you do this, take care when connecting UART devices that have a large series resistor in their RTS line. The combination of the pulldown resistor and the series resistor might cause the high-level voltage to drop under the high-level threshold of the microcontroller, causing strange behaviour.&lt;br /&gt;
&lt;br /&gt;
For Example the RTS , mostly a purple wire, is the '''pin 10''' on the Xtend module when set in the module with Hardware flow control (use X-CTU)&lt;br /&gt;
CTS, most blue, on pin 9 of the Xtend&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=380px heights=205px&amp;gt;&lt;br /&gt;
Image:Lisam-diode.JPG | Remove this diode. After removing this diode you can not power the board via USB anymore.&lt;br /&gt;
Image:Lisam-gpio-usb.JPG | Take care of the small distance between the GPIO pins and the USB pads.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== PCB ==&lt;br /&gt;
&lt;br /&gt;
=== Gerber &amp;amp; Drill Files  ===&lt;br /&gt;
&lt;br /&gt;
'''''Download  Lisa/M v2.0 gerber &amp;amp; drill files (zip)''''' ''[[Lisa/M_v2.0#Get the design|Get the design]]''&lt;br /&gt;
&lt;br /&gt;
== Assembly ==&lt;br /&gt;
&lt;br /&gt;
To create and assemble a board oneself is possible. It takes some skills however. &lt;br /&gt;
&lt;br /&gt;
For the Lisa/m v2.0 without the Aspirin sensor board a good soldering iron is enough.(smallest components are 0402) For the Aspirin Sensor board you need a hot air soldering station.&lt;br /&gt;
&lt;br /&gt;
In case you wan to follow that path you need the design. You came to the right place here is the info to get the needed files;&lt;br /&gt;
&lt;br /&gt;
===Components Layout===&lt;br /&gt;
&lt;br /&gt;
''[[Lisa/M_v2.0#Get the design|Get the design]]''&lt;br /&gt;
&lt;br /&gt;
Need some top and bottom of board images and line drawings here.&lt;br /&gt;
&lt;br /&gt;
=== Bill Of Material ===&lt;br /&gt;
&lt;br /&gt;
'''''Download  Lisa/M v2.0 Bill Of Material (zipped .xls file)''''' ''[[Lisa/M_v2.0#Get the design|Get the design]]''&lt;br /&gt;
&lt;br /&gt;
Open .sch File in Eagle, execute UPL --&amp;gt; bom.ulp , save as .txt&lt;br /&gt;
&lt;br /&gt;
== PCB and assembled boards suppliers ==&lt;br /&gt;
&lt;br /&gt;
To difficult to create your own AP board, understandable, thus pre made board available via [[Get_Hardware|Get Hardware]] page... hopefully :)&lt;br /&gt;
&lt;br /&gt;
== Mechanical Dimensions ==&lt;br /&gt;
&lt;br /&gt;
[[Image:LisaM_V2_0_top_mechanical.png|500px|Lisa/M v2.0 Mechanical Dimensions]]&lt;br /&gt;
&lt;br /&gt;
The overall height of the board including the servo connectors is 10mm. Note that the overall length includes the USB connector. The mounting holes are nominal 2mm diameter (with a bit of clearance).&lt;br /&gt;
Beware that in version 2.1 of the Lisa/MX the mounting holes are for m3 screws.&lt;br /&gt;
&lt;br /&gt;
== Get the design ==&lt;br /&gt;
&lt;br /&gt;
'''Source files'''&lt;br /&gt;
:*download available on GitHub: ''[https://github.com/paparazzi/paparazzi-hardware/tree/master/controller/lisa_m/v2.0 Lisa/M v2.0 Cadsoft Eagle 6 Design]''&lt;br /&gt;
'''Gerber &amp;amp; Drill files'''&lt;br /&gt;
:*download ''NOT YET AVAILABLE'' Need generated gerbers and drill files&lt;br /&gt;
'''Assembly files'''&lt;br /&gt;
:*download ''NOT YET AVAILABLE'' Need Lisa/M v2.0 Components layouts (pdf)&lt;br /&gt;
:*download ''NOT YET AVAILABLE'' Need Lisa/M v2.0 Bill Of Material&lt;br /&gt;
&lt;br /&gt;
== Uploading new software ==&lt;br /&gt;
New onboard software for the Lisa/M v2.0 can uploaded by connecting your PC via a micro-USB port to the autopilot board. For this the board need to contain the [[Luftboot]] bootloader. All Lisa/M 2.0 and Lisa/M 2.1 from [[1BitSquared]] come with luftboot already in the board.&lt;br /&gt;
&lt;br /&gt;
An alternative to get your firmware in the board is by using a Black Magic Probe JTAG/SWD debugger and programmer connected via the 10-pin JTAG/SWD Samtec connector that is on the board.&lt;br /&gt;
&lt;br /&gt;
See the [[FirmwareFlashing]] page for an overview of different methods to upload new software to your autopilot.&lt;br /&gt;
&lt;br /&gt;
=== Using luftboot ===&lt;br /&gt;
'''This is the default FLASH_MODE for Lisa/M v2.0 and v2.1''', it could be explicitly selected by adding&lt;br /&gt;
:&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;configure name=&amp;quot;FLASH_MODE&amp;quot; value=&amp;quot;DFU&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
to the firmware section of your airframe file. Make sure to set Lisa/M 2.0 or 2.1 as it's target board.&lt;br /&gt;
&lt;br /&gt;
Once USB is plugged in, the board automatically goes to bootloader mode and the status LEDs cycle up and down:&lt;br /&gt;
&lt;br /&gt;
[[File:Luftboot.gif|320px]]&lt;br /&gt;
&lt;br /&gt;
If you have trouble entering the bootloader mode or want to upload/update the bootloader itself, see the [[Luftboot]] page.&lt;br /&gt;
&lt;br /&gt;
On Lisa/M V2.1 if you plug in the usb connector the board should go into bootloader mode automatically, older versions of the board come with a bootloader that has to be explicitly entered. If you have trouble with any part of the process, make a github account and click on the chat button in the lower right corner on this page.&lt;br /&gt;
&lt;br /&gt;
=== Using JTAG ===&lt;br /&gt;
You still can use a [[JTAG|JTAG adapter]] for [[FirmwareFlashing#JTAG|flashing]] and [[DevGuide/JTAG-Debug|debugging]] your paparazzi firmware. To use [[FirmwareFlashing#JTAG|JTAG flashing]] configure the ''FLASH_MODE'' in your firmware section:&lt;br /&gt;
:&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;configure name=&amp;quot;FLASH_MODE&amp;quot; value=&amp;quot;JTAG&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is recommended to use the Black Magic Probe as your JTAG adapter. This avoids issues that result from using OpenOCD software. See more details [[JTAG#Black_Magic_Probe|here]]&lt;br /&gt;
&lt;br /&gt;
Using JTAG will not overwrite the bootloader by default. To overwrite the luftboot bootloader configure&lt;br /&gt;
:&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;configure name=&amp;quot;NO_LUFTBOOT&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press upload as normal...&lt;br /&gt;
&lt;br /&gt;
=== Serial Firmware Upload ===&lt;br /&gt;
Firmware upload using the factory integrated bootloader can be useful e.g. if you have overwritten [[Luftboot]] accidentally and don´t have access to [[JTAG]].&amp;lt;br/&amp;gt;&lt;br /&gt;
Either set the flash mode in the target section of the airframe configuration:&lt;br /&gt;
:&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;configure name=&amp;quot;FLASH_MODE&amp;quot; value=&amp;quot;SERIAL&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
or add it to the commandline invocation:&lt;br /&gt;
 make AIRCRAFT=&amp;lt;aircraftname&amp;gt; ap.upload FLASH_MODE=SERIAL&lt;br /&gt;
&lt;br /&gt;
Due to hardware constraints, the board has to be modified to make use of the bootloader, which is only accessible on UART1:&lt;br /&gt;
# Diode D3 has to be removed (the bigger black brick next to the USB connector). Attention, no more powering via USB after that.&lt;br /&gt;
# BOOT1 has to be set to GND by connecting ACC_DRDY(unused) to GND at the Aspirin pads&lt;br /&gt;
&lt;br /&gt;
Now a boot sequence works as follows:&lt;br /&gt;
#BOOT0 has to be set to 3.3V by use of a jumper cable&lt;br /&gt;
#Connect a 3.3V serial cable (FTDI, MAX232...) to UART1, the TX pin is USB_VBUS (accessible were the previously mentioned diode was located)&lt;br /&gt;
#Power the board and activate the bootloader program&lt;br /&gt;
&lt;br /&gt;
=== Prevent board from going into bootloader mode ===&lt;br /&gt;
&lt;br /&gt;
Normally, if you power up the board with the USB cable connected to a PC it will automatically go into bootloader mode. If you want the board to power up normally with the cable connected you can ground the ADC2 in the ANALOG1 connector.&lt;br /&gt;
&lt;br /&gt;
== Detailed Hardware Revision History ==&lt;br /&gt;
&lt;br /&gt;
=== Changes Between LISA v1.1 and v2.0 ===&lt;br /&gt;
&lt;br /&gt;
* Lots of silkscreen improvements&lt;br /&gt;
* Added attributes to all parts to make the usage of bom-ex ulp possible.&lt;br /&gt;
* Improved routing to allow teardropping&lt;br /&gt;
* Fixed stm32f1, f2 and f4 compatibility circuit. (has to jump to ground not to 3v3)&lt;br /&gt;
* Connected existing UART RX pullups to the respective connector power pins instead of 3v3. To prevent connecting 5V over IO pin to the 3v3 power rail.&lt;br /&gt;
* Added pullups on all UART RX lines to prevent undesired floatation.&lt;br /&gt;
* LED's are connected to 3v3 now. To make sure we don't have an issue with voltage tolerance on the gpio pins.&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
== Hardware Change Requests ==&lt;br /&gt;
&lt;br /&gt;
If you have a Lisa/M 2.0 and in the process of using it you come up with something you find annoying, dangerous, or restricting, add your hardware update requests here. Better still, modify the Lisa schematics yourself and show your new improvements if you are skilled enough to do this.&lt;br /&gt;
&lt;br /&gt;
* REQ: Replace BMP085 with MS5611 (the MS5611 seems to be better in performance then the BMP but it is more expensive and seems to be more difficult to obtain. &lt;br /&gt;
** A: Using a MS5611 is possible through using a Aspirin v2.1 board&lt;br /&gt;
&lt;br /&gt;
* REQ: Replace 7 Pin CAN with molex with something less risky to be inserted in 7 Pin SPI in relation to powering the board via CAN molex.&lt;br /&gt;
&lt;br /&gt;
* REQ: Separate spot for external power if powered via separate battery. Realizing we can via Servo ports by Bridge J1 but still like to measure board voltage then and have a way to add power without mistakenly insert I2CCAN Molex conector into SPI Molex on board connector. Thus a separate CAN and Power plug. Power on regular four pin molex with GND, V+5, , V_BATT, V_I (Current sense). Option to have thicker wire to be soldered to the board, for power hungry setups and other issues connectors for power are not a good idea.&lt;br /&gt;
&lt;br /&gt;
* REQ: Replace Aspirin IMU board with InvenSense MPU-9150 and bring the MS5611 back onto the Lisa/M board to reduce footprint, mass, and manufacturing cost once the 9150 becomes readily available(if at al with SPI) and is tested to perform well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Lisa/Lia F4 ==&lt;br /&gt;
Lisa/Lia autopilot can be easily converted to a much more powerful controller, based on STM32F405RGT6 chip [http://www.st.com/web/catalog/mmc/FM141/SC1169/SS1577/LN1035/PF252144]. The chip has the same dimensions (LQFP64 10x10mm package) with the exact same pinout as the original STM32F105RCT6 chip. The main advantage of the f4 chip is:&lt;br /&gt;
&lt;br /&gt;
* 168MHz CPU speed, 1MB flash and 192kb RAM&lt;br /&gt;
* FPU (fast floating point computations)&lt;br /&gt;
* configurable DMA streams (more peripherals can use DMA)&lt;br /&gt;
* multiplexed IO pins (peripherals can be mapped to various IO pins)&lt;br /&gt;
* CPU usage only about 5% with standard rotorcraft flight configuration&lt;br /&gt;
&lt;br /&gt;
STM32F405RGT6 chip can be ordered for example [http://cz.mouser.com/ProductDetail/STMicroelectronics/STM32F405RGT6/?qs=Z8%252beY1k3TIKgj7QWsYGpQw== here]. To replace the chip a good soldering station with microscope and enough light is recommended. After replacing the chip, jumpers CMP1 and CMP2 have to be opened. &lt;br /&gt;
&amp;lt;gallery widths=300px heights=200px&amp;gt;&lt;br /&gt;
 [[File:F4_digikey.jpg]]&lt;br /&gt;
Image:F4_digikey.jpg|DigiKey part number for F4 chip&lt;br /&gt;
Image:F4_on_board.jpg|Lia F4 with the new chip&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Programming ===&lt;br /&gt;
The STM32F4 can be flashed via SWD/JTAG (e.g. with the BlackMagicProbe) or via [[DFU#Native_DFU_bootloader_.28embedded_in_ROM.29|DFU-UTIL]].&lt;br /&gt;
[[Luftboot|Luftboot]] currently supports only F1xx chips.&lt;br /&gt;
&lt;br /&gt;
'''To program via DFU-UTIL:'''&lt;br /&gt;
&lt;br /&gt;
[[File:LisaMX v2_0_DFU.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
[[DFU#Native_DFU_bootloader_.28embedded_in_ROM.29|First, install DFU-UTIL as shown here.]]&amp;lt;br&amp;gt;&lt;br /&gt;
The two pairs of pins circled in red should be shorted (VERY CAREFULLY), eg with tweezers, as shown, i.e.:&amp;lt;br&amp;gt;&lt;br /&gt;
1) The Boot0 and VDD pins on the STM32F4 should be shorted together.&amp;lt;br&amp;gt;&lt;br /&gt;
2) The ACC_DRDY (Boot1) and GND pins should be shorted together on the Aspirin mounting pads. (This can be done even if an aspirin IMU is mounted).&amp;lt;br&amp;gt;&lt;br /&gt;
The USB connector should then be plugged in. This action also powers the board. Do not connect any additional source of power.&amp;lt;br&amp;gt;&lt;br /&gt;
Remove the shorts. The board should now be in bootloader mode. Only one green LED should be lit.&amp;lt;br&amp;gt;&lt;br /&gt;
The board can then be flashed using DFU-UTIL.&amp;lt;br&amp;gt;&lt;br /&gt;
Tested functional on a [http://transition-robotics.com/products/lisa-m-f4-with-10dom-aspirin-imu TRI Lisa/MX v2.0] using Paparazzi Master branch on 18 Nov 2014.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''A guide how to flash the F4 chip from Eclipse can be found in [[RT_Paparazzi|RT_Paparazzi]].'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Lisa]] [[Category:User_Documentation]] [[Category:Autopilots]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Advanced_Navigation_Routines&amp;diff=23362</id>
		<title>Advanced Navigation Routines</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Advanced_Navigation_Routines&amp;diff=23362"/>
		<updated>2016-10-27T15:51:06Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: /* Bungee Takeoff */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
The flight plan standard navigation functions are very flexible. However sometimes one needs to perform a very specific task, and the basic functions are not enough to accomplish a special mission. In that case you can use additional modules functions in the flight plan. By adding a navigation capability to your airframe. The flight plan now has extra functionality that can be used.&lt;br /&gt;
&lt;br /&gt;
= Available navigation modules =&lt;br /&gt;
&lt;br /&gt;
==  Navigation Routines (Prev.OSAM) ==&lt;br /&gt;
&lt;br /&gt;
Thanks to Team OSAM's contribution these navigation capabilities have been added.&lt;br /&gt;
&lt;br /&gt;
To use these navigation routines, you need to change the navigation subsystem type to extra in your airframe file. The navigation extra subsystem includes extra navigation routines like OSAMnav, spiral, poly_survey_advanced, nav_cube, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;subsystem name=&amp;quot;navigation&amp;quot; type=&amp;quot;extra&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also include OSAMNav.h in your flight plan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 #include &amp;quot;subsystems/navigation/OSAMNav.h&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Flower ==&lt;br /&gt;
[[Image:FlowerScreenShot.png|thumb|Screen shot of flower routine]]&lt;br /&gt;
The flower navigation routine flies the aircraft in a flower pattern defined by two waypoints. The center waypoint defines the center of the flower and the altitude the plane flies at. The edge waypoint defines the radius of the flower.&lt;br /&gt;
&lt;br /&gt;
In our example the waypoints are called &amp;quot;Center&amp;quot; and &amp;quot;Edge&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;Center&amp;quot; x=&amp;quot;-20.0&amp;quot; y=&amp;quot;-160.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;Edge&amp;quot; x=&amp;quot;-10.0&amp;quot; y=&amp;quot;-60.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then you can add flower to your flight plan:&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;block name=&amp;quot;Flower&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;call fun=&amp;quot;InitializeFlower(WP_Center,WP_Edge)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;call fun=&amp;quot;FlowerNav()&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Note that in the function InitializeFlower the waypoints need the prefix &amp;quot;WP_&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Bungee Takeoff ==&lt;br /&gt;
&lt;br /&gt;
The bungee takeoff routine helps to automate takeoff by turning the throttle on after the bungee has been release from the hook. The only waypoint you need for this routine is the position of where the bungee is pegged to the ground. Using this waypoint, a line is drawn from the position of the aircraft to the bungee waypoint. This line is called the launch line and will stop updating once the speed of the plane exceeds the MinSpeed. This allows the user to initialize the routine, move the plane and launch it without having to reinitialize. Once the plane is launched, it will follow the launch line until it crosses the throttle line. The throttle line is a line perpendicular to the launch line at a distance d from the bungee waypoint (see the diagram below). When the plane crosses the throttle line and the speed of the aircraft is greater than MinSpeed, the throttle comes on. After the throttle comes on, the plane keeps going straight until it reaches a specified speed and altitude above the bungee waypoint altitude. When it reaches the takeoff speed and takeoff altitude, the next block in the flight plan is executed. The takeoff speed, takeoff altitude, MinSpeed and the distance d from the bungee waypoint are specified in the airframe file. You will need to add those values to your airframe file like this...&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myAircraft.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;Takeoff&amp;quot; prefix=&amp;quot;Takeoff_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;Height&amp;quot; value=&amp;quot;30&amp;quot; unit=&amp;quot;m&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;Speed&amp;quot; value=&amp;quot;15&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;Distance&amp;quot; value=&amp;quot;3&amp;quot; unit=&amp;quot;m&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MinSpeed&amp;quot; value=&amp;quot;5&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;    &lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can add the bungee takeoff routine to your flight plan like so...&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;block name=&amp;quot;Takeoff&amp;quot; strip_button=&amp;quot;Takeoff (wp CLIMB)&amp;quot; strip_icon=&amp;quot;takeoff.png&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;call fun=&amp;quot;InitializeBungeeTakeoff(WP_Bungee)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;call fun=&amp;quot;BungeeTakeoff()&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To get this routine to work consistently, you will need to tune the values in the airframe config file. If the prop doesn't automatically turn on when it crosses the throttle line, it could be because the Distance and/or the MinSpeed are too big. If it turns on to early, it could be because the Distance and/or MinSpeed are too small. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt; ***Precaution should be taken while tuning the auto takeoff with electrical plane. If the MinSpeed is too low, the prop could turn on while holding the aircraft!***&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:BungeeTakeoffDiagram.png|Bungee takeoff diagram&lt;br /&gt;
Image:BungeeTakeoffInit.png|After bungee takeoff initialization&lt;br /&gt;
Image:BungeeTakeoffThrottleOn.png|After crossing the throttle line&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Polygon Survey ==&lt;br /&gt;
=== Explanation ===&lt;br /&gt;
With this navigation routine, an aircraft can survey the area of any [http://en.wikipedia.org/wiki/Convex_polygon convex polygon] given an entry point, the number of waypoints which define the polygon, the sweep width and the desired orientation of the sweeps.&lt;br /&gt;
&lt;br /&gt;
The entry point is the first corner of the polygon and the point at which the aircraft will begin surveying the area. When in the entry state, the aircraft will circle around the entry point in order to smoothly transition into the first sweep. The aircraft will also keep circling around the entry point until it gets to the waypoint altitude. After the first sweep is made, the direction of the next sweep is determined by the distance of the entry point to the edges of the polygon. If there is more area above the first sweep, the aircraft will sweep up. If there is more area below the first sweep, the aircraft will sweep down.&lt;br /&gt;
&lt;br /&gt;
The aircraft will keep sweeping back and forth until it reaches the end of the polygon. At this point, the aircraft will sweep back up/down the polygon halfway in between the sweeps previously made by the aircraft (just like the rectangle survey function). The aircraft will keep sweeping up and down the polygon unless the user manually exits the block or unless an exception is used ([[#Exceptions|see below]]).&lt;br /&gt;
&lt;br /&gt;
The orientation of the sweeps can ranges from north south to east west and any where in between (-90 &amp;lt;-&amp;gt; 90 degrees respectively). The side of the polygon the aircraft starts on (ex. north or south)  is determined by the side of the polygon the entry point is located.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:PolySurveySweepDef.png|Sweep Definition&lt;br /&gt;
Image:PolySurveyEntryPic.png|Entry Point&lt;br /&gt;
Image:PolySurveySweepBack.png|Sweeping Back&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Implementation ====&lt;br /&gt;
&lt;br /&gt;
You can add this navigation routine in your flight plan like so... &lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Poly Survey&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;InitializePolygonSurvey(WP_S1, NumOfCorners, SweepWidth, Orientation)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;PolygonSurvey()&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The parameters are the entry waypoint, the number of waypoints in the polygon, the sweep width (meters), and the desired orientation of the sweeps (degrees). The maximum number of waypoints a polygon can have is currently ten (can be changed in the code). If the number of waypoints in the polygon exceeds the maximum number, the routine will exit and move to the next block in the flight plan. The routine will also exit if the orientation is not between -90 and 90 degrees.&lt;br /&gt;
&lt;br /&gt;
Here is an example of how you should declare each of the corners of the polygon.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;waypoint alt=&amp;quot;1453.0&amp;quot; name=&amp;quot;S1&amp;quot; x=&amp;quot;-546.2&amp;quot; y=&amp;quot;297.4&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;waypoint alt=&amp;quot;1453.0&amp;quot; name=&amp;quot;S2&amp;quot; x=&amp;quot;-129.8&amp;quot; y=&amp;quot;744.1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;waypoint alt=&amp;quot;1553.0&amp;quot; name=&amp;quot;S3&amp;quot; x=&amp;quot;1030.5&amp;quot; y=&amp;quot;535.5&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;waypoint alt=&amp;quot;1453.0&amp;quot; name=&amp;quot;S4&amp;quot; x=&amp;quot;523.0&amp;quot; y=&amp;quot;-236.7&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;waypoint alt=&amp;quot;1453.0&amp;quot; name=&amp;quot;S5&amp;quot; x=&amp;quot;-285.9&amp;quot; y=&amp;quot;-255.7&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
S1 is the entry waypoint and the first corner. The other corners should be in order clockwise or counter clockwise around the polygon. Even though this group of waypoints must be declared together, where the group appears in the list of waypoints doesn't matter.&lt;br /&gt;
&lt;br /&gt;
If you want the edges of the polygon to show up on the GCS, you can also declare the polygon as a sector. This is not required to run the routine.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;sectors&amp;gt;&lt;br /&gt;
    &amp;lt;sector name=&amp;quot;PolySector&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;S1&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;S2&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;S3&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;S4&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;S5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/sector&amp;gt;&lt;br /&gt;
  &amp;lt;/sectors&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;A Range of Different Sweep Orientations&amp;quot;&amp;gt;&lt;br /&gt;
Image:PolySurvey0DegreeEx.png|0 Degrees&lt;br /&gt;
Image:PolySurvey30DegreeEx.png|30 Degrees&lt;br /&gt;
Image:PolySurvey65DegreeEx.png|65 Degrees&lt;br /&gt;
Image:PolySurvey90DegreeEx.png|90 Degrees&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Alternative configurations ====&lt;br /&gt;
&lt;br /&gt;
If you are wanting to start and stop the Poly Survey this is possible by splitting the Poly Survey code above into the initialization routine and the execution routine. You might want to do this if you are searching for something inside the Poly Survey, think you have found it and then realized you haven't, so you want to continue the survey (not restart it). Using the example above, but with the initialisation and execution code separate:&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Init Poly Survey&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;InitializePolygonSurvey(WP_S1, NumOfCorners, SweepWidth, Orientation)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Execute Poly Survey&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;PolygonSurvey()&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Exceptions ====&lt;br /&gt;
There are a couple of built in variables which can be used to exit the routine with an exception. PolySurveySweepNum gives the number of sweeps the aircraft has made and PolySurveySweepBackNum gives the number of times the aircraft has gotten to the bottom of the polygon and swept back. The first example would deroute the aircraft to standby after the aircraft made it's second sweep. The second example would deroute the aircraft to standby before it starts to sweep back up the polygon for the first time.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Poly Survey&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;exception cond=&amp;quot;PolySurveySweepNum &amp;gt;= 2&amp;quot; deroute=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;InitializePolygonSurvey(WP_S1, 5, 200, 45)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;PolygonSurvey()&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Poly Survey&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;exception cond=&amp;quot;PolySurveySweepBackNum &amp;gt;= 1&amp;quot; deroute=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;InitializePolygonSurvey(WP_S1, 5, 200, 45)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;PolygonSurvey()&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Flight Line ===&lt;br /&gt;
The Flight Line Routine allows the user to map/follow one dimensional areas of interest like roads and rivers. Given two waypoints, the routine will automatically transition into the flight line to ensure full coverage between the waypoints. In addition, distances before and after the flight line can be used to add extra security to the coverage.&lt;br /&gt;
&lt;br /&gt;
[[Image:OSAMFlightLineDiagram.png|Flight Line Diagram]]&lt;br /&gt;
&lt;br /&gt;
To use this navigation routine, you need to include OSAMNav.h in your flight plan and OSAMNav.c to your airframe file. Then add this navigation routine in your flight plan like so... &lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Map River&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;FlightLine(WP_R1,WP_R2,nav_radius,distance_before,distance_after)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Multiple flight lines can be daisy chained by reusing waypoints as shown below...&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Map River&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;FlightLine(WP_R1,WP_R2,nav_radius,100,100)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;FlightLine(WP_R2,WP_R3,nav_radius,100,100)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;FlightLine(WP_R3,WP_R4,nav_radius,100,100)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;FlightLine(WP_R5,WP_R6,nav_radius,100,100)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;deroute block=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
However, the previous block can also be implemented using the FlightLineBlock function. The FlightLineBlock function works the same as the FlightLine function except it automatically steps through the waypoints between the given waypoints. Make sure the waypoints are declared in order or else it won't work!&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;block name=&amp;quot;Map River&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;FlightLineBlock(WP_R1,WP_R6,nav_radius,100,100)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;deroute block=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:OSAMFlightLineExample.jpg |Multiple Flight Line Example&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== misc ==&lt;br /&gt;
&lt;br /&gt;
=== Border line ===&lt;br /&gt;
&lt;br /&gt;
border_line is a nav-routine pretty similar to the nav-line-routine. You can use this nav-routine whenever you want to take care your plane stays on a defined site of a border.&lt;br /&gt;
For example you can use this routine to fly along a mountain and always turn away from the mountain ridge wall. Or use it fly along a border road without penetrating the other side of the border.&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;extra&amp;quot; navigation subsystem with:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;subsystem name=&amp;quot;navigation&amp;quot; type=&amp;quot;extra&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to use waypoint 1 and 2 you can add border_line in your flight plan like this:&lt;br /&gt;
* Include header in &amp;quot;header&amp;quot; section at the beginning&lt;br /&gt;
 #include &amp;quot;subsystems/navigation/border_line.h&amp;quot;&lt;br /&gt;
* Add function in a flight plan block:&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;block group=&amp;quot;extra_pattern&amp;quot; name=&amp;quot;border line&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;border_line_init()&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;border_line(WP_1, WP_2, -nav_radius)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;example&amp;quot;&amp;gt;&lt;br /&gt;
Image:border_line.png|Screen shot of border_line&lt;br /&gt;
Image:border_line2.png|Screen shot of border_line2&lt;br /&gt;
Image:border_line3.png|Screen shot of border_line3&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== GLS ===&lt;br /&gt;
&lt;br /&gt;
GLS or  '''G'''lobal Navigation Satellite System (GNSS) '''L'''anding '''S'''ystem adds advanced landing functions to your flightplan&lt;br /&gt;
&lt;br /&gt;
It add the following capabilities:&lt;br /&gt;
&lt;br /&gt;
# Fly via defined glide path angle&lt;br /&gt;
# In flight changeable landing direction without loosing the glide path angle!&lt;br /&gt;
# Smooth intercept, independent of approach angle or wind&lt;br /&gt;
# Separation of '''a'''pproach '''f'''ix, '''s'''tart '''d'''ecent and '''t'''op '''o'''f '''d'''ecent&lt;br /&gt;
# With fixed target speed (in airspeed mode only)&lt;br /&gt;
&lt;br /&gt;
====GLS related abbreviations====&lt;br /&gt;
&lt;br /&gt;
* GLS = '''G'''lobal Navigation Satellite System (GNSS) '''L'''anding '''S'''ystem&lt;br /&gt;
* TOD = '''t'''op '''o'''f '''d'''ecent&lt;br /&gt;
* AF  = '''A'''pproach '''Fix'''&lt;br /&gt;
* SD  = '''S'''tart '''D'''ecend&lt;br /&gt;
* TD  = '''T'''ouch '''D'''own point, The spot where the plane should touch the ground for landing&lt;br /&gt;
&lt;br /&gt;
====Configure====&lt;br /&gt;
&lt;br /&gt;
What to add to your airframe.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;GLS_APPROACH&amp;quot; prefix=&amp;quot;APP_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ANGLE&amp;quot; value=&amp;quot;5&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;INTERCEPT_RATE&amp;quot; value=&amp;quot;0.624&amp;quot; unit=&amp;quot;m/s/s&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DISTANCE_AF_SD&amp;quot; value=&amp;quot;20&amp;quot; unit=&amp;quot;m&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TARGET_SPEED&amp;quot; value=&amp;quot;14&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ANGLE                   - angle from TOD to TD&lt;br /&gt;
&lt;br /&gt;
DISTANCE_AF_SD  - minimum distance (meter) between AF and SD to allow the plane to self stabilize before the intercept starts (e.g. for speed reduction)&lt;br /&gt;
&lt;br /&gt;
You can set the landing direction by moving the approach fix (AF) in relation to the touch down point (TD).&lt;br /&gt;
If you try to set the AF close to the TD  you will see how the top of decent (TOD) and start decent (SD) is calculated and if necessary the AF is moved backwards.&lt;br /&gt;
(please try in simulation)&lt;br /&gt;
&lt;br /&gt;
TARGET_SPEED      - desired airspeed from AF to TD &lt;br /&gt;
&lt;br /&gt;
INTERCEPT_RATE   -&lt;br /&gt;
&lt;br /&gt;
e.g. no wind: TARGET_SPEED = 14m/s and ANGLE = 10 --&amp;gt; desired decent rate 2.5 m/s    (speed * tan(ANGLE))&lt;br /&gt;
&lt;br /&gt;
with an INTERCEPT_RATE of 0.624 m/s/s it will take 4s to intercept the final approach path (desired decent rate / intercept_rate)&lt;br /&gt;
&lt;br /&gt;
the idea is that the INTERCEPT_RATE is unique to each plane and will not change with different approach angles&lt;br /&gt;
&lt;br /&gt;
to find an appropriate value you can start with a lower (to match 8s for example) and increase it until the intercept will be made from above&lt;br /&gt;
&lt;br /&gt;
in general: bigger plane - smaller value!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
how to setup your flightplan.xml:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;waypoints&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint height=&amp;quot;150&amp;quot; name=&amp;quot;AF&amp;quot; x=&amp;quot;-260.6&amp;quot; y=&amp;quot;-344.6&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;SD&amp;quot; x=&amp;quot;-1600.&amp;quot; y=&amp;quot;-36.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;TOD&amp;quot; x=&amp;quot;-1600.&amp;quot; y=&amp;quot;-36.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint height=&amp;quot;0.0&amp;quot; name=&amp;quot;TD&amp;quot; x=&amp;quot;-27.2&amp;quot; y=&amp;quot;-243.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint height=&amp;quot;266.0&amp;quot; name=&amp;quot;_BASELEG&amp;quot; x=&amp;quot;-1652.1&amp;quot; y=&amp;quot;-113.5&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;block name=&amp;quot;land&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;gls_init(WP_AF,WP_SD, WP_TOD, WP_TD)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle radius=&amp;quot;nav_radius&amp;quot; until=&amp;quot;NavCircleCount() &amp;gt; 0.5&amp;quot; wp=&amp;quot;_BASELEG&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle radius=&amp;quot;nav_radius&amp;quot; until=&amp;quot;And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-(nav_radius/fabs(nav_radius))*10),&lt;br /&gt;
                               10 &amp;gt; fabs(GetPosAlt() - WaypointAlt(WP__BASELEG)))&amp;quot; wp=&amp;quot;_BASELEG&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;block name=&amp;quot;final&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;exception cond=&amp;quot;ground_alt + 10 &amp;gt; estimator_z&amp;quot; deroute=&amp;quot;flare&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;gls(WP_AF,WP_SD, WP_TOD, WP_TD)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
those pictures match the old gls routine! anyway - the new one is not much different... (POS I = SD)&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;theory&amp;quot;&amp;gt;&lt;br /&gt;
Image:gls1.png|side view&lt;br /&gt;
Image:gls2.png|from above&lt;br /&gt;
Image:gls3.png|screen shot of flight test&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multi-UAV ==&lt;br /&gt;
For TCAS (Traffic Collision Avoidance System) see the [[MultiUAV]] page.&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:Navigation]] [[Category:User_Documentation]]&lt;br /&gt;
&lt;br /&gt;
= Create a navigation module =&lt;br /&gt;
&lt;br /&gt;
Creating a navigation module is not to complex. Have said that, it is not very likely to need to create one module oneself. The already available functions are very flexible and powerful. Before you set of to create and additional navigation module, make sure you understand all current modules and their capabilities. After you investigated current modules and came to the conclusion, there is no way to solve you flightplan mission by creating a new module, go ahead and plz share your work with the community. The more people test the new module, the faster it will reach a stable state.&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Advanced_Navigation_Routines&amp;diff=23361</id>
		<title>Advanced Navigation Routines</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Advanced_Navigation_Routines&amp;diff=23361"/>
		<updated>2016-10-27T15:47:20Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: xml box code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
The flight plan standard navigation functions are very flexible. However sometimes one needs to perform a very specific task, and the basic functions are not enough to accomplish a special mission. In that case you can use additional modules functions in the flight plan. By adding a navigation capability to your airframe. The flight plan now has extra functionality that can be used.&lt;br /&gt;
&lt;br /&gt;
= Available navigation modules =&lt;br /&gt;
&lt;br /&gt;
==  Navigation Routines (Prev.OSAM) ==&lt;br /&gt;
&lt;br /&gt;
Thanks to Team OSAM's contribution these navigation capabilities have been added.&lt;br /&gt;
&lt;br /&gt;
To use these navigation routines, you need to change the navigation subsystem type to extra in your airframe file. The navigation extra subsystem includes extra navigation routines like OSAMnav, spiral, poly_survey_advanced, nav_cube, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;subsystem name=&amp;quot;navigation&amp;quot; type=&amp;quot;extra&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also include OSAMNav.h in your flight plan:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 #include &amp;quot;subsystems/navigation/OSAMNav.h&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Flower ==&lt;br /&gt;
[[Image:FlowerScreenShot.png|thumb|Screen shot of flower routine]]&lt;br /&gt;
The flower navigation routine flies the aircraft in a flower pattern defined by two waypoints. The center waypoint defines the center of the flower and the altitude the plane flies at. The edge waypoint defines the radius of the flower.&lt;br /&gt;
&lt;br /&gt;
In our example the waypoints are called &amp;quot;Center&amp;quot; and &amp;quot;Edge&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;Center&amp;quot; x=&amp;quot;-20.0&amp;quot; y=&amp;quot;-160.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;Edge&amp;quot; x=&amp;quot;-10.0&amp;quot; y=&amp;quot;-60.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then you can add flower to your flight plan:&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;block name=&amp;quot;Flower&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;call fun=&amp;quot;InitializeFlower(WP_Center,WP_Edge)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;call fun=&amp;quot;FlowerNav()&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Note that in the function InitializeFlower the waypoints need the prefix &amp;quot;WP_&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Bungee Takeoff ==&lt;br /&gt;
&lt;br /&gt;
The bungee takeoff routine helps to automate takeoff by turning the throttle on after the bungee has been release from the hook. The only waypoint you need for this routine is the position of where the bungee is pegged to the ground. Using this waypoint, a line is drawn from the position of the aircraft to the bungee waypoint. This line is called the launch line and will stop updating once the speed of the plane exceeds the MinSpeed. This allows the user to initialize the routine, move the plane and launch it without having to reinitialize. Once the plane is launched, it will follow the launch line until it crosses the throttle line. The throttle line is a line perpendicular to the launch line at a distance d from the bungee waypoint (see the diagram below). When the plane crosses the throttle line and the speed of the aircraft is greater than MinSpeed, the throttle comes on. After the throttle comes on, the plane keeps going straight until it reaches a specified speed and altitude above the bungee waypoint altitude. When it reaches the takeoff speed and takeoff altitude, the next block in the flight plan is executed. The takeoff speed, takeoff altitude, MinSpeed and the distance d from the bungee waypoint are specified in the airframe file. You will need to add those values to your airframe file like this...&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;Takeoff&amp;quot; prefix=&amp;quot;Takeoff_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;Height&amp;quot; value=&amp;quot;30&amp;quot; unit=&amp;quot;m&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;Speed&amp;quot; value=&amp;quot;15&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;Distance&amp;quot; value=&amp;quot;3&amp;quot; unit=&amp;quot;m&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MinSpeed&amp;quot; value=&amp;quot;5&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;    &lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
You can add the bungee takeoff routine to your flight plan like so...&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;block name=&amp;quot;Takeoff&amp;quot; strip_button=&amp;quot;Takeoff (wp CLIMB)&amp;quot; strip_icon=&amp;quot;takeoff.png&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;call fun=&amp;quot;InitializeBungeeTakeoff(WP_Bungee)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;call fun=&amp;quot;BungeeTakeoff()&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To get this routine to work consistently, you will need to tune the values in the airframe config file. If the prop doesn't automatically turn on when it crosses the throttle line, it could be because the Distance and/or the MinSpeed are too big. If it turns on to early, it could be because the Distance and/or MinSpeed are too small. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt; ***Precaution should be taken while tuning the auto takeoff with electrical plane. If the MinSpeed is too low, the prop could turn on while holding the aircraft!***&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:BungeeTakeoffDiagram.png|Bungee takeoff diagram&lt;br /&gt;
Image:BungeeTakeoffInit.png|After bungee takeoff initialization&lt;br /&gt;
Image:BungeeTakeoffThrottleOn.png|After crossing the throttle line&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Polygon Survey ==&lt;br /&gt;
=== Explanation ===&lt;br /&gt;
With this navigation routine, an aircraft can survey the area of any [http://en.wikipedia.org/wiki/Convex_polygon convex polygon] given an entry point, the number of waypoints which define the polygon, the sweep width and the desired orientation of the sweeps.&lt;br /&gt;
&lt;br /&gt;
The entry point is the first corner of the polygon and the point at which the aircraft will begin surveying the area. When in the entry state, the aircraft will circle around the entry point in order to smoothly transition into the first sweep. The aircraft will also keep circling around the entry point until it gets to the waypoint altitude. After the first sweep is made, the direction of the next sweep is determined by the distance of the entry point to the edges of the polygon. If there is more area above the first sweep, the aircraft will sweep up. If there is more area below the first sweep, the aircraft will sweep down.&lt;br /&gt;
&lt;br /&gt;
The aircraft will keep sweeping back and forth until it reaches the end of the polygon. At this point, the aircraft will sweep back up/down the polygon halfway in between the sweeps previously made by the aircraft (just like the rectangle survey function). The aircraft will keep sweeping up and down the polygon unless the user manually exits the block or unless an exception is used ([[#Exceptions|see below]]).&lt;br /&gt;
&lt;br /&gt;
The orientation of the sweeps can ranges from north south to east west and any where in between (-90 &amp;lt;-&amp;gt; 90 degrees respectively). The side of the polygon the aircraft starts on (ex. north or south)  is determined by the side of the polygon the entry point is located.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:PolySurveySweepDef.png|Sweep Definition&lt;br /&gt;
Image:PolySurveyEntryPic.png|Entry Point&lt;br /&gt;
Image:PolySurveySweepBack.png|Sweeping Back&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Implementation ====&lt;br /&gt;
&lt;br /&gt;
You can add this navigation routine in your flight plan like so... &lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Poly Survey&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;InitializePolygonSurvey(WP_S1, NumOfCorners, SweepWidth, Orientation)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;PolygonSurvey()&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The parameters are the entry waypoint, the number of waypoints in the polygon, the sweep width (meters), and the desired orientation of the sweeps (degrees). The maximum number of waypoints a polygon can have is currently ten (can be changed in the code). If the number of waypoints in the polygon exceeds the maximum number, the routine will exit and move to the next block in the flight plan. The routine will also exit if the orientation is not between -90 and 90 degrees.&lt;br /&gt;
&lt;br /&gt;
Here is an example of how you should declare each of the corners of the polygon.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;waypoint alt=&amp;quot;1453.0&amp;quot; name=&amp;quot;S1&amp;quot; x=&amp;quot;-546.2&amp;quot; y=&amp;quot;297.4&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;waypoint alt=&amp;quot;1453.0&amp;quot; name=&amp;quot;S2&amp;quot; x=&amp;quot;-129.8&amp;quot; y=&amp;quot;744.1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;waypoint alt=&amp;quot;1553.0&amp;quot; name=&amp;quot;S3&amp;quot; x=&amp;quot;1030.5&amp;quot; y=&amp;quot;535.5&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;waypoint alt=&amp;quot;1453.0&amp;quot; name=&amp;quot;S4&amp;quot; x=&amp;quot;523.0&amp;quot; y=&amp;quot;-236.7&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;waypoint alt=&amp;quot;1453.0&amp;quot; name=&amp;quot;S5&amp;quot; x=&amp;quot;-285.9&amp;quot; y=&amp;quot;-255.7&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
S1 is the entry waypoint and the first corner. The other corners should be in order clockwise or counter clockwise around the polygon. Even though this group of waypoints must be declared together, where the group appears in the list of waypoints doesn't matter.&lt;br /&gt;
&lt;br /&gt;
If you want the edges of the polygon to show up on the GCS, you can also declare the polygon as a sector. This is not required to run the routine.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;sectors&amp;gt;&lt;br /&gt;
    &amp;lt;sector name=&amp;quot;PolySector&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;S1&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;S2&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;S3&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;S4&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;S5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/sector&amp;gt;&lt;br /&gt;
  &amp;lt;/sectors&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;A Range of Different Sweep Orientations&amp;quot;&amp;gt;&lt;br /&gt;
Image:PolySurvey0DegreeEx.png|0 Degrees&lt;br /&gt;
Image:PolySurvey30DegreeEx.png|30 Degrees&lt;br /&gt;
Image:PolySurvey65DegreeEx.png|65 Degrees&lt;br /&gt;
Image:PolySurvey90DegreeEx.png|90 Degrees&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Alternative configurations ====&lt;br /&gt;
&lt;br /&gt;
If you are wanting to start and stop the Poly Survey this is possible by splitting the Poly Survey code above into the initialization routine and the execution routine. You might want to do this if you are searching for something inside the Poly Survey, think you have found it and then realized you haven't, so you want to continue the survey (not restart it). Using the example above, but with the initialisation and execution code separate:&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Init Poly Survey&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;InitializePolygonSurvey(WP_S1, NumOfCorners, SweepWidth, Orientation)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Execute Poly Survey&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;PolygonSurvey()&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Exceptions ====&lt;br /&gt;
There are a couple of built in variables which can be used to exit the routine with an exception. PolySurveySweepNum gives the number of sweeps the aircraft has made and PolySurveySweepBackNum gives the number of times the aircraft has gotten to the bottom of the polygon and swept back. The first example would deroute the aircraft to standby after the aircraft made it's second sweep. The second example would deroute the aircraft to standby before it starts to sweep back up the polygon for the first time.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Poly Survey&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;exception cond=&amp;quot;PolySurveySweepNum &amp;gt;= 2&amp;quot; deroute=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;InitializePolygonSurvey(WP_S1, 5, 200, 45)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;PolygonSurvey()&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Poly Survey&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;exception cond=&amp;quot;PolySurveySweepBackNum &amp;gt;= 1&amp;quot; deroute=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;InitializePolygonSurvey(WP_S1, 5, 200, 45)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;PolygonSurvey()&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Flight Line ===&lt;br /&gt;
The Flight Line Routine allows the user to map/follow one dimensional areas of interest like roads and rivers. Given two waypoints, the routine will automatically transition into the flight line to ensure full coverage between the waypoints. In addition, distances before and after the flight line can be used to add extra security to the coverage.&lt;br /&gt;
&lt;br /&gt;
[[Image:OSAMFlightLineDiagram.png|Flight Line Diagram]]&lt;br /&gt;
&lt;br /&gt;
To use this navigation routine, you need to include OSAMNav.h in your flight plan and OSAMNav.c to your airframe file. Then add this navigation routine in your flight plan like so... &lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Map River&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;FlightLine(WP_R1,WP_R2,nav_radius,distance_before,distance_after)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Multiple flight lines can be daisy chained by reusing waypoints as shown below...&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Map River&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;FlightLine(WP_R1,WP_R2,nav_radius,100,100)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;FlightLine(WP_R2,WP_R3,nav_radius,100,100)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;FlightLine(WP_R3,WP_R4,nav_radius,100,100)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;FlightLine(WP_R5,WP_R6,nav_radius,100,100)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;deroute block=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
However, the previous block can also be implemented using the FlightLineBlock function. The FlightLineBlock function works the same as the FlightLine function except it automatically steps through the waypoints between the given waypoints. Make sure the waypoints are declared in order or else it won't work!&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;block name=&amp;quot;Map River&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;FlightLineBlock(WP_R1,WP_R6,nav_radius,100,100)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;deroute block=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:OSAMFlightLineExample.jpg |Multiple Flight Line Example&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== misc ==&lt;br /&gt;
&lt;br /&gt;
=== Border line ===&lt;br /&gt;
&lt;br /&gt;
border_line is a nav-routine pretty similar to the nav-line-routine. You can use this nav-routine whenever you want to take care your plane stays on a defined site of a border.&lt;br /&gt;
For example you can use this routine to fly along a mountain and always turn away from the mountain ridge wall. Or use it fly along a border road without penetrating the other side of the border.&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;extra&amp;quot; navigation subsystem with:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;subsystem name=&amp;quot;navigation&amp;quot; type=&amp;quot;extra&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to use waypoint 1 and 2 you can add border_line in your flight plan like this:&lt;br /&gt;
* Include header in &amp;quot;header&amp;quot; section at the beginning&lt;br /&gt;
 #include &amp;quot;subsystems/navigation/border_line.h&amp;quot;&lt;br /&gt;
* Add function in a flight plan block:&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;block group=&amp;quot;extra_pattern&amp;quot; name=&amp;quot;border line&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;border_line_init()&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;border_line(WP_1, WP_2, -nav_radius)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;example&amp;quot;&amp;gt;&lt;br /&gt;
Image:border_line.png|Screen shot of border_line&lt;br /&gt;
Image:border_line2.png|Screen shot of border_line2&lt;br /&gt;
Image:border_line3.png|Screen shot of border_line3&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== GLS ===&lt;br /&gt;
&lt;br /&gt;
GLS or  '''G'''lobal Navigation Satellite System (GNSS) '''L'''anding '''S'''ystem adds advanced landing functions to your flightplan&lt;br /&gt;
&lt;br /&gt;
It add the following capabilities:&lt;br /&gt;
&lt;br /&gt;
# Fly via defined glide path angle&lt;br /&gt;
# In flight changeable landing direction without loosing the glide path angle!&lt;br /&gt;
# Smooth intercept, independent of approach angle or wind&lt;br /&gt;
# Separation of '''a'''pproach '''f'''ix, '''s'''tart '''d'''ecent and '''t'''op '''o'''f '''d'''ecent&lt;br /&gt;
# With fixed target speed (in airspeed mode only)&lt;br /&gt;
&lt;br /&gt;
====GLS related abbreviations====&lt;br /&gt;
&lt;br /&gt;
* GLS = '''G'''lobal Navigation Satellite System (GNSS) '''L'''anding '''S'''ystem&lt;br /&gt;
* TOD = '''t'''op '''o'''f '''d'''ecent&lt;br /&gt;
* AF  = '''A'''pproach '''Fix'''&lt;br /&gt;
* SD  = '''S'''tart '''D'''ecend&lt;br /&gt;
* TD  = '''T'''ouch '''D'''own point, The spot where the plane should touch the ground for landing&lt;br /&gt;
&lt;br /&gt;
====Configure====&lt;br /&gt;
&lt;br /&gt;
What to add to your airframe.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;section name=&amp;quot;GLS_APPROACH&amp;quot; prefix=&amp;quot;APP_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ANGLE&amp;quot; value=&amp;quot;5&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;INTERCEPT_RATE&amp;quot; value=&amp;quot;0.624&amp;quot; unit=&amp;quot;m/s/s&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DISTANCE_AF_SD&amp;quot; value=&amp;quot;20&amp;quot; unit=&amp;quot;m&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TARGET_SPEED&amp;quot; value=&amp;quot;14&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ANGLE                   - angle from TOD to TD&lt;br /&gt;
&lt;br /&gt;
DISTANCE_AF_SD  - minimum distance (meter) between AF and SD to allow the plane to self stabilize before the intercept starts (e.g. for speed reduction)&lt;br /&gt;
&lt;br /&gt;
You can set the landing direction by moving the approach fix (AF) in relation to the touch down point (TD).&lt;br /&gt;
If you try to set the AF close to the TD  you will see how the top of decent (TOD) and start decent (SD) is calculated and if necessary the AF is moved backwards.&lt;br /&gt;
(please try in simulation)&lt;br /&gt;
&lt;br /&gt;
TARGET_SPEED      - desired airspeed from AF to TD &lt;br /&gt;
&lt;br /&gt;
INTERCEPT_RATE   -&lt;br /&gt;
&lt;br /&gt;
e.g. no wind: TARGET_SPEED = 14m/s and ANGLE = 10 --&amp;gt; desired decent rate 2.5 m/s    (speed * tan(ANGLE))&lt;br /&gt;
&lt;br /&gt;
with an INTERCEPT_RATE of 0.624 m/s/s it will take 4s to intercept the final approach path (desired decent rate / intercept_rate)&lt;br /&gt;
&lt;br /&gt;
the idea is that the INTERCEPT_RATE is unique to each plane and will not change with different approach angles&lt;br /&gt;
&lt;br /&gt;
to find an appropriate value you can start with a lower (to match 8s for example) and increase it until the intercept will be made from above&lt;br /&gt;
&lt;br /&gt;
in general: bigger plane - smaller value!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
how to setup your flightplan.xml:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;waypoints&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint height=&amp;quot;150&amp;quot; name=&amp;quot;AF&amp;quot; x=&amp;quot;-260.6&amp;quot; y=&amp;quot;-344.6&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;SD&amp;quot; x=&amp;quot;-1600.&amp;quot; y=&amp;quot;-36.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;TOD&amp;quot; x=&amp;quot;-1600.&amp;quot; y=&amp;quot;-36.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint height=&amp;quot;0.0&amp;quot; name=&amp;quot;TD&amp;quot; x=&amp;quot;-27.2&amp;quot; y=&amp;quot;-243.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint height=&amp;quot;266.0&amp;quot; name=&amp;quot;_BASELEG&amp;quot; x=&amp;quot;-1652.1&amp;quot; y=&amp;quot;-113.5&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;block name=&amp;quot;land&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;gls_init(WP_AF,WP_SD, WP_TOD, WP_TD)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle radius=&amp;quot;nav_radius&amp;quot; until=&amp;quot;NavCircleCount() &amp;gt; 0.5&amp;quot; wp=&amp;quot;_BASELEG&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle radius=&amp;quot;nav_radius&amp;quot; until=&amp;quot;And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-(nav_radius/fabs(nav_radius))*10),&lt;br /&gt;
                               10 &amp;gt; fabs(GetPosAlt() - WaypointAlt(WP__BASELEG)))&amp;quot; wp=&amp;quot;_BASELEG&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;block name=&amp;quot;final&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;exception cond=&amp;quot;ground_alt + 10 &amp;gt; estimator_z&amp;quot; deroute=&amp;quot;flare&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;gls(WP_AF,WP_SD, WP_TOD, WP_TD)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
those pictures match the old gls routine! anyway - the new one is not much different... (POS I = SD)&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;theory&amp;quot;&amp;gt;&lt;br /&gt;
Image:gls1.png|side view&lt;br /&gt;
Image:gls2.png|from above&lt;br /&gt;
Image:gls3.png|screen shot of flight test&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multi-UAV ==&lt;br /&gt;
For TCAS (Traffic Collision Avoidance System) see the [[MultiUAV]] page.&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:Navigation]] [[Category:User_Documentation]]&lt;br /&gt;
&lt;br /&gt;
= Create a navigation module =&lt;br /&gt;
&lt;br /&gt;
Creating a navigation module is not to complex. Have said that, it is not very likely to need to create one module oneself. The already available functions are very flexible and powerful. Before you set of to create and additional navigation module, make sure you understand all current modules and their capabilities. After you investigated current modules and came to the conclusion, there is no way to solve you flightplan mission by creating a new module, go ahead and plz share your work with the community. The more people test the new module, the faster it will reach a stable state.&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Advanced_Navigation_Routines&amp;diff=23360</id>
		<title>Advanced Navigation Routines</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Advanced_Navigation_Routines&amp;diff=23360"/>
		<updated>2016-10-27T15:30:29Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: /* Flower */ xml box code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
The flight plan standard navigation functions are very flexible. However sometimes one needs to perform a very specific task, and the basic functions are not enough to accomplish a special mission. In that case you can use additional modules functions in the flight plan. By adding a navigation capability to your airframe. The flight plan now has extra functionality that can be used.&lt;br /&gt;
&lt;br /&gt;
= Available navigation modules =&lt;br /&gt;
&lt;br /&gt;
==  Navigation Routines (Prev.OSAM) ==&lt;br /&gt;
&lt;br /&gt;
Thanks to Team OSAM's contribution these navigation capabilities have been added.&lt;br /&gt;
&lt;br /&gt;
To use these navigation routines, you need to change the navigation subsystem type to extra in your airframe file. The navigation extra subsystem includes extra navigation routines like OSAMnav, spiral, poly_survey_advanced, nav_cube, etc.&lt;br /&gt;
 &amp;lt;subsystem name=&amp;quot;navigation&amp;quot; type=&amp;quot;extra&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also include OSAMNav.h in your flight plan:&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;subsystems/navigation/OSAMNav.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Flower ==&lt;br /&gt;
[[Image:FlowerScreenShot.png|thumb|Screen shot of flower routine]]&lt;br /&gt;
The flower navigation routine flies the aircraft in a flower pattern defined by two waypoints. The center waypoint defines the center of the flower and the altitude the plane flies at. The edge waypoint defines the radius of the flower.&lt;br /&gt;
&lt;br /&gt;
In our example the waypoints are called &amp;quot;Center&amp;quot; and &amp;quot;Edge&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;Center&amp;quot; x=&amp;quot;-20.0&amp;quot; y=&amp;quot;-160.0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;waypoint name=&amp;quot;Edge&amp;quot; x=&amp;quot;-10.0&amp;quot; y=&amp;quot;-60.0&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Then you can add flower to your flight plan:&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/flight_plans/myflightplan.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;block name=&amp;quot;Flower&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;call fun=&amp;quot;InitializeFlower(WP_Center,WP_Edge)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;call fun=&amp;quot;FlowerNav()&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Note that in the function InitializeFlower the waypoints need the prefix &amp;quot;WP_&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Bungee Takeoff ==&lt;br /&gt;
&lt;br /&gt;
The bungee takeoff routine helps to automate takeoff by turning the throttle on after the bungee has been release from the hook. The only waypoint you need for this routine is the position of where the bungee is pegged to the ground. Using this waypoint, a line is drawn from the position of the aircraft to the bungee waypoint. This line is called the launch line and will stop updating once the speed of the plane exceeds the MinSpeed. This allows the user to initialize the routine, move the plane and launch it without having to reinitialize. Once the plane is launched, it will follow the launch line until it crosses the throttle line. The throttle line is a line perpendicular to the launch line at a distance d from the bungee waypoint (see the diagram below). When the plane crosses the throttle line and the speed of the aircraft is greater than MinSpeed, the throttle comes on. After the throttle comes on, the plane keeps going straight until it reaches a specified speed and altitude above the bungee waypoint altitude. When it reaches the takeoff speed and takeoff altitude, the next block in the flight plan is executed. The takeoff speed, takeoff altitude, MinSpeed and the distance d from the bungee waypoint are specified in the airframe file. You will need to add those values to your airframe file like this...&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;section name=&amp;quot;Takeoff&amp;quot; prefix=&amp;quot;Takeoff_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;Height&amp;quot; value=&amp;quot;30&amp;quot; unit=&amp;quot;m&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;Speed&amp;quot; value=&amp;quot;15&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;Distance&amp;quot; value=&amp;quot;3&amp;quot; unit=&amp;quot;m&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MinSpeed&amp;quot; value=&amp;quot;5&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;    &lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add the bungee takeoff routine to your flight plan like so...&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;block name=&amp;quot;Takeoff&amp;quot; strip_button=&amp;quot;Takeoff (wp CLIMB)&amp;quot; strip_icon=&amp;quot;takeoff.png&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;call fun=&amp;quot;InitializeBungeeTakeoff(WP_Bungee)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;call fun=&amp;quot;BungeeTakeoff()&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To get this routine to work consistently, you will need to tune the values in the airframe config file. If the prop doesn't automatically turn on when it crosses the throttle line, it could be because the Distance and/or the MinSpeed are too big. If it turns on to early, it could be because the Distance and/or MinSpeed are too small. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#ff0000&amp;quot;&amp;gt; ***Precaution should be taken while tuning the auto takeoff with electrical plane. If the MinSpeed is too low, the prop could turn on while holding the aircraft!***&amp;lt;/span&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:BungeeTakeoffDiagram.png|Bungee takeoff diagram&lt;br /&gt;
Image:BungeeTakeoffInit.png|After bungee takeoff initialization&lt;br /&gt;
Image:BungeeTakeoffThrottleOn.png|After crossing the throttle line&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Polygon Survey ==&lt;br /&gt;
=== Explanation ===&lt;br /&gt;
With this navigation routine, an aircraft can survey the area of any [http://en.wikipedia.org/wiki/Convex_polygon convex polygon] given an entry point, the number of waypoints which define the polygon, the sweep width and the desired orientation of the sweeps.&lt;br /&gt;
&lt;br /&gt;
The entry point is the first corner of the polygon and the point at which the aircraft will begin surveying the area. When in the entry state, the aircraft will circle around the entry point in order to smoothly transition into the first sweep. The aircraft will also keep circling around the entry point until it gets to the waypoint altitude. After the first sweep is made, the direction of the next sweep is determined by the distance of the entry point to the edges of the polygon. If there is more area above the first sweep, the aircraft will sweep up. If there is more area below the first sweep, the aircraft will sweep down.&lt;br /&gt;
&lt;br /&gt;
The aircraft will keep sweeping back and forth until it reaches the end of the polygon. At this point, the aircraft will sweep back up/down the polygon halfway in between the sweeps previously made by the aircraft (just like the rectangle survey function). The aircraft will keep sweeping up and down the polygon unless the user manually exits the block or unless an exception is used ([[#Exceptions|see below]]).&lt;br /&gt;
&lt;br /&gt;
The orientation of the sweeps can ranges from north south to east west and any where in between (-90 &amp;lt;-&amp;gt; 90 degrees respectively). The side of the polygon the aircraft starts on (ex. north or south)  is determined by the side of the polygon the entry point is located.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:PolySurveySweepDef.png|Sweep Definition&lt;br /&gt;
Image:PolySurveyEntryPic.png|Entry Point&lt;br /&gt;
Image:PolySurveySweepBack.png|Sweeping Back&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Implementation ====&lt;br /&gt;
&lt;br /&gt;
You can add this navigation routine in your flight plan like so... &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Poly Survey&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;InitializePolygonSurvey(WP_S1, NumOfCorners, SweepWidth, Orientation)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;PolygonSurvey()&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The parameters are the entry waypoint, the number of waypoints in the polygon, the sweep width (meters), and the desired orientation of the sweeps (degrees). The maximum number of waypoints a polygon can have is currently ten (can be changed in the code). If the number of waypoints in the polygon exceeds the maximum number, the routine will exit and move to the next block in the flight plan. The routine will also exit if the orientation is not between -90 and 90 degrees.&lt;br /&gt;
&lt;br /&gt;
Here is an example of how you should declare each of the corners of the polygon.&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;waypoint alt=&amp;quot;1453.0&amp;quot; name=&amp;quot;S1&amp;quot; x=&amp;quot;-546.2&amp;quot; y=&amp;quot;297.4&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;waypoint alt=&amp;quot;1453.0&amp;quot; name=&amp;quot;S2&amp;quot; x=&amp;quot;-129.8&amp;quot; y=&amp;quot;744.1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;waypoint alt=&amp;quot;1553.0&amp;quot; name=&amp;quot;S3&amp;quot; x=&amp;quot;1030.5&amp;quot; y=&amp;quot;535.5&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;waypoint alt=&amp;quot;1453.0&amp;quot; name=&amp;quot;S4&amp;quot; x=&amp;quot;523.0&amp;quot; y=&amp;quot;-236.7&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;waypoint alt=&amp;quot;1453.0&amp;quot; name=&amp;quot;S5&amp;quot; x=&amp;quot;-285.9&amp;quot; y=&amp;quot;-255.7&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
S1 is the entry waypoint and the first corner. The other corners should be in order clockwise or counter clockwise around the polygon. Even though this group of waypoints must be declared together, where the group appears in the list of waypoints doesn't matter.&lt;br /&gt;
&lt;br /&gt;
If you want the edges of the polygon to show up on the GCS, you can also declare the polygon as a sector. This is not required to run the routine.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;sectors&amp;gt;&lt;br /&gt;
    &amp;lt;sector name=&amp;quot;PolySector&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;S1&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;S2&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;S3&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;S4&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;S5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/sector&amp;gt;&lt;br /&gt;
  &amp;lt;/sectors&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;A Range of Different Sweep Orientations&amp;quot;&amp;gt;&lt;br /&gt;
Image:PolySurvey0DegreeEx.png|0 Degrees&lt;br /&gt;
Image:PolySurvey30DegreeEx.png|30 Degrees&lt;br /&gt;
Image:PolySurvey65DegreeEx.png|65 Degrees&lt;br /&gt;
Image:PolySurvey90DegreeEx.png|90 Degrees&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Alternative configurations ====&lt;br /&gt;
&lt;br /&gt;
If you are wanting to start and stop the Poly Survey this is possible by splitting the Poly Survey code above into the initialization routine and the execution routine. You might want to do this if you are searching for something inside the Poly Survey, think you have found it and then realized you haven't, so you want to continue the survey (not restart it). Using the example above, but with the initialisation and execution code separate:&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Init Poly Survey&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;InitializePolygonSurvey(WP_S1, NumOfCorners, SweepWidth, Orientation)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Execute Poly Survey&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;PolygonSurvey()&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Exceptions ====&lt;br /&gt;
There are a couple of built in variables which can be used to exit the routine with an exception. PolySurveySweepNum gives the number of sweeps the aircraft has made and PolySurveySweepBackNum gives the number of times the aircraft has gotten to the bottom of the polygon and swept back. The first example would deroute the aircraft to standby after the aircraft made it's second sweep. The second example would deroute the aircraft to standby before it starts to sweep back up the polygon for the first time.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Poly Survey&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;exception cond=&amp;quot;PolySurveySweepNum &amp;gt;= 2&amp;quot; deroute=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;InitializePolygonSurvey(WP_S1, 5, 200, 45)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;PolygonSurvey()&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Poly Survey&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;exception cond=&amp;quot;PolySurveySweepBackNum &amp;gt;= 1&amp;quot; deroute=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;InitializePolygonSurvey(WP_S1, 5, 200, 45)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;PolygonSurvey()&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Flight Line ===&lt;br /&gt;
The Flight Line Routine allows the user to map/follow one dimensional areas of interest like roads and rivers. Given two waypoints, the routine will automatically transition into the flight line to ensure full coverage between the waypoints. In addition, distances before and after the flight line can be used to add extra security to the coverage.&lt;br /&gt;
&lt;br /&gt;
[[Image:OSAMFlightLineDiagram.png|Flight Line Diagram]]&lt;br /&gt;
&lt;br /&gt;
To use this navigation routine, you need to include OSAMNav.h in your flight plan and OSAMNav.c to your airframe file. Then add this navigation routine in your flight plan like so... &lt;br /&gt;
&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Map River&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;FlightLine(WP_R1,WP_R2,nav_radius,distance_before,distance_after)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Multiple flight lines can be daisy chained by reusing waypoints as shown below...&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Map River&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;FlightLine(WP_R1,WP_R2,nav_radius,100,100)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;FlightLine(WP_R2,WP_R3,nav_radius,100,100)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;FlightLine(WP_R3,WP_R4,nav_radius,100,100)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;FlightLine(WP_R5,WP_R6,nav_radius,100,100)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;deroute block=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the previous block can also be implemented using the FlightLineBlock function. The FlightLineBlock function works the same as the FlightLine function except it automatically steps through the waypoints between the given waypoints. Make sure the waypoints are declared in order or else it won't work!&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;block name=&amp;quot;Map River&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;FlightLineBlock(WP_R1,WP_R6,nav_radius,100,100)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;deroute block=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:OSAMFlightLineExample.jpg |Multiple Flight Line Example&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== misc ==&lt;br /&gt;
&lt;br /&gt;
=== Border line ===&lt;br /&gt;
&lt;br /&gt;
border_line is a nav-routine pretty similar to the nav-line-routine. You can use this nav-routine whenever you want to take care your plane stays on a defined site of a border.&lt;br /&gt;
For example you can use this routine to fly along a mountain and always turn away from the mountain ridge wall. Or use it fly along a border road without penetrating the other side of the border.&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;extra&amp;quot; navigation subsystem with:&lt;br /&gt;
 &amp;lt;subsystem name=&amp;quot;navigation&amp;quot; type=&amp;quot;extra&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to use waypoint 1 and 2 you can add border_line in your flight plan like this:&lt;br /&gt;
* Include header in &amp;quot;header&amp;quot; section at the beginning&lt;br /&gt;
 #include &amp;quot;subsystems/navigation/border_line.h&amp;quot;&lt;br /&gt;
* Add function in a flight plan block:&lt;br /&gt;
    &amp;lt;block group=&amp;quot;extra_pattern&amp;quot; name=&amp;quot;border line&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;border_line_init()&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;border_line(WP_1, WP_2, -nav_radius)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;example&amp;quot;&amp;gt;&lt;br /&gt;
Image:border_line.png|Screen shot of border_line&lt;br /&gt;
Image:border_line2.png|Screen shot of border_line2&lt;br /&gt;
Image:border_line3.png|Screen shot of border_line3&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== GLS ===&lt;br /&gt;
&lt;br /&gt;
GLS or  '''G'''lobal Navigation Satellite System (GNSS) '''L'''anding '''S'''ystem adds advanced landing functions to your flightplan&lt;br /&gt;
&lt;br /&gt;
It add the following capabilities:&lt;br /&gt;
&lt;br /&gt;
# Fly via defined glide path angle&lt;br /&gt;
# In flight changeable landing direction without loosing the glide path angle!&lt;br /&gt;
# Smooth intercept, independent of approach angle or wind&lt;br /&gt;
# Separation of '''a'''pproach '''f'''ix, '''s'''tart '''d'''ecent and '''t'''op '''o'''f '''d'''ecent&lt;br /&gt;
# With fixed target speed (in airspeed mode only)&lt;br /&gt;
&lt;br /&gt;
====GLS related abbriviations====&lt;br /&gt;
&lt;br /&gt;
* GLS = '''G'''lobal Navigation Satellite System (GNSS) '''L'''anding '''S'''ystem&lt;br /&gt;
* TOD = '''t'''op '''o'''f '''d'''ecent&lt;br /&gt;
* AF  = '''A'''pproach '''Fix'''&lt;br /&gt;
* SD  = '''S'''tart '''D'''ecend&lt;br /&gt;
* TD  = '''T'''ouch '''D'''own point, The spot wherethe plane should touch the ground for landing&lt;br /&gt;
&lt;br /&gt;
====Configure====&lt;br /&gt;
&lt;br /&gt;
What to add to your airframe.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;section name=&amp;quot;GLS_APPROACH&amp;quot; prefix=&amp;quot;APP_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ANGLE&amp;quot; value=&amp;quot;5&amp;quot; unit=&amp;quot;deg&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;INTERCEPT_RATE&amp;quot; value=&amp;quot;0.624&amp;quot; unit=&amp;quot;m/s/s&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;DISTANCE_AF_SD&amp;quot; value=&amp;quot;20&amp;quot; unit=&amp;quot;m&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;TARGET_SPEED&amp;quot; value=&amp;quot;14&amp;quot; unit=&amp;quot;m/s&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
ANGLE                   - angle from TOD to TD&lt;br /&gt;
&lt;br /&gt;
DISTANCE_AF_SD  - minimum distance (meter) between AF and SD to allow the plane to self stabilize before the intercept starts (e.g. for speed reduction)&lt;br /&gt;
&lt;br /&gt;
You can set the landing direction by moving the approach fix (AF) in relation to the touch down point (TD).&lt;br /&gt;
If you try to set the AF close to the TD  you will see how the top of decent (TOD) and start decent (SD) is calculated and if necessary the AF is moved backwards.&lt;br /&gt;
(please try in simulation)&lt;br /&gt;
&lt;br /&gt;
TARGET_SPEED      - desired airspeed from AF to TD &lt;br /&gt;
&lt;br /&gt;
INTERCEPT_RATE   -&lt;br /&gt;
&lt;br /&gt;
e.g. no wind: TARGET_SPEED = 14m/s and ANGLE = 10 --&amp;gt; desired decent rate 2.5 m/s    (speed * tan(ANGLE))&lt;br /&gt;
&lt;br /&gt;
with an INTERCEPT_RATE of 0.624 m/s/s it will take 4s to intercept the final approach path (desired decent rate / intercept_rate)&lt;br /&gt;
&lt;br /&gt;
the idea is that the INTERCEPT_RATE is unique to each plane and will not change with different approach angles&lt;br /&gt;
&lt;br /&gt;
to find an appropriate value you can start with a lower (to match 8s for example) and increase it until the intercept will be made from above&lt;br /&gt;
&lt;br /&gt;
in general: bigger plane - smaller value!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
how to setup your flightplan.xml:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;waypoints&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint height=&amp;quot;150&amp;quot; name=&amp;quot;AF&amp;quot; x=&amp;quot;-260.6&amp;quot; y=&amp;quot;-344.6&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;SD&amp;quot; x=&amp;quot;-1600.&amp;quot; y=&amp;quot;-36.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;TOD&amp;quot; x=&amp;quot;-1600.&amp;quot; y=&amp;quot;-36.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint height=&amp;quot;0.0&amp;quot; name=&amp;quot;TD&amp;quot; x=&amp;quot;-27.2&amp;quot; y=&amp;quot;-243.5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint height=&amp;quot;266.0&amp;quot; name=&amp;quot;_BASELEG&amp;quot; x=&amp;quot;-1652.1&amp;quot; y=&amp;quot;-113.5&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;block name=&amp;quot;land&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;gls_init(WP_AF,WP_SD, WP_TOD, WP_TD)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle radius=&amp;quot;nav_radius&amp;quot; until=&amp;quot;NavCircleCount() &amp;gt; 0.5&amp;quot; wp=&amp;quot;_BASELEG&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;circle radius=&amp;quot;nav_radius&amp;quot; until=&amp;quot;And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-(nav_radius/fabs(nav_radius))*10),&lt;br /&gt;
                               10 &amp;gt; fabs(GetPosAlt() - WaypointAlt(WP__BASELEG)))&amp;quot; wp=&amp;quot;_BASELEG&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;block name=&amp;quot;final&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;exception cond=&amp;quot;ground_alt + 10 &amp;gt; estimator_z&amp;quot; deroute=&amp;quot;flare&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;gls(WP_AF,WP_SD, WP_TOD, WP_TD)&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
those pictures match the old gls routine! anyway - the new one is not much different... (POS I = SD)&lt;br /&gt;
&amp;lt;gallery caption=&amp;quot;theory&amp;quot;&amp;gt;&lt;br /&gt;
Image:gls1.png|side view&lt;br /&gt;
Image:gls2.png|from above&lt;br /&gt;
Image:gls3.png|screen shot of flight test&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multi-UAV ==&lt;br /&gt;
For TCAS (Traffic Collision Avoidance System) see the [[MultiUAV]] page.&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:Navigation]] [[Category:User_Documentation]]&lt;br /&gt;
&lt;br /&gt;
= Create a navigation module =&lt;br /&gt;
&lt;br /&gt;
Creating a navigation module is not to complex. Have said that, it is not very likely to need to create one module oneself. The already available functions are very flexible and powerful. Before you set of to create and additional navigation module, make sure you understand all current modules and their capabilities. After you investigated current modules and came to the conclusion, there is no way to solve you flightplan mission by creating a new module, go ahead and plz share your work with the community. The more people test the new module, the faster it wll reach a stable state.&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Input2Ivy&amp;diff=23322</id>
		<title>Input2Ivy</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Input2Ivy&amp;diff=23322"/>
		<updated>2016-09-15T17:00:31Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Tools&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
'''Input2Ivy''' is an [[Ivy]] agent written in Ocaml/C used to read inputs coming from [[Joystick|joysticks or joypads]] and to send Ivy messages accordingly.&lt;br /&gt;
&lt;br /&gt;
= Compiling Input2Ivy =&lt;br /&gt;
&lt;br /&gt;
The program is located in &amp;lt;tt&amp;gt;sw/ground_segment/joystick&amp;lt;/tt&amp;gt;. It should already be compiled with the top level make, you also can explicitly build it with &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;sw/ground_segment/joystick&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the C library sdl_stick (using SDL)&lt;br /&gt;
* input2ivy (ocaml main program that uses sdl_stick)&lt;br /&gt;
* test_stick (a small C test program that display raw values of your joystick)&lt;br /&gt;
&lt;br /&gt;
= Configuration and use =&lt;br /&gt;
&lt;br /&gt;
== Xml configuration file ==&lt;br /&gt;
&lt;br /&gt;
Input2Ivy reads the configuration of your input device in a xml file located in &amp;lt;tt&amp;gt;conf/joystick&amp;lt;/tt&amp;gt;. The format is as follow:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;joystick&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Start with the node 'joystick', no DTD yet.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;input&amp;gt;&lt;br /&gt;
   &amp;lt;axis index=&amp;quot;0&amp;quot; name=&amp;quot;roll&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;axis index=&amp;quot;1&amp;quot; name=&amp;quot;pitch&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;axis index=&amp;quot;2&amp;quot; name=&amp;quot;throttle&amp;quot;/&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
   &amp;lt;button index=&amp;quot;0&amp;quot; name=&amp;quot;shoot&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;button index=&amp;quot;1&amp;quot; name=&amp;quot;button1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;button index=&amp;quot;2&amp;quot; name=&amp;quot;button2&amp;quot;/&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
  &amp;lt;/input&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this section, all the axis and buttons are described with an index and a name. Both have to be unique.&lt;br /&gt;
* the index is the actual axis or button number of your input device (you can use 'test_stick' to determine each index)&lt;br /&gt;
* the name is chosen by the user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;variables&amp;gt;&lt;br /&gt;
   &amp;lt;var name=&amp;quot;mode&amp;quot; default=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;set var=&amp;quot;mode&amp;quot; value=&amp;quot;0&amp;quot; on_event=&amp;quot;button1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;set var=&amp;quot;mode&amp;quot; value=&amp;quot;1&amp;quot; on_event=&amp;quot;button2 &amp;amp;&amp;amp; shoot&amp;quot;/&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
  &amp;lt;/variables&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The section 'variables' allows to declare local variables to the program, those value can be changed based on inputs event. First you need to declare the variable with a default value (integer) and then each event is describe with the 'set' node. It is possible to use logical &amp;quot;C-like&amp;quot; expression for the event (&amp;amp;&amp;amp;, ||, &amp;lt;, &amp;gt;, ...).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;messages period=&amp;quot;0.1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;message class=&amp;quot;datalink&amp;quot; name=&amp;quot;RC_4CH&amp;quot; send_always=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;field name=&amp;quot;mode&amp;quot;        value=&amp;quot;mode&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;field name=&amp;quot;throttle&amp;quot;    value=&amp;quot;Bound(0-ly,0,127)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;field name=&amp;quot;roll&amp;quot;        value=&amp;quot;roll&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;field name=&amp;quot;yaw&amp;quot;         value=&amp;quot;yaw&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;field name=&amp;quot;pitch&amp;quot;       value=&amp;quot;pitch&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/message&amp;gt;&lt;br /&gt;
   &amp;lt;message class=&amp;quot;ground&amp;quot; name=&amp;quot;JUMP_TO_BLOCK&amp;quot; on_event=&amp;quot;shoot &amp;amp;&amp;amp; button1&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;field name=&amp;quot;block_id&amp;quot; value=&amp;quot;IndexOfBlock('land')&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/message&amp;gt;&lt;br /&gt;
   &amp;lt;message class=&amp;quot;ground&amp;quot; name=&amp;quot;DL_SETTING&amp;quot; on_event=&amp;quot;button2&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;field name=&amp;quot;index&amp;quot; value=&amp;quot;IndexOfSetting(kill_throttle)&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;field name=&amp;quot;value&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/message&amp;gt;&lt;br /&gt;
   ...&lt;br /&gt;
  &amp;lt;/messages&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The 'messages' section describes the messages sent to [[Ivy]].&lt;br /&gt;
* the 'period' attribute define the period for sending the messages. A message is send only the at least one of its field has changed since last sending. Only messages with 'send_always=&amp;quot;true&amp;quot;' are always sent.&lt;br /&gt;
* the 'message' node attributes are:&lt;br /&gt;
** class: the class of the message (defined in conf/messages.xml) (mandatory)&lt;br /&gt;
** name: the name of the message (defined in conf/messages.xml) (mandatory)&lt;br /&gt;
** send_always: always send message the 'period' frequency if set to &amp;quot;true&amp;quot; (optional)&lt;br /&gt;
* the 'messages' children are the field of the message as describe in conf/messages.xml, except for the field 'ac_id' that is automatically set if needed.&lt;br /&gt;
* the 'field' node attributes are:&lt;br /&gt;
** name: the name of the field (mandatory)&lt;br /&gt;
** value: the value to be sent (here, expressions can be used, see below) (mandatory)&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/joystick&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Close 'joystick' node.&lt;br /&gt;
&lt;br /&gt;
== Expressions and functions ==&lt;br /&gt;
&lt;br /&gt;
* parenthesis: (, )&lt;br /&gt;
* operators: +, -, *, % (divide, / is not allowed)&lt;br /&gt;
* logical, comparator: &amp;amp;&amp;amp;, ||, &amp;lt;, &amp;gt;&lt;br /&gt;
* functions:&lt;br /&gt;
** Scale(x, min, max): scale the value in the given bounds (input bounds are [-127, 127]&lt;br /&gt;
** Fit(x, min, max, min_input, max_input): some as 'Scale' with custom input bounds&lt;br /&gt;
** Bound(x, min, max): bound the value between [min,max]&lt;br /&gt;
** PprzMode(x): returns '''0''' if input is less than -127/2, '''2''' if greater than 127/2, '''1''' otherwise&lt;br /&gt;
** JoystickId(): returns the joystick ID&lt;br /&gt;
&lt;br /&gt;
== Trims ==&lt;br /&gt;
First calibrate your joystick as described on the [[Joystick]] page.&lt;br /&gt;
&lt;br /&gt;
In flight trimming is to be done...&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
&lt;br /&gt;
 $ ./sw/ground_segment/joystick/input2ivy [options] config_file.xml&lt;br /&gt;
&lt;br /&gt;
The options are:&lt;br /&gt;
* -ac &amp;lt;AC name&amp;gt; the name of your aircraft (mandatory)&lt;br /&gt;
* -b &amp;lt;ivy_bus&amp;gt; the an ivy bus address (default address used if not set)&lt;br /&gt;
* -d &amp;lt;device_index&amp;gt; set the SDL device index (default is 0)&lt;br /&gt;
** for paparazzi versions older than v4.2 use: -d &amp;lt;device_name&amp;gt; set the device name (default is /dev/input/js0))&lt;br /&gt;
* -v verbose mode (can also be used to identify the channels)&lt;br /&gt;
* -id set the joystick ID (in range [0,255], a random value is chosen if not set)&lt;br /&gt;
Do not forget the configuration file name after the options.&lt;br /&gt;
&lt;br /&gt;
Example invocation on Mac OS X using a SNES gamepad configuration as input:&lt;br /&gt;
&lt;br /&gt;
 $ ./sw/ground_segment/joystick/input2ivy  -b 224.255.255.255:2010 -ac Teensy_Fly_Quad_Elle0_v1_2_214 -d 0 snes_gamepad.xml &lt;br /&gt;
&lt;br /&gt;
Input2Ivy can be launched from the Paparazzi Center if your conf/control_panel.xml have the correct 'program' entry. (See conf/control_panel.xml.example)&lt;br /&gt;
&lt;br /&gt;
[[Category:Tools]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Joystick&amp;diff=23321</id>
		<title>Joystick</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Joystick&amp;diff=23321"/>
		<updated>2016-09-15T16:57:52Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
A Joystick can be used to control your aircraft in the simulator or via the modem [[Subsystem/radio_control#Datalink|using radio_control type datalink]] in real flight using [[Input2Ivy]].&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Here a regular gaming pad, perfectly capable to control your aircraft when in manual or assisted flight&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Logitech_Extreme_3D_Pro_Joystick.jpg|Logitech Extreme 3D_Pro Joystick&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here and example of an Joystick that looks like an RC transmitter, but is just an USB connected Joystick. Handy for quick tests, and for ER 13, why not add one to you Paparazzi toolset?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Hk_6ch_rc_joystick_overview.jpg|Hk 6channel RC transmitterlook joystick via USB&lt;br /&gt;
File:Hk_6ch_rc_joystick_large.jpg|Hk 6channel RC transmitterlook joystick via USB closeup&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here a real RC transmitter connected via trainer port to your PC to be used as a Joystick&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Nes_gamepads.jpg|NES gamepads via USB&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also supported are USB based Nintendo gamepad controllers useful when flying in NAV/GUIDED modes&lt;br /&gt;
&lt;br /&gt;
=Quick test=&lt;br /&gt;
&lt;br /&gt;
If plugged in, under Linux a quick test to see if the device is recognized via:&lt;br /&gt;
&lt;br /&gt;
 $ dmesg&lt;br /&gt;
&lt;br /&gt;
Although the message is a little different for every joystick type, it should display something like this in last lines:&lt;br /&gt;
&lt;br /&gt;
 ...&lt;br /&gt;
 [ 8988.708567] usb 2-4.3: new low-speed USB device number 7 using ehci-pci&lt;br /&gt;
 [ 8988.804672] usb 2-4.3: New USB device found, idVendor=0603, idProduct=1a13&lt;br /&gt;
 [ 8988.804679] usb 2-4.3: New USB device strings: Mfr=0, Product=34, SerialNumber=0&lt;br /&gt;
 [ 8988.804683] usb 2-4.3: Product: ART TECH GAME.  &lt;br /&gt;
 [ 8988.808821] input: ART TECH GAME.   as /devices/pci0000:00/0000:00:06.1/usb2/2-4/2-4.3/2-4.3:1.0/input/input14&lt;br /&gt;
 [ 8988.809007] hid-generic 0003:0603:1A13.0006: input,hidraw4: USB HID v1.00 Joystick [ART TECH GAME.  ] on usb-0000:00:06.1-4.3/input0&lt;br /&gt;
 ...&lt;br /&gt;
=Joystick Calibration=&lt;br /&gt;
You should always calibrate your joystick. By calibrating you make sure that your Joystick is not sending steering commanding values; while it should not when the steering sticks are in neutral position.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
Install the joystick and the jstest-gtk packages via:&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get install joystick jstest-gtk&lt;br /&gt;
&lt;br /&gt;
Use the graphical jstest-gtk tool (or the commandline jstest) to view/edit your joystick calibration and axis/button mappings.&lt;br /&gt;
Start it via:&lt;br /&gt;
&lt;br /&gt;
 $ jstest-gtk&lt;br /&gt;
&lt;br /&gt;
===Store the calibration===&lt;br /&gt;
Your calibration and mapping will only be lost once you unplug the joystick, so store your configuration via:&lt;br /&gt;
 &lt;br /&gt;
 $ sudo jscal-store /dev/input/js0&lt;br /&gt;
&lt;br /&gt;
If you replug your joystick the next time, udev should take care of automatically loading the appropriate configuration.&lt;br /&gt;
&lt;br /&gt;
==OSX==&lt;br /&gt;
&lt;br /&gt;
Whether you are running on Mac OS X or Linux, the ''test_stick'' tool provides the ability to profile a joystick device.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
$ ./sw/ground_segment/joystick/test_stick -h&lt;br /&gt;
Usage:&lt;br /&gt;
  ./test_stick &amp;lt;option&amp;gt; [&amp;lt;option&amp;gt;...]&lt;br /&gt;
Options:&lt;br /&gt;
  -d &amp;lt;string&amp;gt;  device name&lt;br /&gt;
  -h           display this help&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default ''device name'' is set to 0 if the ''-d'' option is not specified.&lt;br /&gt;
&lt;br /&gt;
Here's a snippet of the tool output when a single USB enabled SNES gamepad is connected.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&lt;br /&gt;
  $ ./sw/ground_segment/joystick/test_stick&lt;br /&gt;
&lt;br /&gt;
  Available button: 11 (0xb)&lt;br /&gt;
  Available hats: 0 (0x0)&lt;br /&gt;
  Available axes: 2 (0x2)&lt;br /&gt;
  Axis 0 : parameters = [-32768,32768]&lt;br /&gt;
  Axis 1 : parameters = [-32768,32768]&lt;br /&gt;
  Input device name: &amp;quot;2Axes 11Keys Game  Pad&amp;quot; on SDL device &amp;quot;0&amp;quot;&lt;br /&gt;
  buttons 0 0 0 0 0 0 0 0 0 0 0 | hat 0 | axes -1 -1 &lt;br /&gt;
  buttons 0 0 0 0 0 0 0 0 0 0 0 | hat 0 | axes -1 -1 &lt;br /&gt;
  buttons 0 0 0 0 0 0 0 0 0 0 0 | hat 0 | axes -1 -1&lt;br /&gt;
  ...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]] [[Category:User_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=User:Spammer&amp;diff=22980</id>
		<title>User:Spammer</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=User:Spammer&amp;diff=22980"/>
		<updated>2016-07-21T17:48:42Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spammer&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;spam account, please ban.&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Developer_Guide&amp;diff=21305</id>
		<title>Developer Guide</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Developer_Guide&amp;diff=21305"/>
		<updated>2016-07-15T19:20:30Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: /* MISRA-C Rules */  removed random spaces inside of words&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
By the time you land on this page, you probably want to enhance the Paparazzi project, that is really good for your karma and really appreciated by the Paparazzi community. We welcome contributions and improvements to the documentation.&lt;br /&gt;
[[Image:FixIt.jpg|right|FixIt]]&lt;br /&gt;
&lt;br /&gt;
See also [[Doxygen]] for documentation close to the code.&lt;br /&gt;
&lt;br /&gt;
==[[Contributing|Contributing]]==&lt;br /&gt;
You would like to contribute, but are not sure how, then [[Contributing|this is the page to visit]]&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/CodeEditors|Code Editing]]==&lt;br /&gt;
How to setup your IDE for use with the source code&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/LearningToProgram|Learning to Program]]==&lt;br /&gt;
Improve your Paparazzi code in OCAML,C,C++ and Python&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/AircraftBuildProcess|Aircraft build process and code generation]]==&lt;br /&gt;
Description of the (rather complicated) build system and code generation regarding the airborne firmwares&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/DesignOverview|Design Overview]]==&lt;br /&gt;
Attempt at a longer walk through the airborne code architecture&lt;br /&gt;
&lt;br /&gt;
==[[FirmwareArchitecture|Firmware Architecture]]==&lt;br /&gt;
Attempt at brief overview of the firmware architecture with modules and subsystems&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/Communications|Communications]]==&lt;br /&gt;
How telemetry and datalink is done&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/CommunicationsNew|Communications (Proposed New system)]]==&lt;br /&gt;
How the telemetry and datalink works&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/Server_GCS_com|Server-GCS communications]]==&lt;br /&gt;
How the Server and the Ground Control Station interact with each other&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/Values|Values]]==&lt;br /&gt;
A short walk through the system and how values are handled&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/Settings|Settings]]==&lt;br /&gt;
Settings is the generic mechanism that allows to set and get the value of any variable of the embedded code.&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/Mathlib|Paparazzi Math Library]]==&lt;br /&gt;
The custom Paparazzi math library written in C and how to use it in external programs&lt;br /&gt;
&lt;br /&gt;
==[[Reference/bootloader]]==&lt;br /&gt;
All of the questions and answers about the bootloader, but were afraid to ask&lt;br /&gt;
&lt;br /&gt;
===[[Lpc21iap|LPC USB firmware]]===&lt;br /&gt;
All of the answers to the Paparazzi USB bootloader of question you never dared to ask&lt;br /&gt;
&lt;br /&gt;
====[[Lpc21BootloaderUpload|Upload Bootloader for LPC21xx]]====&lt;br /&gt;
How to [[[[Lpc21BootloaderUpload|upload the Bootloader]] to a LPC2148 processor based Autopilot board like the TWOG&lt;br /&gt;
&lt;br /&gt;
===[[Luftboot|Upload the luftboot bootloader]]===&lt;br /&gt;
How to upload the Bootloader to a STM32 processor based Autopilot board like the [[Elle0]] or [[Lisa/M]]&lt;br /&gt;
&lt;br /&gt;
===[[DFU|Upload with DFU (with native or custom dfu bootloader)]]===&lt;br /&gt;
Using the native (embedded in ROM) or custom (e.g. [[Luftboot]] or [[KroozSD#Bootloader|KroozSD]]==) bootloader to upload Paparazzi code&lt;br /&gt;
&lt;br /&gt;
===[[STLink|Upload with STLink via SWD (without Bootloader)]]===&lt;br /&gt;
General ST-LinkV2 page.&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/GDB_OpenOCD_Debug|GDB OpenOCD Debug]]==&lt;br /&gt;
Using GDB or OpenOCD to directly flash and debug Hardware&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/USB-Serial|USB-Serial]]==&lt;br /&gt;
Using a USB connection instead of UART for use with telemetry&lt;br /&gt;
&lt;br /&gt;
==[[ControlTheory]]==&lt;br /&gt;
All [[ControlTheory|information you are looking for about the harsh reality of Control Theory]] needed to let your aircraft fly&lt;br /&gt;
&lt;br /&gt;
==[[Demystified/Altitude and Height|Altitude and Height]]==&lt;br /&gt;
Altitude and Height demystified&lt;br /&gt;
&lt;br /&gt;
==[[Abi|AirBorne Interface ABI]]==&lt;br /&gt;
Presentation of the airborne communication system&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/StateInterface]]==&lt;br /&gt;
A stateinterface is a stateinterface is a stateinterface, [[DevGuide/StateInterface|poems aside read more about what the stateinterface entails here]]&lt;br /&gt;
&lt;br /&gt;
==[[RT_Paparazzi]]==&lt;br /&gt;
[[RT_Paparazzi|Real Time Paparazzi]] how-to and guidelines&lt;br /&gt;
&lt;br /&gt;
==[[Builds|Continuous Integration builds]]==&lt;br /&gt;
Info on the [[Builds|Continuous Integration builds]] (CI) server&lt;br /&gt;
&lt;br /&gt;
==[[MISRA-C Rules]]==&lt;br /&gt;
And guidelines.&lt;br /&gt;
&lt;br /&gt;
=== Directive 4.3 ===&lt;br /&gt;
Assembly language shall be encapsulated an isolated&lt;br /&gt;
&lt;br /&gt;
Where assembly language instructions are used they shall be encapsulated and isolated in: &lt;br /&gt;
* Assembly language functions; &lt;br /&gt;
* C functions ( inline functions preferred for C99 ); &lt;br /&gt;
* C macros. &lt;br /&gt;
&lt;br /&gt;
==== Rationale ====&lt;br /&gt;
For reasons of efficiency it is sometimes necessary to embed simple assembly language instructions in-line, for example to enable and disable interrupts. If this is necessary, then it is recommended that it be achieved by using macros, or for C99, inline functions. &lt;br /&gt;
Encapsulating assembly language is beneficial because: &lt;br /&gt;
* It improves readability; &lt;br /&gt;
* The name, and documentation, of the encapsulating macro or function makes the intent of the assembly language clear; &lt;br /&gt;
* All uses of assembly language for a given purpose can share the same encapsulation which improves maintainability; &lt;br /&gt;
* The assembly language can easily be substituted for a different target or for purposes of static analysis. &lt;br /&gt;
Note: the use of in-line assembly language is an extension to standard C, and therefore violates Rule 1.2. &lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
  #define NOP asm(&amp;quot; NOP&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Directive 4.10 ===&lt;br /&gt;
Precautions shall be taken in order to prevent the contents of a header file being included more than once&lt;br /&gt;
==== Rationale ====&lt;br /&gt;
When a translation unit contains a complex hierarchy of nested header files, it is possible for a particular header file to be included more than once. This can be, at best, a source of confusion. If this multiple inclusion leads to multiple or conflicting definitions, then this can result in undefined or erroneous behaviour. &lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
  /* file.h */&lt;br /&gt;
  #ifndef FILE_H&lt;br /&gt;
  /* Non-co mpliant - does not #define FILE_H */&lt;br /&gt;
  #endif&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to facilitate checking, the contents of the header should be protected from being included more than once using one of the following two forms: &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
  #if !defined ( identifier )&lt;br /&gt;
  #define identifier&lt;br /&gt;
    /* Contents of file */&lt;br /&gt;
  #endif&lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
  #ifndef identifier&lt;br /&gt;
  #define identifier&lt;br /&gt;
    /* Contents of file */&lt;br /&gt;
  #endif&lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Note: the identifier used to test and record whether a given header file has already been included shall be unique across all header files in the project. &lt;br /&gt;
Note: comments are permitted anywhere within these forms. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rule 3.1 === &lt;br /&gt;
The character sequences /* and // shall not be used within a comment&lt;br /&gt;
&lt;br /&gt;
==== Rationale ====&lt;br /&gt;
If a comment starting sequence, /* or //, occurs within a /* comment, is it quite likely to be caused by a missing */ comment ending sequence. &lt;br /&gt;
If a comment starting sequence occurs within a // comment, it is probably because a region of code has been commented-out using //. &lt;br /&gt;
&lt;br /&gt;
==== Exception ====&lt;br /&gt;
The sequence // is permitted within a // comment. &lt;br /&gt;
&lt;br /&gt;
==== Example ==== &lt;br /&gt;
Consider the following code fragment: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
  /* some comment, end comment marker accidentally omitted&lt;br /&gt;
  &amp;gt;&lt;br /&gt;
  Perform_Critical_Safety_Function( X );&lt;br /&gt;
  /* this comment is non-compliant */&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
In reviewing the page containing the call to the function, the assumption is that it is executed code. Because of the accidental omission of the end comment marker, the call to the safety critical function will not be executed. &lt;br /&gt;
In the following C99 example, the presence of // comments changes the meaning of the program: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
  x = y // /*&lt;br /&gt;
        + z&lt;br /&gt;
        // */&lt;br /&gt;
      ;&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
This gives x = y + z; but would have been x = y; in the absence of the two // comment start sequences. &lt;br /&gt;
See Also Dir 4.4 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rule 3.2 ===&lt;br /&gt;
Line splicing shall not be used within // comments.&lt;br /&gt;
&lt;br /&gt;
==== Amplification ====&lt;br /&gt;
Line-splicing occurs when the \ character is immediately followed by a new-line character. If the source file contains multibyte characters, they are converted to the source character set before any splicing occurs. &lt;br /&gt;
&lt;br /&gt;
==== Rationale ====&lt;br /&gt;
If the source line containing a // comment ends with a \ character in the source character set, the next line becomes part of the comment. This may result in unintentional removal of code.&lt;br /&gt;
Note: line-splicing is described in Section 5.1.1.2(2) of both C90 and C99. &lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
In the following non-compliant example, the physical line containing the if keyword is logically part of the previous line and is therefore a comment. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
  extern bool_t b;&lt;br /&gt;
  void f ( void )&lt;br /&gt;
  {&lt;br /&gt;
    uint16_t x = 0; // comment &lt;br /&gt;
    if ( b )&lt;br /&gt;
    {&lt;br /&gt;
      ++x; /* This is always executed */&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
See Also Dir 4.4 &lt;br /&gt;
&lt;br /&gt;
=== Rule 4.1 === &lt;br /&gt;
Octal and hexadecimal escape sequences shall be terminated&lt;br /&gt;
&lt;br /&gt;
==== Amplification ==== &lt;br /&gt;
An octal or hexadecimal escape sequence shall be terminated by either:&lt;br /&gt;
* The start of another escape sequence, or&lt;br /&gt;
* The end of the character constant or the end of a string literal.&lt;br /&gt;
&lt;br /&gt;
====  Rationale ==== &lt;br /&gt;
There is potential for confusion if an octal or hexadecimal escape sequence is followed by other characters. For example, the character constant '\x1f' consists of a single character whereas the character constant '\x1g' consists of the two characters '\x1' and 'g'. The manner in which multi-character constants are represented as integers is implementation-defined. &lt;br /&gt;
The potential for confusion is reduced if every octal or hexadecimal escape sequence in a character constant or string literal is terminated. &lt;br /&gt;
&lt;br /&gt;
====  Example ==== &lt;br /&gt;
In this example, each of the strings pointed to by s1, s2 and s3 is equivalent to &amp;quot;Ag&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
  const char *s1 = &amp;quot;\x41g&amp;quot;;      /* Non-compliant */&lt;br /&gt;
  const char *s2 = &amp;quot;\x41&amp;quot; &amp;quot;g&amp;quot;;   /* Compliant - terminated by end of literal */&lt;br /&gt;
  const char *s3 = &amp;quot;\x41\x67&amp;quot;;  /* Compliant - terminated by another escape */&lt;br /&gt;
  int c1 = '\141t';              /* Non-compliant */&lt;br /&gt;
  int c2 = '\141\t';            /* Compliant - terminated by another escape */&lt;br /&gt;
&amp;lt;/source&amp;gt;  &lt;br /&gt;
&lt;br /&gt;
See Also C90: Section 6.1.3.4, C99: Section 6.4.4.4 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rule 5.1 ===&lt;br /&gt;
External identifiers shall be distinct&lt;br /&gt;
&lt;br /&gt;
==== Amplification ====&lt;br /&gt;
This rule requires that different external identifiers be distinct within the limits imposed by the implementation. &lt;br /&gt;
The definition of distinct depends on the implementation and on the version of the C language that is being used: &lt;br /&gt;
* In C90 the minimum requirement is that the first 6 characters of external identifiers are significant but their case is not required to be significant; &lt;br /&gt;
* In C99 the minimum requirement is that the first 31 characters of external identifiers are significant, with each universal character or corresponding extended source character occupying between 6 and 10 characters. &lt;br /&gt;
In practice, many implementations provide greater limits. For example it is common for external identifiers in C90 to be case-sensitive and for at least the first 31 characters to be significant. &lt;br /&gt;
&lt;br /&gt;
==== Rationale ====&lt;br /&gt;
If two identifiers differ only in non-significant characters, the behaviour is undefined. &lt;br /&gt;
If portability is a concern, it would be prudent to apply this rule using the minimum limits specified in The Standard. &lt;br /&gt;
Long identifiers may impair the readability of code. While many automatic code generation systems produce long identifiers, there is a good argument for keeping identifier lengths well below this limit. &lt;br /&gt;
Note: In C99, if an extended source character appears in an external identifier and that character does not have a corresponding universal character, The Standard does not specify how many characters it occupies. &lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
In the following example, the definitions all occur in the same translation unit. The implementation in question supports 31 significant case-sensitive characters in external identifiers. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
  /*      1234567890123456789012345678901*********  Characters */&lt;br /&gt;
  int32_t engine_exhaust_gas_temperature_raw;&lt;br /&gt;
  int32_t engine_exhaust_gas_temperature_scaled;    /* Non-compliant */&lt;br /&gt;
  /*      1234567890123456789012345678901*********  Characters */&lt;br /&gt;
  int32_t engine_exhaust_gas_temp_raw;&lt;br /&gt;
  int32_t engine_exhaust_gas_temp_scaled;           /* Compliant */&lt;br /&gt;
&amp;lt;/source&amp;gt;  &lt;br /&gt;
 &lt;br /&gt;
In the following non-compliant example, the implementation supports 6 significant case-insensitive characters in external identifiers. The identifiers in the two translation units are different but are not distinct in their significant characters. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
  /* file1.c */&lt;br /&gt;
  int32_t abc = 0;&lt;br /&gt;
&lt;br /&gt;
  /* file2.c */&lt;br /&gt;
  int32_t ABC = 0;&lt;br /&gt;
&amp;lt;/source&amp;gt;  &lt;br /&gt;
 &lt;br /&gt;
See also: Dir 1.1, Rule 5.2, Rule 5.4, Rule 5.5 &lt;br /&gt;
&lt;br /&gt;
=== Rule 5.2 ===&lt;br /&gt;
Identifiers declared in the same scope and name space shall be distinct&lt;br /&gt;
&lt;br /&gt;
==== Amplification ====&lt;br /&gt;
This rule does not apply if both identifiers are external identifiers because this case is covered by Rule 5.1. &lt;br /&gt;
This rule does not apply if either identifier is a macro identifier because this case is covered by Rule 5.4 and Rule 5.5. &lt;br /&gt;
The definition of distinct depends on the implementation and on the version of the C language that is being used: &lt;br /&gt;
* In C90 the minimum requirement is that the first 31 characters are significant; &lt;br /&gt;
* In C99 the minimum requirement is that the first 63 characters are significant, with each universal character or extended source character counting as a single character. &lt;br /&gt;
&lt;br /&gt;
==== Rationale ====&lt;br /&gt;
If two identifiers differ only in non-significant characters, the behaviour is undefined. &lt;br /&gt;
If portability is a concern, it would be prudent to apply this rule using the minimum limits specified in The Standard. &lt;br /&gt;
Long identifiers may impair the readability of code. While many automatic code generation systems produce long identifiers, there is a good argument for keeping identifier lengths well below this limit. &lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
In the following example, the implementation in question supports 31 significant case-sensitive characters inidentifiers that do not have external linkage. &lt;br /&gt;
The identifier engine_exhaust_gas_temperature_local is compliant with this rule. Although it is not distinct from the identifier engine_exhaust_gas_temperature_raw, it is in a different scope. However, it is not compliant with Rule 5.3. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
  /*             1234567890123456789012345678901*********    Characters */&lt;br /&gt;
  extern int32_t engine_exhaust_gas_temperature_raw;&lt;br /&gt;
  static int32_t engine_exhaust_gas_temperature_scaled; /*   Non-compliant */&lt;br /&gt;
&lt;br /&gt;
  void f ( void )&lt;br /&gt;
  {&lt;br /&gt;
    /*      1234567890123456789012345678901*********         Characters */&lt;br /&gt;
    int32_t engine_exhaust_gas_temperature_local; /*         Compliant */&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  /*             1234567890123456789012345678901*********    Characters */&lt;br /&gt;
  static int32_t engine_exhaust_gas_temp_raw;&lt;br /&gt;
  static int32_t engine_exhaust_gas_temp_scaled;          /* Compliant */&lt;br /&gt;
&amp;lt;/source&amp;gt;  &lt;br /&gt;
 &lt;br /&gt;
See also Dir 1.1, Rule 5.1, Rule 5.3, Rule 5.4, Rule 5.5 &lt;br /&gt;
&lt;br /&gt;
=== Rule 5.3 ===&lt;br /&gt;
An identifier declared in an inner scope shall not hide an identifier declared in an outer scope.&lt;br /&gt;
&lt;br /&gt;
==== Amplification ====&lt;br /&gt;
An identifier declared in an inner scope shall be distinct from any identifier declared in an outer scope. &lt;br /&gt;
The definition of distinct depends on the implementation and the version of the C language that is being used: &lt;br /&gt;
* In C90 the minimum requirement is that the first 31 characters are significant; &lt;br /&gt;
* In C99 the minimum requirement is that the first 63 characters are significant, with each universal character or extended source character counting as a single character. &lt;br /&gt;
&lt;br /&gt;
==== Rationale ====&lt;br /&gt;
If two identifiers differ only in non-significant characters, the behaviour is undefined. &lt;br /&gt;
If an identifier is declared in an inner scope but is not distinct from an identifier that already exists in an outer scope, then the inner-most declaration will “hide” the outer one. This may lead to developer confusion. &lt;br /&gt;
Note: An identifier declared in one name space does not hide an identifier declared in a different name space. &lt;br /&gt;
The terms outer and inner scope are defined as follows: &lt;br /&gt;
* Identifiers that have file scope can be considered as having the outermost scope; &lt;br /&gt;
* Identifiers that have block scope have a more inner scope; &lt;br /&gt;
* Successive, nested blocks, introduce more inner scopes. &lt;br /&gt;
&lt;br /&gt;
==== Example ====&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
  void fn1 ( void )&lt;br /&gt;
  {&lt;br /&gt;
    int16_t i;                            /* Declare an object &amp;quot;i&amp;quot; */&lt;br /&gt;
    {&lt;br /&gt;
      int16_t i;                          /* Non-compliant - hides previous &amp;quot;i &amp;quot; */&lt;br /&gt;
      i = 3;                              /* Could be confusing as to which &amp;quot;i&amp;quot; this refers */&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  struct astruct&lt;br /&gt;
  {&lt;br /&gt;
    int16_t m;&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
  extern void g ( struct astruct *p );&lt;br /&gt;
&lt;br /&gt;
  int16_t xyz = 0; /* Declare an object &amp;quot;xyz&amp;quot; */&lt;br /&gt;
&lt;br /&gt;
  void fn2 ( struct astruct xyz )         /* Non-compliant - outer &amp;quot;xyz&amp;quot; is&lt;br /&gt;
                                           * now hidden by parameter name */&lt;br /&gt;
    {&lt;br /&gt;
      g ( &amp;amp;xyz );&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
  uint16_t speed;&lt;br /&gt;
&lt;br /&gt;
  void fn3 ( void )&lt;br /&gt;
  {&lt;br /&gt;
    typedef float32_t speed;              /* Non-compliant - type hides object */&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
See also: Rule 5.2, Rule 5.8 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Logs&amp;diff=21299</id>
		<title>Logs</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Logs&amp;diff=21299"/>
		<updated>2016-07-08T17:02:03Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;On each launch, the &amp;lt;tt&amp;gt;[[Server]]&amp;lt;/tt&amp;gt; creates a ''log'' of all the messages sent by the aircraft. This log can be used to analyse flight data and to replay the flight.&lt;br /&gt;
&lt;br /&gt;
==Format==&lt;br /&gt;
&lt;br /&gt;
The log files are stored in the &amp;lt;tt&amp;gt;var/logs/&amp;lt;/tt&amp;gt; folder (under &amp;lt;tt&amp;gt;PAPARAZZI_HOME&amp;lt;/tt&amp;gt;). A log is split into two files:&lt;br /&gt;
* A &amp;lt;tt&amp;gt;.log&amp;lt;/tt&amp;gt; file, an XML file, which contains a copy of the whole configuration (airframes, flight plans, ...).&lt;br /&gt;
* A &amp;lt;tt&amp;gt;.data&amp;lt;/tt&amp;gt; file, an ascii file, which contains the list of the received messages. Each message is time-stamped in milliseconds since the creation of the file and marked with the ID of the sending aircraft.&lt;br /&gt;
&lt;br /&gt;
The first part before the type of file of these two files is the same and is build from the date and time at the creation.&lt;br /&gt;
&lt;br /&gt;
The lines of the &amp;lt;tt&amp;gt;.data&amp;lt;/tt&amp;gt; file are formatted according to the message description listed in the &amp;lt;tt&amp;gt;conf/messages.xml&amp;lt;/tt&amp;gt; file. For example, the following line:&lt;br /&gt;
 3.300 6 GPS 3 36028551 481359212 899 18500 0 -8 960 31 0&lt;br /&gt;
contains a &amp;lt;tt&amp;gt;GPS&amp;lt;/tt&amp;gt; message received at time 3.3s, from aircraft 6. According the GPS message description:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot; &amp;gt;&lt;br /&gt;
 &amp;lt;message name=&amp;quot;GPS&amp;quot; ID=&amp;quot;8&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;field name=&amp;quot;mode&amp;quot;       type=&amp;quot;uint8&amp;quot; unit=&amp;quot;byte_mask&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;field name=&amp;quot;utm_east&amp;quot;   type=&amp;quot;int32&amp;quot; unit=&amp;quot;cm&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;field name=&amp;quot;utm_north&amp;quot;  type=&amp;quot;int32&amp;quot; unit=&amp;quot;cm&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;field name=&amp;quot;course&amp;quot;     type=&amp;quot;int16&amp;quot; unit=&amp;quot;decideg&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;field name=&amp;quot;alt&amp;quot;        type=&amp;quot;int32&amp;quot; unit=&amp;quot;cm&amp;quot;/&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
 &amp;lt;/message&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
UTM position is 360285.51m east, 4813592.12m north, course is 89.9° (east), altitude is 185m, ...&lt;br /&gt;
Note that the appropriate &amp;lt;tt&amp;gt;messages.xml&amp;lt;/tt&amp;gt; description, i.e. the one which has been used while the log was created, is itself stored in the associated &amp;lt;tt&amp;gt;.log&amp;lt;/tt&amp;gt; file. It may differ from the current one installed in your &amp;lt;tt&amp;gt;conf/&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
Note: The &amp;lt;tt&amp;gt;.data&amp;lt;/tt&amp;gt; files may be huge (about 4M per hour with a standard telemetry configuration). They can be efficiently compressed. The tools described in the next sections handle most of the compressed format (.zip, .gz, .bz2, ...). The bzip2 compression seems to perform better than others on these files.&lt;br /&gt;
&lt;br /&gt;
==Data Plotting==&lt;br /&gt;
&lt;br /&gt;
Data stored in log files can be plotted with the [[Plotter]] (&amp;lt;tt&amp;gt;sw/logalizer/plot&amp;lt;/tt&amp;gt; or launchable from the [[Paparazzi Center]]). This tool can plot data from different logs in the same window and data from the same log in different windows. It also offers to export the track as a KML file for [http://earth.google.com Google Earth].&lt;br /&gt;
&lt;br /&gt;
==Replay==&lt;br /&gt;
A flight can be replayed with the Log Flight Player (&amp;lt;tt&amp;gt;sw/logalizer/play&amp;lt;/tt&amp;gt;) which can be started from the [[Paparazzi Center]] (from tools menu to start alone, or from the '''session''' selection box to start a complete replay session with GCS, server and player tool). This agent then is a substitute for the Data Link agent and will send over the bus the messages which had been send by the aircraft while the log was recorded.&lt;br /&gt;
&lt;br /&gt;
Note: While replaying a log, it is a good idea to disable a new log creation from the server (&amp;lt;tt&amp;gt;-n&amp;lt;/tt&amp;gt; option). &lt;br /&gt;
&lt;br /&gt;
When doing a log replay it is very valuable to launch the messages window (in the tools menu) as well. This allows for the use of the the real time plotter and also gives the data from the aircraft to the user.&lt;br /&gt;
&lt;br /&gt;
If a&amp;lt;tt&amp;gt;.log&amp;lt;/tt&amp;gt; file is added behind the replay command on the command line, this log will be loaded on startup immediately.&lt;br /&gt;
&lt;br /&gt;
TIP: If one want to speed up a replay with 4x speedup of the time [[Simulation#Change_the_environment|Environment Simulator agent, Gaia]] can be used. Launch it from Paparazzi center tools menu &amp;quot;[[Simulation#Change_the_environment|Environment Simulator]]&amp;quot;. Then changing the time scale with the slider or add a commandline option e.g. ''./gaia -t 4''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Output on a serial port===&lt;br /&gt;
Launched with the &amp;lt;tt&amp;gt;-o&amp;lt;/tt&amp;gt; option, the player will send to a serial port all the binary messages, as they have been received through the modem during the flight. Related options:&lt;br /&gt;
* &amp;lt;tt&amp;gt;-s&amp;lt;/tt&amp;gt; Set the baudrate (&amp;lt;tt&amp;gt;9600&amp;lt;/tt&amp;gt;)&lt;br /&gt;
* &amp;lt;tt&amp;gt;-d&amp;lt;/tt&amp;gt; Set the device (&amp;lt;tt&amp;gt;/dev/ttyUSB0&amp;lt;/tt&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
==Load PprzLog into Matlab Workspace==&lt;br /&gt;
Paparazzi log file could also be converted into matrices in matlab workspace for further data processing. An example matlab script is shown in [http://paparazzi.enac.fr/wiki/Image:PprzLog2Matlab_1_0.zip PprzLog2Matlab_1_0.zip]. The example script needs the inputs of the log file name and directory. Just modify the line &amp;quot;fid = fopen('.\FlighLog20090321_MZN\09_03_19__15_03_14.data','r');&amp;quot;. Eight matrices are read into matlab workspace including GPS_SOL, GPS, PPRZ_MODE, DESIRED, ATTITUDE, NAVIGATION, NAVIGATION_REF, COMMANDS. The user could also modify the code easily to add more messages they want to know.&lt;br /&gt;
&lt;br /&gt;
[[Image:logviewer.png|thumb|right|The logviewer GUI]]&lt;br /&gt;
There is now another parser named &amp;lt;tt&amp;gt;log2struct&amp;lt;/tt&amp;gt; available, see [http://lists.gnu.org/archive/html/paparazzi-devel/2009-08/msg00135.html this post on the mailing list].&lt;br /&gt;
It does not require code modification and can read any messages sent from any aircraft.&lt;br /&gt;
Usage examples can be found in the source code documentation.&lt;br /&gt;
&lt;br /&gt;
A GUI built on this parser is available: [http://paparazzi.enac.fr/wiki_images/Logviewer.zip Logviewer.zip].&lt;br /&gt;
It is based on the GUI from &amp;lt;tt&amp;gt;sw/logalizer/matlab_log&amp;lt;/tt&amp;gt; but features some improvements, e.g. in speed and reliability.&lt;br /&gt;
Standard plots like trajectory, attitude or speed are available for quick reviewing and Matlab's plotting tools can be accessed for plot cosmetics and printing.&lt;br /&gt;
&lt;br /&gt;
==NMEA log output==&lt;br /&gt;
NMEA output is useful for [[Kinomap]], for example. Do not confuse this with the application ''ivy2nmea'' live NMEA stream out.&lt;br /&gt;
&lt;br /&gt;
Two methods exist for generating an NMEA gps log from the paparazzi logs:&lt;br /&gt;
: 1- convert the .kml to .nmea by use of gpsbabel application (available on windows and linux)&lt;br /&gt;
: 2- convert the .data to .nmea by use of perl script in sw/in_progress/log_parser/log2nmea.pl (also works on windows and linux)&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:User_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=AR_Drone_2/Mapping&amp;diff=21298</id>
		<title>AR Drone 2/Mapping</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=AR_Drone_2/Mapping&amp;diff=21298"/>
		<updated>2016-07-08T15:55:19Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spelling etc.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;AR Drone 2&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;'''Mapping has not been integrated with paparazzi due to lack of time. Yet, all components have been tested and are working properly.'''&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One of the functions that the AR.Drone2 should have is to be able to map a certain area (starting off with a room). In order to do this the AR.Drone2 needs to be able to: measure distance to objects, keep track of it's own position and heading, store a map efficiently and avoid crashing into objects. The first two things are needed to create a map from measurements during flight, the third is to use a map and still be able to go through all the control loops of paparazzi, the fourth is to maintain flight. It would also be useful to make an algorithm for the AR.Drone2 to explore the area and store the map in the most efficient way.&lt;br /&gt;
&lt;br /&gt;
== Storing the map==&lt;br /&gt;
&lt;br /&gt;
For storing the map, at first we believed [http://octomap.sf.net/ Octomap] ([http://ais.informatik.uni-freiburg.de/publications/papers/wurm10octomap.pdf paper]) to be a good solution. It's a datastructure using an [http://en.wikipedia.org/wiki/Octree OcTree] to store a 3D map that is updateable, flexible and compact. However, since we want to fly in a 2D manner, it's not very useful. You'd have to retrieve a 2D slice of the map at a certain hight (for which there is no build-in function) every iteration which would take a lot of unnecessary time. &lt;br /&gt;
&lt;br /&gt;
Since we liked the flexibility of the Octomap, we created our own 2D version of it: a quadmap so to speak. Instead of an octree, it uses a quadtree to store information about the map. This way we represent the map as a square instead of a cube, like the Octomap does. The rest is pretty much the same: we keep a record of all the occupied, free and unknown cells and we can update the map by casting rays from a startingpoint towards an endpoint (with endpoint being occupied or not). &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exploring the area==&lt;br /&gt;
&lt;br /&gt;
Since the AR.Drone2 will only have point measurement sensors to measure distance to objects, it is pretty much impossible to create a 3D map. Flying on the same hight all the time, will make a 2D map sufficient for the job. We're using [http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&amp;amp;arnumber=613851 Frontier-Based Exploration] for this purpose. With this approach you start with a map filled with unknown cells. Then, by scanning the surroundings of the robot, you fill in the unknown cells: occupied or unoccupied. Next, you search all the frontiers (the border between unoccupied and unknown cells) and pick the frontier with the optimum of being the largest and with the least travel distance. Subsequently you take that frontier as your next destination and upon arrival you scan again. There are also variations for 3D ([http://www.informatik.uni-freiburg.de/~ki/papers/dornhege_etal_ssrr11.pdf paper]). But this is based on a wide range sensor (kinect for example) and therefore not suited for our AR.Drone2.&lt;br /&gt;
&lt;br /&gt;
As explained, Frontier-Based Exploration consists out of a few steps that will be repeated until the whole area is explored:&lt;br /&gt;
* Scan&lt;br /&gt;
* Search for frontiers&lt;br /&gt;
* Pick best frontier&lt;br /&gt;
* Travel&lt;br /&gt;
&lt;br /&gt;
We can use these steps to create a statemachine. Since paparazzi needs to go through its control loops to keep the drone in the air (and because it's a single threaded system), we need to execute the mapping algorithm in smaller steps and thus keep track of what state we are.&lt;br /&gt;
&lt;br /&gt;
[[Image:statediagram_mapping.png|thumb|center|700px|Statediagram of Frontier-Based Exploration with the AR.Drone2]] &lt;br /&gt;
&lt;br /&gt;
As you can see, some of the steps of Frontier-Based Exploration have been split up into smaller substates. This way we can see more easily what the program is supposed to do while keeping the operation time per iteration to a minimum. Note however that, while true for some, not all states shift to the next after one iteration. In some cases, FIND_PATHS for example, it will take a few iterations before it will shift.&lt;br /&gt;
&lt;br /&gt;
=== Init===&lt;br /&gt;
Inside the mapping algorithm, we not only keep track of the state, we also keep track of other things like indexes, iterator positions etc. In the init state, all these fields are set to their respective starting values, after which the algorithm enters the next state.&lt;br /&gt;
&lt;br /&gt;
=== Scanning===&lt;br /&gt;
Some robots can scan entire areas while moving with wide range sensors. Our Ar.Drone2 is limited to point measurement sensors and therefore has to have an explicit step &amp;quot;Scan&amp;quot;. Seeing as our drone will have 4 horizontally placed sensors in a + sign, a 360 degrees scan can be made by making a 45 degrees turn. By keeping track of our rotation and position, with the use of internal sensors, we can deduct where the scanned points are in our selfmade map. &lt;br /&gt;
&lt;br /&gt;
=== Search for frontiers===&lt;br /&gt;
In &amp;quot;Search for frontiers&amp;quot;, we obviously search for frontiers. As the paper of Frontier-Based Exploration explains, we will use these frontiers to deduct our next goal to travel to. As can be seen in the statediagram, we created substates for &amp;quot;Search for frontiers&amp;quot; (DELETE_FRONTIERS, FIND_FRONTIER_NODES, BUILD_FRONTIERGRID and CLUSTER_FRONTIERS) for reasons explained earlier. &lt;br /&gt;
&lt;br /&gt;
==== DELETE_FRONTIERS====&lt;br /&gt;
In the mapping algorithm, we maintain a list of frontierpoints (2D points to represent position) for the sake of speed. That way, we only have to check the area, obtained during state Scanning, for new frontiers instead of going over the whole map. But because of that, we also need to remove any frontierpoints when they´re not frontiers anymore. DELETE_FRONTIERS is the state where every frontierpoint in the list is checked, to see whether it's still a frontier or not.&lt;br /&gt;
&lt;br /&gt;
==== FIND_FRONTIER_NODES====&lt;br /&gt;
When all the outdated frontiers are deleted, we need to add the newly created frontiers. This happens in FIND_FRONTIER_NODES. Because the area that got updated in Scanning is the only area that got updated, we only have to search for new frontierpoints in there. Those frontierpoints will then be added to the list.&lt;br /&gt;
&lt;br /&gt;
==== BUILD_FRONTIERGRID====&lt;br /&gt;
With the frontierpoint list we build a 2D grid representation of the map and fill it with frontiers on their respected positions (positions without frontiers are null pointers). This grid will be used in the next state to cluster them all together.&lt;br /&gt;
&lt;br /&gt;
==== CLUSTER_FRONTIERS====&lt;br /&gt;
In this state, the frontiers will be clustered together using a [http://en.wikipedia.org/wiki/Disjoint-set_data_structure Union-Find Algorithm]. With the list of frontierpoints, we can check the surrounding tiles of that position within the frontiergrid to find neighbouring frontiers. These neighbours are then clustered together. When the size of a cluster reaches a certain threshold, it is added to a list of clustered frontiers. The threshold has two advantages. One of them is that the drone will never visit frontiers that are too small to be of any use. The other advantage is to keep the amount of checks for redundant clusters in the list low. You see, when two clusters, that aren't the same, have been added to the list and later on these two clusters have formed 1 cluster, you'll have two of the same cluster in the list and one will have to be removed. With the threshold it will happen less often that two clusters inside the list will be unified.&lt;br /&gt;
&lt;br /&gt;
=== Pick best frontier===&lt;br /&gt;
Having obtained several clusters of frontiers, we can now use these to deduct our next goal location. By normalizing the size of the frontiers and traveling distance towards them, we can pick the frontier with the optimum of small traveling distance and large size. However, before we can know the traveling distance towards a frontier we need to know the path towards it. For this we apply pathfinding in the FIND_PATHS state using the [http://www.policyalmanac.org/games/aStarTutorial.htm A* algorithm], we choose this algorithm mainly for it's simplicity. To make travelling along the path easier, we trim the found paths to a set of waypoints (not tile by tile). After all the paths have been found, the best frontier will be picked in the FIND_BEST_FRONTIER state.&lt;br /&gt;
&lt;br /&gt;
=== Travel===&lt;br /&gt;
Now knowing where the drone should be headed to, we can start following the path we calculated earlier. Since the path exists out of waypoints, the easiest way of traveling is by turning towards the waypoint (TURN_TO_WAYPOINT), followed by moving forward until waypoint is reached (TRAVEL_TO_WAYPOINT). When the waypoint is reached you take the next waypoint and travel to that one, until there are no more waypoints left and you should have arrived at the goal.&lt;br /&gt;
&lt;br /&gt;
== Integration with Paparazzi==&lt;br /&gt;
&lt;br /&gt;
Since we had a hard time to get the AR.Drone2 flying, we ended up with too little time to integrate the mapping algorithm with Paparazzi. We did however work out how we wanted to integrate it. Our ideas will be explained in this section, just keep in mind that most of it is speculation.&lt;br /&gt;
&lt;br /&gt;
For the mapping algorithm to work with Paparazzi, we need to be able to do a few things:&lt;br /&gt;
* Keep track of position and heading&lt;br /&gt;
* Pilot the AR.Drone2&lt;br /&gt;
* Read out the [[AR_Drone_2/Multidirectional_distance_measurement| distance sensor data]]&lt;br /&gt;
* Let Paparazzi call the algorithm in an iterative way&lt;br /&gt;
&lt;br /&gt;
The first and third bullets are necessary to be able to know which maptiles to update. Keeping track of position and heading is also important for being able to calculate the next action to be taken by the drone (it's hard to figure out how to get somewhere if you don't know where you are). The second bullet is needed to be able to fly to where we want, how we want. The last thing we need is to execute the mapping algorithm, since Paparazzi is the main program, it will have to execute the mapping algorithm (and not the other way around).&lt;br /&gt;
&lt;br /&gt;
=== Keep track of position and heading===&lt;br /&gt;
Paparazzi itself keeps track of a position and heading according to gps (this is all located in sw/airborne/state.h). Although the heading is no problem (you can keep the map pointed north that way), it's hard to convert gps coordinates into map coordinates. But there's another solution to this: if we take the starting position as [0, 0] we can then update the position by integrating the velocity every iteration. Although the outcome won't be 100% correct, the error will be kept to a minimum with a high enough update rate. In case velocity isn't updated fast enough we can also try using the acceleration from the accelerometers to update position.  &lt;br /&gt;
&lt;br /&gt;
=== Pilot the AR.Drone2===&lt;br /&gt;
Flying with Paparazzi currently works in two different ways: autonomous with a [[Flight_Plans| flight plan]] or on radio control with support of the autopilot until a certain degree. Flight plan based will mean that we'd have to be able to update the flight plan while flying from within the mapping algorithm. This is a hard thing to do since the flight plan is located in the ground station and the mapping algorithm will be working on the AR.Drone2 (the airborne part). Though it would be very nice and would also take away the first problem of keeping track of your own position (the flight plan can cooperate with relative x and y values). &lt;br /&gt;
&lt;br /&gt;
The second option is a lot easier to implement, although more prone to errors in the positioning. When using radio control, Paparazzi sends the radio control values from the ground station to the airborne. There, a struct gets filled with the values, which in turn gets handled by the autopilot. By using the right [[Rotorcraft_Configuration#Autopilot_modes| autopilot mode]] we can fly stable to the locations we want (AP_MODE_HOVER_Z_HOLD for yawing and AP_MODE_ATTITUDE_Z_HOLD for moving). Note however that by using the radio control struct you can only use 3 different autopilot modes (these are described in the [[Rotorcraft_Configuration| airframe]]).&lt;br /&gt;
&lt;br /&gt;
=== Read out the distance sensor data===&lt;br /&gt;
To keep it simple, we wanted to directly access the data from the sensors. It is of course possible to integrate the sensors with Paparazzi as well, but Paparazzi itself has no need for distance measurement. &lt;br /&gt;
&lt;br /&gt;
=== Let Paparazzi call the algorithm in an iterative way===&lt;br /&gt;
To let Paparazzi use the mapping algorithm, we can implement mapping as a [[Subsystem| subsystem]]. That way mapping can be added optionally to the airframe (just like gps is optional). Since the mapping algorithm is to be called in an iterative way, we can tell the main control loop to call the algorithm and we're done. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: AR Drone 2]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Other_Infrared_Sensors&amp;diff=21297</id>
		<title>Other Infrared Sensors</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Other_Infrared_Sensors&amp;diff=21297"/>
		<updated>2016-07-08T15:47:39Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Sensors/IR&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= FMA Direct Co Pilot Sensor Boards =&lt;br /&gt;
The [http://www.fmadirect.com FMA Direct] horizontal (X-Y) and vertical (Z) sensors are inexpensive, readily available, and perfectly suited for use with all versions of the Paparazzi autopilot.  These sensors are only available direct from FMA ''Direct''.&amp;lt;br&amp;gt;&lt;br /&gt;
Purchase both the X-Y sensor: [http://www.fmadirect.com/detail.htm?item=1778&amp;amp;section=20 CPD4SENUNIT] and Z sensor: [http://www.fmadirect.com/Detail.htm?item=1888&amp;amp;section=49 FS8ZS] for optimum performance.  The sensor boards are coated with a very thick lacquer that is difficult to penetrate while soldering.  Do not remove more coating than necessary as it prevents the very high value resistors from drifting with humidity changes.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|[[Image:fmairsensor.jpg|thumb|right|FMA X-Y Sensor [http://www.fmadirect.com/detail.htm?item=1778&amp;amp;section=20 CPD4SENUNIT]]]&lt;br /&gt;
|[[Image:fmavertsensor.gif|thumb|right|FMA Z-sensor [http://www.fmadirect.com/Detail.htm?item=1888&amp;amp;section=49 FS8ZS]]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Pinouts and Optional Gain Adjustment ==&lt;br /&gt;
&lt;br /&gt;
The FMA sensors were designed to operate from a 5V source but are typically powered in Paparazzi installations with 3.3V, ensuring that the sensor's analog output does not exceed the 3.3V limit of the ADC inputs on the ARM7 microprocessor.  The sensors work well at 3.3V but their amplifier gain is effectively increased by a factor of 5/3.3.  &lt;br /&gt;
* If the gain is too high and/or the airfield contrast is also too high, the sensor could saturate (reach it's maximum possible reading) well before the aircraft has pitched/rolled 90 degrees, resulting in a tendency for the plane to underbank/underpitch and drift off course.&lt;br /&gt;
* If the gain is too low and/or the contrast is too low, the noise and neutral-offset of the sensor can become dominant, resulting in a tendency for the aircraft to be out of trim and potentially overbank/overpitch in one direction and crash.&lt;br /&gt;
&lt;br /&gt;
Either extreme is bad, of course, but it should be noted that these are only extremes.  For reference, a stock FMA sensor run on 3.3V will saturate when flying over black asphalt on a very hot, dry Arizona day, a modified sensor will not.  Similarly, a modified sensor will show more signs of neutral-offset when operated in cloudy weather or other low contrast situations.  It is suggested that sensors only be modified if needed for very high contrast locales.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Make sure that the IR1 output from the XY sensor goes to IR1 input of the Tiny and that the IR2 output from the XY sensor goes to the IR2 input of the tiny board.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''XY sensors from FMA have the plug connected as:'''&lt;br /&gt;
* 1) Gnd;&lt;br /&gt;
* 2) +3.3v;&lt;br /&gt;
* 3) IR1;&lt;br /&gt;
* 4) IR2;&lt;br /&gt;
&lt;br /&gt;
* '''But on the tiny board the plug is connected as:'''&lt;br /&gt;
* 1) Gnd;&lt;br /&gt;
* 2) +3.3v;&lt;br /&gt;
* 3) IR2;&lt;br /&gt;
* 4) IR1.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Horizontal Sensor Modification ===&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:FMA_IR_OPAMP_OVR.jpg|thumb|left|300px|IR Sensor Board Bottom]]&lt;br /&gt;
|[[Image:FMA_IR_TOP_OVR.jpg|thumb|left|290px|IR Sensor Board Top]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The stock FMA resistors R2/R3 and R5/R6 (0603 0.8 Mohm/0603 510 ohm) set the op amp gain to approximately 1600.  Since this unit is designed to run on 5V and we are running it on 3.3V, we can change R3 and R6 from 510 ohm to 1K ohm to reduce the gain to around 800.  Another option is to replace R2 and R5 with 560 Kohm resistors, generating an output gain of approximately 1100; a gain which is practically identical to that of the Paparazzi board.&lt;br /&gt;
&lt;br /&gt;
''a suitable resistor from mouser is [http://www.mouser.com/search/productdetail.aspx?R=RK73H1JTTD5623Fvirtualkey66000000virtualkey660-RK73H1JTTD5623F here]''&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|R1&lt;br /&gt;
|200 ohm&lt;br /&gt;
|-&lt;br /&gt;
|R2&lt;br /&gt;
|0.8 Mohm&lt;br /&gt;
|-&lt;br /&gt;
|R3&lt;br /&gt;
|510 ohm&lt;br /&gt;
|-&lt;br /&gt;
|R4&lt;br /&gt;
|200 ohm&lt;br /&gt;
|-&lt;br /&gt;
|R5&lt;br /&gt;
|0.8 Mohm&lt;br /&gt;
|-&lt;br /&gt;
|R6&lt;br /&gt;
|510 ohm&lt;br /&gt;
|-&lt;br /&gt;
|R7&lt;br /&gt;
|600 ohm&lt;br /&gt;
|-&lt;br /&gt;
|R8&lt;br /&gt;
|600 ohm&lt;br /&gt;
|-&lt;br /&gt;
|C1&lt;br /&gt;
|0.026 uF&lt;br /&gt;
|-&lt;br /&gt;
|C2&lt;br /&gt;
|0.026 uF&lt;br /&gt;
|-&lt;br /&gt;
|C3&lt;br /&gt;
|0.026 uF&lt;br /&gt;
|-&lt;br /&gt;
|C4&lt;br /&gt;
|0.026 uF&lt;br /&gt;
|-&lt;br /&gt;
|C5&lt;br /&gt;
|0.01 uF&lt;br /&gt;
|-&lt;br /&gt;
|C6&lt;br /&gt;
|0.026 uF&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Vertical Sensor Modification ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|[[Image:Fma_ir_single_bottom.jpg|thumb|left|300px|IR Vertical Sensor Board Bottom]]&lt;br /&gt;
|[[Image:Fma_ir_single_up.jpg|thumb|left|290px|IR Vertical Sensor Board Top]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The same operation can be done with the vertical sensor by changing R3 from 510 ohm to a 1K ohm.&lt;br /&gt;
&lt;br /&gt;
''a suitable resistor from mouser is [http://www.mouser.com/search/productdetail.aspx?R=RK73H1JTTD1001Fvirtualkey66000000virtualkey660-RK73H1JTTD1001F here]''&lt;br /&gt;
&lt;br /&gt;
= Attopilot Sensor Boards =&lt;br /&gt;
&lt;br /&gt;
The Attopilot horizontal (X-Y) and vertical (Z) sensors are an alternative sensor pair for the Paparazzi autopilot. They come without molex connector already soldered if you are lucky. The molex connector on the board is bigger and different from the Paparazzi IR board. It is advised to solder the Paparazzi molex on the board, with a little soldering skill this is doable. &lt;br /&gt;
&lt;br /&gt;
== Pinouts and Optional Gain Adjustment ==&lt;br /&gt;
&lt;br /&gt;
{TODO}&lt;br /&gt;
&lt;br /&gt;
= Alternative sensor schematic from MyResearch =&lt;br /&gt;
&lt;br /&gt;
This is [http://www.myresearch.lt/blog/servo180/servo180.phtml MyResearch.lt] open source data. The sensor is presented as a replacement for a servo potentiometer. It can be used in a same way as the FMA Direct Co Pilot Sensor. The resistors 4k7 are not needed if it is not connected to a servo directly.&lt;br /&gt;
&lt;br /&gt;
[[Image:Ir_ckt.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Ir_pcb.gif]]&lt;br /&gt;
[http://www.myresearch.lt/blog/servo180/pcb.tif PCB]&lt;br /&gt;
&lt;br /&gt;
[[Image:Ir1.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=abZbt1Vm7iw VIDEO]&lt;br /&gt;
&lt;br /&gt;
Such a servomechanism is usable for controlling the bank of the aircraft or the inclination of the camera. You'll be able to control the inclination of the camera; the neutral position will conform to the horizon line. In addition, it is possible to control the ailerons of the aircraft and to incline the aircraft to the desired angle in respect of the horizon. If the horizon line is not symmetric, a bank of the aircraft appears. A signal of the sensor is applied to an ordinary servomechanism instead of the internal potentiometer. The potentiometer of the servomechanism is connected to the negative terminal, to the reference voltage and has one output (3 conductors); the infrared sensor is connected in the same way.&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]] [[Category:Sensors/IR]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Redundant_Communication&amp;diff=21295</id>
		<title>Redundant Communication</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Redundant_Communication&amp;diff=21295"/>
		<updated>2016-06-30T15:33:00Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: /* Hardware */ Tx pin locations&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float: right; width: 15%&amp;quot;&amp;gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Tools&amp;lt;/categorytree&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right; width: 45%; overflow: hidden&amp;quot;&amp;gt;[[Image:link_page.png|center|397px|Link Page in GCS]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right; width: 40%&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This  goal of this project is to allow multiple radio modems or other links be used between the aircraft and the ground station in a redundant fashion so that even if one link is lost, communication can be maintained. So far, the aircraft to ground component has been created and tested in the lab. The ground to aircraft component has not been created yet.&lt;br /&gt;
&lt;br /&gt;
===Reasons to Use Redundant Links===&lt;br /&gt;
Communication from the aircraft to the ground is called telemetry. This communication allows the status of the aircraft such as location, altitude, airspeed, battery level, current flight block, and much more to be monitored in real time. Communication from the ground to the aircraft is called datalink. This communication allows commands to be sent to the aircraft from the ground. This includes telling the aircraft what navigation to perform: fly to a waypoint, start the search area, come in for a landing. If a single link is used, as was always the case before this project, then if the aircraft goes out of range, or that link is otherwise lost, no telemetry information can be displayed in the GCS and commands sent from the GCS won't be received by the aircraft. Using the following redundant link system allows multiple links to be used in an effort to avoid this. Typically, you would introduce diversity when adding links. For example:&lt;br /&gt;
* If you have an on-board computer, you could tunnel messages through Wi-Fi over UDP in addition to a traditional 900 MHz XBee radio modem.&lt;br /&gt;
* You could use a satellite modem for long-range monitoring in addition to a radio modem.&lt;br /&gt;
* You could use a cellular modem in addition to a radio modem.&lt;br /&gt;
* With additional ground infrastructure, you could have radio modems located at different locations.&lt;br /&gt;
* You could use radio modems at different frequencies or with different antenna gains or orientations.&lt;br /&gt;
* You could use this system to evaluate different types of radio modems or antenna placements - you'll get real time info on each such as the ping time, received messages rate, and more information could easily be added.&lt;br /&gt;
&lt;br /&gt;
There are undoubtedly many more possibilities.&lt;br /&gt;
&lt;br /&gt;
== Aircraft to Ground ==&lt;br /&gt;
&lt;br /&gt;
===Compatibility===&lt;br /&gt;
This project was made to be fully backwards compatible and support the awesome functionality that Paparazzi already has. This includes:&lt;br /&gt;
* Completely backwards compatible - includes aircraft configuration files, previous flight logs, existing sessions, etc...&lt;br /&gt;
* Logging and replay - if multiple links are used, data received through either link is recorded. Also, replays will include the status of each link as it was during the flight.&lt;br /&gt;
* Link features such as USB-serial, audio, UDP, different transport layers, etc...&lt;br /&gt;
* Multi-aircraft sessions - also, you can use redundant links for one aircraft, but not for another if desired.&lt;br /&gt;
* Multiple aircraft connected to the same link - such as might come up in a mesh configuration where one aircraft relays data from another aircraft.&lt;br /&gt;
&lt;br /&gt;
===Features===&lt;br /&gt;
Enabling redundant communication from the aircraft to the ground enables the following features:&lt;br /&gt;
* Redundancy - as long as one link is receiving data, it will be logged and displayed on the GCS.&lt;br /&gt;
* Monitoring - the status, ping time, and rate of receiving messages for each link is shown (this makes it useful even if you're only using one link).&lt;br /&gt;
* Alerts - new alerts are added to the console in the GCS to alert you when a link has been connected for the first time, lost, or re-gained.&lt;br /&gt;
&lt;br /&gt;
===Future Improvements===&lt;br /&gt;
Several different improvements can be made to this system to improve it's performance and help satisfy future needs that may arise:&lt;br /&gt;
* Additional information can easily be added to the Link page of the GCS for each link. For example: errors, % uptime, or a scrolling graph of Rx messages/s.&lt;br /&gt;
* The ability to mark different links as either critical or backup. The idea here is that not all links should necessarily be treated equal. Maybe only one link is able to send datalink data to the aircraft (actually, this is the case right now) and so that link should be considered critical. If any other link is lost, then the overall telemetry can be counted as OK. But if the critical link is lost, then the GCS should change the link indicator light to red and start counting up even if the other link(s) are OK.&lt;br /&gt;
* The Link Combiner algorithm currently employs a simple circular buffer. This could be improved on by adding a time-stamp to each element of the buffer and only counting two buffer elements to be the same if their timestamps are close enough (say within 2 seconds - this could be configured)&lt;br /&gt;
* The Link Combiner algorithm could be improved by making the buffer size adjust automatically with the ping time and Rx messages/s rate. Or if the timestamp improvement is implemented, then the maximum time difference could be adjusted.&lt;br /&gt;
* A performance and resource use analysis could be done to optimize the Link Combiner. The circular buffer is currently implemented using Python lists which could probably be improved upon. Also, significantly more ivy messages are sent and received. This might make optimizations to the regex or other parts of the ivybus worthwhile.&lt;br /&gt;
&lt;br /&gt;
===How to Use===&lt;br /&gt;
&lt;br /&gt;
For an example using two USB-serial adaptors, see the '''Flight USB-serial Redundant''' session saved in the example control_panel.xml configuration (on master branch, once the pull request has been accepted).&lt;br /&gt;
&lt;br /&gt;
For the details, keep reading:&lt;br /&gt;
In order to implement redundant links using this code, there are three simple steps to follow:&lt;br /&gt;
&lt;br /&gt;
* Connect the hardware - on the airborne side, connect the Rx pin of the autopilot's UART port to multiple radio modems or whatever other device which will get the information to the ground. On the ground side, connect multiple modems as normal (using USB to serial adapters, a UDP connection, or whatever). (note: Once the ground to aircraft redundancy has been implemented, you won't have to split the Rx signal and can just plug each modem into a UART port)&lt;br /&gt;
* Launch a Link agent for each modem (in Paparazzi Center, select it from the tools menu). Configure the agents as you would have before (serial port, baud rate, UDP, etc...). None of these features have been modified or removed. Then, use two new command line arguments: -redlink and -id. The -redlink flag tells Link that it's one of multiple links. The -id flag lets you specify an integer number as the id of that particular link.&lt;br /&gt;
* Launch the Link Combiner agent (again, from the tools menu). This agent listens to all of the Link agents that have their -redlink set and combines the data.&lt;br /&gt;
&lt;br /&gt;
The following screenshot shows a session with two links, connected to serial ports ttyUSB0 and ttyUSB1, and with id's 1 and 2:&lt;br /&gt;
&lt;br /&gt;
[[File:redundant_session.png|alt=Agents in Redundant Link Session|700px|thumb|center|The Agents Running in a Redundant Link Setup]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Test the system and make sure that it works correctly under all circumstances. Do this before flying. In particular, make sure that the buffer size if appropriate. Take a look at the [[#Algorithm Considerations|Algorithm Considerations]] section for details.&lt;br /&gt;
&lt;br /&gt;
===Interface===&lt;br /&gt;
Once the redundant link system is started (even if only one Link is used), several changes appear in the GCS. This is achieved by the new message LINK_STATUS which is sent by the Link Combiner. These new features are designed to allow closer monitoring and better management of the link(s) between the aircraft and the ground station.&lt;br /&gt;
&lt;br /&gt;
The following screenshot clearly shows these changes:&lt;br /&gt;
[[File:redundant_link_gcs.png|alt=Changes to the GCS when redundant links are used|1000px|thumb|center|Screenshot of the GCS with multiple links]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Firstly, we can see that there is a new page in the notebook named Link. This page contains critical information for each link. More information can easily be added, but for now, it shows the status of the link (just like the main Link status indicator in the strip), the current ping time, and the rate of received messages. So if one link is lost, it's status indicator will turn red and start counting up just like link 2 in the above screenshot.&lt;br /&gt;
&lt;br /&gt;
Next, we can see that the main Link status indicator that's located in the strip has been modified slightly. It now shows the ratio of connected links to the total number of links. I.e. 3/4 means that there are four links and one of them has been lost. Furthermore, the indicator will be green if all links are connected, yellow if one or more are lost, and red if all links are lost. Once all links are lost, the indicator will count up just like before.&lt;br /&gt;
&lt;br /&gt;
Lastly, alerts have been added to the console. Whenever a link is lost or reconnected, a message will appear in the console stating so. Messages also appear when a new link is added.&lt;br /&gt;
&lt;br /&gt;
===Design===&lt;br /&gt;
====Implementation====&lt;br /&gt;
Here's a block diagram showing how the aircraft talks to the various ground segment programs (also known as agents) when not using the redundant link system:&lt;br /&gt;
&lt;br /&gt;
[[File:ground_segment_block_diagram.png|alt=Block diagram of agents in the ground segment|500px|thumb|center|Paparazzi Ground Segment]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ivy bus lets the programs talk to each other through the use of short messages. Pay close attention to the coloured arrows, which show the main flow of these messages. Next we have a block diagram of the redundant link system:&lt;br /&gt;
&lt;br /&gt;
[[File:redundant_links_block_diagram.png|alt=Block diagram of agents in the ground segment when redundant links are used|800px|thumb|center|Paparazzi Ground Segment with Redundant Links]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here we can see the new agent, the Link Combiner. We also see multiple occurrences of the Link agent. When operating in redundant mode, each occurrence of Link transmits the data it receives from the aircraft to the Link Combiner instead of the Server. It does this by transmitting the received telemetry messages within the TELEMETRY_MESSAGE message which the Server doesn't listen to. The Link Combiner on the other hand does. TELEMETRY_MESSAGE messages are sent by each link and include the id of that link. The Link Combiner listens to all of them and then transmits a single set of messages to the Server with the combined data. This results in the Server and all other ground segment agents (such as Messages and the Real Time Plotter) getting their telemetry data from Link Combiner as if it was coming from a single occurrence of Link.&lt;br /&gt;
&lt;br /&gt;
====Link Combiner====&lt;br /&gt;
The Link Combiner agent is written in Python. It receives messages from all of the Links (when they're in redundant mode: -redlink), and outputs messages to the Server and other ground segment agents. There is a bit involved however since the Server and GCS shouldn't be sent identical messages. I.e. if the aircraft sends a message and it's received successfully by more than one link, then that particular message should only sent by Link Combiner once. This is a somewhat tricky requirement since there is no guarantee that the message will be received by all of the links, and it's possible that the aircraft actually sends a second message that's exactly the same as the first. No extra info (such as a time-stamp or counter) is added to the messages sent from the aircraft to the ground, so the Link Combiner employs an algorithm to detect duplicate messages. Testing has shown that for typical links, this algorithm performs extremely well.&lt;br /&gt;
&lt;br /&gt;
The algorithm gives each link a circular buffer to store the last N messages. When a new message comes in on a particular link, the algorithm first checks if it's already in that link's buffer. If it is, then it's obviously a new message, so its removed from all of the other buffers if it's in any of them. Then, the message is sent to the other agents. If the message isn't already in the link's buffer, then it's added to the buffer. After that, all of the other link's buffers are checked for the message. If it's in any of them, then the message was already received by another link, so isn't sent. If it's not in any of them, then the message is sent. The following flowchart depicts this algorithm:&lt;br /&gt;
&lt;br /&gt;
[[File:link_combiner_flowchart.png|alt=Flowchart of the Link Combiner|500px|thumb|center|Algorithm to prevent duplicate messages]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Algorithm Considerations====&lt;br /&gt;
As the aircraft sends various messages, possibly with the exact same data, and the links gain and lose connection, there is no guarantee that this algorithm will do a perfect job of filtering out identical and only identical messages. However, in typical operation, it seems to work very well. And for the application of displaying aircraft data, the occasional missing or duplicate message is acceptable. There are only a few scenarios where the Link Combiner won't produce perfect results, and they should come up infrequently:&lt;br /&gt;
&lt;br /&gt;
* A message will be sent twice if the buffer size is too small to hold all of the messages received from one link between that link receiving the message and another link receiving the identical message. When the second link receives the message that has already been received, if the original isn't in the buffer anymore, than the algorithm won't know it's a duplicate message. This scenario should be considered whenever implementing a redundant link system. Partly because it is the most likely to come up, but also because if it does occur, then all messages will be duplicated. In order to avoid this scenario, you can set the buffer size as a command line argument of Link Combiner. To know what a good value would be, you can observer the Ping time and Rx messages/s of the links in the new Link page of the notebook. Calculate the minimum buffer size by taking the difference between the largest ping time and the smallest ping time and multiplying it by the largest Rx messages/s. Then apply a safety factor when setting the buffer size - 10 times the calculated value should be good.&lt;br /&gt;
* A message won't be sent when it should be if the autopilot sends a message that's the same as one it already sent (same name and exact same values) AND one or more links were lost between the first message and the second AND the link that's receiving the second message doesn't have the first message in it's buffer still. That's three conditions. If this happens, then the Link Combiner will see the second message as a duplicate of the first and will skip it. Only this one message will be missed though - it won't start happening to all messages. Also, the data will have been data that was already received. So if it's for example the battery voltage message, then it's not a big deal to miss it. As long as there aren't links rapidly being lost and gained, then this shouldn't happen often. Note that as the buffer size is increased, it is believed that this becomes more likely to happen.&lt;br /&gt;
&lt;br /&gt;
== Ground to Aircraft ==&lt;br /&gt;
&lt;br /&gt;
This part of the redundant communication system hasn't been implemented yet. All information here is what it is envisioned to look like.&lt;br /&gt;
&lt;br /&gt;
===Features===&lt;br /&gt;
* Enable multiple datalink links to be used for communicating with the autopilot.&lt;br /&gt;
* Let different telemetry be sent out each link.&lt;br /&gt;
* Let the choice of what telemetry is sent be moved from the settings page of the GCS to the Link page, since it can be different for each link.&lt;br /&gt;
* Add a link status indicator (this is the light that turns red when the link is lost) for the datalink to the Link page. This will allow better monitoring of the links by not assuming that if one direction is good, the other direction is good as well.&lt;br /&gt;
* Let each link be configured as telemetry only, datalink only, or by-directional.&lt;br /&gt;
&lt;br /&gt;
===Compatibility===&lt;br /&gt;
Communication in the autopilot is enabled with the ground by including the telemetry subsystem in the airframe file. For example:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing or rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;telemetry&amp;quot;     type=&amp;quot;transparent&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
In order to use multiple links, changes should be made to allow a telemetry subsystem for each link. Related to this, would it be advantageous to have multiple instances be supported for each different subsystem? Once the design for this is determined, would actual support for each subsystem have to be added one at a time? Because of the logic for how multiple subsystems should behave together is dependent on the subsystem, this might be the case. The telemetry subsystem for example should default to sending telemetry out each one and combining the telemetry received.&lt;br /&gt;
&lt;br /&gt;
===Hardware===&lt;br /&gt;
Unlike aircraft to ground redundancy, ground to aircraft redundancy requires multiple UART ports in the hardware of the autopilot. The author is not particularly familiar with this, but believes that there are ways to get multiple UART ports for this purpose:&lt;br /&gt;
* Telemetry can be sent out over USB by specifying the telemetry type to be &amp;quot;transparent_usb&amp;quot;.&lt;br /&gt;
* For the Lisa/M, the USB port can actually be used as a UART port with some hardware modifications.&lt;br /&gt;
* Using an I2C GPS instead of a UART one can free up a UART port on most autopilots.&lt;br /&gt;
* For the Lisa/M, can UART 1 and 5 be used if Spektrum Satellite receivers aren't used?  The board needs to be modified to access UART1_Tx see [[Lisa/M_v2.0#USB_as_UART1TX_.2B_hardware_flow_control|here]].  UART5_Tx is PC12 on the GPIO connector.&lt;br /&gt;
&lt;br /&gt;
In addition, future hardware designs could includes more UART ports for redundant communications or any other purpose.&lt;br /&gt;
&lt;br /&gt;
===Design===&lt;br /&gt;
Unlike the aircraft to ground communication, for ground to aircraft communication it is not acceptable to have the same message be acted on twice. This could cause the aircraft to behave unexpectedly. In order to implement a 100% guaranteed link combiner for the aircraft, the author proposes a system that adds a counter to each message sent to the aircraft. This would allow the autopilot to easily ignore identical messages - they'll have the same value for the counter. Also, since minimal data is sent from the ground to the aircraft, adding the extra bytes to the payload will have a minimal impact on performance - this is not the case for the telemetry.&lt;br /&gt;
&lt;br /&gt;
The challenging part of this design will be integrating it properly into the existing systems.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tools]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=RT_Paparazzi&amp;diff=21293</id>
		<title>RT Paparazzi</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=RT_Paparazzi&amp;diff=21293"/>
		<updated>2016-06-27T14:45:23Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Real Time (RT) Paparazzi =&lt;br /&gt;
== ICUAS 2016 An Open-Source Real-Time UAS Flight Control Prototyping and Testing Platform with Fractional-Order Horizontal Controller Example ==&lt;br /&gt;
The code is available [https://github.com/AggieAir/pprz-icuas2016 here]&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
the '''RT Paparazzi''' initiative is a step towards extended flexibility for the core autopilot. In a real time operating system (RTOS) [http://en.wikipedia.org/wiki/Real-time_operating_system] multiple threads are available, which are doing specific jobs e.g. a telemetry thread, a radio thread, a failsafe thread, at a defined rate. Unlike ''bare-metal'' application which uses interrupt driven timers for timing tasks, real time OS has a kernel which takes care of scheduling and running the threads. Having a kernel, it is possible to set priority of each thread, how much memory it takes etc.etc. which gives the developer more control over timing and resource management.&lt;br /&gt;
&lt;br /&gt;
Besides kernel, a typical RTOS also has a hardware abstraction layer (HAL) which stands between user application and actual hardware, so the core autopilot developer doesn't have to worry to much about writing drivers for the sensor to use.&lt;br /&gt;
&lt;br /&gt;
One of the strengths of Paparazzi is it's modularity - combining this with precise timing, scheduling and resource management a RTOS brings along, Paparazzi is now in a position to exceed even the leading commercial closed-source UAs autopilots.&lt;br /&gt;
&lt;br /&gt;
= Paparazzi with ChibiOS/RT =&lt;br /&gt;
&lt;br /&gt;
RT Paparazzi is based on ChibiOS/RT [http://chibios.org/dokuwiki/doku.php]. ChibiOS/RT supports basically all architectures that standard Paparazzi does (see [http://chibios.org/dokuwiki/doku.php?id=chibios:architectures]), which makes both systems compatible. Since RTOS makes handling multiple I/O easier, but comes with some extra overhead (context switching, kernel code), it gives most leverage to to STM32 F1xx and F4xx based autopilots ([[Apogee/v1.00]],[[Lisa/M_v20]], [[Lisa/S]], [[STM32F4_Discovery]], [[KroozSD]]...).&lt;br /&gt;
&lt;br /&gt;
The development of RT Paparazzi with ChibeOS was started by the AggieAir team [http://aggieair.usu.edu/] at Utah State University.&lt;br /&gt;
&lt;br /&gt;
== Getting the sourcecode ==&lt;br /&gt;
&lt;br /&gt;
First version of functional RT paparazzi code (which comes with other perks such as SD card logging) is already available in the ''[https://github.com/paparazzi/paparazzi master]'' branch, thanks to [https://github.com/gautierhattenberger gautierhattenberger]. The code is continually improving, so stay tuned.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Debugging with an Eclipse IDE ==&lt;br /&gt;
'''NOTE: As of June 2016 and ChibiOS 3.0+ SWD debugging with Black Magic Probe doesn't work under Eclipse (you get segmentation faults). The debugging works normally in terminal (arm-none-eabi-gdb), but I suspect there is some bug in how Eclipse is handling the debugging commands. Older versions of Eclipse (before Mars 2.0) and ChibiOS 2.6 work together perfectly.'''&lt;br /&gt;
&lt;br /&gt;
Having a good development and debugging environment is a must for developing RT embedded system. The steps of setting up Eclipse IDE are described here [http://wiki.chibios.org/dokuwiki/doku.php?id=chibios:guides:eclipse1] and here [http://wiki.chibios.org/dokuwiki/doku.php?id=chibios:guides:eclipse2].&lt;br /&gt;
&lt;br /&gt;
An alternative guide is for example here [http://embeddedprogrammer.blogspot.com/2012/09/stm32f4discovery-development-with-gcc.html]&lt;br /&gt;
&lt;br /&gt;
Another great tutorial for setting up Eclipse is done by [http://docs.armstrap.org/en/latest/getting-started-eclipse-development-tools.html| armstrap].&amp;lt;br/&amp;gt;&lt;br /&gt;
With blacmagic probe integration, without Eclipse Arm Plugin.&lt;br /&gt;
&lt;br /&gt;
Just a few notes to the process:&lt;br /&gt;
* it is preferred to switch-off compiler optimization for debugging (use ''-O0'' in compiler settings in Makefile for given architecture)&lt;br /&gt;
* install GCC Arm Embedded toolchain [https://launchpad.net/~terry.guo/+archive/gcc-arm-embedded] (recommended anyway for Paparazzi since v 5.0)&lt;br /&gt;
* get Black Magic probe from Blacksphere [http://www.blacksphere.co.nz/main/blackmagic], it will make your life easier &lt;br /&gt;
* in '''Creating a GDB Debug Configuration''' use the following commands for Black Magic Probe:&lt;br /&gt;
 target extended-remote /dev/ttyACM0&lt;br /&gt;
 monitor jtag_scan&lt;br /&gt;
 attach 1&lt;br /&gt;
 monitor vector_catch disable hard&lt;br /&gt;
 set mem inaccessible-by-default off&lt;br /&gt;
 monitor option erase&lt;br /&gt;
 set print pretty&lt;br /&gt;
(for [[Lisa/M_v2.0#Lisa.2FLia_F4 | Lisa/Lia F4]] board use '' swdp_scan'' instead of ''jtag_scan'')&lt;br /&gt;
* if you are using luftboot, don't forget to add image offset into the debug configuration:&lt;br /&gt;
[[File:Rt_paparazzi_eclipse_setup_2.png]]&lt;br /&gt;
* don't forget in &amp;quot;Eclipse-&amp;gt;Window-&amp;gt;Preferences-&amp;gt;Run/Debug-&amp;gt;Launching-&amp;gt;Default Launchers-&amp;gt;GDB Hardware Debugging&amp;quot; set preferred launcher to &amp;quot;Standard GDB&amp;quot; (otherwise the ChibiOS/RT plugin won't work, tested in Eclipse Kepler Service Release 1):&lt;br /&gt;
[[File:Rt_paparazzi_eclipse_setup_1.png]]&lt;br /&gt;
&lt;br /&gt;
=== ChibiOS Eclipse plugin ===&lt;br /&gt;
&lt;br /&gt;
ChibiStudio plugin is officially supported for Windows only (write to the [http://www.chibios.com/forum/ ChibiOS forum] if you would like Linux support too), but since it is in Java it works under Linux too. If you want to test it yourself, here is the HOWTO:&lt;br /&gt;
&lt;br /&gt;
* Get the latest eclipse (Version: Mars.2 Release (4.5.2))&lt;br /&gt;
* Install C/C++ Hardware Debugging as described [[wiki.chibios.org/dokuwiki/doku.php?id=chibios:guides:eclipse1#eclipse|here]]&lt;br /&gt;
* Make sure you have gcc-arm-none-eabi installed (v.4.9)&lt;br /&gt;
* Download latest ChibiStudi (preview 17) from [https://sourceforge.net/projects/chibios/files/ChibiStudio/ here] extract it and from ''ChibiStudio/eclipse/plugins'' Copy these libraries into your Eclipse/plugins directory:&lt;br /&gt;
    org.chibios.chibistudio.branding_1.0.0.jar&lt;br /&gt;
    org.chibios.tools.eclipse.config_1.9.1.201603121101.jar&lt;br /&gt;
    org.chibios.tools.eclipse.debug.chibiosrt2_1.2.0.201603121101.jar&lt;br /&gt;
    org.chibios.tools.eclipse.debug.chibiosrt3_1.0.1.201603121101.jar&lt;br /&gt;
    org.chibios.tools.eclipse.debug.chibiosrt4_1.0.0.201603121101.jar&lt;br /&gt;
* Restart Eclipse - now you will see the ChibiOs plugings under ''Help-&amp;gt;Installation Details-&amp;gt;Plugins''&lt;br /&gt;
* Enable the plug-in while in the &amp;quot;Debug&amp;quot; view under: Window-&amp;gt;Show View-&amp;gt;Other...-&amp;gt;ChibiOS/RT-&amp;gt;ChibiOS/RT&amp;quot; (see [http://forum.chibios.org/phpbb/viewtopic.php?f=3&amp;amp;t=140] for details)&lt;br /&gt;
&lt;br /&gt;
Now you can use ChibiStudio plugin to view your threads memory usage, available stack, trace buffer etc. depending on the debugging options you enabled.&lt;br /&gt;
&lt;br /&gt;
=== ChibiOS Tutorials ===&lt;br /&gt;
Related videos about setting up Eclipse with ChibiOS plugins (called together ChibiStudio) are available [https://www.youtube.com/playlist?list=PLpDawCIUjDFFXjRFUT9tFcUuuvNb6iT1A here]&lt;br /&gt;
&lt;br /&gt;
= Compiling Paparazzi code in Eclipse =&lt;br /&gt;
Moved to [[DevGuide/CodeEditors#Eclipse_2|DevGuide/CodeEditors]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Builds/Tests&amp;diff=21258</id>
		<title>Builds/Tests</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Builds/Tests&amp;diff=21258"/>
		<updated>2016-06-14T13:29:11Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Automated testing =&lt;br /&gt;
&lt;br /&gt;
There are a number of automated tests that can be run from the command line from the top level Paparazzi directory:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;make test&amp;lt;/code&amp;gt;: runs test_math and test_examples&lt;br /&gt;
* &amp;lt;code&amp;gt;make test_math&amp;lt;/code&amp;gt;: test math lib&lt;br /&gt;
* &amp;lt;code&amp;gt;make test_examples&amp;lt;/code&amp;gt;: test compiles all aircrafts/targets in conf/conf_tests.xml&lt;br /&gt;
* &amp;lt;code&amp;gt;make test_all_confs&amp;lt;/code&amp;gt;: test compiles all confs, i.e. all aircrafts found in all conf files found by &amp;lt;code&amp;gt;find_confs.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To test compile all aircrafts in one specific conf file:&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;CONF_XML=conf/conf_personal.xml prove tests/aircrafts/&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
See [https://github.com/paparazzi/paparazzi/blob/master/tests/aircrafts/01_compile_all_aircrafts.t tests/aircrafts/01_compile_all_aircrafts.t] for more details.&lt;br /&gt;
&lt;br /&gt;
If you require more verbose output of the results run the command &amp;lt;code&amp;gt;make test TEST_VERBOSE=1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The test results can also be generated in JUnit format adding the option &amp;lt;code&amp;gt;JUNIT=1&amp;lt;/code&amp;gt; to the command line i.e. &amp;lt;code&amp;gt;make test JUNIT=1&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;make test TEST_VERBOSE=1 JUNIT=1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
JUnit formatting of test results requires that the Perl module &amp;lt;code&amp;gt;TAP::Formatters::JUnit&amp;lt;/code&amp;gt; is installed on the machine that the tests are run on. Please see [[Builds/Tests#Installing Perl Modules| installing Perl modules]] for more details&lt;br /&gt;
&lt;br /&gt;
= Hardware tests =&lt;br /&gt;
The hardware testing is executed using the Perl test framework.&lt;br /&gt;
&lt;br /&gt;
To implement the hardware testing we need do the following&lt;br /&gt;
* Build the firmware&lt;br /&gt;
* Upload the firmware to the target board noting that multiple boards may be connected to the same computer&lt;br /&gt;
* Start up the '''server''' program&lt;br /&gt;
* Start up the '''link''' program&lt;br /&gt;
* Run the test suite by reading and writing data to the Ivy bus.&lt;br /&gt;
* Stop the '''server''' and '''link''' processes&lt;br /&gt;
&lt;br /&gt;
The Perl module &amp;lt;code&amp;gt;IO::Socket::Multicast&amp;lt;/code&amp;gt; is required to be installed to be able to execute the hardware tests. Please see [[Builds/Tests#Installing Perl Modules| installing Perl modules]] for more details&lt;br /&gt;
&lt;br /&gt;
To execute the hardware tests run the command &amp;lt;code&amp;gt;make test TEST_HARDWARE=1&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Installing Perl modules =&lt;br /&gt;
On Ubuntu/Debian simply &lt;br /&gt;
  apt-get install libio-socket-multicast-perl libtap-formatter-junit-perl&lt;br /&gt;
&lt;br /&gt;
To install Perl modules directly from CPAN the following procedure can be run.&lt;br /&gt;
&lt;br /&gt;
# sudo perl -MCPAN -e shell&lt;br /&gt;
# install &amp;lt;module name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should install all of the required modules. note that errors may be reported during the installation process so you should pay attention to what is happening.&lt;br /&gt;
&lt;br /&gt;
[[Category:Testing]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Installation/MacOSX-legacy&amp;diff=21256</id>
		<title>Installation/MacOSX-legacy</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Installation/MacOSX-legacy&amp;diff=21256"/>
		<updated>2016-06-10T15:55:37Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Intro =&lt;br /&gt;
This page contains the different installation approaches that did work on past versions of Mac OS X. They are currently not working any more on the newest versions of Mac OS X. They still might be useful as information sources for those that either want to install on a legacy mac os x or want to resurrect one of the installation approaches.&lt;br /&gt;
&lt;br /&gt;
= Basic Install (Binary Installer) =&lt;br /&gt;
Depending on the version of Mac OS you have installed on your computer the installation process will vary slightly. Also this install process is only recommended for beginners. If you want to be able to use more up to date Paparazzi and be able to track the development more closely, you should consider installing Paparazzi tools using the source solution described in the next chapter.&lt;br /&gt;
&lt;br /&gt;
== Installation Video Tutorials (On OS X 10.9.* '''Mavericks''') ==&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtubehd|s5KFZqxqAr4}} {{#ev:youtubehd|lXB1y0Dv2y0}}&lt;br /&gt;
&lt;br /&gt;
== Basic Install (Binary Installer) (On OS X 10.9.* '''Mavericks''') ==&lt;br /&gt;
If your Apple Mac operation system is OSX Mavericks or newer then the easiest way to get started with Paparazzi on your Apple Mac is to start with the following Basic install. If you have an older version you want to follow the slightly longer Basic install, below.&lt;br /&gt;
&lt;br /&gt;
The steps you need to take to enjoy Paparazzi are:&lt;br /&gt;
# Install XQuartz from [http://xquartz.macosforge.org MacOSForge]. (You can alternatively use the X11.app if it is available for your version of Mac OS X.)&lt;br /&gt;
# Open the Terminal.app&lt;br /&gt;
# Install the command line tools by executing: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;xcode-select --install&amp;lt;/source&amp;gt; and clicking on the &amp;quot;Install&amp;quot; button in the dialog that will pop up.&lt;br /&gt;
# Install the Paparazzi Tools installer for your OS version from [http://download.paparazziuav.org/darwin/ paparazziuav.org]&lt;br /&gt;
## You might get an error saying: &amp;quot;paparazzi-tools-xxxxxx.mpkg can't be opened because it is from an unidentified developer.&amp;quot; To get rid of this error you will need to:&lt;br /&gt;
### Open &amp;quot;System Preferences&amp;quot;-&amp;gt;&amp;quot;Security&amp;amp;Privacy&amp;quot; and change the &amp;quot;Allow apps downloaded from:&amp;quot; setting to &amp;quot;Anywhere&amp;quot;. (The option might be greyed out. To activate the selection you will need to authenticate yourself as system administrator. Click on the lock in the left lower corner of the &amp;quot;System Preferences&amp;quot; window, to open the authentication window.)&lt;br /&gt;
# Set up your environment variables and Python appropriately using the pprz-env-set script:&lt;br /&gt;
## Get the script: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;curl https://raw.githubusercontent.com/paparazzi/paparazzi-portability-support/master/darwin/install/Contents/Resources/pprz-env-set &amp;gt;~/Desktop/pprz-env-set&amp;lt;/source&amp;gt;&lt;br /&gt;
## Move script to right location: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo mv ~/Desktop/pprz-env-set /opt/paparazzi/bin/pprz-env-set&amp;lt;/source&amp;gt;&lt;br /&gt;
## Change script permissions: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo chmod 755 /opt/paparazzi/bin/pprz-env-set&amp;lt;/source&amp;gt;&lt;br /&gt;
## Run the script: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo /opt/paparazzi/bin/pprz-env-set&amp;lt;/source&amp;gt;&lt;br /&gt;
## Close the terminal. (Do that before you try to move on to the next step. Otherwise the newly set environment will not take effect and you will end up with compilation errors.)&lt;br /&gt;
# That's it! To run Paparazzi you need to open the Terminal app and build and run Paparazzi.&lt;br /&gt;
## In spotlight type Terminal and then open the Terminal App&lt;br /&gt;
## then type: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;cd ~/paparazzi &amp;amp;&amp;amp; make &amp;amp;&amp;amp; ./paparazzi&amp;lt;/source&amp;gt; (The first time you start paparazzi it might take several minutes to show a window. It is because GTK is indexing the fonts the first time it starts up.) (If you get the error: &amp;quot;Fatal error: exception Gtk.error(&amp;quot;GtkMain.init: initialization failed ml_gtk_init: initialization failed&amp;quot;)&amp;quot; the most likely source of the issue is the lack of X11 server. Install either X11.app or XQuartz as mentioned in step 1.)&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
* the binary installer will check if ~/paparazzi exists on your system. If it does, then the installer does nothing. If this directory does NOT already exist, the installer will automatically clone the Paparazzi Git repository into that directory.&lt;br /&gt;
* the binary installer will add a few lines to your ~/.profile for PATH modification and for default PAPARAZZI_HOME and PAPARAZZI_SRC env vars. If you have something other than the default ~/paparazzi installation, please edit your ~/.profile and comment out the env var exports.&lt;br /&gt;
* the binary installer creates a symbolic link between the available /opt/paparazzi/bin/python2.7 and /opt/paparazzi/bin/python. Combined with the PATH modification, this will cause &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;python something.py&amp;lt;/source&amp;gt; to call /opt/paparazzi/bin/python2.7 instead of any system pythons.&lt;br /&gt;
&lt;br /&gt;
== Basic Install (Binary Installer) (Support: 10.7.* '''Lion''', 10.8.* '''Mountain Lion''') ==&lt;br /&gt;
If your Apple Mac operation system is OSX Snow Leopard or Lion or newer then the easiest way to get started with Paparazzi on your Apple Mac is to start with the Basic install.&lt;br /&gt;
&lt;br /&gt;
The steps you need to take to enjoy Paparazzi are:&lt;br /&gt;
# Install XQuartz from [http://xquartz.macosforge.org MacOSForge]. (You alternatively can install the X11.app from Apple. If it is available for your version of Mac OS X.)&lt;br /&gt;
# Install the latest available [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] development tool for your OS, we had good success with [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 Xcode] v4.2 on Snow Leopard and v4.3.2 on Lion. For Snow Leopard, Xcode 3.2.6 also works and is still available as a [https://developer.apple.com/downloads/ free download] with an Apple ID (search for ''xcode 3.2.6'').&lt;br /&gt;
## With Xcode 4.3 and above you need to install the command line tools. Xcode --&amp;gt; Preferences --&amp;gt; Downloads --&amp;gt; Components --&amp;gt; Command line tools&lt;br /&gt;
## Check that the correct version of Xcode is being used for compilation &amp;lt;source lang=bash&amp;gt;/usr/bin/xcodebuild -version&amp;lt;/source&amp;gt; It should return the version of Xcode that has been installed, e.g. 4.2. In the rare case you need to change your XCode version run the following command in your terminal: &amp;lt;source lang=bash&amp;gt;sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer&amp;lt;/source&amp;gt;&lt;br /&gt;
# Install the Paparazzi Tools installer for your OS version from [http://download.paparazziuav.org/darwin/ paparazziuav.org]&lt;br /&gt;
# Set up your environment variables and Python appropriately using the pprz-env-set script:&lt;br /&gt;
## Get the script: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;curl https://raw2.github.com/paparazzi/paparazzi-portability-support/master/darwin/install/Contents/Resources/pprz-env-set &amp;gt; ~/Desktop/pprz-env-set&amp;lt;/source&amp;gt;&lt;br /&gt;
## Move script to right location: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo mv ~/Desktop/pprz-env-set /opt/paparazzi/bin/pprz-env-set&amp;lt;/source&amp;gt;&lt;br /&gt;
## Change script permissions: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo chmod 755 /opt/paparazzi/bin/pprz-env-set&amp;lt;/source&amp;gt;&lt;br /&gt;
## Run the script: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo /opt/paparazzi/bin/pprz-env-set&amp;lt;/source&amp;gt;&lt;br /&gt;
## Close the terminal. (Do that before you try to move on to the next step. Otherwise the newly set environment will not take effect and you will end up with compilation errors.)&lt;br /&gt;
# That's it! To run Paparazzi you need to open the Terminal app and build and run Paparazzi.&lt;br /&gt;
## In spotlight type Terminal and then open the Terminal App&lt;br /&gt;
## then type: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;cd ~/paparazzi &amp;amp;&amp;amp; make &amp;amp;&amp;amp; ./paparazzi&amp;lt;/source&amp;gt; (The first time you start paparazzi it might take several minutes to show a window. It is because GTK is indexing the fonts the first time it starts up.) (If you get the error: &amp;quot;Fatal error: exception Gtk.error(&amp;quot;GtkMain.init: initialization failed ml_gtk_init: initialization failed&amp;quot;)&amp;quot; the most likely source of the issue is the lack of X11 server. Install either X11.app or XQuartz as mentioned in step 1.)&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
* the binary installer will check if ~/paparazzi exists on your system. If it does, then the installer does nothing. If this directory does NOT already exist, the installer will automatically clone the Paparazzi Git repository into that directory.&lt;br /&gt;
* the binary installer will add a few lines to your ~/.profile for PATH modification and for default PAPARAZZI_HOME and PAPARAZZI_SRC env vars. If you have something other than the default ~/paparazzi installation, please edit your ~/.profile and comment out the env var exports.&lt;br /&gt;
* the binary installer creates a symbolic link between the available /opt/paparazzi/bin/python2.7 and /opt/paparazzi/bin/python. Combined with the PATH modification, this will cause &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;python something.py&amp;lt;/source&amp;gt; to call /opt/paparazzi/bin/python2.7 instead of any system pythons.&lt;br /&gt;
&lt;br /&gt;
== Basic Uninstall ==&lt;br /&gt;
In the case you would like to uninstall Paparazzi after completing a basic installation, one must type the following in your terminal prompt:&lt;br /&gt;
&lt;br /&gt;
'''Warning''' This first step removes your paparazzi source code, including any changes you may have made yourself locally. If you want to keep your git repository intact, skip this first step and only use the following two steps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;rm -rf ~/paparazzi&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo pprz-env-set -u&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo rm -rf /opt/paparazzi&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that pprz-env-setup -u removes the entry from ~/.profile and also removes the /opt/paparazzi/bin/python symlink.&lt;br /&gt;
&lt;br /&gt;
== Using Luftboot and PyUSB ==&lt;br /&gt;
&lt;br /&gt;
'''UPDATE:''' The latest binary installer should have PyUSB included by default, no need to install it separately.&lt;br /&gt;
&lt;br /&gt;
If you are planning on loading code onto a Luftboot-equipped STM32 board, you will need to have a Python version on your machine that is active and with [http://sourceforge.net/apps/trac/pyusb/ PyUSB] installed for that version.&lt;br /&gt;
&lt;br /&gt;
To install PyUSB, execute&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo python setup.py install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
from inside the unzipped PyUSB source directory.&lt;br /&gt;
&lt;br /&gt;
To test which Python version is the default and whether this Python version can find the PyUSB module, in Terminal simply type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To start the default Python. At the Python prompt (&amp;gt;&amp;gt;&amp;gt;) type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
import usb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If another prompt line comes up, PyUSB is installed correctly and you will be able to use Luftboot. If an error is thrown, then your configuration is not correct.&lt;br /&gt;
&lt;br /&gt;
== MacPorts and PyUSB ==&lt;br /&gt;
If you have MacPorts installed, you can install either &amp;lt;code&amp;gt;py26-pyusb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;py26-pyusb-devel&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;py27-pyusb-devel&amp;lt;/code&amp;gt;, depending on which Python(s) you have installed already, or wish to install. For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo port selfupdate&lt;br /&gt;
sudo port install py27-pyusb-devel&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To find out what versions of Python are available on your system (via MacPorts):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
port select --list python&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Default Apple Python versions have a -apple ending.&lt;br /&gt;
&lt;br /&gt;
Select a different version of python to be the active version if desired. For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo port select --set python python27&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A good, working configuration would be to have MacPorts installed, and install &amp;lt;code&amp;gt;py27-pyusb-devel&amp;lt;/code&amp;gt;, then ensure that python27 is the active version.&lt;br /&gt;
&lt;br /&gt;
== Adjusting your PATH and Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
There are sometimes path issues with OS X if you have MacPorts or a similar (Homebrew, Fink) system installed. The reason for this is there may be multiple copies of a binary required for Paparazzi in different places, and depending on the path, the desired instance is not correctly called. This often presents itself as an error when building the main Paparazzi source code. A typical error may involve the &amp;lt;code&amp;gt;pkg-config&amp;lt;/code&amp;gt; program. This can often be corrected by checking and adjusting your PATH environment variable.&lt;br /&gt;
&lt;br /&gt;
To check the currently configured default PATH:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
echo $PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Ideally, the Paparazzi binary paths (&amp;lt;code&amp;gt;/opt/paparazzi/bin&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/opt/paparazzi/sbin&amp;lt;/code&amp;gt;) should come first. To move the Paparazzi paths to the highest search priority:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PATH=/opt/paparazzi/bin:/opt/paparazzi/sbin:$PATH&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This will only be active in the current terminal session. If you wish to manually modify the path permanently, you can edit ~/.profile and add the above line to the bottom of the file.&lt;br /&gt;
&lt;br /&gt;
= Installing from source (MacPorts) =&lt;br /&gt;
Note: This is known to work for Mac OS X MountainLion. For newer Mac OS versions you should try the Homebrew based install.&lt;br /&gt;
&lt;br /&gt;
The tools that are required to work with paparazzi on a Mac are installed from MacPorts. All of the commands are given by terminal commands, please open your terminal first.&lt;br /&gt;
&lt;br /&gt;
In case you '''already have MacPorts installed''', it is advised to run the following steps before proceeding:&lt;br /&gt;
&lt;br /&gt;
# check that /opt/local/bin is the first entry in your PATH, easy to check by giving the following command &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;echo $PATH&amp;lt;/source&amp;gt;&lt;br /&gt;
# Then give the following command to make sure your ports are up-to-date &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo port selfupdate &amp;amp;&amp;amp; sudo port upgrade outdated&amp;lt;/source&amp;gt;&lt;br /&gt;
..great, you now can run the installation steps starting from step '''4''' below.&lt;br /&gt;
&lt;br /&gt;
If you don't already have MacPorts installed run the following steps:&lt;br /&gt;
&lt;br /&gt;
# Install the latest [http://itunes.apple.com/us/app/xcode/id448457090?mt=12 XCode]. If you are using 10.9 (Mavericks) or newer you just need to run &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;xcode-select --install&amp;lt;/source&amp;gt;&lt;br /&gt;
# If you are using Mountain Lion, X11 is no longer included by default, use the [http://xquartz.macosforge.org/landing/ XQuartz project] to install it.&lt;br /&gt;
# Install [http://www.macports.org/install.php MacPorts]&lt;br /&gt;
# Edit the file &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;/opt/local/etc/macports/sources.conf&amp;lt;/source&amp;gt; and above the &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;rsync://...&amp;lt;/source&amp;gt; line add &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;rsync://rsync.paparazziuav.org/macports/ports/&amp;lt;/source&amp;gt; It is important that this line comes before the path to the standard ports as some of the Paparazzi ports are intended to replace the standard versions. The file is write protected so it will be necessary to be root in order to edit it. The simplest way is to open a terminal window and use nano thus: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo nano /opt/local/etc/macports/sources.conf&amp;lt;/source&amp;gt;&lt;br /&gt;
# Now update the available ports with the command: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo port selfupdate&amp;lt;/source&amp;gt;&lt;br /&gt;
# To install all of the paparazzi prerequisites: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo port install paparazzi-tools&amp;lt;/source&amp;gt;&lt;br /&gt;
# ...Then go and have lunch, get a coffee, get some sleep. This will probably take a long time.&lt;br /&gt;
# After installation, we need to set the correct python to override the default OS X python: &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo port select --set python python27&amp;lt;/source&amp;gt;&lt;br /&gt;
# You can also [[#Changing the GTK look and feel|change the GTK theme]]&lt;br /&gt;
&lt;br /&gt;
Now you can follow the generic instructions for [[Installation|installing the paparazzi source]].&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' If you had previously used MacPorts to install Paparazzi, you may need to manually uninstall arm-none-eabi-binutils, arm-none-eabi-gcc-linaro, and arm-none-eabi-gdb prior to upgrading paparazzi-tools. libcmsis, libopenstm32 and libopencm3 ports may need to be uninstalled as well. For example:&lt;br /&gt;
 &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo port uninstall -f libcmsis libopenstm32 libopencm3 arm-none-eabi-gdb arm-none-eabi-gcc-linaro arm-none-eabi-binutils&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Lion and XCode 4.3 or newer notes ==&lt;br /&gt;
&lt;br /&gt;
After installing Xcode 4.3 you will need to install the command line tools by opening the XCode preferences pane, Downloads and selecting Command Line Tools for installation. Otherwise you will not find GCC in your unix path.&lt;br /&gt;
&lt;br /&gt;
Also if macports is complaining about xcodebuild and that you should run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt; sudo xcode-select -switch /Applications/Xcode.app &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should actually run&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt; sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so that xcodebuild can find the needed executables for you.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
If you continually experience problems installing paparazzi or paparazzi-tools then it may be that you have some other conflicting software installed. i.e. an old version of a library in /usr.&lt;br /&gt;
&lt;br /&gt;
One way to work around issues relating to prior MacPort installs that has been found is to clean out everything MacPorts has installed and install from scratch using the latest MacPorts&lt;br /&gt;
# &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo port -f uninstall installed&amp;lt;/source&amp;gt;&lt;br /&gt;
# &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo port clean --all uninstalled&amp;lt;/source&amp;gt;&lt;br /&gt;
# &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo port selfupdate&amp;lt;/source&amp;gt;&lt;br /&gt;
# &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo port install paparazzi-tools&amp;lt;/source&amp;gt;&lt;br /&gt;
This was in fact the process used to check that the code installed on a clean machine.&lt;br /&gt;
&lt;br /&gt;
== Upgrading to Lion ==&lt;br /&gt;
If you already have MacPorts and Paparazzi installed and running and you then upgrade to Lion you'll probably find that some things are broken. (make can't be found for example)&lt;br /&gt;
To remedy this situation you need to do the following:&lt;br /&gt;
# Upgrade Xcode to the Lion version. (App Store --&amp;gt; Search for Xcode and install)&lt;br /&gt;
# Install the Lion version of [http://www.macports.org/install.php MacPorts]&lt;br /&gt;
# &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo port -f uninstall installed&amp;lt;/source&amp;gt;&lt;br /&gt;
# &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo port clean --all uninstalled&amp;lt;/source&amp;gt;&lt;br /&gt;
# &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo port selfupdate&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now here you have the opportunity to use the binary installer method detailed above or if installing from source then Macports can be used to build from source thus:&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;sudo port install paparazzi-tools&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you use a USB to serial converter that isn't based on the FTDI chipset then you may also find that your USB to Serial driver needs to be updated.&lt;br /&gt;
# Start console&lt;br /&gt;
# Plug in your USB to serial converter&lt;br /&gt;
You may get a message similar to this &amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;Jul 26 23:14:48 Bernies com.apple.kextd[10]: Can't load /System/Library/Extensions/osx-pl2303.kext - no code for running kernel's architecture.&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are fortunate enough to have a USB to serial converter that is using the PL2303 chipset then the [http://www.prolific.com.tw/eng/downloads.asp?id=31 Prolific] driver should sort you out. Installation instructions are included in the readme.txt and are well worth following.&lt;br /&gt;
&lt;br /&gt;
== Keeping source files for debugging ==&lt;br /&gt;
If you wish to debug code using the source install then you'll find that many of the source files for the libraries are missing.&lt;br /&gt;
&lt;br /&gt;
This is because MacPorts cleans up the build artifacts and source files after the installation is complete. This behaviour can be changed by adding the -k option to the port command.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
  sudo port -k install paparazzi-tools&lt;br /&gt;
This will result in all of the source and build artefact files being left on the hard disk.&lt;br /&gt;
&lt;br /&gt;
Should you later wish to clean up these files you can do so with the clean command.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
  sudo port clean installed&lt;br /&gt;
&lt;br /&gt;
== Mavericks Notes ==&lt;br /&gt;
&lt;br /&gt;
'''Q:''' Can not find the command line tools package in XCode any more.&lt;br /&gt;
&lt;br /&gt;
'''A:''' Since Mavericks (10.9) it is not necessary to install xcode to install the command line tools package that is needed for macports and paparazzi. Just run in the command line:&lt;br /&gt;
  xcode-select --install&lt;br /&gt;
&lt;br /&gt;
'''Q:''' libgcc is not compiling with error:&lt;br /&gt;
  :info:build The directory that should contain system headers does not exist:&lt;br /&gt;
  :info:build   /usr/include&lt;br /&gt;
&lt;br /&gt;
'''A:''' You probably upgraded from older OS X and are using old command line tools. Make sure to run '''xcode-select --install''' command. This should fix the libgcc compilation error.&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=DevGuide/CodeEditors&amp;diff=21255</id>
		<title>DevGuide/CodeEditors</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=DevGuide/CodeEditors&amp;diff=21255"/>
		<updated>2016-06-10T15:50:07Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
So you want to adjust the sourcecode to your wishes, get rid of some bugs that bother you and help to improve the code, great! While theoretically it all an be done with VI and command line instructions, learning to code for Paparazzi this way is a little cumbersome. Therefore it is a good idea to set up an IDE Integrated Development Environment.&lt;br /&gt;
&lt;br /&gt;
As you may have noticed, this page is far from finished, it really would be great if you help to improve this page with even a small improvement. &lt;br /&gt;
&lt;br /&gt;
== IDE for OCAML ==&lt;br /&gt;
&lt;br /&gt;
We start of with OCAML IDE's first&lt;br /&gt;
&lt;br /&gt;
=== EMACS ===&lt;br /&gt;
Tuareg is a really nice mode for Emacs. On Ubuntu/Debian just '''apt-get install tuareg-mode'''.&lt;br /&gt;
&lt;br /&gt;
http://www.emacswiki.org/emacs/TuaregMode&lt;br /&gt;
&lt;br /&gt;
=== Netbeans ===&lt;br /&gt;
&lt;br /&gt;
==== Installation ====&lt;br /&gt;
First install a reasonable new Netbeans, e.g. v6.8 via the synaptic package manager in Ubuntu or use the commandline&lt;br /&gt;
&lt;br /&gt;
==== OCAML Plugin ====&lt;br /&gt;
&lt;br /&gt;
http://ocamlplugin.loki-a.com/index.php?title=Main_Page&lt;br /&gt;
&lt;br /&gt;
# Start netbeans IDE&lt;br /&gt;
# Go to Netbean menu -Tools - Plugins&lt;br /&gt;
&lt;br /&gt;
# Select tab - Settings&lt;br /&gt;
# Click the Add button&lt;br /&gt;
&lt;br /&gt;
Name: Ocaml from Loki a&lt;br /&gt;
URL:  http://ocamlplugin.loki-a.com/ocamlplugin/updates/updates.xml&lt;br /&gt;
&lt;br /&gt;
# Then click the tab &amp;quot;Available plugins&amp;quot;&lt;br /&gt;
# Select for install from the list the &amp;quot;Ocaml Plugin&amp;quot;&lt;br /&gt;
# Click Install&lt;br /&gt;
# Click Install Then Next&lt;br /&gt;
# If you see &amp;quot;Signed but not trusted, ignore the message just click &amp;quot;continue&amp;quot;&lt;br /&gt;
# If it all worked, you will see &amp;quot;Install completed successfully, just click &amp;quot;Finish&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== Syntax Highlighting ====&lt;br /&gt;
&lt;br /&gt;
=== Eclipse ===&lt;br /&gt;
&lt;br /&gt;
* [http://www.algo-prog.info/ocaide/ OcaIDE]&lt;br /&gt;
* [http://ocamldt.free.fr/ ODT: OCaml Development Tools]&lt;br /&gt;
&lt;br /&gt;
OcaIDE seems to be the best option for Eclipse. Note that OcaIDE requires eclipse to run under Java 7.&lt;br /&gt;
No release of ODT since November 2013.&lt;br /&gt;
&lt;br /&gt;
== IDE for Python ==&lt;br /&gt;
&lt;br /&gt;
[http://www.jetbrains.com/pycharm/ PyCharm] is a great Python IDE with awesome completion, code assistance, debugger and git integration and much more...&lt;br /&gt;
&lt;br /&gt;
== IDE for C and CPP ==&lt;br /&gt;
&lt;br /&gt;
Next are the IDE's for C development&lt;br /&gt;
&lt;br /&gt;
=== Netbeans ===&lt;br /&gt;
=== Eclipse ===&lt;br /&gt;
&lt;br /&gt;
* [http://eclipse.org/cdt/ Eclipse CDT]&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks ===&lt;br /&gt;
&lt;br /&gt;
== Debugging tools ==&lt;br /&gt;
&lt;br /&gt;
===GDB===&lt;br /&gt;
GDB can be used for quite effective Paparazzi debugging. Debugging [[RT_Paparazzi#Debugging_with_an_Eclipse_IDE|guide]] with Eclipse IDE was already described for [[RT_Paparazzi]], but the exact same steps can be used for classic Paparazzi. The guide is [[RT_Paparazzi#Debugging_with_an_Eclipse_IDE|here]]: &lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:Developer_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Sensors/GPS&amp;diff=21254</id>
		<title>Sensors/GPS</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Sensors/GPS&amp;diff=21254"/>
		<updated>2016-06-08T14:22:02Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: /* Tips */ sp&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Sensors&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:left; clear:left; margin-right:2ex; padding: 0.7ex;&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=GPS Receivers=&lt;br /&gt;
&lt;br /&gt;
An overview of GPS receivers used in combination with Paparazzi. The list is by far not complete. A lot more devices will work flawlessly with Paparazzi. If you have a GPS receiver you have used with Paparazzi that is not listed here, it would be great if you could add that information to this page.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=[http://1bitsquared.com 1BitSquared] [http://1bitsquared.com/products/g0-gps G0 GPS]=&lt;br /&gt;
&lt;br /&gt;
[[Image:G0_GPS_V1_1_Top_with_skirt.jpeg|240px|thumb|left|G0 GPS]]&lt;br /&gt;
&lt;br /&gt;
[http://1bitsquared.com 1BitSquared] sells a Paparazzi UAV compatible GPS module called [[G0]]. It is designed to neatly fit on top of the [[Elle0]] autopilot. It can also be used with any other Paparazzi UAV compatible hardware. [[G0]] GPS module features a large ground plane with optional ground plane skirt, as well as RF shielding on the back of the module.&lt;br /&gt;
&lt;br /&gt;
The large ground plane improves the directionality of the unit helping reject multi-path. When using the [[G0]] GPS unit on a multi-copter it results in less drift when taking off the ground, and improves GPS lock when flying from waypoint to waypoint.&lt;br /&gt;
&lt;br /&gt;
The EMI shielding on the back of the unit decreases the amount of noise injected from the aircraft avionics into the GPS unit, improving the noise to signal ratio. An increased signal results in a more robust satellite lock, and more reliable fully autonomous and guided flight operations.&lt;br /&gt;
&lt;br /&gt;
[[G0]] GPS module is using a U-Blox that is providing very fast speed updates that are crucial for accurate navigation within Paparazzi UAV. Additionally Paparazzi UAV supports the binary U-Blox protocol that is very efficient to parse compared to the very vaguely defined NMEA text protocol. Just enable the UCenter Module in your airframe file and Paparazzi will configure the module for best performance without the need for user interaction.&lt;br /&gt;
&lt;br /&gt;
For more information go to the [[G0|G0 GPS wiki page]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=[http://swiftnav.com/ Swiftnav] Piksi=&lt;br /&gt;
&lt;br /&gt;
A very special receiver is the OpenSource (almost all...) Swiftnav Piksi GPS receiver. How to use this device with Paparazzi is described on the a specific page&lt;br /&gt;
[[Image:Piksi_GPS_back.jpg|200px|thumb|left|Swiftnav Piksi]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=LS20031 GPS Receiver=&lt;br /&gt;
&lt;br /&gt;
[[Image:ls20031.jpg|170px|thumb|left|LS20031]]&lt;br /&gt;
Sparkfun sells the LS20031 GPS module which uses NMEA (Paparazzi support for NMEA is BETA right now.) This Locosys GPS module supports WAAS (U.S. DGPS), EGNOS (EU DGPS), and MSAS (Japanese DGPS).&lt;br /&gt;
&lt;br /&gt;
More information on configuring the GPS via PMTK can be found [http://dallasmakerspace.org/wiki/LS20031_GPS here]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Globalsat BU 353=&lt;br /&gt;
&lt;br /&gt;
[[Image:BU-353_gps_receiver.jpg|thumb|left|170px|BU-353 GPS receiver]]&lt;br /&gt;
&lt;br /&gt;
USB US Globalsat GPS-Mouse&lt;br /&gt;
&lt;br /&gt;
Typical Uses:&lt;br /&gt;
&lt;br /&gt;
* Parrot AR Drone 2.0&lt;br /&gt;
* Ground Station GPS (direct support with Linux / gpsd)&lt;br /&gt;
&lt;br /&gt;
''Not appropriate for many airborne applications due to extra USB-serial circuitry and weight of housing and internal magnet''&lt;br /&gt;
&lt;br /&gt;
Basic compatibility with Windows, Mac and Linux.&amp;lt;br/&amp;gt;&lt;br /&gt;
More information at the [[GPS/BU_353]] site.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=uBlox=&lt;br /&gt;
&lt;br /&gt;
[[Image:U-blox_color_warm_60.gif|100px]]&lt;br /&gt;
[http://www.u-blox.com uBlox is a Swiss technology company] that develops very good positioning modules. They are the recommended GPS modules for use with Paparazzi autopilots. Note that u-Blox produces the modules only. They do not sell complete boards to end users. These are sold by a multitude of vendors. &lt;br /&gt;
&lt;br /&gt;
Why uBlox:&lt;br /&gt;
*Low cost ([[Sensors/GPS#u-blox_NEO-6M|i.e. NEO6-M]])&lt;br /&gt;
*Small size&lt;br /&gt;
*Excellent performance (u-Blox 7 and 8 series)&lt;br /&gt;
*Up to 10Hz update rate&lt;br /&gt;
*5V tolerant UART&lt;br /&gt;
*Works out of the box with Paparazzi's u-Blox [[Module/GPS_UBlox_UCenter|auto-configuration module]]&lt;br /&gt;
&lt;br /&gt;
The '''[[Tiny]]''' series features an onboard LEA series GPS receiver and patch antenna, while most other boards boards require an external receiver+antenna such as the [[#Paparazzi_Stand-alone_GPS_Receivers|Paparazzi GPS]] or [[#u-Blox_SAM-LS_GPS_Smart_Antenna|SAM-LS]]. &lt;br /&gt;
&lt;br /&gt;
{|align = center&lt;br /&gt;
|-&lt;br /&gt;
|[[Image:Lea big.jpg|200px|thumb|center|u-blox LEA GPS Receiver]]&lt;br /&gt;
|[[Image:Ublox_SAM-LS.jpg|200px|thumb|center|u-Blox SAM-LS GPS receiver (w/built-in Smart Antenna)]]&lt;br /&gt;
|[[Image:UBlox_LEA-6H_Sarantel_Helix_s.jpg|200px|thumb|center|u-Blox LEA-6H GPS receiver with Sarantel Helix Antenna]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The proprietary UBX protocol is used as it offers more information and efficiency than the universal NMEA protocol. For details take a look at the code in &amp;lt;tt&amp;gt;sw/airborne/subsystems/gps/gps_ubx.c&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==u-Blox LEA Series Receivers==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- [[Image:Lea big.jpg|200px|thumb|right|u-blox LEA]] --&amp;gt;&lt;br /&gt;
[[Image:Lea5htiny13.jpg|thumb|left|200px|LEA-5H installed on the Tiny]]&lt;br /&gt;
The '''[[Lisa]]''' series, '''[[Twog_v1|TWOG]]''', '''[[Classix]]''' and '''[[Previous_Autopilots|AVR-based]]''' boards require an external GPS module and antenna.  The '''[[Tiny]]''' features an integrated receiver and antenna.  Either type is designed for [http://www.u-blox.com/ u-blox] 4, 5 and 6 series GPS receivers and the proprietary UBX binary protocol.  An external battery or capacitor is typically used to enable the GPS to retain data while powered off for significantly faster signal re-acquisition.  Any of the LEA-4, LEA-5 and LEA-6 series receivers can be used including the less expensive LEA-4A, 4S, 5A and 5S and similar low cost 6-series models as the special boot configuration code required for these models is already written as a [[Module/GPS_UBlox_UCenter|module]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- autobaud - runtime configuration of - ROM-only modules: use ucenter-module to configure your UBlox with no cable nor windows u-center --&amp;gt;&lt;br /&gt;
  &amp;lt;load name=&amp;quot;gps_ubx_ucenter.xml&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*4Hz Position update rate&lt;br /&gt;
*Supports active or passive antennas&lt;br /&gt;
*Supports [http://en.wikipedia.org/wiki/DGPS DGPS], [http://en.wikipedia.org/wiki/WAAS WAAS], [http://en.wikipedia.org/wiki/EGNOS EGNOS], and [http://en.wikipedia.org/wiki/MSAS MSAS]&lt;br /&gt;
*Low position noise figure&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Paparazzi Stand-alone uBlox GPS Receivers==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Ppzgps13med01.jpg|Top&lt;br /&gt;
Image:Ppzgps13_lrg_02.jpg|Bottom&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Paparazzi source provides a design for an external GPS board. An external GPS board is required for other boards like Lisa, TWOG, Elle0 and Classix.&lt;br /&gt;
Programming it is similar to the Tiny2.11 GPS configuration. If you build your own you will want to upload the latest u-blox firmware before you configure. See [[Get Hardware]] for sources of assembled boards.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The Paparazzi design in https://github.com/paparazzi/paparazzi-hardware/tree/master/sensors/gps/gps_13. The board is very small and light as it has only the components required. It is powered from the 5v line on the &amp;quot;downloads&amp;quot; connector of a TWOG. Also note it is a 4-layer PCB that means better noise resistance. The board has pins for USB connection but requires a different cable and a solder jumper to be move from the ground (default) to 3.3v input to enable the USB port on the module. &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[http://paparazzi.enac.fr/wiki_images/Gps_13_BOM.xls V1 BOM.xls]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://paparazzi.enac.fr/wiki_images/TinygpsBOM.txt Eagle Parts List Output.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
See [[Get_Hardware|Get Hardware]] page for suppliers.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Wiring Diagram===&lt;br /&gt;
&lt;br /&gt;
{|align = none&lt;br /&gt;
|-&lt;br /&gt;
|[[Image:TWOG to GPS.jpg|200px|thumb|center|TWOG to Standalone GPS Cable Schematic]]&lt;br /&gt;
|[[Image:gps13v09FTDIcable.jpg|200px|thumb|center|GPS13 v0.9 Ucenter cable (ftdi)]]&lt;br /&gt;
|[[Image:booz gps.jpg|200px|thumb|center|BoozGPS (quadrotor gps V1.1 2009/5) Ucenter cable (ftdi)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===uBlox to ARdrone 2===&lt;br /&gt;
&lt;br /&gt;
[[Image:HowtoConnectUSBHelixGPSForParrotARDrone2.jpg|thumb|left|How to connect USB to uBlox Helix GPS for Parrot ARDrone2]]&lt;br /&gt;
To connect a uBlox with Helix antenna via a USB to serial cable that you can just plug into your ARdrone 2&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==3rd Party u-blox Reference Design Boards==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[Image:LEA5HExternalModulePinout.jpg|thumb|left|LEA-5H Full Board Pinout]]&lt;br /&gt;
The only other GPS board in use seems to be u-blox reference designs or similar to it. They have LEA-4H, LEA-5H and LEA-6H (typically) and several interfaces. Often a larger antenna as well. &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The board in the photo is a [http://www.rfdesign.co.za/pages/5645456/Products/GPS-Products/Receiver-Boards.asp RF DESIGN] LEA-5H-SMART. &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The jumpers adjacent to the TTL interface connectors need to be closed with low value resistors for paparazzi uart port use. Also a [http://nz.element14.com/jsp/search/productdetail.jsp?SKU=1514218 battery] has to be added with an appropriate charging resistor to enable RTC functionality.&lt;br /&gt;
&amp;lt;/p&amp;gt;     &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NAVILOCK NL-507ETTL==&lt;br /&gt;
&lt;br /&gt;
[[Image:Navilock NL-507ETTL.jpg|thumb|left|NAVILOCK NL-507TTL]]&lt;br /&gt;
The NAVILOCK NL-507TTL u-blox TTL Modul 60416 features an LEA-4 series receiver and 25mm patch antenna on a 30mm x 30mm board.&lt;br /&gt;
* Datasheet: [http://www.navilock.de/download/Dokumente_SLASH_Sonstiges/60415_-_Datenblatt_u-blox_GPS_Module/481 http://www.navilock.de/download/Dokumente_SLASH_Sonstiges/60415_-_Datenblatt_u-blox_GPS_Module/481]&lt;br /&gt;
* Purchase:  Available for 28€ at [http://www.amazon.de/Navilock-NL-507TTL-u-blox-TTL-Modul/dp/B0011E6VQG www.amazon.de]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SPK GS407==&lt;br /&gt;
&lt;br /&gt;
[[Image:GS407.jpg|thumb|left|SPK GS407]]&lt;br /&gt;
[https://www.sparkfun.com/products/11466 This] is the model Sparkfun recommends as a replacement for the old GS406.  It's essentially the same, but uses the newer 6-series receiver, and is not using a ribbon cable as an interface.  It  uses [http://www.sarantel.com/products/sl1206 Sarantels] SL1206 active antenna.&lt;br /&gt;
It's recommended to buy [https://www.sparkfun.com/products/574 This extension cable] to use with it.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==u-blox NEO-6M==&lt;br /&gt;
&lt;br /&gt;
[[Image:Hk neo gps.jpg|thumb|left|Hobbyking NEO 6M back]]&lt;br /&gt;
This is the cheapest GPS module with antenna for ~13€ at [http://www.hobbyking.com/hobbyking/store/__31135__NEO_6M_GPS_Module.html Hobbyking].&lt;br /&gt;
&lt;br /&gt;
They come with different (sized) patch antenna, mounted on a separate PCB. The main PCB and antenna PCB are fixed with hot glue together and can be separated by hand.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Navilock NL-652ETTL==&lt;br /&gt;
&lt;br /&gt;
Nice module with u-blox 6 chip and without the annoying cable that the HK NEO-6m has.&lt;br /&gt;
[http://www.navilock.de/produkte/G_61846/merkmale.html?setLanguage=en Navilock NL-652ETTL]&lt;br /&gt;
&lt;br /&gt;
==u-Blox C04-6H Reference Design==&lt;br /&gt;
&lt;br /&gt;
[[Image:abavimage.jpg|thumb|left|u-blox C04-5H]]&lt;br /&gt;
u-Blox sells a complete module with antenna for around $200 and will also provide complete schematics, BOM, and PCB files for free if you wish to make your own.  Two versions are offered, one with an 18mm patch antenna and the other with the Sarantel P2 helical antenna.&lt;br /&gt;
See [http://www.ublox.com/en/evaluation-tools-a-software/reference-designs/for-gps-chips/c04-6h.html http://www.ublox.com/en/evaluation-tools-a-software/reference-designs/for-gps-chips/c04-6h.html] for more info.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drotek Boards==&lt;br /&gt;
[http://www.drotek.com Drotek's] u-Blox GPS boards work well and are not expensive. &lt;br /&gt;
&lt;br /&gt;
==uBlox GPS configuration==&lt;br /&gt;
&lt;br /&gt;
===using U-Center===&lt;br /&gt;
&lt;br /&gt;
''Note: Before attempting manual configuration consider using the [[Module/GPS_UBlox_UCenter|u-blox UCenter module]] instead. If automatic configuration does not work with more recent modules you should report it to the mailing list or the Gitter chat and may attempt the manual procedure below. But be aware that a wrong configuration can cause Paparazzi not acquiring any GPS lock for sometimes hard to find reasons.''  &lt;br /&gt;
&lt;br /&gt;
[[Image:U-center_screencap.jpg|thumb|u-center configuration software]]&lt;br /&gt;
[http://www.u-blox.com/products/u_center.html U-Center] is a very comprehensive freeware program intended for the configuration and evaluation of u-blox receivers. &lt;br /&gt;
* [http://www.u-blox.com/en/evaluation-tools-a-software/u-center/u-center.html Download u-center]&lt;br /&gt;
&lt;br /&gt;
* Note 1: You must [[tunnel|install the UART tunnel firmware]] to enable direct access to the built-in GPS on the [[Tiny|Tiny]].&lt;br /&gt;
&lt;br /&gt;
* Note 2: You will need a driver for your FTDI cable if you run u-center on Windows, which can be found  [http://www.ftdichip.com/Drivers/D2XX.htm here].&lt;br /&gt;
&lt;br /&gt;
* Note 3: You can run u-center on Linux by installing &amp;quot;Wine&amp;quot; ([http://www.winehq.org/site/download-deb Installation of Wine]) and set up COM1 as /dev/ttyUSB0. You need to create a symbolic link from the COM device to TTY like this (assuming your serial device is /dev/ttyUSB0):&lt;br /&gt;
 mkdir -p ~/.wine/dosdevices&lt;br /&gt;
 ln -s /dev/ttyUSB0 ~/.wine/dosdevices/COM1&lt;br /&gt;
&lt;br /&gt;
or what worked in Ubuntu 9.10&lt;br /&gt;
 &lt;br /&gt;
 ln -s /dev/ttyUSB0 ~/.wine/dosdevices/com1&lt;br /&gt;
&lt;br /&gt;
This command will create the symbolic link from ttyUSB0 to COM1. See Info on Wine for &amp;quot;dosdevices&amp;quot; setup. Just download the u-setup.exe and run it with Wine, follow prompts. This has been tested with Ubuntu7.10 and Ubuntu 8.04 so far.&lt;br /&gt;
&lt;br /&gt;
''Depending on your connection method and your udev configuration your serial device may have a different path. Just look it up using &amp;lt;code&amp;gt;dmesg&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;tail -f /var/log/syslog&amp;lt;/code&amp;gt; after plugging in.''&lt;br /&gt;
&lt;br /&gt;
The u-blox and Tiny UARTs both operate at 3.3V TTL levels and are 5V TTL tolerant.  You must use a level shifter such as the common MAX232 to connect these devices to a standard PC serial port.  The easiest and most recommended method is to connect to a USB port instead of serial with an [http://www.ftdichip.com/Products/EvaluationKits/TTL-232R.htm FTDI USB-TTL converter cable] available from Digikey, Mouser, or direct from FTDI. You can also use the [[UU0]] adapter designed and manufactured by [[1BitSquared]]. Instead of a cable it has a USB-A connector directly on the board. Other similar converters are available from [http://www.pololu.com/products/pololu/0391/ pololu] / [http://www.sparkfun.com/commerce/product_info.php?products_id=199 sparkfun].  A stand-alone GPS such as the SAM-LS will require clean 3.3V/50mA power and a common ground with the TTL converter.&lt;br /&gt;
&lt;br /&gt;
* U-blox occasionally releases firmware updates. Log on to the u-blox website using ''paparazzi'' for username &amp;amp; password to view or download the latest firmware images.  There have 'never' been any updates released for the Antaris-4 series used in the Tiny.&lt;br /&gt;
&lt;br /&gt;
Start U-center and choose your com port from the pull down list under the connect button near the top left corner of the window. Choose your baudrate from the pull down box to the right of the connect button or select the auto-baud button to the right of that.  U-blox default is 9600 baud.  This must be changed to 19200 or higher to accommodate the 4Hz update rate. It needs to match whatever your module is configured to (if you configured it with the U-blox U-Center or the [[Module/GPS_UBlox_UCenter|u-blox UCenter module]]). &lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:U-center_buttons.jpg|connect, baud, and autobaud buttons]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Uploading the Configuration File===&lt;br /&gt;
&lt;br /&gt;
Download the appropriate configuration file below and use u-center to load in onto your receiver. Under the ''Tools'' menu, choose ''GPS configuration''.  Be sure the box 'Store configuration into BBR/Flash' is checked and hit the button ''File&amp;gt;&amp;gt;GPS''.  A few errors and retries are normal, but a significant number of errors may indicate a poor connection and the software will notify you if it is unable to send all the data successfully.&lt;br /&gt;
* [[Media:Tiny_LEA-4P-v6.zip|LEA-4P]]&lt;br /&gt;
* [[Media:Tim-LL-V5.zip|TIM-LL]]&lt;br /&gt;
* [[Media:Tiny_LEA-5H-v5.zip|LEA-5H (For Use w/ Firmware V5 ONLY!)]]&lt;br /&gt;
* [[Media:Hk_NEO-6M.zip‎| Hobbyking NEO-6M]] [http://www.hobbyking.com/hobbyking/store/__31135__neo_6m_gps_module.html this module]&lt;br /&gt;
&lt;br /&gt;
===Automatic Configuration at Startup===&lt;br /&gt;
&lt;br /&gt;
You can also use the [[Module/GPS_UBlox_UCenter|u-blox UCenter module]] which will take over the task of initializing the GPS for you when you power your autopilot.&lt;br /&gt;
&lt;br /&gt;
===Manual Configuration===&lt;br /&gt;
&lt;br /&gt;
If you prefer to setup your receiver manually or have a model not listed above, here are instructions to configure your receiver in u-center.&lt;br /&gt;
Open the message window (menu View-&amp;gt;messages view) to start the configuration process by changing the following settings:&lt;br /&gt;
&lt;br /&gt;
====LEA-4P====&lt;br /&gt;
&lt;br /&gt;
# Right Click on the '''NMEA''' Icon and choose '''disable child'''&lt;br /&gt;
# Choose UBX-&amp;gt;CFG-&amp;gt;NAV2(Navigation 2) - set it to use '''Airborne 4G''' (tells the Kalman filter to expect significant changes in direction)&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#GPS|Airframe file]])&lt;br /&gt;
# Change the baudrate of U-Center to 38400bps if the connection is lost at this point&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;RXM(Receiver Manager) - change '''GPS Mode''' to '''3 - Auto''' (Enabling faster bootup only if signal levels are very good)&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;RATE(Rates) - change the '''Measurement Period''' to '''250ms''' (4 Hz position updates)&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calcuation errors)&lt;br /&gt;
# UBX-&amp;gt;NAV (not UBX-&amp;gt;CFG-&amp;gt;NAV): double click on '''POSUTM, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;CFG : '''save current config''', click '''&amp;quot;send&amp;quot;''' in the lower left corner to permanently save these settings to the receiver &lt;br /&gt;
&lt;br /&gt;
====LEA-5H====&lt;br /&gt;
&lt;br /&gt;
# Right Click on the '''NMEA''' Text on top of the tree and choose '''disable child messages'''&lt;br /&gt;
# Choose UBX-&amp;gt;CFG-&amp;gt;NAV5(Navigation 5) - set it to use '''Airborne 8 &amp;lt;4G'''. This tells the Kalman filter to expect significant changes in direction. &amp;lt;p&amp;gt;    Note that this setting is only good for faster moving airplanes. For a fixed position hovering heli, 'pedestrian' setting is better&amp;lt;/p&amp;gt;&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#GPS|Airframe file]])&lt;br /&gt;
# Change the baudrate of U-Center to 38400bps if the connection is lost at this point&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;RATE(Rates) - change the '''Measurement Period''' to '''250ms''' This gives a 4 Hz position update since 4 x 250ms is one second.&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calculation errors)&lt;br /&gt;
# UBX-&amp;gt;NAV (not UBX-&amp;gt;CFG-&amp;gt;NAV): double click on '''POSLLH, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;CFG : '''save current config''', click '''&amp;quot;send&amp;quot;''' in the lower left corner to permanently save these settings to the receiver&lt;br /&gt;
&lt;br /&gt;
* Cycle the power and verify that the new configuration was saved&lt;br /&gt;
* To reset the receiver to the factory defaults go to ''UBX-&amp;gt;CFG-&amp;gt;CFG'', select 'Revert to default configuration', and click ''Send'' at the bottom left corner.  To permanently save these values choose 'Save current configuration' and click ''Send''.&lt;br /&gt;
* To backup the configuration to a file on your PC: under the tools menu, choose GPS configuration, then click GPS&amp;gt;&amp;gt;file.  This file can be re-loaded in a similar manner to configure additional identical receivers.  Be sure the box 'Store configuration into BBR/Flash' is checked when reloading a configuration file to make the changes permanent.&lt;br /&gt;
* To update the firmware on a LEA-5H get u-center &amp;gt;= 5.03, revert the GPS receiver to the default configuration, get an appropriate image from u-Blox (fitting your receivers serial number), find the flash identification flash.txt file in the u-center install directory and be prepared to wait a long time.&lt;br /&gt;
&lt;br /&gt;
#NOTE: If you have a Tiny with LEA-5H module you must use u-center and manually setup the parameters as shown above (at least switch to 38400 baud manually before transferring the configuration file).&lt;br /&gt;
#NOTE: POSUTM is not available on LEA-5H. Instead, use POSLLH.&lt;br /&gt;
&lt;br /&gt;
====LEA-6H====&lt;br /&gt;
&lt;br /&gt;
We use the same configuration as for version 5&lt;br /&gt;
&lt;br /&gt;
# Right Click on the '''NMEA''' Text on top of the tree and choose '''disable child messages'''&lt;br /&gt;
# Choose UBX-&amp;gt;CFG-&amp;gt;NAV5(Navigation 5) - set it to use '''Airborne 8 &amp;lt;4G'''. This tells the Kalman filter to expect significant changes in direction. &amp;lt;p&amp;gt; Note that this setting is only good for faster moving airplanes. For a fixed position hovering heli, 'pedestrian' setting is better &amp;lt;/p&amp;gt;&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#GPS|Airframe file]])&lt;br /&gt;
# Change the baudrate of U-Center to 38400bps if the connection is lost at this point&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;RATE(Rates) - change the '''Measurement Period''' to '''250ms''' This gives a 4 Hz position update since 4 x 250ms is one second.&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calculation errors)&lt;br /&gt;
# UBX-&amp;gt;NAV (not UBX-&amp;gt;CFG-&amp;gt;NAV): double click on '''POSLLH, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;CFG : '''save current config''', click '''&amp;quot;send&amp;quot;''' in the lower left corner to permanently save these settings to the receiver.&amp;lt;p&amp;gt;    Make sure you activate '''&amp;quot;2 - I2C-EEPROM&amp;quot;''' if using a ROM-based NEO chipset with external EEPROM (like [http://www.hobbyking.com/hobbyking/store/__31135__neo_6m_gps_module.html HK 31135])&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Cycle the power and verify that the new configuration was saved&lt;br /&gt;
* To reset the receiver to the factory defaults go to ''UBX-&amp;gt;CFG-&amp;gt;CFG'', select 'Revert to default configuration', and click ''Send'' at the bottom left corner.  To permanently save these values choose 'Save current configuration' and click ''Send''.&lt;br /&gt;
* To backup the configuration to a file on your PC: under the tools menu, choose GPS configuration, then click GPS&amp;gt;&amp;gt;file.  This file can be re-loaded in a similar manner to configure additional identical receivers.  Be sure the box 'Store configuration into BBR/Flash' is checked when reloading a configuration file to make the changes permanent.&lt;br /&gt;
* To update the firmware on a LEA-6H get u-center &amp;gt;= 6.21, revert the GPS receiver to the default configuration, get an appropriate firmaware file from u-Blox, find the flash identification flash.txt file in the u-center install directory and be prepared to wait a long time.(seriously)&lt;br /&gt;
&lt;br /&gt;
==uBlox Tips==&lt;br /&gt;
&lt;br /&gt;
===Reset to Default Settings===&lt;br /&gt;
&lt;br /&gt;
The GPS module can be reset to its original default settings by pulling BOOT_INT high(3.3V) during a power cycle ([http://www.u-blox.com/customersupport/gps.g4/ANTARIS4_Modules_SIM(GPS.G4-MS4-05007).pdf Antaris Manual, p. 122]). It may be required after a wrong firmware upgrade or a bad configuration change.&lt;br /&gt;
&lt;br /&gt;
===Invalid argument===&lt;br /&gt;
&lt;br /&gt;
Problem:  I keep getting this error with my nice shiny Tiny v2.1 with a LEA-5H: Invalid_argument (&amp;quot;Latlong.of_utm&amp;quot;)&lt;br /&gt;
Solution: Select the correct [[Subsystem/gps|GPS subsystem]].&lt;br /&gt;
&lt;br /&gt;
===WAAS issues===&lt;br /&gt;
&lt;br /&gt;
WAAS has been officially operational and &amp;quot;suitable for safety-of-life applications&amp;quot; since 2003.  The default setting of all u-blox receivers ignores WAAS correction data and only uses the WAAS satellites for regular navigation like any other satellite.  U-blox recommends further limiting this setting to exclude any stray EGNOS/MSAS satellites in North America, and completely disabling all SBAS functions for use outside North America.  In 2006 one formerly reliable Paparazzi aircraft began having great GPS problems and displaying very erratic altitude calculations, disabling WAAS immediately resolved the issue and this phenomenon was recreated several times for verification. Turns out a new WAAS satellite was being added to the system and the others were being moved that week for better distribution. Our advice is to first test if SBAS works well in your region.&lt;br /&gt;
&lt;br /&gt;
The default used by the [[Module/GPS_UBlox_UCenter|u-blox UCenter module]] keeps SBAS enabled. &lt;br /&gt;
&lt;br /&gt;
===Assist Now===&lt;br /&gt;
u-Blox modules that have a flash memory can keep the almanac correction data for up to 35 days into the future. That will give you a 3d GPS fix within seconds. [https://www.u-blox.com/en/assistnow-lock-your-position-instantly AssitNow] Offline data can be uploaded to the module while it is connected to the u-center application. To use this feature you need to provide a u-Blox account credentials that you can receive from the [https://www.u-blox.com/en/assistnow-service-registration-form u-Blox registration site]. &lt;br /&gt;
&lt;br /&gt;
===Antenna options for the Tiny and Paparazzi GPS units===&lt;br /&gt;
See [[GPS/Antenna]].&lt;br /&gt;
&lt;br /&gt;
=Tips=&lt;br /&gt;
&lt;br /&gt;
There is a huge amount of good information on the Internet about GPS specifics that gives some good insight into GPS. This Paparazzi wiki is not intended to repeat already available information, some is added here.&lt;br /&gt;
&lt;br /&gt;
==EGNOS==&lt;br /&gt;
&lt;br /&gt;
EGNOS augments the GPS satellite navigation system and makes it suitable for safety critical UAS applications. EGNOS became operational on 1 October 2009. ESA claims that it can determine position to within 2 meters compared with about 20 meters for GPS alone. Note that the service is currently provided only in western Europe. For further information take a look on the [http://www.esa.int/esaNA/egnos.html ESA EGNOS website].&lt;br /&gt;
&lt;br /&gt;
For the latest update about functionality of EGNOS please check the website: [http://www.gsa.europa.eu European GNSS Supervisory Authority]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==DGPS (Differential GPS)==&lt;br /&gt;
&lt;br /&gt;
Differential GPS is any method of improving GPS accuracy by comparing the GPS-indicated position of a nearby location to the known value and transmitting any error to the mobile unit.  DGPS was originally created as a means of bypassing the deliberately introduced inaccuracies in civilian GPS signals.  The original method used low frequency ground radios to relay correction data to the mobile unit and is still used today at airports, shipping ports, and even individual farms.  Satellite Based Augmentation System (SBAS) is a modern form of DGPS where the ground stations relay correction data to a GEO-Stationary satellite, which then relays it to the mobile unit on standard GPS frequencies eliminating the need for a separate radio receiver.  SBAS is currently available in 3 regions, [http://www.esa.int/esaNA/ESAF530VMOC_egnos_1.html WAAS, EGNOS, and MSAS regions]. U-blox receivers support all common varieties of DGPS [http://www.u-blox.com/customersupport/gps.g3/ENGOS_Issues(GPS.G3-CS-04009).pdf read the u-blox SBAS application note].&lt;br /&gt;
* It is important to note that DGPS methods only improve the ''accuracy'' of the position calculation, not the ''precision''.  Since Paparazzi navigation is typically performed relative to the power-on location, any static error that could be corrected with DGPS is irrelevant.&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]] [[Category:Sensors]] [[Category:User_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Sensors/GPS&amp;diff=21253</id>
		<title>Sensors/GPS</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Sensors/GPS&amp;diff=21253"/>
		<updated>2016-06-08T14:20:28Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Sensors&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:left; clear:left; margin-right:2ex; padding: 0.7ex;&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=GPS Receivers=&lt;br /&gt;
&lt;br /&gt;
An overview of GPS receivers used in combination with Paparazzi. The list is by far not complete. A lot more devices will work flawlessly with Paparazzi. If you have a GPS receiver you have used with Paparazzi that is not listed here, it would be great if you could add that information to this page.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=[http://1bitsquared.com 1BitSquared] [http://1bitsquared.com/products/g0-gps G0 GPS]=&lt;br /&gt;
&lt;br /&gt;
[[Image:G0_GPS_V1_1_Top_with_skirt.jpeg|240px|thumb|left|G0 GPS]]&lt;br /&gt;
&lt;br /&gt;
[http://1bitsquared.com 1BitSquared] sells a Paparazzi UAV compatible GPS module called [[G0]]. It is designed to neatly fit on top of the [[Elle0]] autopilot. It can also be used with any other Paparazzi UAV compatible hardware. [[G0]] GPS module features a large ground plane with optional ground plane skirt, as well as RF shielding on the back of the module.&lt;br /&gt;
&lt;br /&gt;
The large ground plane improves the directionality of the unit helping reject multi-path. When using the [[G0]] GPS unit on a multi-copter it results in less drift when taking off the ground, and improves GPS lock when flying from waypoint to waypoint.&lt;br /&gt;
&lt;br /&gt;
The EMI shielding on the back of the unit decreases the amount of noise injected from the aircraft avionics into the GPS unit, improving the noise to signal ratio. An increased signal results in a more robust satellite lock, and more reliable fully autonomous and guided flight operations.&lt;br /&gt;
&lt;br /&gt;
[[G0]] GPS module is using a U-Blox that is providing very fast speed updates that are crucial for accurate navigation within Paparazzi UAV. Additionally Paparazzi UAV supports the binary U-Blox protocol that is very efficient to parse compared to the very vaguely defined NMEA text protocol. Just enable the UCenter Module in your airframe file and Paparazzi will configure the module for best performance without the need for user interaction.&lt;br /&gt;
&lt;br /&gt;
For more information go to the [[G0|G0 GPS wiki page]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=[http://swiftnav.com/ Swiftnav] Piksi=&lt;br /&gt;
&lt;br /&gt;
A very special receiver is the OpenSource (almost all...) Swiftnav Piksi GPS receiver. How to use this device with Paparazzi is described on the a specific page&lt;br /&gt;
[[Image:Piksi_GPS_back.jpg|200px|thumb|left|Swiftnav Piksi]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=LS20031 GPS Receiver=&lt;br /&gt;
&lt;br /&gt;
[[Image:ls20031.jpg|170px|thumb|left|LS20031]]&lt;br /&gt;
Sparkfun sells the LS20031 GPS module which uses NMEA (Paparazzi support for NMEA is BETA right now.) This Locosys GPS module supports WAAS (U.S. DGPS), EGNOS (EU DGPS), and MSAS (Japanese DGPS).&lt;br /&gt;
&lt;br /&gt;
More information on configuring the GPS via PMTK can be found [http://dallasmakerspace.org/wiki/LS20031_GPS here]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Globalsat BU 353=&lt;br /&gt;
&lt;br /&gt;
[[Image:BU-353_gps_receiver.jpg|thumb|left|170px|BU-353 GPS receiver]]&lt;br /&gt;
&lt;br /&gt;
USB US Globalsat GPS-Mouse&lt;br /&gt;
&lt;br /&gt;
Typical Uses:&lt;br /&gt;
&lt;br /&gt;
* Parrot AR Drone 2.0&lt;br /&gt;
* Ground Station GPS (direct support with Linux / gpsd)&lt;br /&gt;
&lt;br /&gt;
''Not appropriate for many airborne applications due to extra USB-serial circuitry and weight of housing and internal magnet''&lt;br /&gt;
&lt;br /&gt;
Basic compatibility with Windows, Mac and Linux.&amp;lt;br/&amp;gt;&lt;br /&gt;
More information at the [[GPS/BU_353]] site.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=uBlox=&lt;br /&gt;
&lt;br /&gt;
[[Image:U-blox_color_warm_60.gif|100px]]&lt;br /&gt;
[http://www.u-blox.com uBlox is a Swiss technology company] that develops very good positioning modules. They are the recommended GPS modules for use with Paparazzi autopilots. Note that u-Blox produces the modules only. They do not sell complete boards to end users. These are sold by a multitude of vendors. &lt;br /&gt;
&lt;br /&gt;
Why uBlox:&lt;br /&gt;
*Low cost ([[Sensors/GPS#u-blox_NEO-6M|i.e. NEO6-M]])&lt;br /&gt;
*Small size&lt;br /&gt;
*Excellent performance (u-Blox 7 and 8 series)&lt;br /&gt;
*Up to 10Hz update rate&lt;br /&gt;
*5V tolerant UART&lt;br /&gt;
*Works out of the box with Paparazzi's u-Blox [[Module/GPS_UBlox_UCenter|auto-configuration module]]&lt;br /&gt;
&lt;br /&gt;
The '''[[Tiny]]''' series features an onboard LEA series GPS receiver and patch antenna, while most other boards boards require an external receiver+antenna such as the [[#Paparazzi_Stand-alone_GPS_Receivers|Paparazzi GPS]] or [[#u-Blox_SAM-LS_GPS_Smart_Antenna|SAM-LS]]. &lt;br /&gt;
&lt;br /&gt;
{|align = center&lt;br /&gt;
|-&lt;br /&gt;
|[[Image:Lea big.jpg|200px|thumb|center|u-blox LEA GPS Receiver]]&lt;br /&gt;
|[[Image:Ublox_SAM-LS.jpg|200px|thumb|center|u-Blox SAM-LS GPS receiver (w/built-in Smart Antenna)]]&lt;br /&gt;
|[[Image:UBlox_LEA-6H_Sarantel_Helix_s.jpg|200px|thumb|center|u-Blox LEA-6H GPS receiver with Sarantel Helix Antenna]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The proprietary UBX protocol is used as it offers more information and efficiency than the universal NMEA protocol. For details take a look at the code in &amp;lt;tt&amp;gt;sw/airborne/subsystems/gps/gps_ubx.c&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==u-Blox LEA Series Receivers==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- [[Image:Lea big.jpg|200px|thumb|right|u-blox LEA]] --&amp;gt;&lt;br /&gt;
[[Image:Lea5htiny13.jpg|thumb|left|200px|LEA-5H installed on the Tiny]]&lt;br /&gt;
The '''[[Lisa]]''' series, '''[[Twog_v1|TWOG]]''', '''[[Classix]]''' and '''[[Previous_Autopilots|AVR-based]]''' boards require an external GPS module and antenna.  The '''[[Tiny]]''' features an integrated receiver and antenna.  Either type is designed for [http://www.u-blox.com/ u-blox] 4, 5 and 6 series GPS receivers and the proprietary UBX binary protocol.  An external battery or capacitor is typically used to enable the GPS to retain data while powered off for significantly faster signal re-acquisition.  Any of the LEA-4, LEA-5 and LEA-6 series receivers can be used including the less expensive LEA-4A, 4S, 5A and 5S and similar low cost 6-series models as the special boot configuration code required for these models is already written as a [[Module/GPS_UBlox_UCenter|module]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- autobaud - runtime configuration of - ROM-only modules: use ucenter-module to configure your UBlox with no cable nor windows u-center --&amp;gt;&lt;br /&gt;
  &amp;lt;load name=&amp;quot;gps_ubx_ucenter.xml&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*4Hz Position update rate&lt;br /&gt;
*Supports active or passive antennas&lt;br /&gt;
*Supports [http://en.wikipedia.org/wiki/DGPS DGPS], [http://en.wikipedia.org/wiki/WAAS WAAS], [http://en.wikipedia.org/wiki/EGNOS EGNOS], and [http://en.wikipedia.org/wiki/MSAS MSAS]&lt;br /&gt;
*Low position noise figure&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Paparazzi Stand-alone uBlox GPS Receivers==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Ppzgps13med01.jpg|Top&lt;br /&gt;
Image:Ppzgps13_lrg_02.jpg|Bottom&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Paparazzi source provides a design for an external GPS board. An external GPS board is required for other boards like Lisa, TWOG, Elle0 and Classix.&lt;br /&gt;
Programming it is similar to the Tiny2.11 GPS configuration. If you build your own you will want to upload the latest u-blox firmware before you configure. See [[Get Hardware]] for sources of assembled boards.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The Paparazzi design in https://github.com/paparazzi/paparazzi-hardware/tree/master/sensors/gps/gps_13. The board is very small and light as it has only the components required. It is powered from the 5v line on the &amp;quot;downloads&amp;quot; connector of a TWOG. Also note it is a 4-layer PCB that means better noise resistance. The board has pins for USB connection but requires a different cable and a solder jumper to be move from the ground (default) to 3.3v input to enable the USB port on the module. &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[http://paparazzi.enac.fr/wiki_images/Gps_13_BOM.xls V1 BOM.xls]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://paparazzi.enac.fr/wiki_images/TinygpsBOM.txt Eagle Parts List Output.txt]&amp;lt;br&amp;gt;&lt;br /&gt;
See [[Get_Hardware|Get Hardware]] page for suppliers.&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Wiring Diagram===&lt;br /&gt;
&lt;br /&gt;
{|align = none&lt;br /&gt;
|-&lt;br /&gt;
|[[Image:TWOG to GPS.jpg|200px|thumb|center|TWOG to Standalone GPS Cable Schematic]]&lt;br /&gt;
|[[Image:gps13v09FTDIcable.jpg|200px|thumb|center|GPS13 v0.9 Ucenter cable (ftdi)]]&lt;br /&gt;
|[[Image:booz gps.jpg|200px|thumb|center|BoozGPS (quadrotor gps V1.1 2009/5) Ucenter cable (ftdi)]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===uBlox to ARdrone 2===&lt;br /&gt;
&lt;br /&gt;
[[Image:HowtoConnectUSBHelixGPSForParrotARDrone2.jpg|thumb|left|How to connect USB to uBlox Helix GPS for Parrot ARDrone2]]&lt;br /&gt;
To connect a uBlox with Helix antenna via a USB to serial cable that you can just plug into your ARdrone 2&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==3rd Party u-blox Reference Design Boards==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
[[Image:LEA5HExternalModulePinout.jpg|thumb|left|LEA-5H Full Board Pinout]]&lt;br /&gt;
The only other GPS board in use seems to be u-blox reference designs or similar to it. They have LEA-4H, LEA-5H and LEA-6H (typically) and several interfaces. Often a larger antenna as well. &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The board in the photo is a [http://www.rfdesign.co.za/pages/5645456/Products/GPS-Products/Receiver-Boards.asp RF DESIGN] LEA-5H-SMART. &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
The jumpers adjacent to the TTL interface connectors need to be closed with low value resistors for paparazzi uart port use. Also a [http://nz.element14.com/jsp/search/productdetail.jsp?SKU=1514218 battery] has to be added with an appropriate charging resistor to enable RTC functionality.&lt;br /&gt;
&amp;lt;/p&amp;gt;     &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==NAVILOCK NL-507ETTL==&lt;br /&gt;
&lt;br /&gt;
[[Image:Navilock NL-507ETTL.jpg|thumb|left|NAVILOCK NL-507TTL]]&lt;br /&gt;
The NAVILOCK NL-507TTL u-blox TTL Modul 60416 features an LEA-4 series receiver and 25mm patch antenna on a 30mm x 30mm board.&lt;br /&gt;
* Datasheet: [http://www.navilock.de/download/Dokumente_SLASH_Sonstiges/60415_-_Datenblatt_u-blox_GPS_Module/481 http://www.navilock.de/download/Dokumente_SLASH_Sonstiges/60415_-_Datenblatt_u-blox_GPS_Module/481]&lt;br /&gt;
* Purchase:  Available for 28€ at [http://www.amazon.de/Navilock-NL-507TTL-u-blox-TTL-Modul/dp/B0011E6VQG www.amazon.de]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==SPK GS407==&lt;br /&gt;
&lt;br /&gt;
[[Image:GS407.jpg|thumb|left|SPK GS407]]&lt;br /&gt;
[https://www.sparkfun.com/products/11466 This] is the model Sparkfun recommends as a replacement for the old GS406.  It's essentially the same, but uses the newer 6-series receiver, and is not using a ribbon cable as an interface.  It  uses [http://www.sarantel.com/products/sl1206 Sarantels] SL1206 active antenna.&lt;br /&gt;
It's recommended to buy [https://www.sparkfun.com/products/574 This extension cable] to use with it.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==u-blox NEO-6M==&lt;br /&gt;
&lt;br /&gt;
[[Image:Hk neo gps.jpg|thumb|left|Hobbyking NEO 6M back]]&lt;br /&gt;
This is the cheapest GPS module with antenna for ~13€ at [http://www.hobbyking.com/hobbyking/store/__31135__NEO_6M_GPS_Module.html Hobbyking].&lt;br /&gt;
&lt;br /&gt;
They come with different (sized) patch antenna, mounted on a separate PCB. The main PCB and antenna PCB are fixed with hot glue together and can be separated by hand.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Navilock NL-652ETTL==&lt;br /&gt;
&lt;br /&gt;
Nice module with u-blox 6 chip and without the annoying cable that the HK NEO-6m has.&lt;br /&gt;
[http://www.navilock.de/produkte/G_61846/merkmale.html?setLanguage=en Navilock NL-652ETTL]&lt;br /&gt;
&lt;br /&gt;
==u-Blox C04-6H Reference Design==&lt;br /&gt;
&lt;br /&gt;
[[Image:abavimage.jpg|thumb|left|u-blox C04-5H]]&lt;br /&gt;
u-Blox sells a complete module with antenna for around $200 and will also provide complete schematics, BOM, and PCB files for free if you wish to make your own.  Two versions are offered, one with an 18mm patch antenna and the other with the Sarantel P2 helical antenna.&lt;br /&gt;
See [http://www.ublox.com/en/evaluation-tools-a-software/reference-designs/for-gps-chips/c04-6h.html http://www.ublox.com/en/evaluation-tools-a-software/reference-designs/for-gps-chips/c04-6h.html] for more info.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Drotek Boards==&lt;br /&gt;
[http://www.drotek.com Drotek's] u-Blox GPS boards work well and are not expensive. &lt;br /&gt;
&lt;br /&gt;
==uBlox GPS configuration==&lt;br /&gt;
&lt;br /&gt;
===using U-Center===&lt;br /&gt;
&lt;br /&gt;
''Note: Before attempting manual configuration consider using the [[Module/GPS_UBlox_UCenter|u-blox UCenter module]] instead. If automatic configuration does not work with more recent modules you should report it to the mailing list or the Gitter chat and may attempt the manual procedure below. But be aware that a wrong configuration can cause Paparazzi not acquiring any GPS lock for sometimes hard to find reasons.''  &lt;br /&gt;
&lt;br /&gt;
[[Image:U-center_screencap.jpg|thumb|u-center configuration software]]&lt;br /&gt;
[http://www.u-blox.com/products/u_center.html U-Center] is a very comprehensive freeware program intended for the configuration and evaluation of u-blox receivers. &lt;br /&gt;
* [http://www.u-blox.com/en/evaluation-tools-a-software/u-center/u-center.html Download u-center]&lt;br /&gt;
&lt;br /&gt;
* Note 1: You must [[tunnel|install the UART tunnel firmware]] to enable direct access to the built-in GPS on the [[Tiny|Tiny]].&lt;br /&gt;
&lt;br /&gt;
* Note 2: You will need a driver for your FTDI cable if you run u-center on Windows, which can be found  [http://www.ftdichip.com/Drivers/D2XX.htm here].&lt;br /&gt;
&lt;br /&gt;
* Note 3: You can run u-center on Linux by installing &amp;quot;Wine&amp;quot; ([http://www.winehq.org/site/download-deb Installation of Wine]) and set up COM1 as /dev/ttyUSB0. You need to create a symbolic link from the COM device to TTY like this (assuming your serial device is /dev/ttyUSB0):&lt;br /&gt;
 mkdir -p ~/.wine/dosdevices&lt;br /&gt;
 ln -s /dev/ttyUSB0 ~/.wine/dosdevices/COM1&lt;br /&gt;
&lt;br /&gt;
or what worked in Ubuntu 9.10&lt;br /&gt;
 &lt;br /&gt;
 ln -s /dev/ttyUSB0 ~/.wine/dosdevices/com1&lt;br /&gt;
&lt;br /&gt;
This command will create the symbolic link from ttyUSB0 to COM1. See Info on Wine for &amp;quot;dosdevices&amp;quot; setup. Just download the u-setup.exe and run it with Wine, follow prompts. This has been tested with Ubuntu7.10 and Ubuntu 8.04 so far.&lt;br /&gt;
&lt;br /&gt;
''Depending on your connection method and your udev configuration your serial device may have a different path. Just look it up using &amp;lt;code&amp;gt;dmesg&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;tail -f /var/log/syslog&amp;lt;/code&amp;gt; after plugging in.''&lt;br /&gt;
&lt;br /&gt;
The u-blox and Tiny UARTs both operate at 3.3V TTL levels and are 5V TTL tolerant.  You must use a level shifter such as the common MAX232 to connect these devices to a standard PC serial port.  The easiest and most recommended method is to connect to a USB port instead of serial with an [http://www.ftdichip.com/Products/EvaluationKits/TTL-232R.htm FTDI USB-TTL converter cable] available from Digikey, Mouser, or direct from FTDI. You can also use the [[UU0]] adapter designed and manufactured by [[1BitSquared]]. Instead of a cable it has a USB-A connector directly on the board. Other similar converters are available from [http://www.pololu.com/products/pololu/0391/ pololu] / [http://www.sparkfun.com/commerce/product_info.php?products_id=199 sparkfun].  A stand-alone GPS such as the SAM-LS will require clean 3.3V/50mA power and a common ground with the TTL converter.&lt;br /&gt;
&lt;br /&gt;
* U-blox occasionally releases firmware updates. Log on to the u-blox website using ''paparazzi'' for username &amp;amp; password to view or download the latest firmware images.  There have 'never' been any updates released for the Antaris-4 series used in the Tiny.&lt;br /&gt;
&lt;br /&gt;
Start U-center and choose your com port from the pull down list under the connect button near the top left corner of the window. Choose your baudrate from the pull down box to the right of the connect button or select the auto-baud button to the right of that.  U-blox default is 9600 baud.  This must be changed to 19200 or higher to accommodate the 4Hz update rate. It needs to match whatever your module is configured to (if you configured it with the U-blox U-Center or the [[Module/GPS_UBlox_UCenter|u-blox UCenter module]]). &lt;br /&gt;
&amp;lt;br&amp;gt;[[Image:U-center_buttons.jpg|connect, baud, and autobaud buttons]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Uploading the Configuration File===&lt;br /&gt;
&lt;br /&gt;
Download the appropriate configuration file below and use u-center to load in onto your receiver. Under the ''Tools'' menu, choose ''GPS configuration''.  Be sure the box 'Store configuration into BBR/Flash' is checked and hit the button ''File&amp;gt;&amp;gt;GPS''.  A few errors and retries are normal, but a significant number of errors may indicate a poor connection and the software will notify you if it is unable to send all the data successfully.&lt;br /&gt;
* [[Media:Tiny_LEA-4P-v6.zip|LEA-4P]]&lt;br /&gt;
* [[Media:Tim-LL-V5.zip|TIM-LL]]&lt;br /&gt;
* [[Media:Tiny_LEA-5H-v5.zip|LEA-5H (For Use w/ Firmware V5 ONLY!)]]&lt;br /&gt;
* [[Media:Hk_NEO-6M.zip‎| Hobbyking NEO-6M]] [http://www.hobbyking.com/hobbyking/store/__31135__neo_6m_gps_module.html this module]&lt;br /&gt;
&lt;br /&gt;
===Automatic Configuration at Startup===&lt;br /&gt;
&lt;br /&gt;
You can also use the [[Module/GPS_UBlox_UCenter|u-blox UCenter module]] which will take over the task of initializing the GPS for you when you power your autopilot.&lt;br /&gt;
&lt;br /&gt;
===Manual Configuration===&lt;br /&gt;
&lt;br /&gt;
If you prefer to setup your receiver manually or have a model not listed above, here are instructions to configure your receiver in u-center.&lt;br /&gt;
Open the message window (menu View-&amp;gt;messages view) to start the configuration process by changing the following settings:&lt;br /&gt;
&lt;br /&gt;
====LEA-4P====&lt;br /&gt;
&lt;br /&gt;
# Right Click on the '''NMEA''' Icon and choose '''disable child'''&lt;br /&gt;
# Choose UBX-&amp;gt;CFG-&amp;gt;NAV2(Navigation 2) - set it to use '''Airborne 4G''' (tells the Kalman filter to expect significant changes in direction)&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#GPS|Airframe file]])&lt;br /&gt;
# Change the baudrate of U-Center to 38400bps if the connection is lost at this point&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;RXM(Receiver Manager) - change '''GPS Mode''' to '''3 - Auto''' (Enabling faster bootup only if signal levels are very good)&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;RATE(Rates) - change the '''Measurement Period''' to '''250ms''' (4 Hz position updates)&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calcuation errors)&lt;br /&gt;
# UBX-&amp;gt;NAV (not UBX-&amp;gt;CFG-&amp;gt;NAV): double click on '''POSUTM, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;CFG : '''save current config''', click '''&amp;quot;send&amp;quot;''' in the lower left corner to permanently save these settings to the receiver &lt;br /&gt;
&lt;br /&gt;
====LEA-5H====&lt;br /&gt;
&lt;br /&gt;
# Right Click on the '''NMEA''' Text on top of the tree and choose '''disable child messages'''&lt;br /&gt;
# Choose UBX-&amp;gt;CFG-&amp;gt;NAV5(Navigation 5) - set it to use '''Airborne 8 &amp;lt;4G'''. This tells the Kalman filter to expect significant changes in direction. &amp;lt;p&amp;gt;    Note that this setting is only good for faster moving airplanes. For a fixed position hovering heli, 'pedestrian' setting is better&amp;lt;/p&amp;gt;&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#GPS|Airframe file]])&lt;br /&gt;
# Change the baudrate of U-Center to 38400bps if the connection is lost at this point&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;RATE(Rates) - change the '''Measurement Period''' to '''250ms''' This gives a 4 Hz position update since 4 x 250ms is one second.&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calculation errors)&lt;br /&gt;
# UBX-&amp;gt;NAV (not UBX-&amp;gt;CFG-&amp;gt;NAV): double click on '''POSLLH, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;CFG : '''save current config''', click '''&amp;quot;send&amp;quot;''' in the lower left corner to permanently save these settings to the receiver&lt;br /&gt;
&lt;br /&gt;
* Cycle the power and verify that the new configuration was saved&lt;br /&gt;
* To reset the receiver to the factory defaults go to ''UBX-&amp;gt;CFG-&amp;gt;CFG'', select 'Revert to default configuration', and click ''Send'' at the bottom left corner.  To permanently save these values choose 'Save current configuration' and click ''Send''.&lt;br /&gt;
* To backup the configuration to a file on your PC: under the tools menu, choose GPS configuration, then click GPS&amp;gt;&amp;gt;file.  This file can be re-loaded in a similar manner to configure additional identical receivers.  Be sure the box 'Store configuration into BBR/Flash' is checked when reloading a configuration file to make the changes permanent.&lt;br /&gt;
* To update the firmware on a LEA-5H get u-center &amp;gt;= 5.03, revert the GPS receiver to the default configuration, get an appropriate image from u-Blox (fitting your receivers serial number), find the flash identification flash.txt file in the u-center install directory and be prepared to wait a long time.&lt;br /&gt;
&lt;br /&gt;
#NOTE: If you have a Tiny with LEA-5H module you must use u-center and manually setup the parameters as shown above (at least switch to 38400 baud manually before transferring the configuration file).&lt;br /&gt;
#NOTE: POSUTM is not available on LEA-5H. Instead, use POSLLH.&lt;br /&gt;
&lt;br /&gt;
====LEA-6H====&lt;br /&gt;
&lt;br /&gt;
We use the same configuration as for version 5&lt;br /&gt;
&lt;br /&gt;
# Right Click on the '''NMEA''' Text on top of the tree and choose '''disable child messages'''&lt;br /&gt;
# Choose UBX-&amp;gt;CFG-&amp;gt;NAV5(Navigation 5) - set it to use '''Airborne 8 &amp;lt;4G'''. This tells the Kalman filter to expect significant changes in direction. &amp;lt;p&amp;gt; Note that this setting is only good for faster moving airplanes. For a fixed position hovering heli, 'pedestrian' setting is better &amp;lt;/p&amp;gt;&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;PRT - set '''USART1''' to '''38400bps''' (must match the value in your [[Airframe_Configuration#GPS|Airframe file]])&lt;br /&gt;
# Change the baudrate of U-Center to 38400bps if the connection is lost at this point&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;RATE(Rates) - change the '''Measurement Period''' to '''250ms''' This gives a 4 Hz position update since 4 x 250ms is one second.&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;SBAS : '''Disable''' (SBAS appears to cause occasional severe altitude calculation errors)&lt;br /&gt;
# UBX-&amp;gt;NAV (not UBX-&amp;gt;CFG-&amp;gt;NAV): double click on '''POSLLH, SOL, STATUS, SVINFO, VELNED.''' They should change from grey to black&lt;br /&gt;
# UBX-&amp;gt;CFG-&amp;gt;CFG : '''save current config''', click '''&amp;quot;send&amp;quot;''' in the lower left corner to permanently save these settings to the receiver.&amp;lt;p&amp;gt;    Make sure you activate '''&amp;quot;2 - I2C-EEPROM&amp;quot;''' if using a ROM-based NEO chipset with external EEPROM (like [http://www.hobbyking.com/hobbyking/store/__31135__neo_6m_gps_module.html HK 31135])&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Cycle the power and verify that the new configuration was saved&lt;br /&gt;
* To reset the receiver to the factory defaults go to ''UBX-&amp;gt;CFG-&amp;gt;CFG'', select 'Revert to default configuration', and click ''Send'' at the bottom left corner.  To permanently save these values choose 'Save current configuration' and click ''Send''.&lt;br /&gt;
* To backup the configuration to a file on your PC: under the tools menu, choose GPS configuration, then click GPS&amp;gt;&amp;gt;file.  This file can be re-loaded in a similar manner to configure additional identical receivers.  Be sure the box 'Store configuration into BBR/Flash' is checked when reloading a configuration file to make the changes permanent.&lt;br /&gt;
* To update the firmware on a LEA-6H get u-center &amp;gt;= 6.21, revert the GPS receiver to the default configuration, get an appropriate firmaware file from u-Blox, find the flash identification flash.txt file in the u-center install directory and be prepared to wait a long time.(seriously)&lt;br /&gt;
&lt;br /&gt;
==uBlox Tips==&lt;br /&gt;
&lt;br /&gt;
===Reset to Default Settings===&lt;br /&gt;
&lt;br /&gt;
The GPS module can be reset to its original default settings by pulling BOOT_INT high(3.3V) during a power cycle ([http://www.u-blox.com/customersupport/gps.g4/ANTARIS4_Modules_SIM(GPS.G4-MS4-05007).pdf Antaris Manual, p. 122]). It may be required after a wrong firmware upgrade or a bad configuration change.&lt;br /&gt;
&lt;br /&gt;
===Invalid argument===&lt;br /&gt;
&lt;br /&gt;
Problem:  I keep getting this error with my nice shiny Tiny v2.1 with a LEA-5H: Invalid_argument (&amp;quot;Latlong.of_utm&amp;quot;)&lt;br /&gt;
Solution: Select the correct [[Subsystem/gps|GPS subsystem]].&lt;br /&gt;
&lt;br /&gt;
===WAAS issues===&lt;br /&gt;
&lt;br /&gt;
WAAS has been officially operational and &amp;quot;suitable for safety-of-life applications&amp;quot; since 2003.  The default setting of all u-blox receivers ignores WAAS correction data and only uses the WAAS satellites for regular navigation like any other satellite.  U-blox recommends further limiting this setting to exclude any stray EGNOS/MSAS satellites in North America, and completely disabling all SBAS functions for use outside North America.  In 2006 one formerly reliable Paparazzi aircraft began having great GPS problems and displaying very erratic altitude calculations, disabling WAAS immediately resolved the issue and this phenomenon was recreated several times for verification. Turns out a new WAAS satellite was being added to the system and the others were being moved that week for better distribution. Our advice is to first test if SBAS works well in your region.&lt;br /&gt;
&lt;br /&gt;
The default used by the [[Module/GPS_UBlox_UCenter|u-blox UCenter module]] keeps SBAS enabled. &lt;br /&gt;
&lt;br /&gt;
===Assist Now===&lt;br /&gt;
u-Blox modules that have a flash memory can keep the almanac correction data for up to 35 days into the future. That will give you a 3d GPS fix within seconds. [https://www.u-blox.com/en/assistnow-lock-your-position-instantly AssitNow] Offline data can be uploaded to the module while it is connected to the u-center application. To use this feature you need to provide a u-Blox account credentials that you can receive from the [https://www.u-blox.com/en/assistnow-service-registration-form u-Blox registration site]. &lt;br /&gt;
&lt;br /&gt;
===Antenna options for the Tiny and Paparazzi GPS units===&lt;br /&gt;
See [[GPS/Antenna]].&lt;br /&gt;
&lt;br /&gt;
=Tips=&lt;br /&gt;
&lt;br /&gt;
There is a huge amount of good information on the internet about GPS specifics that gives some good insight into GPS. This Paparazzi wiki is not intended to repeat already available information, some is added here.&lt;br /&gt;
&lt;br /&gt;
==EGNOS==&lt;br /&gt;
&lt;br /&gt;
EGNOS augments the GPS satellite navigation system and makes it suitable for safety critical UAS applications. EGNOS became operational on 1 October 2009. ESA claims that it can determine position to within 2 meters compared with about 20 meters for GPS alone. Note that the service is currently provided only in western Europe. For further information take a look on the [http://www.esa.int/esaNA/egnos.html ESA EGNOS website].&lt;br /&gt;
&lt;br /&gt;
For the latest update about functionality of EGNOS please check the website: [http://www.gsa.europa.eu European GNSS Supervisory Authority]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==DGPS (Differential GPS)==&lt;br /&gt;
&lt;br /&gt;
Differential GPS is any method of improving GPS accuracy by comparing the GPS-indicated position of a nearby location to the known value and transmitting any error to the mobile unit.  DGPS was originally created as a means of bypassing the deliberately introduced inaccuracies in civilian GPS signals.  The original method used low frequency ground radios to relay correction data to the mobile unit and is still used today at airports, shipping ports, and even individual farms.  Satellite Based Augmentation System (SBAS) is a modern form of DGPS where the ground stations relay correction data to a GEO-Stationary satellite, which then relays it to the mobile unit on standard GPS frequencies eliminating the need for a separate radio reciever.  SBAS is currently available in 3 regions, [http://www.esa.int/esaNA/ESAF530VMOC_egnos_1.html WAAS, EGNOS, and MSAS regions]. U-blox receivers support all common varieties of DGPS [http://www.u-blox.com/customersupport/gps.g3/ENGOS_Issues(GPS.G3-CS-04009).pdf read the u-blox SBAS application note].&lt;br /&gt;
* It is important to note that DGPS methods only improve the ''accuracy'' of the position calculation, not the ''precision''.  Since Paparazzi navigation is typically performed relative to the power-on location, any static error that could be corrected with DGPS is irrelevant.&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]] [[Category:Sensors]] [[Category:User_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=STLink&amp;diff=21252</id>
		<title>STLink</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=STLink&amp;diff=21252"/>
		<updated>2016-06-08T14:14:31Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float: right; width: 20%&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Firmware Flashing&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right; width: 60%&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:St-link.jpg|right|450px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Every STM discovery / eval board comes with a [http://www.st.com/web/catalog/tools/FM146/CL1984/SC724/SS1677/PF251168 ST-Link V2] on board, with one exception; the STM32VL version comes with a ST-Link V1.&lt;br /&gt;
&lt;br /&gt;
==SWD Header==&lt;br /&gt;
&lt;br /&gt;
[[Image:swd_header_discovery_board.png|250px|Pinout with Apogee connector]]&lt;br /&gt;
&lt;br /&gt;
==Install Software==&lt;br /&gt;
&lt;br /&gt;
The ''st-flash'' and ''st-util'' tools are needed, provided by [https://github.com/texane/stlink texane]&lt;br /&gt;
&lt;br /&gt;
Download and compile&lt;br /&gt;
 $ cd /opt&lt;br /&gt;
 $ git clone git://github.com/texane/stlink.git stlink&lt;br /&gt;
 $ cd stlink&lt;br /&gt;
 $ ./autogen.sh&lt;br /&gt;
 $ ./configure&lt;br /&gt;
 $ make&lt;br /&gt;
&lt;br /&gt;
Set environment variable&lt;br /&gt;
 $ exportline=&amp;quot;PATH=$PATH:/opt/stlink&amp;quot;&lt;br /&gt;
 $ if grep -Fxq &amp;quot;$exportline&amp;quot; ~/.profile; then echo nothing to do ; else echo $exportline &amp;gt;&amp;gt; ~/.profile; fi&lt;br /&gt;
 $ source ~/.profile&lt;br /&gt;
&lt;br /&gt;
Add udev rules &lt;br /&gt;
 $ sudo cp /opt/stlink/49-stlinkv*.rules /etc/udev/rules.d&lt;br /&gt;
 $ sudo udevadm control --reload-rules&lt;br /&gt;
&lt;br /&gt;
ST-LinkV1 requires a bit different treatment, read the [https://github.com/texane/stlink/blob/master/README Readme.txt]&lt;br /&gt;
&lt;br /&gt;
==Airframe.xml setup==&lt;br /&gt;
&lt;br /&gt;
Connect the ST-Link to the MCU.&lt;br /&gt;
If a complete STM32Fx-Discovery board is used, CN3 jumpers need to be set. To program a external MCU, remove CN3 jumpers and connect the external MCU with the SWD header.&lt;br /&gt;
&lt;br /&gt;
To use SWD via STLink as default:&amp;lt;br/&amp;gt;&lt;br /&gt;
Set '''FLASH_MODE=STLINK'''&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Update the ST-Link to blackmagic probe==&lt;br /&gt;
&lt;br /&gt;
The STM32F103 (STLink MCU) can be flashed with the blackmagic's firmware.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Two STLinkV2 Method===&lt;br /&gt;
&lt;br /&gt;
Use one STLink to flash another&lt;br /&gt;
&lt;br /&gt;
Hardware Setup:&lt;br /&gt;
One STLinkV2 (connected via USB) is programming the other one. Change the 4 Solder jumpers on the bottom of the target STLinkV2 from &amp;quot;DEFAULT&amp;quot; to &amp;quot;REVERSED&amp;quot;.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Connections between the two STLinks&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;6&amp;quot;&lt;br /&gt;
|+'''Connections [Header-Pin]'''&lt;br /&gt;
!''Use''!!''From Programmer''!!''To Target''&lt;br /&gt;
|-&lt;br /&gt;
|5V||P2-5V||P2-5V&lt;br /&gt;
|-&lt;br /&gt;
|SWDIO||CN2-4||CN3-2&lt;br /&gt;
|-&lt;br /&gt;
|SWDCLK||CN2-2||CN3-3&lt;br /&gt;
|-&lt;br /&gt;
|GND||CN2-3||CN3-4&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Download and build the Firmware&lt;br /&gt;
 git clone https://github.com/blacksphere/blackmagic&lt;br /&gt;
 cd blackmagic&lt;br /&gt;
 git submodule init&lt;br /&gt;
 git submodule update&lt;br /&gt;
 make&lt;br /&gt;
 cd src&lt;br /&gt;
 make clean&lt;br /&gt;
 make PROBE_HOST=stlink&lt;br /&gt;
&lt;br /&gt;
Remove the readout protection, erase and flash&lt;br /&gt;
 openocd -f interface/stlink-v2.cfg -f target/stm32f1x_stlink.cfg -c &amp;quot;init&amp;quot; -c &amp;quot;halt&amp;quot; -c &amp;quot;stm32f1x unlock 0&amp;quot; -c &amp;quot;shutdown&amp;quot;&lt;br /&gt;
 st-flash erase&lt;br /&gt;
 st-flash --reset write blackmagic.bin 0x8002000&lt;br /&gt;
 st-flash write blackmagic_dfu.bin 0x8000000&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
&lt;br /&gt;
[http://esden.net/2014/12/29/black-magic-discovery Black Magic Discovery from Esden] &amp;lt;-- This also describes how to remove the read out protection. &amp;lt;br/&amp;gt;&lt;br /&gt;
[http://embdev.net/articles/STM_Discovery_as_Black_Magic_Probe embdev.net page]&lt;br /&gt;
&lt;br /&gt;
===BMP Method===&lt;br /&gt;
&lt;br /&gt;
Use a BMP to flash a STLink&lt;br /&gt;
&lt;br /&gt;
Transfer the solder jumpers from &amp;quot;Default&amp;quot; to &amp;quot;Reversed&amp;quot; and build the firmware as described above.&amp;lt;br/&amp;gt;&lt;br /&gt;
Connect the BMP to the CN2 header (see Pinout above).&lt;br /&gt;
&lt;br /&gt;
Start gdb, erase the option bytes and flash BMP&lt;br /&gt;
 (gdb) target extended-remote /dev/ttyACM0&lt;br /&gt;
 (gdb) mon swdp_scan&lt;br /&gt;
 (gdb) att 1 &lt;br /&gt;
 (gdb) mon option erase&lt;br /&gt;
 (gdb) load /dir/to/blackmagic&lt;br /&gt;
 (gdb) load /dir/to/blackmagic_dfu&lt;br /&gt;
 (gdb) detach&lt;br /&gt;
&lt;br /&gt;
The option bytes do not cover the Readout Protection (RDP), but the RDP is disabled anyhow...&lt;br /&gt;
&lt;br /&gt;
'''Error at loading a new image after removing RDP'''&lt;br /&gt;
&lt;br /&gt;
 Error erasing flash with vFlashErase packet&lt;br /&gt;
If this occurs powercycle the target (disconnect and reconnect the 3V3 connection), swd scan, attach and try loading the image again. Usually the reset of the RDP requires a flash erase (done by mon option erase) and reset.&lt;br /&gt;
&lt;br /&gt;
Probably this can also be done via gdb.&lt;br /&gt;
&lt;br /&gt;
==Clones==&lt;br /&gt;
&lt;br /&gt;
There are also a lot of different Chinese clones out there. Most with an identical MCU as the original STLinkV2, some with an STM32F101.&lt;br /&gt;
&lt;br /&gt;
It seems that each clone has its own programming pinout, so better double check (continuity tester) than to release the magic smoke...&lt;br /&gt;
&lt;br /&gt;
Most (all?) should work with the &amp;quot;stlink&amp;quot; target from Blackmagic Probe, since they probably use the same firmware from the original STLinkV2.&lt;br /&gt;
&lt;br /&gt;
===Red PCB===&lt;br /&gt;
&lt;br /&gt;
Seems to work with the standard stlink BMP image.&lt;br /&gt;
&lt;br /&gt;
[[Image:stlinkv2_clone_red_front.jpg|250px]]&lt;br /&gt;
[[Image:stlinkv2_clone_red_back.jpg|250px]]&lt;br /&gt;
&lt;br /&gt;
* STM32F103C8T6&lt;br /&gt;
&lt;br /&gt;
Programming header (1.27mm, populated on the images) from the Mini USB to the Pin header (right to left on the image), used for programming the onboard MCU.&lt;br /&gt;
&lt;br /&gt;
# SWDIO&lt;br /&gt;
# GND&lt;br /&gt;
# SWDCLK&lt;br /&gt;
# 3V3 &lt;br /&gt;
&lt;br /&gt;
Some Images and details about this hardware can be found at[https://www.mikrocontroller.net/articles/IRMP_auf_STM32_-_Bauanleitung]&lt;br /&gt;
&lt;br /&gt;
===Blue PCB===&lt;br /&gt;
NOT TESTED YET&lt;br /&gt;
[[Image:stlinkv2_clone_blue_front.jpg|250px]]&lt;br /&gt;
[[Image:stlinkv2_clone_blue_back.jpg|250px]]&lt;br /&gt;
&lt;br /&gt;
* STM32F103C8T6&lt;br /&gt;
&lt;br /&gt;
Programming header (2.54mm, unpopulated on the images) from the USB to the Pin header (left to the right on the images), used for programming the onboard MCU.&lt;br /&gt;
&lt;br /&gt;
# GND&lt;br /&gt;
# 5V&lt;br /&gt;
# USART1 RX (PA10)&lt;br /&gt;
# USART1 TX (PA9)&lt;br /&gt;
&lt;br /&gt;
Bootloader header (2.54mm, unpopulated on the images), from the USB to the Pin header (left to the right on the images), used for USART bootloader activation&lt;br /&gt;
&lt;br /&gt;
# 3V3&lt;br /&gt;
# BOOT0 (pin 44)&lt;br /&gt;
&lt;br /&gt;
The 3V3/5V switch selects the input voltage for the onboard MCU.&lt;br /&gt;
&lt;br /&gt;
===Aluminium housing===&lt;br /&gt;
NOT TESTED YET&lt;br /&gt;
[[Image:stlinkv2_clone_aluminium.jpg|250px]]&lt;br /&gt;
[[Image:stlinkv2_clone_aluminium_front.jpg|250px]]&lt;br /&gt;
[[Image:stlinkv2_clone_aluminium_back.jpg|250px]]&lt;br /&gt;
&lt;br /&gt;
* STM32F101C8T6&lt;br /&gt;
&lt;br /&gt;
Programming header (1.27mm, unpopulated on the images) from the USB to the Pin header (left to the right on the images), used for programming the onboard MCU.&lt;br /&gt;
&lt;br /&gt;
# SWDIO (PA13)&lt;br /&gt;
# GND&lt;br /&gt;
# SWDCLK(PA14)&lt;br /&gt;
# VDD, VBAT&lt;br /&gt;
&lt;br /&gt;
To disassemble pull the aluminium housing towards the USB connector.&lt;br /&gt;
&lt;br /&gt;
This has not the same hardware as https://github.com/blacksphere/blackmagic/issues/62 , but the same MCU, seems that this has just an other PCB.&lt;br /&gt;
&lt;br /&gt;
[[Category:Firmware Flashing]] [[Category:Developer_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Subsystem/ahrs&amp;diff=21251</id>
		<title>Subsystem/ahrs</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Subsystem/ahrs&amp;diff=21251"/>
		<updated>2016-06-08T13:53:50Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: minor spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages hideprefix=always&amp;gt;Subsystems&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
== AHRS subsystem ==&lt;br /&gt;
The '''A'''ttitude and '''H'''eading '''R'''eference '''S'''ystem subsystem specifies which attitude estimation filter you are using.&lt;br /&gt;
&lt;br /&gt;
Currently possible AHRS subsystem types are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Type !! Point type !! Firmwares !! Notes&lt;br /&gt;
|-&lt;br /&gt;
|'''[[Subsystem/ahrs#Complementary_Quaternion_.28fixed_point.29|int_cmpl_quat]]''' || fixed || all ||&lt;br /&gt;
|-&lt;br /&gt;
|'''[[Subsystem/ahrs#Complementary_Quaternion.2FRotation_Matrix_.28floating_point.29|float_cmpl]]''' || floating || all ||&lt;br /&gt;
|-&lt;br /&gt;
|'''[[Subsystem/ahrs#DCM_.28floating_point.29|float_dcm]]''' || floating || fixedwing ||&lt;br /&gt;
|-&lt;br /&gt;
|'''[[Subsystem/ahrs#Complementary_Euler_.28fixed_point.29|int_cmpl_euler]]'''  || fixed || rotorcraft ||&lt;br /&gt;
|-&lt;br /&gt;
|'''[[Subsystem/ahrs#Kalman_Filter_Quaternion|float_mlkf]]''' || floating || rotorcraft ||&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Subsystem/ahrs#Infrared|infrared]]''' ||  || fixedwing? ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
e.g. for the latest complementary filter:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing or rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ahrs&amp;quot; type=&amp;quot;int_cmpl_quat&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Implementations ==&lt;br /&gt;
&lt;br /&gt;
There is a test program ( sw/airborne/test/ahrs/compare_ahrs.py ) to compare different AHRS implementations on simple test cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;'''Caution!'''&amp;lt;/span&amp;gt; '''Please also see [https://github.com/paparazzi/paparazzi/issues/93 issue 93] about proper handling of BODY_TO_IMU in all AHRS algorithms.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Complementary Quaternion (fixed point) ===&lt;br /&gt;
&lt;br /&gt;
To measure attitude angles, gyrometers measurements are integrated. The result of integration is accurate for short term, but gyro bias is accumulated, which results in long term errors (drift). &lt;br /&gt;
On the other hand, accelerometers can be used to measure angles directly, but they suffer from noise due to vibrations. The measurement is then only accurate when averaged over a long term. Also, accelerometers alone are unable to give accurate angles when the vehicle is accelerating. &lt;br /&gt;
Complementary filter takes advantage of both sensors, using a low-pass filter on accelerometer readings and high pass filter on gyrometers readings, to estimate attitude angles.&lt;br /&gt;
* No danger of [http://en.wikipedia.org/wiki/Gimbal_lock gimbal lock], since quaternions are used.&lt;br /&gt;
* The arithmetic is [http://en.wikipedia.org/wiki/Fixed-point_arithmetic fixed point] and is thus suitable if the processor (on your board) has no [http://en.wikipedia.org/wiki/Floating_point_unit FPU].&lt;br /&gt;
* Estimates the gyro bias.&lt;br /&gt;
* For rotorcrafts: uses magnetometer for heading. Needs calibration!&amp;lt;br/&amp;gt;You can add &amp;lt;source lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;&amp;lt;configure name=&amp;quot;USE_MAGNETOMETER&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt; to be explicit about it.&lt;br /&gt;
* Also suitable for fixedwings, but you need GPS.&lt;br /&gt;
** Compensation of centrifugal force via GPS speed (to fly in circles with a fixedwing).&amp;lt;br/&amp;gt;Enabled with AHRS_GRAVITY_UPDATE_COORDINATED_TURN which is set by default for a fixedwing firmware.&lt;br /&gt;
** For fixedwing firmware, GPS course is used for heading estimation by default (and magnetometer disabled), add &amp;lt;source lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;&amp;lt;configure name=&amp;quot;USE_MAGNETOMETER&amp;quot; value=&amp;quot;FALSE&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt; if you want to be explicit.&lt;br /&gt;
** To use magnetometer for heading: &amp;lt;source lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;&amp;lt;configure name=&amp;quot;USE_MAGNETOMETER&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt; and &amp;lt;source lang=&amp;quot;xml&amp;quot; enclose=&amp;quot;none&amp;quot;&amp;gt;&amp;lt;configure name=&amp;quot;AHRS_USE_GPS_HEADING&amp;quot; value=&amp;quot;FALSE&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other flags of interest are:&lt;br /&gt;
*AHRS_PROPAGATE_LOW_PASS_RATES : apply a low pass filter on rotational velocity&lt;br /&gt;
*AHRS_MAG_UPDATE_ALL_AXES : use mag to also update roll/pitch and not only yaw (not recommended in most cases)&lt;br /&gt;
&lt;br /&gt;
* NEW since [https://github.com/paparazzi/paparazzi/commit/b40da0ae56e861e088017c01426d0c4ed7c43350 v5.1_devel-455-gb40da0a]:&lt;br /&gt;
** Proper scaling of corrections for 100Hz fixedwing or 500Hz for rotorcraft.&lt;br /&gt;
** Allow tuning of the accel and mag correction natural frequency and damping.&lt;br /&gt;
** Tunable gravity_heuristic_factor to reduce accelerometer influence only when the vehicle is accelerating (norm of ax,ay,az ~ 9,81 m/s2).&lt;br /&gt;
&lt;br /&gt;
* Flags of interest in master branch are:&lt;br /&gt;
** AHRS_PROPAGATE_FREQUENCY: IMU gyrometer reading frequency ( Hz, depend on IMU subsystem used and its configuration)&lt;br /&gt;
** AHRS_CORRECT_FREQUENCY: IMU accelerometer reading frequency (Hz)&lt;br /&gt;
** AHRS_MAG_CORRECT_FREQUENCY: IMU magnetometer reading frequency (Hz)&lt;br /&gt;
** AHRS_ACCEL_OMEGA: Complementary filter accelerometer cut-off frequency (rd/s). Default is 0.063 rd/s, the accelerometer reading are &amp;quot;averaged&amp;quot; over 100 seconds (= 2*pi/0.063) to correct gyro bias. Lower the cut-off frequency reduce the influence of accelerometers. WARNING: if ACCEL_OMEGA is set at a lower frequency, the gyro bias variations may not be corrected fast enough. As a result, the computed attitude may show significant static (or low frequency) errors. If accel_omega is set higher, the gyro bias will be well corrected and the static accuracy of the computed angle will be very good, but the dynamic error of the computed angle may be bad. &lt;br /&gt;
** AHRS_ACCEL_ZETA: Complementary filter accelerometer damping. Default is 0.9&lt;br /&gt;
** AHRS_MAG_OMEGA:Complementary filter magnetometer cut-off frequency (rd/s). Default is 0.04 rd/s. Acts the same as accelerometer but on the yaw axis.&lt;br /&gt;
** AHRS_MAG_ZETA:Complementary filter magnetometer damping. Default is 0.9&lt;br /&gt;
** AHRS_GRAVITY_HEURISTIC_FACTOR: Default is 30. Reduce accelerometer cut-off frequency when the vehicle is accelerating: norm(ax,ay,az) ~ 9,81 m/s2. WARNING: when the IMU is not well damped, the norm of accelerometers never equals to 9,81 m/s2. As a result, the GRAVITY_HEURISTIC_FACTOR will reduce the accelerometer bandwith even if the vehicle is not accelerating. Set AHRS_GRAVITY_HEURISTIC_FACTOR = 0 in case of vibrations.&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing or rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ahrs&amp;quot; type=&amp;quot;int_cmpl_quat&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;section name=&amp;quot;AHRS&amp;quot; prefix=&amp;quot;AHRS_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;H_X&amp;quot; value=&amp;quot; 0.51562740288882&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;H_Y&amp;quot; value=&amp;quot;-0.05707735220832&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;H_Z&amp;quot; value=&amp;quot; 0.85490967783446&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Also see the [[Subsystem/ahrs#Local_Magnetic_Field|Local Magnetic Field]] section.&lt;br /&gt;
&lt;br /&gt;
To use '''int_cmpl_quat''' for fixedwings without magnetometer (GPS based heading estimation instead):&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ahrs&amp;quot; type=&amp;quot;int_cmpl_quat&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;configure name=&amp;quot;USE_MAGNETOMETER&amp;quot; value=&amp;quot;FALSE&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Complementary Quaternion/Rotation Matrix (floating point) ===&lt;br /&gt;
* Estimates the gyro bias.&lt;br /&gt;
* By default uses magnetometer for heading for rotorcrafts.&lt;br /&gt;
* Choose either ''type=&amp;quot;float_cmpl_rmat&amp;quot;'' or ''type=&amp;quot;float_cmpl_quat&amp;quot;'', which define ''AHRS_PROPAGATE_RMAT'' or ''AHRS_PROPAGATE_QUAT'' respectively to select if the propagation is done in rotation matrix or quaternion representation.&lt;br /&gt;
* For fixedwings:&lt;br /&gt;
** Compensation of centrifugal force via GPS speed (to fly in circles with a fixedwing).&amp;lt;br/&amp;gt;Enabled with AHRS_GRAVITY_UPDATE_COORDINATED_TURN which is set by default for a fixedwing firmware.&lt;br /&gt;
** GPS based heading estimation: https://github.com/paparazzi/paparazzi/issues/130&lt;br /&gt;
Other flags of interest are:&lt;br /&gt;
* AHRS_PROPAGATE_LOW_PASS_RATES : apply a low pass filter on rotational velocity&lt;br /&gt;
* AHRS_MAG_UPDATE_ALL_AXES : use mag to also update roll/pitch and not only yaw (not recommended in most cases)&lt;br /&gt;
* AHRS_GRAVITY_HEURISTIC_FACTOR: Default is 30. Reduce accelerometer cut-off frequency when the vehicle is accelerating: norm(ax,ay,az) ~ 9,81 m/s2. WARNING: when the IMU is not well damped, the norm of accelerometers never equals to 9,81 m/s2. As a result, the GRAVITY_HEURISTIC_FACTOR will reduce the accelerometer bandwith even if the vehicle is not accelerating. Set AHRS_GRAVITY_HEURISTIC_FACTOR = 0 in case of vibrations&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;rotorcraft or fixedwing&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ahrs&amp;quot; type=&amp;quot;float_cmpl_quat&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;/subsystem&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;section name=&amp;quot;AHRS&amp;quot; prefix=&amp;quot;AHRS_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;H_X&amp;quot; value=&amp;quot; 0.51562740288882&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;H_Y&amp;quot; value=&amp;quot;-0.05707735220832&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;H_Z&amp;quot; value=&amp;quot; 0.85490967783446&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Also see the [[Subsystem/ahrs#Local_Magnetic_Field|Local Magnetic Field]] section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
No danger of [http://en.wikipedia.org/wiki/Gimbal_lock gimbal lock], since quaternions are used.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Suitable for fixedwings. Needs GPS!&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Suitable for rotorcraft if the magnetometer is calibrated.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The arithmetic is [http://en.wikipedia.org/wiki/Floating_point floating point] and is thus '''not''' suitable if the processor (on your board) has '''no''' [http://en.wikipedia.org/wiki/Floating_point_unit FPU].&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== DCM (floating point) ===&lt;br /&gt;
* No direct gyro bias estimation, but also compensates for attitude drift.&lt;br /&gt;
* Uses GPS speed for heading.&lt;br /&gt;
* Compensation of centrifugal force via GPS speed (to fly in circles with a fixedwing).&lt;br /&gt;
* '''Careful, it doesn't handle all BODY_TO_IMU rotations (mounting positions) correctly!'''&lt;br /&gt;
&lt;br /&gt;
The algorithm was developed by William Premerlani and Paul Bizard. The theory can be found here: [[Media:DCMDraft2.pdf|DCMDraft2.pdf]]  The algorithm is also used in the AHRS systems of the AdruIMU.&lt;br /&gt;
The name DCM for the algorithm is really a misnomer, as that just means that the orientation is represented as a '''D'''irection'''C'''osine'''M'''atrix (rotation matrix). But since people already know it under that name, we kept it.&lt;br /&gt;
&lt;br /&gt;
Other flags of interest are:&lt;br /&gt;
*USE_MAGNETOMETER : use magnetometer to update yaw (UNTESTED. The magnetometer code has to be improved, since ferromagnetic materials affect the magnetic field. This is currently not implemented.)&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ahrs&amp;quot; type=&amp;quot;float_dcm&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Complementary Euler (fixed point) ===&lt;br /&gt;
* Not recommended for fixedwings, as this filter doesn't compensate for centrifugal force when flying turns.&lt;br /&gt;
* Magnetometer is always only used for heading (yaw).&lt;br /&gt;
* '''Does not handle the accel and mag updates correctly if BODY_TO_IMU is used for more than just adjustment by a few degrees.'''&lt;br /&gt;
* In general, rather use ''[[Subsystem/ahrs#Complementary_Quaternion_.28fixed_point.29|int_cmpl_quat]]''&lt;br /&gt;
&lt;br /&gt;
Optional flags/defines are:&lt;br /&gt;
* FACE_REINJ_1 : defaults to 1024&lt;br /&gt;
* IMU_MAG_OFFSET : offset to subtract from the heading calculated by the magnetometer&lt;br /&gt;
* USE_NOISE_FILTER : apply a simple filter on the rate and accel inputs&lt;br /&gt;
* USE_NOISE_CUT : cut rate input at 1 rad/s and accel input at 20m/s²&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ahrs&amp;quot; type=&amp;quot;int_cmpl_euler&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;section name=&amp;quot;MISC&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;FACE_REINJ_1&amp;quot; value=&amp;quot;1024&amp;quot;/&amp;gt; &amp;lt;!-- optional, defaults to 1024 --&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Possible danger of [http://en.wikipedia.org/wiki/Gimbal_lock gimbal lock], since quaternions are not used.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Repeat from above: '''Not''' suitable for fixedwings.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Suitable for rotorcraft. The magnetometer is used to determine the yaw and needs to be calibrated.&lt;br /&gt;
Recommended replacement: [[Subsystem/ahrs#Complementary_Quaternion_.28fixed_point.29|int_cmpl_quat]]&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The arithmetic is [http://en.wikipedia.org/wiki/Fixed-point_arithmetic fixed point] and is thus suitable if the processor (on your board) has no [http://en.wikipedia.org/wiki/Floating_point_unit FPU].&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Kalman Filter Quaternion ===&lt;br /&gt;
Multiplicative Linearized [http://en.wikipedia.org/wiki/Kalman_filter Kalman Filter] in quaternion formulation.&lt;br /&gt;
* Available in v5.0 and later&lt;br /&gt;
* Estimates the gyro bias.&lt;br /&gt;
* Uses magnetometer to update all 3 axes.&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ahrs&amp;quot; type=&amp;quot;float_mlkf&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;section name=&amp;quot;AHRS&amp;quot; prefix=&amp;quot;AHRS_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;H_X&amp;quot; value=&amp;quot; 0.51562740288882&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;H_Y&amp;quot; value=&amp;quot;-0.05707735220832&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;H_Z&amp;quot; value=&amp;quot; 0.85490967783446&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Also see the [[Subsystem/ahrs#Local_Magnetic_Field|Local Magnetic Field]] section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
No danger of [http://en.wikipedia.org/wiki/Gimbal_lock gimbal lock], since quaternions are used.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
'''Not''' suitable for fixedwings!&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Suitable for rotorcraft. The magnetometer is used and needs to be well calibrated.&lt;br /&gt;
Estimates attitude and heading. Does not use GPS.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
The arithmetic is [http://en.wikipedia.org/wiki/Floating_point floating point] and is thus '''not''' suitable if the processor (on your board) has '''no''' [http://en.wikipedia.org/wiki/Floating_point_unit FPU].&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Infrared ===&lt;br /&gt;
For use with infrared sensors that detect aircraft attitude and the [[Module/infrared| infrared module]].&lt;br /&gt;
&lt;br /&gt;
== Local Magnetic Field ==&lt;br /&gt;
[[Image:Noaa_mag_data.png|thumb|right|200px|Screenshot of noaa page]]&lt;br /&gt;
[[Image:Normalised_mag_fields.png|thumb|right|200px|Screenshot of scilab page]]&lt;br /&gt;
'''This is needed if the magnetometer should be used !'''&amp;lt;br/&amp;gt;&lt;br /&gt;
Take also a look at [[ImuCalibration#Calibrating_for_the_Earth_magnetic_field| magnetometer calibration]] which should be done to increase accuracy !&lt;br /&gt;
&lt;br /&gt;
First the values of the local magnetic field vector are needed. They can be found at the states geological institute.&lt;br /&gt;
&lt;br /&gt;
USA [http://www.ngdc.noaa.gov/geomag-web/#igrfwmm ngdc.noaa.gov]&lt;br /&gt;
&lt;br /&gt;
Needed values are:&lt;br /&gt;
* north component (x)&lt;br /&gt;
* east component (y)&lt;br /&gt;
* vertical component (z)&lt;br /&gt;
&lt;br /&gt;
The vector components are in nanotesla (nT) but AHRS needs these values as a unit vector (the length of a unit vector is 1), so they need to be normalized.&lt;br /&gt;
&lt;br /&gt;
'''Convert them:'''&lt;br /&gt;
&lt;br /&gt;
Copy the north(x), east(y), and vertical(z) component values into scilab and execute &amp;quot;X/norm(X)&amp;quot; or run this in ipython:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=python&amp;gt;&lt;br /&gt;
import numpy as np&lt;br /&gt;
x = np.array([20875.1, 8480.2, -51279.8])&lt;br /&gt;
x/np.linalg.norm(x)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or enter this into [http://wolframalpha.com Wolfram Alpha]:&lt;br /&gt;
&amp;lt;source lang=python&amp;gt;&lt;br /&gt;
Normalize[{20875.1, 8480.2, -51279.8}]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lastly, enter the results into your airframe file as H_X, H_Y, and H_Z:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;AHRS&amp;quot; prefix=&amp;quot;AHRS_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;H_X&amp;quot; value=&amp;quot;0.372692&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;H_Y&amp;quot; value=&amp;quot;0.151401&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;H_Z&amp;quot; value=&amp;quot;-0.915521&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Update geomagnetic field vector based on GPS ===&lt;br /&gt;
You can also add the [http://docs.paparazziuav.org/latest/module__geo_mag.html geo_mag.xml module], which will update the normalized magnetic field at startup using GPS fix:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;modules&amp;gt;&lt;br /&gt;
    &amp;lt;load name=&amp;quot;geo_mag.xml&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/modules&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Enabling External Sensors ==&lt;br /&gt;
&lt;br /&gt;
By default the AHRS algorithms will utilize onboard sensors. Paparazzi currently has support for external Magnetometers. In order to use an external sensor you must specify the ABI Message ID of the sensor.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ahrs&amp;quot; type=&amp;quot;float_cmpl_quat&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;define name=&amp;quot;AHRS_FC_MAG_ID&amp;quot; value=&amp;quot;MAG_HMC58XX_SENDER_ID&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/subsystem&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Type !! AHRS_XXX_MAG_ID&lt;br /&gt;
|-&lt;br /&gt;
|'''[[Subsystem/ahrs#Complementary_Quaternion_.28fixed_point.29|int_cmpl_quat]]''' || AHRS_ICQ_MAG_ID &lt;br /&gt;
|-&lt;br /&gt;
|'''[[Subsystem/ahrs#Complementary_Quaternion.2FRotation_Matrix_.28floating_point.29|float_cmpl]]'''  || AHRS_FC_MAG_ID  &lt;br /&gt;
|-&lt;br /&gt;
|'''[[Subsystem/ahrs#DCM_.28floating_point.29|float_dcm]]''' || AHRS_DCM_MAG_ID &lt;br /&gt;
|-&lt;br /&gt;
|'''[[Subsystem/ahrs#Complementary_Euler_.28fixed_point.29|int_cmpl_euler]]'''  || AHRS_ICE_MAG_ID &lt;br /&gt;
|-&lt;br /&gt;
|'''[[Subsystem/ahrs#Kalman_Filter_Quaternion|float_mlkf]]''' || AHRS_MLKF_MAG_ID&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:User_Documentation]] [[Category:Subsystems]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Sensors/IMU&amp;diff=21250</id>
		<title>Sensors/IMU</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Sensors/IMU&amp;diff=21250"/>
		<updated>2016-06-08T13:50:51Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Sensors&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
'''See the [[Subsystem/imu|IMU subsystem]] page for the software drivers.'''&lt;br /&gt;
== Terminology ==&lt;br /&gt;
* '''IMU''':  inertial measurement unit: only measures the accelerations and rotation rates (and magnetic field)&lt;br /&gt;
* '''AHRS''': attitude and heading reference system: uses IMU data + extra (airspeed/GPS/baro/...) to do sensor fusion and provide pitch and roll&lt;br /&gt;
* '''INS''': integrated navigation system: uses IMU + Navigation sensor(s) (e.g. GPS) + even more complex algorithms that besides pitch and roll also interpolates positions and velocities using the attitude corrected acceleration measurements.&lt;br /&gt;
&lt;br /&gt;
== Paparazzi IMUs ==&lt;br /&gt;
&lt;br /&gt;
=== Booz IMU v 1.01 ===&lt;br /&gt;
&lt;br /&gt;
*High quality analog devices sensors&lt;br /&gt;
*16bit ADC capable of 200 000 samples per second&lt;br /&gt;
*Special attention to clean power with onboard linear supplies&lt;br /&gt;
*Efficient high-speed SPI for minimal microcontroller overhead and ultra-low latency (=better controller performance).&lt;br /&gt;
*Fits on Booz, Lisa AND Tiny/TWOG autopilots. &lt;br /&gt;
&lt;br /&gt;
While originally designed for use with rotorcrafts, code is now available for use with fixed wing. &lt;br /&gt;
&lt;br /&gt;
[[Image:IMU001.jpg|240px]]&lt;br /&gt;
&lt;br /&gt;
The hardware description is [[BoozIMU|here]].&lt;br /&gt;
&lt;br /&gt;
Available at [https://mini.ppzuav.com/osc/product_info.php?cPath=15&amp;amp;products_id=122&amp;amp;osCsid=bq9cget2u5c7ksa6kd9ssdf03lisuksq PPZUAV].&lt;br /&gt;
&lt;br /&gt;
=== YAI v1.0 ===&lt;br /&gt;
&lt;br /&gt;
Why &amp;quot;yet another imu&amp;quot; while there are already so many out there?&lt;br /&gt;
&lt;br /&gt;
[[Image:yai_assemb.jpg|240px]]&lt;br /&gt;
&lt;br /&gt;
*Designed to be completely compatible with original booz IMU and its code&lt;br /&gt;
*Cheaper sensors (lower bias stability)&lt;br /&gt;
*Higher resolution (16bits) and frequency (200ksps) and cleaner onboard power supply, better grounding and shielding than compared with e.g. external sparkfun breakout boards&lt;br /&gt;
*Fast low latency SPI communication (no uart as the tiny/twog miss uarts)&lt;br /&gt;
*The most important part of attitude determination is proper kinematic compensation using for instance GPS, pressure sensors etc etc. When using IMU with external processors there is often less flexibility. Things as timing for instance are as important as the quality of the gyros themselves.&lt;br /&gt;
&lt;br /&gt;
Board, BOM -&amp;gt; [ http://svn.savannah.nongnu.org/viewvc/paparazzi-hardware/trunk/sensors/yai/?root=paparazzi Hardware Repository]&lt;br /&gt;
&lt;br /&gt;
=== Aspirin IMU ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Aspirin_imu_front.jpg|240px]]&lt;br /&gt;
&lt;br /&gt;
[[AspirinIMU|Next generation flat imu.]] This little imu with latest generation of integrated high rate high resolution gyros's moreover has very low noise and stable power supplies and outputs all sensors interrupt pins for optimal performance.&lt;br /&gt;
&lt;br /&gt;
Note: while the main intended use is the very low latency high performance spi+i2c+interrupts connection (e.g. on lisa/M), please note that aspirin v2 can also be used with any tiny/twog for fixedwing aircraft with the same 4-wire interface and identical software as the PPZUAV-IMU. (connect Aspirin-SCK and aspirin-SCL to the I2C-SCL, aspirin-mosi and aspirin-SDA to I2C-SDA, Vcc to 5V (preferably linear), aspirin-gnd and aspirin-miso to GND, and aspirin-CS to 3.3V.)&lt;br /&gt;
&lt;br /&gt;
Detailed information about the [[AspirinIMU|Aspirin IMU]] is available [[AspirinIMU|here.]]&lt;br /&gt;
&lt;br /&gt;
=== KroozSD ===&lt;br /&gt;
&lt;br /&gt;
The KroozSD has it's IMU(MPU6050(Gyro/Accel), HMC5883(Mag), MS5611(Baro) already on the board. The Files for the Krooz IMU are currently only in the &amp;quot;Kooz port of the paparazzi master branch&amp;quot; available. [https://github.com/softsr/paparazzi|softsr's port of the master branch]&lt;br /&gt;
&lt;br /&gt;
== 3rd Party IMU ==&lt;br /&gt;
&lt;br /&gt;
'''Loose Terminology Note:''' Like the sparkfun website, the following text incorrectly equates the term &amp;quot;degree-of-freedom&amp;quot; with sensor measurement. Unless we're talking about articulated arms (which paparazzi to date isn't involved with), a body can only have 6 physical DOFs and that would correspond to translation and rotations in the x,y,z Cartesian directions of 3D space. If the vehicle state vector includes positions and velocities for each degree of freedom, the state vector would have a dimension of 6 x 2 = 12 states. The goal is to reconstruct these vehicle states using sensor measurements, as once the states can be obtained with reasonable certainty, a control algorithm can have a shot at controlling the system. Using various filtering techniques, multiple sensor types can be combined to estimate these states.&lt;br /&gt;
&lt;br /&gt;
IMU's measure rotation rates, acceleration (6DOF) and some also magnetic fields (9DOF). This data is used by an autopilot to estimate the state of the aircraft. They that can be used with a Paparazzi autopilot based UAS. If you happen to have such a device, we really would love to see that you share your IMU paparazzi autopilot integration projects information on this Wiki.&lt;br /&gt;
&lt;br /&gt;
=== PPZUAV IMU 9DOF ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Image:Ppz9dofimu.jpg|9DOM IMU&lt;br /&gt;
Image:Ppz9dofimumed.jpg|Example Wiring to Tiny2.11&lt;br /&gt;
Image:Ppz9domschematic.jpg|Schematic&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
Another IMU based around the ITG-3200, ADXL345 and HMC5843.&amp;lt;br&amp;gt;&lt;br /&gt;
Features: I2C out 5v input. Interrupts .&amp;lt;br&amp;gt;&lt;br /&gt;
PCBs available from PPZUAV (assemblies soon). Schematic open, design is Altium Designer, gerbers available.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A sample airframe illustrating all calibration issues and reading and merging the sensor at 100Hz with minimal control delays is in the repository to get you started:&lt;br /&gt;
&lt;br /&gt;
 airframe: PPZUAV/fixedwing/tiny_imu.xml&lt;br /&gt;
 settings: tuning_basic_ins.xml&lt;br /&gt;
 telemetry: default_fixedwing_imu.xml&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Credit and thanks go out to Christophe for making the code and testing. &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Media&lt;br /&gt;
YouTube: http://www.youtube.com/watch?v=OaMTyJ-s-PU&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ryan Mechatronics CHIMU AHRS ===&lt;br /&gt;
&lt;br /&gt;
Very nice product: using the ultra high speed ultra low latency 200Hz SPI-slave mode (even 200Hz innerloop control of fixedwing is possible) or simple 4-wire connection via serial port to any TWOG/TINY/LISA/YAPA. &lt;br /&gt;
&lt;br /&gt;
Don't want to spend time testing AHRS filters? Nor calibrating IMU? This module with molex connector can be bought calibrated and does all the filtering internally.&lt;br /&gt;
&lt;br /&gt;
Use it with highspeed SPI on LPC-based boards: http://www.youtube.com/watch?v=mxx-f3Ur0L8&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;modules&amp;gt;&lt;br /&gt;
    &amp;lt;load name=&amp;quot;ins_chimu_spi.xml&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/modules&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  ...&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;subsystem name=&amp;quot;spi_slave_hs&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use CHIMU with simple uart connection on both lisa or tiny/twog&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;modules&amp;gt;&lt;br /&gt;
    &amp;lt;load name=&amp;quot;ins_chimu_uart.xml&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;configure name=&amp;quot;CHIMU_UART_NR&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/load&amp;gt;&lt;br /&gt;
  &amp;lt;/modules&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SparkFun Razor 6DOF IMU ===&lt;br /&gt;
&lt;br /&gt;
'''This product has been discontinued by the manufacturer ! '''&lt;br /&gt;
&lt;br /&gt;
[[Image:RazzorIMU.jpg|thumb|left|Razor IMU (top) with the tiny13 autopilot]]&lt;br /&gt;
&lt;br /&gt;
[[Image:RazzorIMUb.jpg|thumb|left|Razor IMU in the tiny13 autopilot box]]&lt;br /&gt;
&lt;br /&gt;
[http://www.sparkfun.com/commerce/product_info.php?products_id=10010  Official website]&lt;br /&gt;
&lt;br /&gt;
6DOF - Ultra-Thin IMU&lt;br /&gt;
&lt;br /&gt;
Very cheap, currently 62-72 Euro.  [http://www.watterott.com/de/Sensoren/IMU Shop in Europe]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Has been integrated in Paparazzi by implementing the DCM algorihm  from William Premerlani and Paul Bizard by Hochschule Bremen, Germany.&lt;br /&gt;
&lt;br /&gt;
Remove the high pass filters of the RazorIMU to get better results.&lt;br /&gt;
&lt;br /&gt;
For the Twog and Tiny 2.2 autopilots you have also remove the resistors to GND and the series resistors to the MC of the 5V analog inputs. The code to fly normal plane is currently in the repository.  Christoph is working on improvements look here: http://paparazzi.enac.fr/wiki/User:Christoph   &lt;br /&gt;
&lt;br /&gt;
[[Media:Wiring_Razor_IMU.pdf|Connections and wiring to the tiny13]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Drotek 6DOF (MPU6050) ===&lt;br /&gt;
&lt;br /&gt;
[[Image:drotek1.jpg|thumb|left|component side]]&lt;br /&gt;
[[Image:drotek2.jpg|thumb|left|solder side]]&lt;br /&gt;
&lt;br /&gt;
IMU Drotek MPU6050 6 Degrees of Freedom Invensens MPU6050&lt;br /&gt;
&lt;br /&gt;
[http://www.drotek.fr/shop/en/42-mpu6050-gyro-accelerometer.html drotek.fr shop]&lt;br /&gt;
&lt;br /&gt;
Tiny, very low cost 12 € , 5V and 3.3V input, I2C interface.&lt;br /&gt;
&lt;br /&gt;
Note that this sensor use the alternative I2C address. Correct is in the driver file. It is a low cost and precise solution for normal aircraft.&lt;br /&gt;
&lt;br /&gt;
Similar chinese breakout boards can be found on ebay starting at 2€. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Drotek 10DOF (MPU6050-HMC5883-MS5611) ===&lt;br /&gt;
&lt;br /&gt;
[[Image:drotek3.jpg|thumb|left|component side]]&lt;br /&gt;
[[Image:drotek4.jpg|thumb|left|solder side]]&lt;br /&gt;
&lt;br /&gt;
IMU Drotek MPU6050 - 10 Degrees of Freedom &lt;br /&gt;
&lt;br /&gt;
[http://www.drotek.fr/shop/en/62-imu-10dof-mpu6050-hmc5883-ms5611.html drotek.fr shop]&lt;br /&gt;
&lt;br /&gt;
Tiny, low cost 23€, 5V and 3.3V input (onboard voltage regulator), I2C interface.&lt;br /&gt;
It is a low cost and precise  solution for normal aircraft with a excellent baro sensor.&lt;br /&gt;
&lt;br /&gt;
By default the axes orientation should be as printed on the pcb, meaning z-axis pointing down if ICs are facing down. The orientation can be switched so that the IMU can be mounted ICs facing up by defining IMU_DROTEK_2_ORIENTATION_IC_UP.#&lt;br /&gt;
&lt;br /&gt;
Maybe setting a different I2C address is required.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;subsytem name=&amp;quot;imu&amp;quot; type=&amp;quot;drotek_10dof_v2&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;configure name=&amp;quot;DROTEK_2_I2C_DEV&amp;quot; value=&amp;quot;i2c0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;!--define name=&amp;quot;DROTEK_2_MPU_I2C_ADDR&amp;quot; value=&amp;quot;MPU60X0_ADDR&amp;quot; /--&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;IMU_DROTEK_2_ORIENTATION_IC_UP&amp;quot; value=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/subsystem&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
To read the baro use the separate [[Module/Meas_Spec_MS5611_I2C| baro_ms5611 module]].&lt;br /&gt;
&lt;br /&gt;
Similar chinese breakout boards (different pinout/pcb size) can be found on ebay starting at 12€.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== SparkFun SEN-10121 ===&lt;br /&gt;
&lt;br /&gt;
[[Image:SEN-10121.jpg|thumb|left|SEN-10121]]&lt;br /&gt;
&lt;br /&gt;
IMU Digital Combo Board - 6 Degrees of Freedom ITG3200/ADXL345&lt;br /&gt;
&lt;br /&gt;
http://www.sparkfun.com/products/10121&lt;br /&gt;
&lt;br /&gt;
Tiny, ADXL345 accelerometer, ITG-3200 gyro, 3.3V input, I2C interface.&lt;br /&gt;
&lt;br /&gt;
This IMU has been tested and flown with Tiny v2.11 and TWOG. It is very similar to the PPZUAV IMU.&lt;br /&gt;
&lt;br /&gt;
Details of [[IMU/SEN-10121|configuration]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pololu MinIMU-9 ===&lt;br /&gt;
&lt;br /&gt;
'''This product has been discontinued by the manufacturer !'''&lt;br /&gt;
&lt;br /&gt;
[[Image:MinIMU9.jpg|thumb|left|MinIMU-9]]&lt;br /&gt;
&lt;br /&gt;
IMU Digital Combo Board - 9 Degrees of Freedom L3G4200/LSM303&lt;br /&gt;
&lt;br /&gt;
http://www.pololu.com/catalog/product/1265&lt;br /&gt;
&lt;br /&gt;
Tiny, LSM303 accelerometer and magnetometer, L3G4200 gyro, 3.3V input, I2C interface.&lt;br /&gt;
&lt;br /&gt;
This IMU has been tested and flown with TWOG.&lt;br /&gt;
&lt;br /&gt;
Details of [[IMU/MinIMU-9|configuration]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Cloudcap Crista IMU ===&lt;br /&gt;
&lt;br /&gt;
[[Image:crista_sensorhead.jpg|thumb|left|Christa IMU]]&lt;br /&gt;
&lt;br /&gt;
[http://www.cloudcaptech.com/crista_sensorhead.shtm Official website / Site not found !]&lt;br /&gt;
&lt;br /&gt;
More infos soon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 3rd Party INS ==&lt;br /&gt;
&lt;br /&gt;
INS measure rates with their sensors and run algorithms to estimate the state on their own. They give this information the the autopilot (e.g. Euler angles) that can then use it for navigation.&lt;br /&gt;
&lt;br /&gt;
===[http://diydrones.com/profiles/blogs/arduimu-v2-flat-now-available|DIYDrones ArduIMU+ V2 (Flat)] ===&lt;br /&gt;
[[Image:ArduIMU.jpg|thumb|left|ArduIMU]]&lt;br /&gt;
&lt;br /&gt;
[http://code.google.com/p/ardu-imu/wiki/HomePage?tm=6 Official website]&lt;br /&gt;
&lt;br /&gt;
[[ArduIMU|Paparazzi Wiki Page]]&lt;br /&gt;
&lt;br /&gt;
* 3 axis accelerometer + 3 axis gyroscope&lt;br /&gt;
* Low cost&lt;br /&gt;
* Has been integrated in Paparazzi by ZHAW, Winterthur, Switzerland.&lt;br /&gt;
* A magnetometer has been integrated in the software to compensate drift in yaw.&lt;br /&gt;
* GPS data from the Tiny is passed over I2C to the AHRS on the IMU.&lt;br /&gt;
* Is sold by [http://www.sparkfun.com/products/9956 Sparkfun] and [http://store.diydrones.com/ProductDetails.asp?ProductCode=KT-ArduIMU-20 DIYDrones Store].&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Vector-Nav VN-100 ===&lt;br /&gt;
[[Image:VN-100.jpg|thumb|left|Vector-Nav VN-100]]&lt;br /&gt;
&lt;br /&gt;
[http://www.vectornav.com/vn-100-features Official website]&lt;br /&gt;
&lt;br /&gt;
There is a [[Modules|module]] for this AHRS (ins_vn100.xml for fixedwings).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Vectornav VN-200 ===&lt;br /&gt;
[[File:Vn-200-rugged.png|thumb|left|VN-200 Rugged version]]&lt;br /&gt;
[[File:Vn-200-smd.gif|thumb|left|VN-200 SMD version]]&lt;br /&gt;
&lt;br /&gt;
[http://www.vectornav.com/products/vn200-rugged Official website Rugged version]&lt;br /&gt;
[http://www.vectornav.com/products/vn200-smd Official website SMD version]&lt;br /&gt;
&lt;br /&gt;
Vectornav VN-200 is a relatively new (2015) INS solution. In our tests it outperforms GX2/3 and has similar performance as MTI-G (see white paper ''A Comparison of Flight Data from 5 Small Low-cost IMUs'' from Nathan V. Hoffer, Calvin Coopmans, Austin M. Jensen, AggieAir at the Utah Water Research Laboratory) at roughly half price.&lt;br /&gt;
&lt;br /&gt;
The code is available, use it as an INS subsystem (ins_vectornav). Comes with recommended configuration target (setup_vectornav) so it can be easily configured. Another option is to use the Windows configuration tool from Vectornav.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MicroStrain 3DM-GX2/3 === &lt;br /&gt;
[[Image:3DM-GX2.jpg|thumb|left|MicroStrain 3DM-GX2]]&lt;br /&gt;
&lt;br /&gt;
[http://www.microstrain.com/3dm-gx2.aspx Official website GX2]&lt;br /&gt;
[http://www.microstrain.com/inertial/3DM-GX3-25-OEM Official website GX3]&lt;br /&gt;
&lt;br /&gt;
GX3 AHRS (ahrs_gx3.xml) available for both fixedwing and rotorcraft. Can be used for GX2 too, since the commands and packets are identical (GX2 has slower update rate).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Xsens MTi and MTi-G (with GPS) ===&lt;br /&gt;
[[Image:MTi.jpeg|thumb|left|Xsens MTi]]&lt;br /&gt;
&lt;br /&gt;
[[Image:MTi-G.jpeg|thumb|left|Xsens MTi-G (with GPS)]]&lt;br /&gt;
&lt;br /&gt;
[http://www.xsens.com/en/general/mti Official website MTi]&lt;br /&gt;
&lt;br /&gt;
[http://www.xsens.com/en/general/mti-g Official website MTi-G]&lt;br /&gt;
&lt;br /&gt;
In sensor fusion, calibration and timing are crucial. If you want latency compensated ADXRS gyro integrated attitude done by an efficient and optimized Blackfin DSP you need an XSens. For rotorcraft the 100Hz is a bit slow, but for fixedwing it's perfect. Directly compatible with [[Yapa]] and [[Lisa]] and all needed code in paparazzi. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MemSense MAG3 ===&lt;br /&gt;
&lt;br /&gt;
MAG3 - 6 DOF Analog IMU with Triaxial Magnetometer&lt;br /&gt;
&lt;br /&gt;
[http://www.memsense.com/index.php/Product-Pages/mag3-worlds-smallest-analog-inertial-measurement-unit.html Official website mag3]&lt;br /&gt;
&lt;br /&gt;
== The Very Short Essential Introduction To Inertial Attitude Estimation ==&lt;br /&gt;
&lt;br /&gt;
The only physical entity related to attitude (pitch and roll) is the earth gravity vector (unless you use a multi-antenna phase-measuring GPS... $$$$). Unfortunately, the sensors that measure gravity (=accelerometers) also measure so-called kinematic accelerations or in other words: changes in speed: like centrifugal forces, Coriolis forces, linear accelerations etc... The sum of all these litteraly is &amp;quot;what you feel&amp;quot; and is called [http://en.wikipedia.org/wiki/Specific_force &amp;quot;specific force&amp;quot;]. &lt;br /&gt;
&lt;br /&gt;
so &lt;br /&gt;
&lt;br /&gt;
  accelerometer_value (specific force) = earth_gravity + change in velocity (linear accelerations) + velocity times turn rate (centrifugal etc)&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
  A = B + C + D  &lt;br /&gt;
&lt;br /&gt;
You measure A and want to know B. What all &amp;quot;gyroscopes and accelerometer only&amp;quot; AHRS projects are doing in some way or another is to neglect the last 2 (C and D). In many situations this is not bad: for instance: when testing the AHRS attached to your computer: it can not accelerate for a very long time (at most a few meters: so if you accelerate to the left, then you need to accelerate to the right directly after so the average is zero) and can not rotate to much either (or your cable gets strangled). This is why all AHRS videos on Youtube look perfect. And on the desk they are perfect: you neglected 2 terms in the equation that in that situation are perfectly neglect-able. Also with a quadrotor that hovers and keeps its nose in the same direction all the time, these neglected terms are small.&lt;br /&gt;
&lt;br /&gt;
Now what about the gyroscopes you might ask. I deliberately keep them only second as gyroscopes (turn rate or rotation speed sensors) do NOT give you attitude but ONLY HELP TO SOLVE SHORT TERM errors in the previous part. If gyroscopes would measure turn-rate perfectly, then they would help more but all MEMS/PIEZZO sensors are more or less sensitive to 1) temperature, 2) turnrate, 3) vibrations, 4) accelerations, 5) radiation, 6) power supply quality 7) non-linearity 8) ADC-quality 9) dynamic range and saturation problems, ... so if you integrate gyroscopes, sooner or later errors build up (drift). I put this list here so you know what to pay attention for: if using gyroscopes: always try to keep the temperature as constant as possible or let the temperature settle, reduce vibrations (dampers), use better ADC (e.g. 10bit ADC with +/- 1200 deg/sec gyros have a resolution of 2.4 degrees/s per ADC tick, so your phi/theta might drift 1.2deg/sec without noticing) and power supply filtering and shielding etc to start with. All of these define for how long (seconds!/minutes?) gyroscope integration is useful.&lt;br /&gt;
&lt;br /&gt;
If you convert the accelerometer directly to attitude and plot it, it will vibrate a lot and will show errors when you accelerate the AHRS on your desk. During a coordinated turn of a fixedwing plane, the force you feel is perpendicular to the plane (not pointing to earth). The accelerometer only clearly is insufficient to know your attitude. One solution is to use gyroscopes that are so good that you can predict for many minutes (then the average acceleration during several turns would still point to earth). But if your gyros can only help for shorter terms (like all MEMS sensors of less than 500euro/each) then extra information is required. E.g: if you add GPS data or airspeed data however, from the flightpath you can quite accurately reconstruct the missing C and D terms. Together with the accelerometer you can know &amp;quot;where the earth is&amp;quot; even when you keep accelerating and turning. Here questions like latency, update rate, noisy derivatives (linear acceleration) are of importance. &lt;br /&gt;
&lt;br /&gt;
Finally there is the heading... GPS ground-track is not the same as nose direction. Gyroscopes measure how much the nose has been turning, so using GPS to correct it induces errors that increase with crosswind. Magnetometers can help here, and become necessary whenever you do not move enough anymore (hovering). This situation can also occur in plane flying in very strong winds.&lt;br /&gt;
&lt;br /&gt;
See the [[Subsystem/ahrs|AHRS subsystem]] page for an overview of some algorithm implementations.&lt;br /&gt;
&lt;br /&gt;
[[Category:Sensors]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Modules&amp;diff=21238</id>
		<title>Modules</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Modules&amp;diff=21238"/>
		<updated>2016-06-06T18:32:15Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Modules&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
The modules allow to add new code in a flexible way with initialisation, periodic and event functions without modifying the main AP loop.&lt;br /&gt;
&lt;br /&gt;
See [[FirmwareArchitecture]] and [[Subsystems]] for the differences of modules to subsystems.&lt;br /&gt;
&lt;br /&gt;
=== Available modules ===&lt;br /&gt;
&lt;br /&gt;
There is a special page listing all currently available modules to simply extend your Paparazzi autopilot board possibilities. [[Modules_list| Go here to inspect this list of modules]].&lt;br /&gt;
&lt;br /&gt;
The auto-generated list and short doc for all modules in the master branch can be found at the [http://docs.paparazziuav.org/latest/onboard_modules.html onboard modules page of the doxygen docs].&lt;br /&gt;
&lt;br /&gt;
=== Make your own ===&lt;br /&gt;
&lt;br /&gt;
It is very possible to make your own module and to share it with the world. To make it even easier there is a helper tool called &amp;quot;create_module&amp;quot; in the main Paparazzi directory. Try it, you'll be surprised how easy it is to start your own module with the help of this tool. &lt;br /&gt;
&lt;br /&gt;
=== In the airframe file ===&lt;br /&gt;
&lt;br /&gt;
To add a new module for an aircraft, add a section '''modules''' in his airframe xml file :&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;modules main_freq=&amp;quot;60&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;load name=&amp;quot;demo_module.xml&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;load name=&amp;quot;dummy.xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;BLA&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;BLUB&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;configure name=&amp;quot;FOO&amp;quot; value=&amp;quot;BAR&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/load&amp;gt;&lt;br /&gt;
 &amp;lt;/modules&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
* The main_freq parameter (in Hz) is optional. If present, it allows to specify the frequency of the main loop. Default is the ''main periodic frequency'' of the autopilot. If not needed to be specified, then the first line is just: &amp;lt;modules&amp;gt;&lt;br /&gt;
* The children &amp;quot;define&amp;quot; generate compilation defines for all the targets of a module and can be used with or without value. It allows to keep the module description more generic add to place the airframe dependent parameters in the airframe xml file.&lt;br /&gt;
* The child &amp;quot;configure&amp;quot; generates a makefile variable.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Since '''v5.8''' it is possible to safely replace ''subsystem'' by ''module'' in your airframe file. The roadmap of Paparazzi is to convert existing [[subsystems]] to modules.&lt;br /&gt;
&lt;br /&gt;
As a result, modules can be loaded using the same format than subsystems, as children of the '''firmware''' node.&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;firmware name=&amp;quot;...&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;module name=&amp;quot;demo_module&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;module name=&amp;quot;dummy&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;BLA&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;BLUB&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;configure name=&amp;quot;FOO&amp;quot; value=&amp;quot;BAR&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/module&amp;gt;&lt;br /&gt;
  &amp;lt;target name=&amp;quot;...&amp;quot; board=&amp;quot;...&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;module name=&amp;quot;something&amp;quot; type=&amp;quot;sometype&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/target&amp;gt;&lt;br /&gt;
 &amp;lt;/modules&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The '''modules''' node is then only needed if a custom ''main_freq'' parameter need to be specified.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== In the module file ===&lt;br /&gt;
&lt;br /&gt;
The modules description files are located in '''conf/modules'''.&lt;br /&gt;
{{Box Code|conf/modules/mymodule.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE module SYSTEM &amp;quot;module.dtd&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;module name=&amp;quot;demo_module&amp;quot; dir=&amp;quot;demo_module&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;doc&amp;gt;&lt;br /&gt;
   &amp;lt;description&amp;gt;&lt;br /&gt;
     Demo module.&lt;br /&gt;
     More details about this module.&lt;br /&gt;
   &amp;lt;/description&amp;gt;&lt;br /&gt;
   &amp;lt;configure name=&amp;quot;SOMETHING&amp;quot; value=&amp;quot;S1|S2|S3&amp;quot; description=&amp;quot;The thing to use&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;DEMO_MODULE_LED&amp;quot; value=&amp;quot;LED_X&amp;quot; description=&amp;quot;LED Selection&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/doc&amp;gt;&lt;br /&gt;
  &amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;dl_settings name=&amp;quot;bla&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;dl_setting min=&amp;quot;0&amp;quot; max=&amp;quot;5&amp;quot; step=&amp;quot;1&amp;quot; var=&amp;quot;bla_bla&amp;quot; shortname=&amp;quot;bb&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/dl_settings&amp;gt;&lt;br /&gt;
  &amp;lt;settings&amp;gt;&lt;br /&gt;
  &amp;lt;depends&amp;gt;foo.xml,bar|baz&amp;lt;/depends&amp;gt;&lt;br /&gt;
  &amp;lt;conficts&amp;gt;boo&amp;lt;/conflicts&amp;gt;&lt;br /&gt;
  &amp;lt;header&amp;gt;&lt;br /&gt;
   &amp;lt;file name=&amp;quot;demo_module.h&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/header&amp;gt;&lt;br /&gt;
  &amp;lt;init fun=&amp;quot;init_demo()&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;periodic fun=&amp;quot;periodic_1Hz_demo()&amp;quot; freq=&amp;quot;1.&amp;quot; start=&amp;quot;start_demo()&amp;quot; stop=&amp;quot;stop_demo()&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;periodic fun=&amp;quot;periodic_10Hz_demo()&amp;quot; period=&amp;quot;0.1&amp;quot; start=&amp;quot;start_demo()&amp;quot; stop=&amp;quot;stop_demo()&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;makefile&amp;gt;&lt;br /&gt;
   &amp;lt;raw&amp;gt;&lt;br /&gt;
    #Raw makefile section&lt;br /&gt;
   &amp;lt;/raw&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;USE_SOMETHING&amp;quot; value=&amp;quot;$(SOMETHING)&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;DEMO_MODULE_LED&amp;quot; value=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;file name=&amp;quot;demo_module.c&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/makefile&amp;gt;&lt;br /&gt;
 &amp;lt;/module&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
* module&lt;br /&gt;
** name : this parameter is the name of the module (mandatory)&lt;br /&gt;
** dir : the name of the directory in '''sw/airborne/modules''' where the source code is located (in the above example: sw/airborne/modules/demo_module), if not specified, the name of the module is used as default directory name&lt;br /&gt;
&lt;br /&gt;
* doc&lt;br /&gt;
** description: a description of the module. The content of the first line until the dot is treated as the brief description used as the name in the [http://paparazzi.github.com/docs/latest/onboard_modules.html generated docs] (mandatory).&lt;br /&gt;
** define: describe the possible define flags for this module with default values and a short description (usually called from the [[Airframe_Configuration|airframe firmware section]])&lt;br /&gt;
** configure: describe the possible configuration options for this module with default values and a short description (usually called from the [[Airframe_Configuration|airframe firmware section]])&lt;br /&gt;
** section: describe the parameters that can be added as a section in the [[Airframe_Configuration|airframe configuration file]]&lt;br /&gt;
&lt;br /&gt;
* settings_file (0 or more)&lt;br /&gt;
** file name of a settings xml file&lt;br /&gt;
&lt;br /&gt;
* settings (0 or more): use the same format than systems [[Settings]]&lt;br /&gt;
** target: a list of targets allowed or forbidden for which embedded settings should be used&lt;br /&gt;
** dl_settings node with a tab name&lt;br /&gt;
*** dl_setting: setting description, see [[Settings]] page for details&lt;br /&gt;
&lt;br /&gt;
* depends (0 or 1 'depends' node)&lt;br /&gt;
** comma separated list of required modules&lt;br /&gt;
** allows to specify OR dependencies with pipe (|) similar to Debian depends, ex: &amp;lt;code&amp;gt;foo,bar|baz&amp;lt;/code&amp;gt; would make it depend on foo AND (bar OR baz)&lt;br /&gt;
** the elements can be a xml file (in conf/modules) or a module name (as set in the module xml 'name' node)&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
Prior to '''v5.3.0_testing''' we had one &amp;lt;tt&amp;gt;depend&amp;lt;/tt&amp;gt; node instead of &amp;lt;tt&amp;gt;depends&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;conflicts&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;'depend' node used prior to '''v5.3_devel-438-g8be5c42'''):&lt;br /&gt;
* depend (0 or 1 'depend' node)&lt;br /&gt;
** require : the list of required modules&lt;br /&gt;
** conflict : the list of conflicting modules&lt;br /&gt;
** the elements of a list are separated with a pipe (|), ex: &amp;quot;bla|boo&amp;quot;&lt;br /&gt;
** the elements can be a xml file (in conf/modules) or a module name (in sw/airborne/modules)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
* conflicts (0 or 1 'conflicts' node)&lt;br /&gt;
** comma separated list of conflicting modules&lt;br /&gt;
** the elements can be a xml file (in conf/modules) or a module name (as set in the module xml 'name' node)&lt;br /&gt;
&lt;br /&gt;
* header (0 or 1 'header' node)&lt;br /&gt;
** file : the name of the header to automatically include in modules.h&lt;br /&gt;
&lt;br /&gt;
* init (0 or more 'init' node)&lt;br /&gt;
** fun : initialization function name, called once at startup&lt;br /&gt;
&lt;br /&gt;
* periodic (0 or more 'periodic' node)&lt;br /&gt;
** fun : periodic function name (mandatory)&lt;br /&gt;
** period : period of the function in seconds, cannot be higher than the main frequency (if not specified, use freq parameter)&lt;br /&gt;
** freq : frequency of the function in Hz, cannot be higher than main frequency (used if period is not defined; if nor period nor freq are defined, the maximum frequency is used by default)&lt;br /&gt;
** delay : integer that can be used to impose a sequence in the periodic functions (use values between 0 and main_freq/function_freq)&lt;br /&gt;
** start : function to be executed before the periodic function starts&lt;br /&gt;
** stop : function to be executed after the periodic function stops (never called if autorun=LOCK)&lt;br /&gt;
** autorun : TRUE to make the periodic function starts automatically after init, FALSE to make it way for a user command to start, LOCK to make it always true (default is LOCK)&lt;br /&gt;
&lt;br /&gt;
* event (0 or more 'event' node)&lt;br /&gt;
** fun : event function name called in each cycle of the main AP loop&lt;br /&gt;
&lt;br /&gt;
* datalink (0 or more 'datalink' node)&lt;br /&gt;
** message : name of the datalink (uplink) message to be parsed&lt;br /&gt;
** fun : name of the function called when a message arrived&lt;br /&gt;
&lt;br /&gt;
* makefile (0 or more 'makefile' node)&lt;br /&gt;
** target : a list of build targets separated with pipes (ex: &amp;lt;makefile target=&amp;quot;tunnel|foo&amp;quot;&amp;gt;) (default is &amp;quot;ap|sim|nps&amp;quot;)&lt;br /&gt;
** define : each define node specifies a CFLAGS for the current targets&lt;br /&gt;
*** name : name of the define (ex: name=&amp;quot;USE_MODULE_LED&amp;quot; -&amp;gt; target.CFLAGS += -DUSE_MODULE_LED) (mandatory)&lt;br /&gt;
*** value : the value to associate (ex: name=&amp;quot;DEMO_MODULE_LED&amp;quot; value=&amp;quot;2&amp;quot; -&amp;gt; target.CFLAGS += -DDEMO_MODULE_LED=2)&lt;br /&gt;
*** type : the type of define, possible values are &amp;quot;define&amp;quot; or &amp;quot;D&amp;quot;, &amp;quot;include&amp;quot; or &amp;quot;I&amp;quot; (ex: name=&amp;quot;$(ARCH_SRC)&amp;quot; type=&amp;quot;include&amp;quot; -&amp;gt; target.CFLAGS += -I$(ARCH_SRC) ) (default is &amp;quot;define&amp;quot;)&lt;br /&gt;
** file&lt;br /&gt;
*** name : the name of the c file (located in &amp;quot;sw/airborne/modules/&amp;lt;dir_name&amp;gt;&amp;quot;) to add in the Makefile (ex: name=&amp;quot;demo_module.c&amp;quot; -&amp;gt; target.srcs += modules/&amp;lt;dir_name&amp;gt;/demo_module.c)&lt;br /&gt;
*** dir : select a directory for this file only (overrides the default directory)&lt;br /&gt;
** file_arch (hardware related code)&lt;br /&gt;
*** name : the name of the c file (located in &amp;quot;sw/airborne/arch/&amp;lt;ARCH&amp;gt;/modules/&amp;lt;dir_name&amp;gt;&amp;quot;) add in the Makefile (ex: name=&amp;quot;demo_module_hw.c&amp;quot; -&amp;gt; target.srcs += arch/&amp;lt;ARCH&amp;gt;/modules/&amp;lt;dir_name&amp;gt;/demo_module_hw.c)&lt;br /&gt;
*** dir : select a directory for this file only (overrides the default directory)&lt;br /&gt;
** raw : allows to define a raw makefile section&lt;br /&gt;
&lt;br /&gt;
If the compilation target is not supported by the module, it will be automatically unloaded. This may require a 'clean_ac' to work.&lt;br /&gt;
&lt;br /&gt;
=== In the airborne code ===&lt;br /&gt;
&lt;br /&gt;
The code corresponding to a module should be placed in the directory &amp;quot;sw/airborne/modules/&amp;lt;dir_name&amp;gt;&amp;quot; where dir_name must match the one in your conf file (attribute &amp;quot;dir&amp;quot; if specified, &amp;quot;name&amp;quot; otherwise). There are also defines generated for the frequency and period of every periodic functions of the module that can be used in the code: &amp;lt;PERIODIC_FUNCTION_NAME&amp;gt;_FREQ and &amp;lt;PERIODIC_FUNCTION_NAME&amp;gt;_PERIOD.&lt;br /&gt;
&lt;br /&gt;
=== Starting / stopping a module ===&lt;br /&gt;
&lt;br /&gt;
If modules are loaded with periodical functions that are not locked, a new tab will automatically appear in the setting page of the GCS that allows you to start and stop them.&lt;br /&gt;
&lt;br /&gt;
An other possibility is that any file that includes the header &amp;quot;modules.h&amp;quot; can start or stop the periodic tasks.&lt;br /&gt;
&lt;br /&gt;
=== Telemetry ===&lt;br /&gt;
&lt;br /&gt;
In the [[telemetry]] file, if a module name is specified in a field '''message''', it will be included in the telemetry messages only if the corresponding module is loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;message name=&amp;quot;SOME_MODULE_MSG&amp;quot; period=&amp;quot;2&amp;quot; module=&amp;quot;module_name&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This functionality was removed again in v5.9 ([https://github.com/paparazzi/paparazzi/pull/1678 #1678]), since it is not needed anymore with the &amp;lt;tt&amp;gt;register_periodic_telemetry&amp;lt;/tt&amp;gt; functionality we have since v5.0.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer_Documentation]] [[Category:Modules]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Installation/Linux&amp;diff=21222</id>
		<title>Installation/Linux</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Installation/Linux&amp;diff=21222"/>
		<updated>2016-05-10T16:48:43Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Installation&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;This page only describes the installation of the prerequisite tools and dependencies on Debian/Ubuntu needed for Paparazzi.&amp;lt;/span&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
'''See the general [[Installation]] page for how to [[Installation#Getting_the_Source_Code|download Paparazzi]] and [[Installation#Launching_the_Software|launching it]] after you followed the instructions here.'''&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Paparazzi is very easily installed on any laptop or workstation running [http://www.ubuntu.com/ Ubuntu], [http://www.debian.org/ Debian] (or any of their derivatives).&lt;br /&gt;
&lt;br /&gt;
The steps required to install the software needed to be able to let your UAS fly &lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[Installation/Linux#Installation_of_dependencies|Install the basic Paparazzi dependencies]] and the [[Installation/Linux#ARM_embedded_toolchain|ARM cross compiling toolchain.]]&lt;br /&gt;
&amp;lt;li&amp;gt;[[Installation#Getting_the_Source_Code|Download the source code from the source repository.]]&lt;br /&gt;
&amp;lt;li&amp;gt;Allow access to your PC hardware connection by adding appropriate [[Udev]] rules.&lt;br /&gt;
&amp;lt;li&amp;gt;[[Installation#Launching_the_Software|Compile the binaries from the sources and launch the software.]]&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Users of other Linux flavors than a recent Ubuntu or Debian and anyone needing manual control of each individual package can [[Installation/Manual|install them independently]].&lt;br /&gt;
&lt;br /&gt;
===For the impatient===&lt;br /&gt;
&lt;br /&gt;
For Ubuntu add the [https://launchpad.net/~paparazzi-uav/+archive/ppa paparazzi-uav ppa] &amp;lt;tt&amp;gt;sudo add-apt-repository ppa:paparazzi-uav/ppa&amp;lt;/tt&amp;gt; and install the &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt; package.&lt;br /&gt;
&lt;br /&gt;
Since Paparazzi v5.0 the [https://launchpad.net/gcc-arm-embedded/ gcc-arm-embedded toolchain] is recommended.&lt;br /&gt;
Available as of Ubuntu 14.04, on older versions it can be [[Installation/Linux#ARM_embedded_toolchain|installed via tarball]].&lt;br /&gt;
&lt;br /&gt;
Or just use the [[Installation#Quickstart_on_Ubuntu_12.04|Quickstart for Ubuntu 12.04 LTS]].&lt;br /&gt;
&lt;br /&gt;
== Installation video Tutorials ==&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtubehd|SshFJrBuku8}} {{#ev:youtubehd|eW0PCSjrP78}}&lt;br /&gt;
&lt;br /&gt;
== Installation of dependencies ==&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu ===&lt;br /&gt;
'''Binary packages for Ubuntu are available for the ''i386'', ''amd64'' and ''armhf'' architectures.'''&lt;br /&gt;
&lt;br /&gt;
Add the installation sources for the Paparazzi software packages. Run from a terminal:&lt;br /&gt;
 sudo add-apt-repository ppa:paparazzi-uav/ppa&lt;br /&gt;
&lt;br /&gt;
Then update the systems package inventory and install the main Paparazzi software dependencies. This will take some time.&lt;br /&gt;
 sudo apt-get update &lt;br /&gt;
 sudo apt-get install paparazzi-dev&lt;br /&gt;
&lt;br /&gt;
=== Debian ===&lt;br /&gt;
'''Binary packages for Debian are available for the ''i386'' and ''amd64'' architectures. ''armhf'' packages seem to be currently not supported by the OpenSUSE build service.'''&lt;br /&gt;
&lt;br /&gt;
For Debian Wheezy (7.0) and Jessie (8.0) packages are built using the [http://openbuildservice.org/ Open Build Service (OBS)] on [https://build.opensuse.org/project/show?project=home%3Aflixr%3Apaparazzi-uav OpenSUSE Build Service project home:flixr:paparazzi-uav]&lt;br /&gt;
&lt;br /&gt;
[http://software.opensuse.org/download/package?project=home:flixr:paparazzi-uav&amp;amp;package=paparazzi-dev Install paparazzi-dev]&lt;br /&gt;
&lt;br /&gt;
First add the key:&lt;br /&gt;
 wget -q &amp;quot;http://download.opensuse.org/repositories/home:/flixr:/paparazzi-uav/Debian_8.0/Release.key&amp;quot; -O- | sudo apt-key add -&lt;br /&gt;
&lt;br /&gt;
Add the appropriate repo, depending on your Debian version to sources.list&lt;br /&gt;
 echo &amp;quot;deb http://download.opensuse.org/repositories/home:/flixr:/paparazzi-uav/Debian_7.0/ ./&amp;quot; | tee -a /etc/apt/sources.list&lt;br /&gt;
 echo &amp;quot;deb http://download.opensuse.org/repositories/home:/flixr:/paparazzi-uav/Debian_8.0/ ./&amp;quot; | tee -a /etc/apt/sources.list&lt;br /&gt;
&lt;br /&gt;
Update the systems package inventory and install the main Paparazzi software dependencies.&lt;br /&gt;
 sudo apt-get update &lt;br /&gt;
 sudo apt-get install paparazzi-dev&lt;br /&gt;
&lt;br /&gt;
== ARM embedded toolchain ==&lt;br /&gt;
&lt;br /&gt;
For current Paparazzi versions (v5.0 and above) the [https://launchpad.net/gcc-arm-embedded/ gcc-arm-embedded toolchain] is recommended, which also supports the STM32F4 with FPU (hardware floating point).&lt;br /&gt;
&lt;br /&gt;
=== gcc-arm-none-eabi as Debian/Ubuntu package ===&lt;br /&gt;
&lt;br /&gt;
'''This is the recommended method'''&lt;br /&gt;
&lt;br /&gt;
Note that there are actually two '''different''' toolchains available that unfortunately have the same Debian package name (&amp;lt;tt&amp;gt;gcc-arm-none-eabi&amp;lt;/tt&amp;gt;)!&lt;br /&gt;
* [https://launchpad.net/gcc-arm-embedded/ ARM gcc-arm-embedded toolchain]&lt;br /&gt;
** includes libstdc++ and newlib-nano&lt;br /&gt;
* [https://packages.debian.org/jessie/gcc-arm-none-eabi Debian gcc-arm-none-eabi toolchain]&lt;br /&gt;
** does not include libstdc++&lt;br /&gt;
** does not include newlib-nano&lt;br /&gt;
&lt;br /&gt;
Both toolchains ''should'' work for most use-cases (if you don't need C++ or nano specs), although the [https://launchpad.net/gcc-arm-embedded/ ARM gcc-arm-embedded toolchain] is better tested.&lt;br /&gt;
&lt;br /&gt;
You can list the available versions with &amp;lt;tt&amp;gt;apt-cache policy gcc-arm-none-eabi&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== gcc-arm-embedded toolchain ====&lt;br /&gt;
&lt;br /&gt;
'''This is the recommended toolchain'''&lt;br /&gt;
&lt;br /&gt;
On ''most'' Ubuntu versions the [https://launchpad.net/gcc-arm-embedded/ gcc-arm-embedded toolchain] can be installed as a debian package from the [https://launchpad.net/~terry.guo/+archive/gcc-arm-embedded ppa]:&lt;br /&gt;
 sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install gcc-arm-none-eabi&lt;br /&gt;
&lt;br /&gt;
!!! If you are using Ubuntu 14.04 and later, please be careful because there are packages with same name but produced by Debian and inherited by Ubuntu.&lt;br /&gt;
Check available versions after adding the PPA with&lt;br /&gt;
&lt;br /&gt;
 apt-cache policy gcc-arm-none-eabi&lt;br /&gt;
&lt;br /&gt;
To install a specific version (the one from terry.guo PPA) specify the version explicitly, e.g.&lt;br /&gt;
 sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install gcc-arm-none-eabi=4.9.3.2015q3-1trusty1&lt;br /&gt;
Meanwhile we are working with Debian to consolidate and unify this toolchain.&lt;br /&gt;
&lt;br /&gt;
==== gcc-arm-none-eabi Debian toolchain ====&lt;br /&gt;
&lt;br /&gt;
Current Debian ('''jessie''') and Ubuntu (14.04 '''trusty''' and later) releases have the gcc-arm-none-eabi package in the official repositories ('''universe'''), and can be installed with:&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install gcc-arm-none-eabi&lt;br /&gt;
&lt;br /&gt;
=== ARM gcc-arm-embedded tarball ===&lt;br /&gt;
Another way is to download and unpack the tarball and add it to your PATH:&lt;br /&gt;
&lt;br /&gt;
* Download gcc-arm-none-eabi-*-*-linux.tar.bz2 from [https://launchpad.net/gcc-arm-embedded/+download External Downloads] section of ARM gcc-arm-embedded project&lt;br /&gt;
* Unpack it to a directory of your choice&lt;br /&gt;
* Add the bin folder in to your PATH&lt;br /&gt;
&lt;br /&gt;
e.g.:&lt;br /&gt;
 cd ~&lt;br /&gt;
 wget https://launchpad.net/gcc-arm-embedded/4.7/4.7-2013-q2-update/+download/gcc-arm-none-eabi-4_7-2013q2-20130614-linux.tar.bz2&lt;br /&gt;
 sudo tar -vjxf gcc-arm-none-eabi-4_7-2013q2-20130614-linux.tar.bz2 -C /opt&lt;br /&gt;
 rm -r gcc-arm-none-eabi-4_7-2013q2-20130614-linux.tar.bz2&lt;br /&gt;
 exportline=&amp;quot;PATH=$PATH:/opt/gcc-arm-none-eabi-4_7-2013q2/bin&amp;quot;&lt;br /&gt;
 if grep -Fxq &amp;quot;$exportline&amp;quot; ~/.profile; then echo nothing to do ; else echo $exportline &amp;gt;&amp;gt; ~/.profile; fi&lt;br /&gt;
 source ~/.profile&lt;br /&gt;
&lt;br /&gt;
The file .profile will be sourced in every bash after logging out and in again. Until then,&lt;br /&gt;
 source ~/.profile&lt;br /&gt;
can be used for every bash individually.&lt;br /&gt;
&lt;br /&gt;
If you can not access your toolchain with PATH working, look a the [[Installation/Linux#Troubleshooting]].&lt;br /&gt;
&lt;br /&gt;
=== Old toolchain for Paparazzi v4.x and earlier ===&lt;br /&gt;
&lt;br /&gt;
'''For Paparazzi v4.x''' and earlier you need to install the &amp;lt;tt&amp;gt;paparazzi-arm-multilib&amp;lt;/tt&amp;gt; package. It has support for both ARM7 (i.e. Tiny,TWOG,YAPA autopilot boards) as well as STM32F1 (i.e. LISA boards).&amp;lt;br&amp;gt;&lt;br /&gt;
'''This toolchain does not properly support STM32F4 based autopilots!!'''&lt;br /&gt;
&lt;br /&gt;
You can install it explicitly with:&lt;br /&gt;
 sudo apt-get install paparazzi-arm-multilib&lt;br /&gt;
&lt;br /&gt;
== Optional Packages ==&lt;br /&gt;
&lt;br /&gt;
The packages &amp;lt;b&amp;gt;lpc21isp&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;openocd&amp;lt;/b&amp;gt; are normally '''automatically installed''' as they are recommended packages of paparazzi-dev, '''if not''' you can manually install them via:&lt;br /&gt;
 &lt;br /&gt;
 sudo apt-get install lpc21isp openocd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;lpc21isp&amp;lt;/tt&amp;gt; is needed to serially flash the LPC2148 based autopilots (e.g. bootloader for tiny, twog, umarim), &amp;lt;tt&amp;gt;openocd&amp;lt;/tt&amp;gt; is for flashing via JTAG (e.g. for Lisa boards) and debugging.&lt;br /&gt;
&lt;br /&gt;
== Installing and running Paparazzi ==&lt;br /&gt;
&lt;br /&gt;
Please see [[Installation#Getting_the_Source_Code|Getting the Source Code on the general Installation page]] for details on downloading the Paparazzi source code, compiling and running it.&lt;br /&gt;
&lt;br /&gt;
== Udev rules ==&lt;br /&gt;
&lt;br /&gt;
Add the appropriate [[Udev]] rule (available in fhe file ''50-paparazzi.rules'') to the USB handler.  Simply copy as root &amp;lt;tt&amp;gt;conf/system/udev/rules/50-paparazzi.rules&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;/etc/udev/rules.d/&amp;lt;/tt&amp;gt;, e.g in a terminal:&lt;br /&gt;
&lt;br /&gt;
 cd &amp;lt;your paparazzi directory&amp;gt;&lt;br /&gt;
 sudo cp conf/system/udev/rules/50-paparazzi.rules /etc/udev/rules.d/&lt;br /&gt;
 sudo udevadm control --reload-rules&lt;br /&gt;
&lt;br /&gt;
See the [[Udev]] page for more details.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== No access rights for USB devices ===&lt;br /&gt;
&lt;br /&gt;
Some Linux distributions, don't allow standard (non admin) users to directly access the USB bus by default. On recent Ubuntu/Debian versions the first/main user is already a member of the ''plugdev'' group which should be sufficient for most cases.&amp;lt;br&amp;gt;&lt;br /&gt;
If you have problems, make yourself a member of the ''plugdev'' and ''dialout'' groups:&lt;br /&gt;
&lt;br /&gt;
 sudo adduser &amp;lt;your login&amp;gt; plugdev&lt;br /&gt;
 sudo adduser &amp;lt;your login&amp;gt; dialout&lt;br /&gt;
&lt;br /&gt;
Logout and login again.&lt;br /&gt;
&lt;br /&gt;
=== arm-none-eabi-gcc: Command not found ===&lt;br /&gt;
Appeared on Debian Wheezy 7 (gcc-arm-none-eabi-4_8-2013q4 installed via tarball)&amp;lt;br/&amp;gt;&lt;br /&gt;
If this error occurs, maybe the [https://packages.debian.org/de/wheezy/ia32-libs ia32-libs] are missing.&lt;br /&gt;
&lt;br /&gt;
Enable multiarch and install ia32-libs:&lt;br /&gt;
 dpkg --add-architecture i386&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install ia32-libs&lt;br /&gt;
&lt;br /&gt;
=== arm-linux-gnueabi-gcc cross-compiler not found ===&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu ===&lt;br /&gt;
 apt-get install gcc-arm-linux-gnueabi&lt;br /&gt;
&lt;br /&gt;
=== Debian ===&lt;br /&gt;
Starting with jessie, there were [https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=771496#41 some changes] to the way cross-compilers are set up. To make it work you will have to add armel architecture and pick up some crossbuild tools.&lt;br /&gt;
&lt;br /&gt;
First edit your /etc/apt/sources.list and add the following line, to enable the emdebian repo:&lt;br /&gt;
 deb http://emdebian.org/tools/debian/ jessie main&lt;br /&gt;
&lt;br /&gt;
Run the following command in your terminal to add the keys for it&lt;br /&gt;
 curl http://emdebian.org/tools/debian/emdebian-toolchain-archive.key | sudo apt-key add -&lt;br /&gt;
&lt;br /&gt;
Then you could add armel architecture and fetch the missing cross-compiler packages&lt;br /&gt;
 dpkg --add-architecture armel&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install crossbuild-essential-armel&lt;br /&gt;
&lt;br /&gt;
You could find out more about cross-toolchains in jessie on debian [https://wiki.debian.org/CrossToolchains wiki page].&lt;br /&gt;
&lt;br /&gt;
Note that some of your repos might not mirror embedded architectures, which would give you an error when you try to update the sources. In that case you will have to specify which architecture you do want from them by editing the corresponding entry in your sources.list file, in a way described [https://wiki.debian.org/Multiarch/HOWTO here]. Like in this example with the crunchbang repo you could specify it by adding [arch=amd64,i386] to the line, so you only enable amd64 and i386 architectures:&lt;br /&gt;
 deb [arch=amd64,i386] http://packages.crunchbang.org/waldorf waldorf main&lt;br /&gt;
&lt;br /&gt;
===arm-none-eabi-gdb: error with libncurses.so.5===&lt;br /&gt;
Appeared on Xubuntu 14.04 LTS (gcc-arm-none-eabi-4_8-2013q4 installed via tarball)&amp;lt;br/&amp;gt;&lt;br /&gt;
Terminal output: arm-none-eabi-gdb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
If this error occurs, maybe [http://packages.ubuntu.com/search?keywords=lib32ncurses5 lib32ncurses5] is missing. &amp;lt;br/&amp;gt;&lt;br /&gt;
Found on [https://answers.launchpad.net/gcc-arm-embedded/+question/226680 launchpad q&amp;amp;a]&lt;br /&gt;
&lt;br /&gt;
=== FTDI serial adapter not working on old Ubuntu version ===&lt;br /&gt;
&lt;br /&gt;
On older Linux distributions (not needed for lucid and later), the Braille TTY driver interferes with FTDI USB Serial adapters. If somehow your FTDI serial adapter does not work, remove the package via:&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get remove brltty&lt;br /&gt;
&lt;br /&gt;
=== Code not starting on autopilot after changing gcc ===&lt;br /&gt;
&lt;br /&gt;
If you changed the toolchain (e.g. installed a new one for having FPU-Support for the F4), you need to run&lt;br /&gt;
&lt;br /&gt;
 make clean &amp;amp;&amp;amp; make&lt;br /&gt;
&lt;br /&gt;
in sw/ext in order to rebuild the libs. Otherwise the embedded code can behave strange (most likely not start)&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:User_Documentation]] [[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Modems/xbee&amp;diff=21221</id>
		<title>Modems/xbee</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Modems/xbee&amp;diff=21221"/>
		<updated>2016-05-10T16:46:00Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Paparazzi supports the following modem protocols:&lt;br /&gt;
* Standard transparent serial (pprz protocol, AT mode) - compatible with all modems and can be used to connect the autopilot directly to a PC for testing without a modem.&lt;br /&gt;
* Digi (formerly Maxstream) API protocol (xbee) - compatible with all Digi modems including the 9XTend and Zigbee. This protocol enables hardware addressing through API mode, allowing multiple aircraft to be managed from a single ground modem.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Installation of X-CTU ===&lt;br /&gt;
The simplest way to configure the XBee modems is to use the [http://www.digi.com/support/productdetail?pid=3352 X-CTU] software from Digi. It runs natively under MacOS X, Windows and Linux.&lt;br /&gt;
To use versions before X-CTU 6 under Linux, use Wine.&lt;br /&gt;
&lt;br /&gt;
==== Installation using Wine ====&lt;br /&gt;
'''X-CTU versions 6 and up are available natively for Linux''', so using Wine is only needed for older versions.&lt;br /&gt;
&lt;br /&gt;
Under Wine make sure you have the USB serial link connecting to XBee mapped to a com port (please consult [[Installation/Linux/udev | paparazzi linux device naming]]):&lt;br /&gt;
&lt;br /&gt;
* First of all you should install wine.&lt;br /&gt;
* Then install winetricks (X-CTU requires MS Visual C++ Redistributable package so winetricks will make things much easier to get installed).&lt;br /&gt;
* Then ('''!important''') run wine configuration before doing something else, so wine can create ~/.wine&lt;br /&gt;
* Make symlink to your modem device.&lt;br /&gt;
&lt;br /&gt;
 $ sudo ln -s /dev/paparazzi/xbee ~/.wine/dosdevices/com4&lt;br /&gt;
&lt;br /&gt;
* Set permissions for COM port (if you are not root):&lt;br /&gt;
 &lt;br /&gt;
 $ sudo ls -l /dev/paparazzi/xbee&lt;br /&gt;
 lrwxrwxrwx 1 root root 10 june 14 19:00 /dev/paparazzi/xbee -&amp;gt; /dev/ttyUSB0&lt;br /&gt;
 $ sudo chown &amp;lt;your_user_name_here&amp;gt; /dev/ttyUSB0&lt;br /&gt;
&lt;br /&gt;
* Run X-CTU setup and install it.&lt;br /&gt;
* Then run installed application. When window opens switch to &amp;quot;User Com Ports&amp;quot; tab and add com port &amp;quot;COM4. Note: This procedure have to be made every time you start X-CTU on Linux.&lt;br /&gt;
* Click &amp;quot;Test/Query&amp;quot; button. If you get some modem information (like serial, etc.) after a little time, then you have modem link established.&lt;br /&gt;
&lt;br /&gt;
If X-CTU complains on com port connectivity, try adding these strings to ~/.wine/system.reg&lt;br /&gt;
 [hardware\\DEVICEMAP\\SERIALCOMM]&lt;br /&gt;
 &amp;quot;COM1&amp;quot;=&amp;quot;COM1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If your X-CTU does not update its firmware correctly from the web, follow the steps described in the chapter &amp;quot;Manually Update the X-CTU firmware files&amp;quot; of [http://wiki.openpilot.org/display/Doc/Configure+Xbee+via+Linux this page].&lt;br /&gt;
&lt;br /&gt;
=== Configuring XBee AT mode using X-CTU ===&lt;br /&gt;
This is the recommended way to start. With this firmware the modems basically act as a serial link replacement and don't do any mesh networking. The pprz protocol is based on this mode.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Basic approach:&lt;br /&gt;
# Connect your XBee to your PC. There are several vendors of [[Modems#GCS_Adaptation|USB boards]].&lt;br /&gt;
# Start the X-CTU programm and go to the modem configuration.&lt;br /&gt;
# Click on READ&lt;br /&gt;
# Select the appropriate function set with AT command set.&lt;br /&gt;
# set PAN ID, etc... depending on which XBee you use&lt;br /&gt;
# Set the baudrate you want to use. 57600 is the maximum baudrate setting for bidirectional transfers to work correctly. At a higher baudrate setting, transmission can only be done in one direction.&lt;br /&gt;
# Then write the firmware to the module.&lt;br /&gt;
If X-CTU asks you to reset the XBee, you have to connect the RST pin (5) to the GND pin (10) of the XBee. You can do this manually using tweezers or a short wire.&lt;br /&gt;
&lt;br /&gt;
=== Configuring XBee using a terminal emulator ===&lt;br /&gt;
&lt;br /&gt;
Alternatively you can configure your XBee using a text-based modem control and terminal emulation program, such as [http://en.wikipedia.org/wiki/Minicom Minicom] for Linux or [http://freeware.the-meiers.org CoolTerm] for Linux, Mac OSX, or Windows.&lt;br /&gt;
&lt;br /&gt;
The xBee modules can be set to the following baud rates:&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;6&amp;quot;&lt;br /&gt;
!''Baud Code''!!''Baud Rate''!!''Notes''&lt;br /&gt;
|-&lt;br /&gt;
|0||1200||&lt;br /&gt;
|-&lt;br /&gt;
|1||2400||&lt;br /&gt;
|-&lt;br /&gt;
|2||4800||&lt;br /&gt;
|-&lt;br /&gt;
|3||9600||&lt;br /&gt;
|-&lt;br /&gt;
|4||19200|| Use with fixedwing aircraft and their GCSs&lt;br /&gt;
|-&lt;br /&gt;
|5||38400||&lt;br /&gt;
|-&lt;br /&gt;
|6||57600|| Use with rotorcraft or transitioning aircraft and their GCSs&lt;br /&gt;
|-&lt;br /&gt;
|7||115200||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Quick, I'm in a rush''':&lt;br /&gt;
 $ sudo screen /dev/ttyUSB0 9600&lt;br /&gt;
 +++&lt;br /&gt;
 ATBD6&amp;lt;enter&amp;gt;&lt;br /&gt;
 ATAP1&amp;lt;enter&amp;gt;&lt;br /&gt;
 ATWR&amp;lt;enter&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Minicom Instructions''':&lt;br /&gt;
* Connect XBee to your computer&lt;br /&gt;
* Setup minicom (by default XBee modems come set up for 9600 baud) 8-N-1 &lt;br /&gt;
* Type Ctrl-A A in minicom this will set it up to add linefeeds to the stream&lt;br /&gt;
* Type three '+' in quick succession resulting in &amp;quot;+++&amp;quot; string (you have 10s to type your next command otherwise the modem will revert back to transparent mode). Do NOT press enter.&lt;br /&gt;
** you get a confirmation: 'OK'&lt;br /&gt;
* Type &amp;quot;AT&amp;lt;enter&amp;gt;&amp;quot;&lt;br /&gt;
** you get a confirmation: 'OK'&lt;br /&gt;
* Type &amp;quot;ATBD&amp;lt;enter&amp;gt;&amp;quot;&lt;br /&gt;
** you get the current baudrate code: '3'&lt;br /&gt;
* To set another baudrate select one from the above table and type &amp;quot;ATBD &amp;lt;baud code&amp;gt;&amp;lt;enter&amp;gt;&amp;quot;:&lt;br /&gt;
* Type &amp;quot;ATAP 0 or 1 for API mode or not&amp;lt;enter&amp;gt;&amp;quot;&lt;br /&gt;
* To store the new baudrate in the rom type &amp;quot;ATWR&amp;lt;enter&amp;gt;&amp;quot;&lt;br /&gt;
* Now you can close minicom&lt;br /&gt;
* Reconnect modem&lt;br /&gt;
* Restart minicom with the new baudrate&lt;br /&gt;
* Test that the modem is setup correctly by typing &amp;quot;+++&amp;quot; and getting &amp;quot;OK&amp;quot; confirmation&lt;br /&gt;
&lt;br /&gt;
'''CoolTerm Instructions''':&lt;br /&gt;
* Connect xBee to your computer&lt;br /&gt;
* Open CoolTerm and click 'Options.' From the 'Serial Port' tab select:&lt;br /&gt;
**Port: USB Serial (or as appropriate for your xBee carrier board)&lt;br /&gt;
**Baudrate: 9600&lt;br /&gt;
**Data Bits: 8&lt;br /&gt;
**Parity: None&lt;br /&gt;
**Stop Bits 1&lt;br /&gt;
*From the 'Terminal' tab enable Local Echo&lt;br /&gt;
*Click OK&lt;br /&gt;
*Click Connect&lt;br /&gt;
* Type three '+' in quick succession resulting in &amp;quot;+++&amp;quot; string (you have 10s to type your next command otherwise the modem will revert back to transparent mode). Do NOT press enter.&lt;br /&gt;
** you get a confirmation: 'OK'&lt;br /&gt;
* Type &amp;quot;AT&amp;lt;enter&amp;gt;&amp;quot;&lt;br /&gt;
** you get a confirmation: 'OK'&lt;br /&gt;
* Type &amp;quot;ATBD&amp;lt;enter&amp;gt;&amp;quot;&lt;br /&gt;
** you get the current baudrate code: '3'&lt;br /&gt;
* To set another baudrate select one from the above table and type &amp;quot;ATBD &amp;lt;baud code&amp;gt;&amp;lt;enter&amp;gt;&amp;quot;:&lt;br /&gt;
* To store the new baudrate in the rom type &amp;quot;ATWR&amp;lt;enter&amp;gt;&amp;quot;&lt;br /&gt;
* Now you can close CoolTerm.&lt;br /&gt;
* Reconnect modem&lt;br /&gt;
* Restart CoolTerm, change options to new baudrate, and connect&lt;br /&gt;
* Test that the modem is setup correctly by typing &amp;quot;+++&amp;quot; and getting &amp;quot;OK&amp;quot; confirmation&lt;br /&gt;
&lt;br /&gt;
== XBee Pro ZB (AT command set) ==&lt;br /&gt;
This 2.4GHz modem uses ZigBee PRO Feature Set and is compatible with devices from other vendors using the ZigBee PRO Feature Set.&lt;br /&gt;
&lt;br /&gt;
=== Flashing the airborne module ===&lt;br /&gt;
# Connect your XBee, start X-CTU, click READ&lt;br /&gt;
# Select the function set '''ZIGBEE END DEVICE AT''' (or ZIGBEE ROUTER AT).&lt;br /&gt;
# Set the PAN ID to any number, must be the same as the pan id of the coordinator (Ground Station).&lt;br /&gt;
# Set the Node Identifier (NI) to your aircraft name or any other appropriate name.&lt;br /&gt;
# Set the baudrate you want to use. 57600 is the maximum baudrate setting for bidirectional transfers to work correctly.&lt;br /&gt;
# Then write the firmware to the module.&lt;br /&gt;
&lt;br /&gt;
=== Flashing the ground station module ===&lt;br /&gt;
# Connect your XBee, start X-CTU, click READ&lt;br /&gt;
# Select the function set '''ZIGBEE COORDINATOR AT'''.&lt;br /&gt;
# Set the PAN ID to any number, must be the same as the pan id of the end device (aircraft).&lt;br /&gt;
# Set the Node Identifier (NI) to PPRZ_GROUND or any other appropriate name.&lt;br /&gt;
# Set the baudrate you want to use. 57600 is the maximum baudrate setting for bidirectional transfers to work correctly.&lt;br /&gt;
# Then write the firmware to the module.&lt;br /&gt;
&lt;br /&gt;
=== Pairing your Modems ===&lt;br /&gt;
&lt;br /&gt;
For maximum performance you can pair the ground modem to the airborne modem. Set the &amp;quot;DH - Destination Address High&amp;quot; and &amp;quot;DL - Destination Address Low&amp;quot; to the unique serial number &amp;quot;SH - Serial Number High&amp;quot; and &amp;quot;SL - Serial Number Low&amp;quot; of the other modem. Do so both on the ground modem and on the airborne modem. Failing to properly pair your modems will likely result in poor throughput and data loss between your airframe and your ground control station. If this is the case you may see errors on the Paparazzi Center console like &amp;lt;tt&amp;gt;Failure(&amp;quot;Pprz.values_of_payload, wrong argument: 00 08 &amp;quot;)&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;Failure(&amp;quot;Pprz.values_of_payload, too many bytes in message PONG: 00 03 02 2a 00 00 00 00 00 00 00 00 00 00 00 00 &amp;quot;)&amp;lt;/tt&amp;gt;. Pairing does help and the error messages will disappear. &lt;br /&gt;
&lt;br /&gt;
=== Reviving a non-responding Xbee Pro ===&lt;br /&gt;
&lt;br /&gt;
To bring an apparently dead XBee Pro Series 2 back to life, do the following:&lt;br /&gt;
&lt;br /&gt;
#Connect the USB device that holds the XBee to your laptop/desktop (without the XBee connected).&lt;br /&gt;
#Open X-CTU.&lt;br /&gt;
#In the tab used to program the device, select the proper modem (normally you would do a READ to get the values).&lt;br /&gt;
#Choose the option you want to program (i.e., &amp;quot;END DEVICE&amp;quot; or &amp;quot;COORDINATOR&amp;quot;) as if you were programming it.&lt;br /&gt;
#With the XBee not in the device, click &amp;quot;WRITE&amp;quot;. It will hang, timeout, and bring up a dialog box.&lt;br /&gt;
#Before you click OK to the dialog box, plug in the XBee module (carefully).&lt;br /&gt;
#Click OK to clear the message and it should start programming automatically.&lt;br /&gt;
&lt;br /&gt;
=== Other tutorials ===&lt;br /&gt;
&lt;br /&gt;
[http://pixhawk.ethz.ch/tutorials/how_to_configure_xbee PixHawk: HowTo configure XBee]&lt;br /&gt;
&lt;br /&gt;
[http://wiki.openpilot.org/display/Doc/Configure+Xbee+via+Linux openpilot: XBee RF modems]&lt;br /&gt;
&lt;br /&gt;
== XBee Pro ZNet 2.5 (AT command set) ==&lt;br /&gt;
These are legacy modems and not recommended/sold by Digi anymore.&lt;br /&gt;
It is recommended to upgrade these to XBee Pro ZB with the [ftp://ftp1.digi.com/support/images/ZNet%202.5%20to%20ZB%20Conversion%20Kit.zip ZNet 2.5 to ZB Conversion Kit] from Digi.&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
If you want to use ZNet 2.5 feature set nevertheless, here is how to configure it:&lt;br /&gt;
&lt;br /&gt;
=== Flashing the airborne module ===&lt;br /&gt;
# Connect your XBee, start X-CTU, click READ&lt;br /&gt;
# Select the function set '''ZNET 2.5 ROUTER/END DEVICE AT'''.&lt;br /&gt;
# Set the PAN ID to any number, must be the same as the pan id of the coordinator (Ground Station).&lt;br /&gt;
# Set the Node Identifier (NI) to your aircraft name or any other appropriate name.&lt;br /&gt;
# Set the baudrate you want to use. 57600 is the maximum baudrate setting for bidirectional transfers to work correctly.&lt;br /&gt;
# Then write the firmware to the module.&lt;br /&gt;
&lt;br /&gt;
=== Flashing the ground station module ===&lt;br /&gt;
# Connect your XBee, start X-CTU, click READ&lt;br /&gt;
# Select the function set '''ZNET 2.5 COORDINATOR DEVICE AT'''.&lt;br /&gt;
# Set the Destination Address Low (DL) to FFFF.&lt;br /&gt;
# Set the PAN ID to any number, must be the same as the pan id of the end device (aircraft).&lt;br /&gt;
# Set the Node Identifier (NI) to PPRZ_GROUND or any other appropriate name.&lt;br /&gt;
# Set the baudrate you want to use. 57600 is the maximum baudrate setting for bidirectional transfers to work correctly.&lt;br /&gt;
# Then write the firmware to the module.&lt;br /&gt;
&lt;br /&gt;
=== Setup ===&lt;br /&gt;
&lt;br /&gt;
For the ZigBee ZNet 2.5 and ZB modules to work one of the modules has to be flashed with the coordinator firmware. All the others in the same PAN can either run as routers or end-devices.&lt;br /&gt;
* Flash one module (ground station) with the coordinator AT firmware&lt;br /&gt;
* Flash aircraft module with router or end-device AT firmware&lt;br /&gt;
To allow modules to join any PAN set the PAN ID to zero (default setting). Then the coordinator will generate a random PAN ID and routers and end-devices will join the first PAN they find.&lt;br /&gt;
&lt;br /&gt;
If you operate in an environment with multiple zigbee PANs it is recommended to set the PAN ID explicitly:&lt;br /&gt;
* Set PAN ID to some unique (but same) ID on both modules&lt;br /&gt;
* Set a Node Identifier for each module (e.g. ground, aircraft)&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== XBee Pro DigiMesh / 802.15.4 (&amp;quot;Series 1&amp;quot;) ==&lt;br /&gt;
&lt;br /&gt;
=== Flashing the airborne module ===&lt;br /&gt;
# Connect your XBee, start X-CTU, click READ&lt;br /&gt;
# Leave the function set on '''XBEE PRO 802.15.4'''.&lt;br /&gt;
# Set the PAN ID to any number, must be the same as the pan id of the coordinator (Ground Station).&lt;br /&gt;
# Set the Node Identifier (NI) to your aircraft name or any other appropriate name.&lt;br /&gt;
# Set the baudrate you want to use. 57600 is the maximum baudrate setting for bidirectional transfers to work correctly.&lt;br /&gt;
# Then write the firmware to the module.&lt;br /&gt;
&lt;br /&gt;
=== Flashing the ground station module ===&lt;br /&gt;
# Connect your XBee, start X-CTU, click READ&lt;br /&gt;
# Leave the function set on '''XBEE PRO 802.15.4'''.&lt;br /&gt;
# '''Set Coordinator Enable to &amp;quot;1 - COORDINATOR&amp;quot;.'''&lt;br /&gt;
# Set the PAN ID to any number, must be the same as the pan id of the end device (aircraft).&lt;br /&gt;
# Set the Node Identifier (NI) to PPRZ_GROUND or any other appropriate name.&lt;br /&gt;
# Set the baudrate you want to use. 57600 is the maximum baudrate setting for bidirectional transfers to work correctly.&lt;br /&gt;
# Then write the firmware to the module.&lt;br /&gt;
&lt;br /&gt;
(Tested on XBP24 Firmwareversion 10E6)&lt;br /&gt;
&lt;br /&gt;
== XBee Pro 868 MHZ ==&lt;br /&gt;
&lt;br /&gt;
=== Getting Them Working ===&lt;br /&gt;
Even with the xbee868.xml telemetry file, XBee868s will not last over 6 minutes. There is a special 868 build flag (in slayer1.xml), and matching option for the datalink but I could not get this to work. Eventually, I got them to work for about 20 minutes, which happily is the flight endurance of a heavily overloaded GWS Formosa.&lt;br /&gt;
&lt;br /&gt;
I did this using a command window, but you could use X-CTU if you are a wuss or have Windows handy.&lt;br /&gt;
&lt;br /&gt;
#Attach Xbee and start serial comm program (I use &amp;lt;code&amp;gt;screen /dev/ttyUSB0 &amp;amp;lt;baud rate, just a number, no angled brackets&amp;amp;gt;&amp;lt;/code&amp;gt;, you can also use pico- or microcom)&lt;br /&gt;
#Type AT and enter. You should get an OK back.&lt;br /&gt;
#ATMT and enter. You should get a number&amp;amp;mdash;this represents the number of extra times each packet will be broadcast. We now need to change this to zero.&lt;br /&gt;
#ATMT0 and enter =&amp;gt; OK&lt;br /&gt;
#ATRR and enter. This number is the number of retries that will be sent if an ACK is not received. Disabling this will also have the side effect of disabling ACKs, giving us more packets to play with.&lt;br /&gt;
#ATRR0 and enter =&amp;gt; OK&lt;br /&gt;
#Type ATWR to store the new stuff in the firmware. You should get an OK.&lt;br /&gt;
#Set the datalink to transparent mode both in your airframe file and on the datalink.&lt;br /&gt;
&lt;br /&gt;
You may also want to drop the power level to 1mW for testing, or it won't actually work - they are just too damn powerful to talk to each other at a range of a couple of feet. I also used 1mW for flying - never lost the link, even after a mile. Didn't get round to range testing them though. &lt;br /&gt;
&lt;br /&gt;
You probably want to do this to both XBees (at least I did). I personally had the baud rate at 57600 for legacy reasons, but it should work just as well at any other baud rate. '''Thanks to CheBuzz for this info''', and for helping me work all this out at 11pm the night before EMAV09.&lt;br /&gt;
&lt;br /&gt;
== XBee 868LF ==&lt;br /&gt;
&lt;br /&gt;
These relatively new modems use the whole spectrum allowed in your country to avoid Duty Cycle restrictions.&lt;br /&gt;
&lt;br /&gt;
== XBee Pro XSC (900MHZ) ==&lt;br /&gt;
&lt;br /&gt;
== Configuring XBee API mode (xbee protocol) ==&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]] [[Category:User_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Installation&amp;diff=21144</id>
		<title>Installation</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Installation&amp;diff=21144"/>
		<updated>2016-04-05T17:45:10Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Installation&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Paparazzi is very easily installed on any laptop or workstation running the [http://www.ubuntu.com/ Ubuntu Linux OS] or virtually any [http://www.debian.org/ Debian] based [http://en.wikipedia.org/wiki/Linux Linux] or Apple Macintosh running [http://en.wikipedia.org/wiki/OS_X Mac OS X]. There is also work being done to port Paparazzi to Windows.&lt;br /&gt;
&lt;br /&gt;
The steps required to install the software needed to be able to let your UAS fly are:&lt;br /&gt;
&lt;br /&gt;
# Install tools and prerequisites needed by Paparazzi.&lt;br /&gt;
# Download the source code from the source repository.&lt;br /&gt;
# Compile the Paparazzi software from sourcecode&lt;br /&gt;
# Complete any final configuration&lt;br /&gt;
&lt;br /&gt;
== Quickstart for Ubuntu users ==&lt;br /&gt;
Love one-liners? To get the latest Paparazzi up and running on your '''Ubuntu 12.04 or higher OS''', make sure you have internet, then just copy and paste the text below into your terminal and press [enter] ... and wait a while...&lt;br /&gt;
&lt;br /&gt;
 sudo add-apt-repository -y ppa:paparazzi-uav/ppa &amp;amp;&amp;amp; sudo add-apt-repository -y ppa:terry.guo/gcc-arm-embedded &amp;amp;&amp;amp; sudo apt-get update &amp;amp;&amp;amp; \ &lt;br /&gt;
 sudo apt-get -f -y install paparazzi-dev paparazzi-jsbsim gcc-arm-none-eabi &amp;amp;&amp;amp; cd ~ &amp;amp;&amp;amp; &amp;lt;nowiki&amp;gt;git clone --origin upstream https://github.com/paparazzi/paparazzi.git&amp;lt;/nowiki&amp;gt; &amp;amp;&amp;amp; \&lt;br /&gt;
 cd ~/paparazzi &amp;amp;&amp;amp; git remote update -p &amp;amp;&amp;amp; \&lt;br /&gt;
 git checkout -b v5.8 upstream/v5.8 &amp;amp;&amp;amp; sudo cp conf/system/udev/rules/*.rules /etc/udev/rules.d/ &amp;amp;&amp;amp; \&lt;br /&gt;
 make clean &amp;amp;&amp;amp; make &amp;amp;&amp;amp; ./paparazzi&lt;br /&gt;
&lt;br /&gt;
                [[File:Done.jpg|frameless|center|Done!]]&lt;br /&gt;
If all went well the Paparazzi Center should now be running... '''skip''' the rest of this page and go fly! &lt;br /&gt;
&lt;br /&gt;
If you are new you'll need to do some more things before you go fly like configuring your XML definition file detailing your airframe configuration. There is help here for that: [[Airframe_Configuration]]&lt;br /&gt;
&lt;br /&gt;
In case you have no autopilot hardware yet, no problem, you can get hardware [[Get_Hardware|here]] or just buy a ready to fly aircraft that can run Paparazzi Software like the Parrot Drones [http://www.parrot.com/products/bebop-drone/ Parrot Bebop] and run Paparazzi on your Parrot [[AR_Drone_2|ARDRone2]], [[Bebop|Bebop]] and Bebop2 (soon the Disco drone).&lt;br /&gt;
&lt;br /&gt;
== OS Specific Instructions ==&lt;br /&gt;
&lt;br /&gt;
For Linux an instructional video explaining it all in detail can be found here https://www.youtube.com/watch?v=eW0PCSjrP78&lt;br /&gt;
&lt;br /&gt;
The process of installing the prerequisite tools and dependencies needed by Paparazzi is specific to the operating system you are using. For detailed installation instructions, please see the following pages:&lt;br /&gt;
*[[Installation/Linux|Installing prerequisites tools on Linux]]&lt;br /&gt;
*[[Installation/MacOSX|Installing prerequisites tools on Mac OS X]]&lt;br /&gt;
*[[Installation/RaspberryPi|Installing prerequisites tools on the RaspberryPi (Raspbian)]]&lt;br /&gt;
&lt;br /&gt;
For more advanced installation information or developers, please see the following pages:&lt;br /&gt;
*[[Installation/FromScratch|Installing everything from scratch]] For non Debian based Linux distributions or if one just wants to be able to use all the latest and greatest compilers, or source code of everything to improve something. Then there is no other way than to install from scratch.&lt;br /&gt;
*[[Installation/Windows|Installing prerequisite tools on Windows]] Note that this is '''a work in progress, and not finished yet'''. It would be fantastic if you are interested in running Paparazzi on this OS to help out with the porting. Being able to help is one of opensource software main features. If your skill- set is not so good in this area, but you still insist using Windows OS, then it is best to install a VirtualMachine from within Windows where you run the free Ubuntu OS of choice.&lt;br /&gt;
&lt;br /&gt;
=== Virtual Machines ===&lt;br /&gt;
&lt;br /&gt;
It is also possible to have your Debian/Ubuntu running in a virtual machine, for instance with [http://www.virtualbox.org/ VirtualBox]. This requires minimal changes to your computer setup, as you can run the VM from all common platforms (Windows, OS X, Linux). The virtual machine image can easily be transferred between different laptops, giving greater flexibility. Unfortunately, the Open-Source Edition of VirtualBox doesn't include the necessary USB support, so you'll need to get the regular version from the website.&lt;br /&gt;
&lt;br /&gt;
If you are new and this is your first time installing it is suggested you keep it simple. Use the standard Linux or OS X install. Select a system you can dedicate to the Linux installation. No VMs or dual boot configurations. The idea is do a very simple generic installation that is certain to have no issues. This reassures you that the installation process works and you can see and use a working Paparazzi install for some time before you try a more complicated install. The install is well documented and certain to succeed if followed exactly. Most issues arise when someone unfamiliar with Paparazzi or their OS tries a non-standard install that requires special steps that are not documented. Generally, commands can be copied and pasted for easy, step-by-step installation.&lt;br /&gt;
&lt;br /&gt;
== Getting the Source Code ==&lt;br /&gt;
The Paparazzi source code is hosted on [https://github.com/paparazzi/paparazzi Github]. While you can download it as a tarball from https://github.com/paparazzi/paparazzi/releases, it is recommended to clone the repository with [[git]].&lt;br /&gt;
&lt;br /&gt;
From the directory of your choice type:&lt;br /&gt;
 git clone --origin upstream https://github.com/paparazzi/paparazzi.git&lt;br /&gt;
Check out the released stable version branch:&lt;br /&gt;
 git checkout v5.8&lt;br /&gt;
&lt;br /&gt;
'''If this whole &amp;quot;Git&amp;quot; thing is new to you, more options and information can be found on the [[git|Git page]].'''&lt;br /&gt;
&lt;br /&gt;
== Launching the Software ==&lt;br /&gt;
Make sure you have installed the &amp;lt;tt&amp;gt;paparazzi-dev&amp;lt;/tt&amp;gt; package as described above. Without these you will not be able to compile the sourcecode.&lt;br /&gt;
The first step is to compile. From the &amp;lt;tt&amp;gt;paparazzi&amp;lt;/tt&amp;gt; directory (&amp;lt;tt&amp;gt;cd ~/paparazzi&amp;lt;/tt&amp;gt;), run&lt;br /&gt;
&lt;br /&gt;
 make&lt;br /&gt;
&lt;br /&gt;
You will have to run this command after each update of the source (&amp;lt;tt&amp;gt;git pull&amp;lt;/tt&amp;gt; command).&lt;br /&gt;
Launch the software from the &amp;lt;tt&amp;gt;paparazzi&amp;lt;/tt&amp;gt; directory with&lt;br /&gt;
&lt;br /&gt;
 ./paparazzi&lt;br /&gt;
&lt;br /&gt;
From the [[Paparazzi_Center|Paparazzi Center]] interface, select the ''Microjet'' aircraft, select the ''sim'' target and ''Build'' it. Then ''Execute'' the ''Simulation'' session. The procedure is detailed in the [[Simulation]] page.&lt;br /&gt;
&lt;br /&gt;
=== Environment Variables ===&lt;br /&gt;
&lt;br /&gt;
If ('''and only if''') you want to directly launch some Paparazzi agents (the ''Tools'' of the [[Paparazzi_Center|Paparazzi Center]]) from the command line, without using the Paparazzi Center, 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|~/.bashrc|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PAPARAZZI_HOME=''your paparazzi software directory''&lt;br /&gt;
export PAPARAZZI_SRC=''your paparazzi software directory''&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Verify that your variables are set correctly with the following command:&lt;br /&gt;
:&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;env | grep PAPARAZZI&amp;lt;/source&amp;gt;&lt;br /&gt;
which should return the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
PAPARAZZI_HOME=''your paparazzi software directory''&lt;br /&gt;
PAPARAZZI_SRC=''your paparazzi software directory''&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&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;
:&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;export PAPARAZZI_HOME=`pwd`;export PAPARAZZI_SRC=`pwd`&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Software Updates ==&lt;br /&gt;
'''We manage the software with the git version control system. Learn it! If you are new to it, see the [[Git|Git wiki page]].'''&lt;br /&gt;
&lt;br /&gt;
Paparazzi is a very rapidly evolving project and as such you might want to update your software regularly. See the [[RepositoryStructure|branching model and release process page]].&lt;br /&gt;
&lt;br /&gt;
Any new files you created will not be lost/overwritten when updating (like your own airframe file). Nevertheless, as with all things, backups are advised.&lt;br /&gt;
If you modified source code, the best way is of course to use the version control system [[Git]] to commit your changes. Otherwise at least use the brute force method and save everything in another directory.&lt;br /&gt;
&lt;br /&gt;
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. You might need to update your airframe file as well. The compiler will usually complain if there is a problem, at which point you can look at the [[Airframe_Configuration|Airframe Configuration wiki page]] again, look on the [[Contact#Mailing_List|mailing list]] or some of the most recent airframe files on git to find the proper syntax.&lt;br /&gt;
&lt;br /&gt;
'''See also the [[Release Upgrades]] page for information on how to update your configuration from one release to the next.'''&lt;br /&gt;
&lt;br /&gt;
=== Quick'n dirty description ===&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;
 git pull&lt;br /&gt;
&lt;br /&gt;
After any git update or source code modification the code can be recompiled from ''your paparazzi software directory'' 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.&lt;br /&gt;
If it does not behave as expected you can delete 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;
If you'd like to check that the code compiles all example airframes then you can run the test suite using the command&lt;br /&gt;
&lt;br /&gt;
 make test&lt;br /&gt;
&lt;br /&gt;
For more details see the [[Builds/Tests|tests page]].&lt;br /&gt;
&lt;br /&gt;
== Using the Live CD ==&lt;br /&gt;
&lt;br /&gt;
There is a [[LiveCD]] available, but it dates back to 2008. It is still an easy way to get a first glimpse of Paparazzi however without installing anything.&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:User_Documentation]] [[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&amp;diff=20886</id>
		<title>Flight Plans</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&amp;diff=20886"/>
		<updated>2016-02-09T21:17:57Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A '''flight plan''' is a XML document which one can create and store aboard an autopilot. The flight plan will describe how you want your aircraft to travel if released into into the wild blue yonder.&lt;br /&gt;
&lt;br /&gt;
== DTD and Structure ==&lt;br /&gt;
&lt;br /&gt;
The formal description of the flight plan file is given in the [http://en.wikipedia.org/wiki/Document_Type_Definition '''DTD'''] (located in &amp;lt;tt&amp;gt;conf/flight_plans/flight_plan.dtd&amp;lt;/tt&amp;gt;). This&lt;br /&gt;
DTD must be referenced in the header of your flight plan XML document using the following line:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;!DOCTYPE flight_plan SYSTEM &amp;quot;flight_plan.dtd&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The flight plans are stored in the &amp;lt;tt&amp;gt;conf/flight_plans&amp;lt;/tt&amp;gt; directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans via the GUI.&lt;br /&gt;
&lt;br /&gt;
Extract from the [http://en.wikipedia.org/wiki/Document_Type_Definition DTD]:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT flight_plan (header?,waypoints,sectors?,variables?,includes?,exceptions?,blocks)&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''A flight plan is composed of two mandatory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]]'''&lt;br /&gt;
&lt;br /&gt;
The root &amp;lt;tt&amp;gt;flight_plan&amp;lt;/tt&amp;gt; element is specified with several attributes:&lt;br /&gt;
 &amp;lt;tt&amp;gt;'''&amp;lt;flight_plan name lat0 lon0 ground_alt security_height home_mode_height qfu alt max_dist_from_home&amp;gt;'''&amp;lt;/tt&amp;gt;&lt;br /&gt;
; &amp;lt;tt&amp;gt;'''name'''&amp;lt;/tt&amp;gt;: The name of the mission (a text string)&lt;br /&gt;
; &amp;lt;tt&amp;gt;'''lat0, lon0'''&amp;lt;/tt&amp;gt;: Defines the latitude and longitude coordinates of the reference point {0,0} in WGS84 degree coordinates&lt;br /&gt;
; &amp;lt;tt&amp;gt;'''ground_alt'''&amp;lt;/tt&amp;gt;: The ground altitude (in meters), Above Sea Level where you are flying. It defines the &amp;lt;tt&amp;gt;GROUND_ALT&amp;lt;/tt&amp;gt; constant value which can be used in combination with a waypoint &amp;lt;height&amp;gt; parameter to define a waypoint height&lt;br /&gt;
; &amp;lt;tt&amp;gt;'''security_height'''&amp;lt;/tt&amp;gt;:  The height (over &amp;lt;tt&amp;gt;'''ground_alt'''&amp;lt;/tt&amp;gt;) used by the circle-home failsafe procedure and in other flight procedures such as formation flight and anti-collision avoidance. Warnings are produced if you place a waypoint lower than &amp;lt;tt&amp;gt;'''security_height'''&amp;lt;/tt&amp;gt; (usually the case for the landing point)&lt;br /&gt;
; &amp;lt;tt&amp;gt;'''home_mode_height'''&amp;lt;/tt&amp;gt; (optional): This optional attribute available since v4.2 allows to override &amp;lt;tt&amp;gt;'''security_height'''&amp;lt;/tt&amp;gt; as failsafe height in home mode. If &amp;lt;tt&amp;gt;'''home_mode_height'''&amp;lt;/tt&amp;gt; Is set lower than &amp;lt;tt&amp;gt;'''security_height'''&amp;lt;/tt&amp;gt;, the later is used. This attribute is useful if you need to return home at a high altitude rather than a low altitude.&lt;br /&gt;
; &amp;lt;tt&amp;gt;'''qfu'''&amp;lt;/tt&amp;gt; (optional): defines the global constant &amp;lt;tt&amp;gt;QFU&amp;lt;/tt&amp;gt;. It usually is the magnetic heading in degrees (north=0, east=90) of the runway, the opposite of wind direction. This constant may be used in the mission description. It is also used by the simulator as the original course of the aircraft. So if you want to take off and climb to the West you would use qfu=270. &lt;br /&gt;
; &amp;lt;tt&amp;gt;'''alt'''&amp;lt;/tt&amp;gt;: The default altitude of waypoints ([[Altitude_definitions|Above Sea Level]]). So if your ground altitude is 400 then alt needs to be a value greater than ground altitude and above any obstructions in the flight plan. &lt;br /&gt;
; &amp;lt;tt&amp;gt;'''max_dist_from_home'''&amp;lt;/tt&amp;gt;: A radius representing the maximum allowed distance (in meters) from the HOME waypoint. Exceeding this value (ie flying outside the circle with this radius) will trigger an exception. It is up to you to define the block to be executed (ie what to do) for the exception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Here is an '''example''' of such a line in the top of a flight plan:''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;flight_plan alt=&amp;quot;250&amp;quot; ground_alt=&amp;quot;185&amp;quot; lat0=&amp;quot;43.46223&amp;quot; lon0=&amp;quot;1.27289&amp;quot; name=&amp;quot;Example Muret&amp;quot; max_dist_from_home=&amp;quot;300&amp;quot; qfu=&amp;quot;270&amp;quot; security_height=&amp;quot;25&amp;quot; &amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that a flight plan could also contain optional &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt;'s and &amp;lt;tt&amp;gt;exceptions&amp;lt;/tt&amp;gt; cases.&lt;br /&gt;
&lt;br /&gt;
In English the above flight plan says the name is Example Muret. The reference coordinates for the 0,0 point is: 43.46223 (lat) and 1.27289 (long). The flying site 0,0 location is 185m above sea level. The security height is 25m above 0,0 point or 210m above sea level. The default (ie if not defined in a waypoint this alt is used) altitude is 250m (above sea level). The home mode block altitude is defined to be 150m above sea level. Also, for security, a circle is defined with a radius that's 300m from 0,0 position. This is the max_dist_from_home value. Fly 301m from 0,0 and an exception is triggered. A useful block is to trigger/go to the home mode block and return to home when the aircraft flies outside the safety circle. Example flight plans are helpful for study before you build your own from scratch.&lt;br /&gt;
&lt;br /&gt;
== Waypoints ==&lt;br /&gt;
&lt;br /&gt;
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified by it's name and coordinates:&lt;br /&gt;
 &amp;lt;tt&amp;gt;''' &amp;lt;waypoint name wpx wpy [alt] [height]/&amp;gt; '''&amp;lt;/tt&amp;gt;&lt;br /&gt;
where wpx and wpy are real positional coordinates ( &amp;lt;tt&amp;gt;'''lat/lon'''&amp;lt;/tt&amp;gt; )  '''or''' UTM coordinates ( &amp;lt;tt&amp;gt;'''utm_x0/utm_y0'''&amp;lt;/tt&amp;gt; ) '''or''' relative coordinates ( &amp;lt;tt&amp;gt;'''x/y'''&amp;lt;/tt&amp;gt; ) in meters from your reference point {0,0} .  &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; is an optional parameter and can be used to assign an altitude to a particular waypoint that is different from the globally defined &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; parameter of the flightplan. The &amp;lt;tt&amp;gt;height&amp;lt;/tt&amp;gt; attribute can be used to set the waypoint height relative to the [[Altitude_definitions|ground altitude]] (&amp;lt;tt&amp;gt;ground_alt&amp;lt;/tt&amp;gt;) of the flight plan for this waypoint.&lt;br /&gt;
&lt;br /&gt;
An example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;waypoints&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;HOME&amp;quot; x=&amp;quot;0.0&amp;quot; y=&amp;quot;30.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;BRIDGEOVERRIVER&amp;quot; x=&amp;quot;-100.0&amp;quot; y=&amp;quot;60.0&amp;quot; alt=&amp;quot;270.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;MyBarn&amp;quot; x=&amp;quot;-130.0&amp;quot; y=&amp;quot;217.5&amp;quot; alt=&amp;quot;3000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;3&amp;quot; x=&amp;quot;-30.0&amp;quot; y=&amp;quot;50&amp;quot; height=&amp;quot;50.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;4&amp;quot; x=&amp;quot;-30.0&amp;quot; y=&amp;quot;50.&amp;quot; alt=&amp;quot;ground_alt + 50&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;_MYHELPERSPOT&amp;quot; x=&amp;quot;-30.0&amp;quot; y=&amp;quot;60&amp;quot; height=&amp;quot;50.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;_MYOTHERHELPERSPOT&amp;quot; x=&amp;quot;-70.0&amp;quot; y=&amp;quot;90&amp;quot; height=&amp;quot;70.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;TOWER&amp;quot; lat=&amp;quot;48.858249&amp;quot; lon=&amp;quot;2.294494&amp;quot; height=&amp;quot;324.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;MountainCAFE&amp;quot; utm_x0=&amp;quot;360284.8&amp;quot; utm_y0=&amp;quot;4813595.5&amp;quot; alt=&amp;quot;1965.&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Tips'''&lt;br /&gt;
* Waypoints are easily adjusted with the [[Flight_Plan_Editor|flight plan editor]].&lt;br /&gt;
* If a waypoint name starts with an underscore ( _ ), the waypoint is '''not displayed''' in the GCS, except in editor mode.&lt;br /&gt;
* The maximum number of waypoints is 254.&lt;br /&gt;
* A waypoint named &amp;lt;tt&amp;gt;HOME&amp;lt;/tt&amp;gt; is required if the failsafe HOME mode procedure is used.&lt;br /&gt;
* A waypoints index/reference pointer is derived by prefixing the waypoint name with &amp;quot;WP_&amp;quot;. Useful when a [[#Call |call function]] uses the waypoints reference index vs. it's name.&lt;br /&gt;
&lt;br /&gt;
== Sectors ==&lt;br /&gt;
&lt;br /&gt;
=== Static sectors (default) ===&lt;br /&gt;
&lt;br /&gt;
Flat ''Sectors'' can be described as an area defined by list of waypoint corners. Such an area will be displayed in the Ground Control Station (GCS) by colored lines connecting the cornerpoints.&lt;br /&gt;
A function is generated to check if a point, usually the aircraft itself, is ''inside'' this sector. Currently, this feature requires that the polygon is &amp;lt;b&amp;gt;convex&amp;lt;/b&amp;gt; and described in a &amp;lt;b&amp;gt;clockwise&amp;lt;/b&amp;gt; order. For a sector named &amp;lt;tt&amp;gt;MyBigGarden&amp;lt;/tt&amp;gt; the generated function for the example here would be &amp;lt;tt&amp;gt;bool_t InsideMyBigGarden(float x, float y);&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; are east and north coordinated, in meters, relative to the geographic reference of the flight plan. If the flight plan is dynamically relocated, such a sector will be relocated but the display is currently not updated on the GCS. It would be great if one would help improving that part of the source code. Note that sector names are not allowed to contain spaces.&lt;br /&gt;
&lt;br /&gt;
For example, with the following element in a flight plan.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;sectors&amp;gt;&lt;br /&gt;
    &amp;lt;sector name=&amp;quot;MyBigGarden&amp;quot; color=&amp;quot;red&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;_1&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;_2&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;_3&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;_4&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/sector&amp;gt;&lt;br /&gt;
  &amp;lt;/sectors&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is then possible to add an exception clause to your flightplan. For example if the aircraft for some reason flies outside this, defined by us, sector the airframe will fly to a standby waypoint. The exclamation mark (!) means the boolean operator &amp;lt;tt&amp;gt;NOT&amp;lt;/tt&amp;gt; in this example. In regular language one would describe &amp;quot;If my airframe is NOT inside the MyBigGarden sector anymore then deroute it to the standby waypoint. In Flightplan &amp;quot;Speak&amp;quot; this is written like: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;! InsideMyBigGarden(GetPosX(), GetPosY())&amp;quot; deroute=&amp;quot;standby&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: editing of the waypoints of the sector during the flight will not dynamically update the inside function. It will always check if the position is inside the original sector.&lt;br /&gt;
&lt;br /&gt;
'''Tips'''&lt;br /&gt;
* A nice option in the corner notation is that one can add an underscore ( _ ) in front of the name; a corner or waypoint name that starts with an underscore is not displayed in the GCS. Only in editor mode it is visible. It is visible in editor mode, because if you the could not see it, it also would be not possible to edit or drag the corner or waypoint to another position.&lt;br /&gt;
* The color indicating the sector borders is not fixed but can be defined by oneself if wished for via the color attribute.&lt;br /&gt;
&lt;br /&gt;
=== Dynamic sectors ===&lt;br /&gt;
&lt;br /&gt;
With the latest version (v5.5-devel-628), it is possible to create dynamic sectors. The procedure to create the sector is the same than for the static version with an extra attribute '''type=&amp;quot;dynamic&amp;quot;''':&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;sectors&amp;gt;&lt;br /&gt;
    &amp;lt;sector name=&amp;quot;MyBigGarden&amp;quot; color=&amp;quot;red&amp;quot; type=&amp;quot;dynamic&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;C1&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;C2&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;C3&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;C4&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/sector&amp;gt;&lt;br /&gt;
  &amp;lt;/sectors&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also recommended to avoid using hidden waypoints (no _ prefix), so you can move the corner of your sector from the GCS. The polygon is updated on the 2D map to reflect the new waypoints positions.&lt;br /&gt;
Beside the possibility to change the shape of the area in flight, one of the main benefit is that the algorithm behind allows concave hulls. The only restriction is that the edges of the polygon should not cross each other.&lt;br /&gt;
&lt;br /&gt;
The generated function is the same than the static version and can be used the same way.&lt;br /&gt;
&lt;br /&gt;
== Variables ==&lt;br /&gt;
&lt;br /&gt;
'''Available since v5.9'''&lt;br /&gt;
&lt;br /&gt;
It is possible to declare a list of variables that will be automatically created during the flight plan generation and available for the rest of the system from the generated flight plan header and of course inside the flight plan itself. With appropriate attributes, it is also possible to make the variables accessible from the telemetry as a [[Settings|setting]].&lt;br /&gt;
&lt;br /&gt;
The following code will produce a '''float''' variable initialized to 0:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;variables&amp;gt;&lt;br /&gt;
    &amp;lt;variable var=&amp;quot;my_var&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/variables&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The type and the initial value can be changed with the '''type''' and '''init''' attributes:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;variables&amp;gt;&lt;br /&gt;
    &amp;lt;variable var=&amp;quot;my_var&amp;quot; init=&amp;quot;10&amp;quot; type=&amp;quot;int&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/variables&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To produce an automatic setting for a variable, at least '''min''', '''max''' and '''step''' attributes need to be specified:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;variables&amp;gt;&lt;br /&gt;
    &amp;lt;variable var=&amp;quot;my_var&amp;quot; min=&amp;quot;0.&amp;quot; max=&amp;quot;10.&amp;quot; step=&amp;quot;0.1&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/variables&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
They will appear under the '''Flight Plan''' settings tab in the GCS. So more attributes can be specified: '''shortname''', '''unit''', '''alt_unit''', '''alt_unit_coef''', '''values'''. See [[Settings]] page for more information about these options.&lt;br /&gt;
&lt;br /&gt;
== Includes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; is used to add some flight plan elements defined in an external procedure. It’s useful to include pre-written procedures with only few arguments and then clarify the flight plan.&lt;br /&gt;
Here is the structure:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name procedure&amp;gt; [&amp;lt;arg name value /&amp;gt;]*[&amp;lt;with from to /&amp;gt;]*&amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; attribute of the include element will be used in this flight plan to prefix the blocks of the &amp;lt;tt&amp;gt;procedure&amp;lt;/tt&amp;gt;, the XML referenced file.&lt;br /&gt;
Named arguments may be given with their value in the &amp;lt;tt&amp;gt;arg&amp;lt;/tt&amp;gt; elements. The &amp;lt;tt&amp;gt;with&amp;lt;/tt&amp;gt; tag allows to link labels (e.g. attribute of a deroute instruction or of an exception) from the procedure to blocks of the main flight plan.&lt;br /&gt;
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; of a procedure named &amp;lt;tt&amp;gt;p&amp;lt;/tt&amp;gt; is named &amp;lt;tt&amp;gt;b.p&amp;lt;/tt&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
Here is an example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;includes&amp;gt;&lt;br /&gt;
    &amp;lt;include name=&amp;quot;landing&amp;quot; procedure=&amp;quot;landing.xml&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/includes&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Blocks ==&lt;br /&gt;
&lt;br /&gt;
Block elements are the main part of a flight plan: they describe each unit of the mission.&lt;br /&gt;
They are made of various primitives, called stages and exceptions, you can put one after the other. When a&lt;br /&gt;
stage (or a block) is finished, the autopilot goes to the next one. The behaviour after the last stage of the last block is undefined. &lt;br /&gt;
&lt;br /&gt;
As described in the DTD, the &amp;lt;tt&amp;gt;blocks&amp;lt;/tt&amp;gt; element is composed of &amp;lt;tt&amp;gt;block&amp;lt;/tt&amp;gt; elements which are sequence of ''stages'':&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!ELEMENT blocks (block+)&amp;gt;&lt;br /&gt;
  &amp;lt;!ELEMENT block  (exception|while|heading|attitude|go|xyz|set|call|circle|deroute|stay|follow|survey_rectangle|for|return|eight|oval|home|path)*&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;block name=&amp;quot;circlehome&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;circle radius=&amp;quot;75&amp;quot; wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute &amp;lt;tt&amp;gt;strip_button&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;block name=&amp;quot;descent&amp;quot; strip_button=&amp;quot;Descent&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;circle wp=&amp;quot;HOME&amp;quot; throttle=&amp;quot;0.0&amp;quot; pitch=&amp;quot;-15&amp;quot; vmode=&amp;quot;throttle&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This button will activate the block. If the attribute &amp;lt;tt&amp;gt;group&amp;lt;/tt&amp;gt; is specified, all strip buttons of the same group will be placed vertically on top of each other.&lt;br /&gt;
&lt;br /&gt;
In the same way, a key shortcut can be specified:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;block key=&amp;quot;D&amp;quot; name=&amp;quot;descent&amp;quot; strip_button=&amp;quot;Descent&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;circle wp=&amp;quot;HOME&amp;quot; throttle=&amp;quot;0.0&amp;quot; pitch=&amp;quot;-15&amp;quot; vmode=&amp;quot;throttle&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Modifiers are allowed, using the syntax of [http://library.gnome.org/devel/gtk/2.15/gtk-Keyboard-Accelerators.html#gtk-accelerator-parse GTK accelerators].&lt;br /&gt;
&lt;br /&gt;
An icon can be specified to display the button. The &amp;lt;tt&amp;gt;strip_button&amp;lt;/tt&amp;gt; label then is a tooltip for the icon. The icon must be an image file available in the directory &amp;lt;tt&amp;gt;data/pictures/gcs_icons&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;block name=&amp;quot;Takeoff&amp;quot; strip_icon=&amp;quot;takeoff.png&amp;quot; strip_button=&amp;quot;Takeoff&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can call functions before or after each execution of the block:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;block name=&amp;quot;circlehome&amp;quot; pre_call=&amp;quot;function_to_call_before_circle()&amp;quot; post_call=&amp;quot;function_to_call_after_circle()&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;circle wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Expressions ====&lt;br /&gt;
&lt;br /&gt;
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to &lt;br /&gt;
* numeric constants&lt;br /&gt;
* some internal autopilot variables (not fully documented, see [[Flight_Plans#Internal_Variables_in_Flight_Plans|internal variables section]] below and other examples)&lt;br /&gt;
* Some binary operators: &amp;lt;, &amp;gt;, &amp;lt;=, &amp;gt;=, &amp;lt;&amp;gt;, ==, +, -, /, *&lt;br /&gt;
* Some utility functions&lt;br /&gt;
&lt;br /&gt;
Some examples of usable expressions are given in the next sections.&lt;br /&gt;
=== Initialization  Blocks ===&lt;br /&gt;
Most flight plans will have three blocks of flight plan initialization blocks. It is good practice to follow this example below if you first start learning to create flightplans&lt;br /&gt;
&lt;br /&gt;
The first block waits until the GPS fix has been established, as shown below.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;blocks&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Wait GPS&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;set value=&amp;quot;1&amp;quot; var=&amp;quot;kill_throttle&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;while cond=&amp;quot;!GpsFixValid()&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The second block updates the local waypoints with respect to the UAV.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Geo init&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;while cond=&amp;quot;LessThan(NavBlockTime(), 10)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;NavSetGroundReferenceHere()&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This next block prevents the UAV from starting the engine and taking off. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Holding point&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;!--set var=&amp;quot;nav_mode&amp;quot; value=&amp;quot;NAV_MODE_ROLL&amp;quot;/--&amp;gt;&lt;br /&gt;
      &amp;lt;set value=&amp;quot;1&amp;quot; var=&amp;quot;kill_throttle&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;attitude roll=&amp;quot;0&amp;quot; throttle=&amp;quot;0&amp;quot; vmode=&amp;quot;throttle&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Exceptions ===&lt;br /&gt;
&lt;br /&gt;
The flight manager can handle exceptions. They consist in conditions checked periodically (at the same pace as the navigation control), allowing the control to jump to a given block. Here is the syntax of exceptions:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;exception cond=&amp;quot;...&amp;quot; deroute=&amp;quot;...&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;cond&amp;lt;/tt&amp;gt; is an expression and &amp;lt;tt&amp;gt;deroute&amp;lt;/tt&amp;gt; is the name of the block we want to switch to as soon as the condition is true.&lt;br /&gt;
&lt;br /&gt;
Here are some example of exceptions:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;exception cond=&amp;quot;10 &amp;gt; PowerVoltage()&amp;quot; deroute=&amp;quot;go_down&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;exception cond=&amp;quot;(ground_alt+10 &amp;gt; GetPosAlt())&amp;quot; deroute=&amp;quot;go_up&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;exception cond=&amp;quot;(autopilot_flight_time &amp;gt; 840)&amp;quot; deroute=&amp;quot;quick_land&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exceptions can be local to a block or global to the flight plan, in the &amp;lt;tt&amp;gt;&amp;lt;exceptions&amp;gt;&amp;lt;/tt&amp;gt; element. In the following example, time since last reception of a message from the ground station is monitored and the navigation is switched to the &amp;lt;tt&amp;gt;Standby&amp;lt;/tt&amp;gt; block if no message have been received for 22s. This exception is valid for '''all''' the blocks.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;flight_plan ...&amp;gt;&lt;br /&gt;
    &amp;lt;waypoints&amp;gt; ... &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
    &amp;lt;exceptions&amp;gt;&lt;br /&gt;
      &amp;lt;exception cond=&amp;quot;datalink_time &amp;gt; 22&amp;quot; deroute=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/exceptions&amp;gt;&lt;br /&gt;
  &amp;lt;blocks&amp;gt; ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Deroute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;deroute&amp;lt;/tt&amp;gt; is the ''goto'' directive of the flight plan; it switches the navigation to the given block:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;deroute block=&amp;quot;landing&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this primitive should not be used to execute loops which are provided by the following elements.&lt;br /&gt;
&lt;br /&gt;
=== Return ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;return&amp;lt;/tt&amp;gt; is also a ''goto'' directive that brings you back to the last block (and last stage). It has no argument.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;return/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Loops ===&lt;br /&gt;
&lt;br /&gt;
Unbounded loops are written with &amp;lt;tt&amp;gt;while&amp;lt;/tt&amp;gt; elements whose &amp;lt;tt&amp;gt;cond&amp;lt;/tt&amp;gt; attribute is a boolean expression.&lt;br /&gt;
Children  of &amp;lt;tt&amp;gt;while&amp;lt;/tt&amp;gt; are stages:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;while cond=&amp;quot;TRUE&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;go wp=&amp;quot;A&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;go wp=&amp;quot;B&amp;quot;/&amp;gt; &lt;br /&gt;
    &amp;lt;go wp=&amp;quot;C&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;while cond=&amp;quot;5 &amp;gt; stage_time&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/while&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In this example, we run an infinite loop, letting the aircraft try to go via waypoints &amp;lt;tt&amp;gt;A&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;B&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;C&amp;lt;/tt&amp;gt; and waiting for 5 seconds before repeating.&lt;br /&gt;
&lt;br /&gt;
Bounded loops are written with the &amp;lt;tt&amp;gt;for&amp;lt;/tt&amp;gt; tag:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;0&amp;quot; to=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/for&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where the body of the loop will be run four times.&lt;br /&gt;
&lt;br /&gt;
The variable of a &amp;lt;tt&amp;gt;for&amp;lt;/tt&amp;gt; loop can be used inside expressions appearing as attributes of the stages:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;1&amp;quot; to=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot; alt=&amp;quot;ground_alt+50*$i&amp;quot; until=&amp;quot;stage_time&amp;gt;10&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/for&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, the aircraft will circle around waypoint '''HOME''' for 10 seconds at and altitude above ground of 50m, 10 seconds at altitude 100 meter (50+50), ... until 250m (5x +50).&lt;br /&gt;
&lt;br /&gt;
Note: Two bounded loops using the same control variable are not allowed in the same block.&lt;br /&gt;
&lt;br /&gt;
=== Navigation modes ===&lt;br /&gt;
&lt;br /&gt;
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through&lt;br /&gt;
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are&lt;br /&gt;
* attitude : just keep a fixed attitude;&lt;br /&gt;
* heading : keep a given course;&lt;br /&gt;
* go : go to a given waypoint;&lt;br /&gt;
* path : list of waypoints linked by ''go''&lt;br /&gt;
* circle : circle around a waypoint;&lt;br /&gt;
* oval : two half circles with a straight between two nav points&lt;br /&gt;
* eight : fly a figure of eight through a waypoint and around another&lt;br /&gt;
* stay : hold the position (hard to realize for a fixed-wing aircraft);&lt;br /&gt;
* follow : follow another aircraft;&lt;br /&gt;
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).&lt;br /&gt;
&lt;br /&gt;
The vertical control is achieved using the &amp;lt;tt&amp;gt;vmode&amp;lt;/tt&amp;gt; attribute of these stages. The possible values are &lt;br /&gt;
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; attribute;&lt;br /&gt;
* '''climb''' : the autopilot keeps the desired vertical speed specified with the &amp;lt;tt&amp;gt;climb&amp;lt;/tt&amp;gt; attribute (in m/s);&lt;br /&gt;
* '''throttle''' : the autopilots sets the desired throttle specified with the &amp;lt;tt&amp;gt;throttle&amp;lt;/tt&amp;gt; attribute (between 0 and 1);&lt;br /&gt;
* '''glide''' : the autopilot keeps the desired slope between two waypoints&lt;br /&gt;
&lt;br /&gt;
The default control is done with the throttle. However, setting the &amp;lt;tt&amp;gt;pitch&amp;lt;/tt&amp;gt; attribute to '''auto''' and the &amp;lt;tt&amp;gt;throttle&amp;lt;/tt&amp;gt; attribute to a constant allows a vertical control only by controlling the attitude of the A/C.&lt;br /&gt;
The &amp;lt;tt&amp;gt;pitch&amp;lt;/tt&amp;gt; attribute also can be set to any value (in degrees) while the throttle control is in use: it usually affects the airspeed of the aircraft.  &lt;br /&gt;
&lt;br /&gt;
The different navigation modes are detailed in the next sections.&lt;br /&gt;
&lt;br /&gt;
=== Attitude ===&lt;br /&gt;
&lt;br /&gt;
Element &amp;lt;tt&amp;gt;attitude&amp;lt;/tt&amp;gt; is the navigation mode which corresponds to the current lowest control loop for horizontal mode.&lt;br /&gt;
The autopilot then keeps a constant attitude. The &amp;lt;tt&amp;gt;roll&amp;lt;/tt&amp;gt; attribute is required (in degrees, positive to put right wing low).&lt;br /&gt;
&lt;br /&gt;
To fly away, at constant airspeed:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;attitude roll=&amp;quot;0&amp;quot; vmode=&amp;quot;throttle&amp;quot;, throttle=&amp;quot;0.5&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fly around, holding a given altitude:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;attitude roll=&amp;quot;30&amp;quot; alt=&amp;quot;ground_alt+50&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that it is not a ''safe'' navigation mode since the geographic position of the plane is not controlled. However, this mode is useful to tune the roll attitude control loop.&lt;br /&gt;
&lt;br /&gt;
=== Heading ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;heading&amp;lt;/tt&amp;gt; primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given &amp;lt;tt&amp;gt;course&amp;lt;/tt&amp;gt;, a required attribute (in degrees, clockwise, north=0, east=90).&lt;br /&gt;
&lt;br /&gt;
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;heading course=&amp;quot;QFU&amp;quot; vmode=&amp;quot;throttle&amp;quot; throttle=&amp;quot;0.8&amp;quot; pitch=&amp;quot;15&amp;quot; until=&amp;quot;(GetPosAlt() &amp;gt; ground_alt+30)&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Go ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;go&amp;lt;/tt&amp;gt; primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (&amp;lt;tt&amp;gt;wp&amp;lt;/tt&amp;gt;, the only required attribute). So the simplest thing you can ask for is&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;go wp=&amp;quot;HOME&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
which will set the '''HOME''' waypoint as the desired target position. Note than since &amp;lt;tt&amp;gt;vmode=&amp;quot;alt&amp;quot;&amp;lt;/tt&amp;gt; is the default, the altitude of the target waypoint is also taken into account. The navigation will switch to the next stage as soon as the target is reached.&lt;br /&gt;
&lt;br /&gt;
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.&lt;br /&gt;
Setting the &amp;lt;tt&amp;gt;hmode&amp;lt;/tt&amp;gt; attribute to '''route''', the navigation will go over a segment joining two waypoints:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The target altitude is the altitude of the target waypoint; it can also be set with the &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; attribute. The following example keeps an altitude with fixed throttle:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;go from=&amp;quot;wp2&amp;quot; wp=&amp;quot;wp3&amp;quot; hmode=&amp;quot;route&amp;quot; pitch=&amp;quot;auto&amp;quot; throttle=&amp;quot;0.75&amp;quot; alt=&amp;quot;ground_alt+100&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The attributes related to the vertical control can also be set to replace the default altitude mode:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot; vmode=&amp;quot;climb&amp;quot; climb=&amp;quot;1.5&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, the &amp;lt;tt&amp;gt;approaching_time&amp;lt;/tt&amp;gt; (in seconds) attribute helps to decide when the target is ''reached''. It can be set&lt;br /&gt;
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot; approaching_time=&amp;quot;1&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Path ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;path&amp;lt;/tt&amp;gt; primitive is just a shorthand expression for a set of &amp;lt;tt&amp;gt;go&amp;lt;/tt&amp;gt; primitives. A list of waypoints defined with the &amp;lt;tt&amp;gt;wpts&amp;lt;/tt&amp;gt; attribute is pre-processed into a set of &amp;lt;tt&amp;gt;go&amp;lt;/tt&amp;gt; primitives with the &amp;lt;tt&amp;gt;hmode&amp;lt;/tt&amp;gt; attribute. For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;path wpts=&amp;quot;wp1, wp2, wp3&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other attributes are optional:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;path wpts=&amp;quot;wp3, wp1, wp2&amp;quot; approaching_time=&amp;quot;1&amp;quot; pitch=&amp;quot;auto&amp;quot; throttle=&amp;quot;0.5&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Circle ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;circle&amp;lt;/tt&amp;gt; primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
A positive radius makes the UAS move clockwise, a negative counter-clockwise.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;until&amp;lt;/tt&amp;gt; attribute may be used to control the end of the stage. The following example defines an ascending trajectory at constant throttle, nose up (15 degrees), over growing circles, until the battery level is low:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;circle wp=&amp;quot;wp1&amp;quot; radius=&amp;quot;50+(GetPosAlt()-ground_alt)/2&amp;quot; vmode=&amp;quot;throttle&amp;quot; throttle=&amp;quot;0.75&amp;quot; pitch=&amp;quot;15&amp;quot; until=&amp;quot;10&amp;gt;PowerVoltage()&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Oval ===&lt;br /&gt;
The oval consists of two half circles that are connected with two straight lines. This flight path is usefull when a IMU is used because the straights allow for level flight. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt; &amp;lt;oval p1=&amp;quot;1&amp;quot; p2=&amp;quot;2&amp;quot; radius=&amp;quot;nav_radius&amp;quot;/&amp;gt; &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Eight ===&lt;br /&gt;
Fly a figure of eight that consists of two straight legs that pass though the center and the center of the half circle at the end of the two legs is in the turn around  waypoint. The altitude of the center waypoint is used for the entire figure. The turn around waypoint is moved to match radius given. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;  &amp;lt;eight center=&amp;quot;1&amp;quot; radius=&amp;quot;nav_radius&amp;quot; turn_around=&amp;quot;2&amp;quot;/&amp;gt; &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Survey rectangle ===&lt;br /&gt;
Fly a survey rectangle defined by two waypoints. The distance between the legs of the grid (in meter) and the orientation of the grid (NS or WE) can be set by the operator. The plane will turn outside of the border of the rectangle before starting a new leg.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;  &amp;lt;survey_rectangle wp1=&amp;quot;1&amp;quot; wp2=&amp;quot;2&amp;quot; grid=&amp;quot;200&amp;quot; orientation=&amp;quot;NS&amp;quot;/&amp;gt; &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Follow ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;follow&amp;lt;/tt&amp;gt; is a special primitive which makes the UAS follow another UAS (real or simulated, named with its &amp;lt;tt&amp;gt;ac_id&amp;lt;/tt&amp;gt;) at a given &amp;lt;tt&amp;gt;distance&amp;lt;/tt&amp;gt; (in meters) behind and at a given &amp;lt;tt&amp;gt;height&amp;lt;/tt&amp;gt; (in meters) above.&lt;br /&gt;
&lt;br /&gt;
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;follow ac_id=&amp;quot;4&amp;quot; distance=&amp;quot;50&amp;quot; height=&amp;quot;20&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stay ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;stay&amp;lt;/tt&amp;gt; is a mode for UAS's able to hover:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;stay wp=&amp;quot;HOME&amp;quot; alt=&amp;quot;10&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XYZ ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;xyz&amp;lt;/tt&amp;gt; is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:&lt;br /&gt;
* YAW channel controls the point over the west-east axis;&lt;br /&gt;
* PITCH channel controls the point over the south-north axis;&lt;br /&gt;
* ROLL channel controls the altitude.&lt;br /&gt;
&lt;br /&gt;
Example (default radius is '''100'''):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;xyz radius=&amp;quot;40&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;set&amp;lt;/tt&amp;gt; element is a dangerous one which should be used only by expert users: it is used to directly set an internal variable of the autopilot. For example, you can change the value of the default ground altitude, a variable used by the home mode failsafe procedure (and maybe by your own flight plan):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;set var=&amp;quot;ground_alt&amp;quot; value=&amp;quot;ground_alt+50&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
This directive is extremely powerful and has great potential for error - use with caution.&lt;br /&gt;
&lt;br /&gt;
=== Call ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;call&amp;lt;/tt&amp;gt; allows the user to define its own navigation procedures in C. The &amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt; must be a call to a boolean function which must return TRUE as long as the stage is not completed (a function which should be called only once would then return immediately FALSE).&lt;br /&gt;
This feature is illustrated with the '''line''' pattern:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;call fun=&amp;quot;nav_line_setup()&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;call fun=&amp;quot;nav_line_run(WP_1, WP_2, nav_radius)&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;nav_line_setup()&amp;lt;/tt&amp;gt; returns FALSE and &amp;lt;tt&amp;gt;nav_line_run()&amp;lt;/tt&amp;gt; always returns TRUE (this stage never ends). '''Note''' that a waypoints index is derived/denoted by prefixing the waypoint name with &amp;lt;tt&amp;gt;WP_&amp;lt;/tt&amp;gt;(i.e.: 1 --&amp;gt; WP_1, 2 --&amp;gt; WP_2)&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To call ''any'' function exactly once regardless of the return value (e.g. call a void function), add &amp;lt;tt&amp;gt;loop=&amp;quot;FALSE&amp;quot;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;call fun=&amp;quot;viewvideo_take_shot(TRUE)&amp;quot; loop=&amp;quot;FALSE&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Such extra navigation functions are usually written as a [[Modules|Module]] and the header files are included automatically.&lt;br /&gt;
&lt;br /&gt;
If you want to call functions that are not part of a module, you need to include the header file which contains the function declaration:or supplementary C file which must be specified in the &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;header&amp;gt;&lt;br /&gt;
#include &amp;quot;path/to/header.h&amp;quot;&lt;br /&gt;
  &amp;lt;/header&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where the path is relative to the &amp;lt;tt&amp;gt;sw/airborne&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
You can also call functions before or after each execution of the block (this means continuously on each iteration of each stage of the block, not just when entering o exiting the block).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;block name=&amp;quot;circlehome&amp;quot; pre_call=&amp;quot;function_to_call_before_circle()&amp;quot; post_call=&amp;quot;function_to_call_after_circle()&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;circle wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pre Call ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;block name=&amp;quot;Standby&amp;quot; strip_button=&amp;quot;Standby&amp;quot; strip_icon=&amp;quot;home.png&amp;quot; pre_call=&amp;quot;if(!InsideKill(GetPosX(), GetPosY())) NavKillThrottle();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post Call ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;block name=&amp;quot;traj&amp;quot; pre_call=&amp;quot;formation_pre_call()&amp;quot; post_call=&amp;quot;formation_flight()&amp;quot;&amp;gt; &amp;lt;!-- formation flight is call after all other navigation tasks --&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Procedures ==&lt;br /&gt;
&lt;br /&gt;
Procedures are libraries which can be included in flight plans. They are composed of waypoints, sectors and blocks. The header of a procedure may contain some parameters which are replaced by arguments when the procedure is included.&lt;br /&gt;
&lt;br /&gt;
Extract of the DTD: a procedure is a sequence of parameters, waypoints, ...:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;!ELEMENT procedure (param*,header?,waypoints?,sectors?,exceptions?,blocks?)&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;param&amp;lt;/tt&amp;gt;eter is just a name. A parameter is optional if it is declared with a default value.&lt;br /&gt;
An example with a required and an optional parameter:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;param name=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;param name=&amp;quot;radius&amp;quot; default_value=&amp;quot;75&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Procedures are called with the &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; element in a flight plan. A procedure cannot be included twice or by another procedure. A procedure call requires:&lt;br /&gt;
&lt;br /&gt;
* the name of the procedure file, the name given to this inclusion; &lt;br /&gt;
* values for the parameters;&lt;br /&gt;
* backlinks for block name exits of the procedure.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;include name=&amp;quot;landing&amp;quot; procedure=&amp;quot;landing.xml&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is the corresponding procedure '''landing.xml''':&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE procedure SYSTEM &amp;quot;flight_plan.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;procedure&amp;gt;&lt;br /&gt;
    &amp;lt;waypoints&amp;gt;&lt;br /&gt;
      &amp;lt;waypoint name=&amp;quot;AF&amp;quot; x=&amp;quot;177.4&amp;quot; y=&amp;quot;45.1&amp;quot; alt=&amp;quot;30&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;waypoint name=&amp;quot;TD&amp;quot; x=&amp;quot;28.8&amp;quot; y=&amp;quot;57.0&amp;quot; alt=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;waypoint name=&amp;quot;_BASELEG&amp;quot; x=&amp;quot;168.8&amp;quot; y=&amp;quot;-13.8&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
    &amp;lt;blocks&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
      &amp;lt;block name=&amp;quot;land&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;call fun=&amp;quot;nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;circle radius=&amp;quot;nav_radius&amp;quot; until=&amp;quot;NavCircleCount() &amp;gt; 0.5&amp;quot; wp=&amp;quot;_BASELEG&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;circle radius=&amp;quot;nav_radius&amp;quot; until=&amp;quot;And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10), 10 &amp;gt; fabs(GetPosAlt()- WaypointAlt(WP__BASELEG)))&amp;quot; wp=&amp;quot;_BASELEG&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;/block&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/blocks&amp;gt;&lt;br /&gt;
  &amp;lt;/procedure&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the name of procedure '''land''' block will be renamed into '''landing.land''':&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;deroute block=&amp;quot;landing.land&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
will jump to this procedure block.&lt;br /&gt;
&lt;br /&gt;
Suppose you have a go-around condition in your landing procedure. You would write it&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;exception cond=&amp;quot;...&amp;quot; deroute=&amp;quot;go-around&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
then you must link this block exit with one of your block (e.g. &amp;lt;tt&amp;gt;Standby&amp;lt;/tt&amp;gt;). So you would include the procedure as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;include name=&amp;quot;landing&amp;quot; procedure=&amp;quot;landing.xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;with from=&amp;quot;go-around&amp;quot; to=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/include&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Internal Variables in Flight Plans ==&lt;br /&gt;
&lt;br /&gt;
The flight plan can use several internal variables, macros and functions coming from the rest of the system or the flight plan API itself. The following list present some of the most commonly used variables, but much more are actually available:&lt;br /&gt;
&lt;br /&gt;
* '''autopilot_flight_time''': time in seconds since autopilot was booted (integer)&lt;br /&gt;
* '''datalink_time''': time in seconds since last connection of telemetry to ground control station (including ''subsystems/datalink/datallink.h'' in the '''header''' section is required) (integer)&lt;br /&gt;
* '''GetPosAlt()''': returns the current altitude above ground level in meter (float)&lt;br /&gt;
* '''GetPosX()''': returns x (easting) of current position relative to reference in meter (float)&lt;br /&gt;
* '''GetPosY()''': returns y (northing) of current position relative to reference in meter (float)&lt;br /&gt;
* '''ground_alt''': altitude above ground level in meter (float)&lt;br /&gt;
* '''GetAltRef()''': returns reference altitude, usually ground_alt&lt;br /&gt;
* '''NavSetGroundReferenceHere()''': reset position and altitude reference point to current position&lt;br /&gt;
* '''NavSetAltitudeReferenceHere()''': reset altitude reference to current alt but keep previous horizontal position reference&lt;br /&gt;
* '''NavSetWaypointHere(_wp)''': set position of a waypoint given as argument to the current position&lt;br /&gt;
* '''WaypointX(_wp)''': returns x (easting) of waypoint position relative to reference in meter (float)&lt;br /&gt;
* '''WaypointY(_wp)''': returns y (northing) of waypoint position relative to reference in meter (float)&lt;br /&gt;
* '''WaypointAlt(_wp)''': returns waypoint altitude in meter (float)&lt;br /&gt;
* '''nav_radius''': free variable usually used to set circle radius in flight plan&lt;br /&gt;
* '''NavKillThrottle()''': function to switch off throttle&lt;br /&gt;
* '''PowerVoltage()''': returns current voltage of the battery&lt;br /&gt;
* all functions from the [http://docs.paparazziuav.org/latest/group__state__interface.html state interface API]&lt;br /&gt;
* all functions from the [http://docs.paparazziuav.org/latest/subsystems_2navigation_2waypoints_8h.html waypoint API]&lt;br /&gt;
* all variables declared in [[modules]] headers&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Advanced Examples ==&lt;br /&gt;
&lt;br /&gt;
Parameters used in a flight plan can be computed expressions. In this example, the plane is asked to perform 5 circles at progressively increasing altitudes for exactly one minute at each altitude:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;1&amp;quot; to=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot;&lt;br /&gt;
          alt=&amp;quot;ground_alt + 50*$i&amp;quot;&lt;br /&gt;
          until=&amp;quot;stage_time &amp;gt; 60&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/for&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below you find some random examples of the posibilities. This is only the tip of the iceberg, use your imagination and go wild with new creative ideas for your flightplan&lt;br /&gt;
&lt;br /&gt;
=== Gains on the fly ===&lt;br /&gt;
&lt;br /&gt;
It is very well possible to set specific gain for an airframe if it reaches e.g a certain block.&lt;br /&gt;
&lt;br /&gt;
=== Dynacmically adjustable maximum speed ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Immobilize Actuators === &lt;br /&gt;
&lt;br /&gt;
h_ctl setpoints variable are set by the h_ctl_attitude_loop() (from fw_h_ctl.c) loop) which can be disabled with the h_ctl_disabled flag:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;set var=&amp;quot;h_ctl_disabled&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;set var=&amp;quot;h_ctl_aileron_setpoint&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;set var=&amp;quot;h_ctl_elevator_setpoint&amp;quot; value=&amp;quot;MAX_PPRZ/2&amp;quot;/&amp;gt;&lt;br /&gt;
 .... waiting for a condition ...&lt;br /&gt;
 &amp;lt;set var=&amp;quot;h_ctl_disabled&amp;quot; value=&amp;quot;FALSE&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and Tricks ==&lt;br /&gt;
&lt;br /&gt;
There are many ways to skin a cat just as there are many ways to craft your flight plan. Following the best practices tips can save you from a lot of frustration and mishap.&lt;br /&gt;
&lt;br /&gt;
* Simulate your flight plan before taking it to the sky. Flight plans should always be carefully tested prior to flight, take a look at the [[Simulation|simulation]] page for details on how to simulate your plan.&lt;br /&gt;
* Make an subdirectory in the Flight_plan directory with your own name and add your flight plans there. Make sure that the location of the DTD is correct, e.g by using relative directory double dots as in &amp;lt;tt&amp;gt;&amp;lt;!DOCTYPE flight_plan SYSTEM &amp;quot;../flight_plan.dtd&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Take a good look at other flight plans included with Paparazzi. To learn from example flight plans please visit the [[Flight_Plan_Examples|flight plan examples]] page&lt;br /&gt;
* There are several option to build failsafe features into you flightplan, [[Failsafe|for some examples visit the Failsafe page]].&lt;br /&gt;
* Some flight plan examples define waypoint locations using relative coordinates. These are relative positions from the fixed lat and lon in the header of the flight plan. When simulating your flight plan the aircraft always use the lat/lon as defined in the flight plan since a regular simulation has no notion of you current position of you local PC where you simulate on. This is something to keep in mind if you test your flight plan in real flights.&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:User_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Modules&amp;diff=20879</id>
		<title>Modules</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Modules&amp;diff=20879"/>
		<updated>2016-02-04T15:07:12Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Modules&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
The modules allow to add new code in a flexible way with initialisation, periodic and event functions without modifying the main AP loop.&lt;br /&gt;
&lt;br /&gt;
See [[FirmwareArchitecture]] and [[Subsystems]] for the differences of modules to subsystems.&lt;br /&gt;
&lt;br /&gt;
=== Available modules ===&lt;br /&gt;
&lt;br /&gt;
There is a special page listing all currently available modules to simply extend your Paparazzi autopilot board possibilities. [[Modules_list| Go here to inspect this list of modules]].&lt;br /&gt;
&lt;br /&gt;
The auto-generated list and short doc for all modules in the master branch can be found at the [http://docs.paparazziuav.org/latest/onboard_modules.html onboard modules page of the doxygen docs].&lt;br /&gt;
&lt;br /&gt;
=== Make your own ===&lt;br /&gt;
&lt;br /&gt;
It is very possible to make your own module and to share it with the world. To make it even easier there is a helper tool called &amp;quot;create_module&amp;quot; in the main Paparazzi directory. Try it, you'll be surprised how easy it is to start your own module with the help of this tool. &lt;br /&gt;
&lt;br /&gt;
=== In the airframe file ===&lt;br /&gt;
&lt;br /&gt;
To add a new module for an aircraft, add a section '''modules''' in his airframe xml file :&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;modules main_freq=&amp;quot;60&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;load name=&amp;quot;demo_module.xml&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;load name=&amp;quot;dummy.xml&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;BLA&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;BLUB&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;configure name=&amp;quot;FOO&amp;quot; value=&amp;quot;BAR&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/load&amp;gt;&lt;br /&gt;
 &amp;lt;/modules&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
* The main_freq parameter (in Hz) is optional. If present, it allows to specify the frequency of the main loop. Default is '''60 Hz'''. If not needed to be specified, then the first line is just: &amp;lt;modules&amp;gt;&lt;br /&gt;
* The children &amp;quot;define&amp;quot; generate compilation defines for all the targets of a module and can be used with or without value. It allows to keep the module description more generic add to place the airframe dependent parameters in the airframe xml file.&lt;br /&gt;
* The child &amp;quot;configure&amp;quot; generates a makefile variable.&lt;br /&gt;
&lt;br /&gt;
=== In the module file ===&lt;br /&gt;
&lt;br /&gt;
The modules description files are located in '''conf/modules'''.&lt;br /&gt;
{{Box Code|conf/modules/mymodule.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE module SYSTEM &amp;quot;module.dtd&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;module name=&amp;quot;demo_module&amp;quot; dir=&amp;quot;demo_module&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;doc&amp;gt;&lt;br /&gt;
   &amp;lt;description&amp;gt;&lt;br /&gt;
     Demo module.&lt;br /&gt;
     More details about this module.&lt;br /&gt;
   &amp;lt;/description&amp;gt;&lt;br /&gt;
   &amp;lt;configure name=&amp;quot;SOMETHING&amp;quot; value=&amp;quot;S1|S2|S3&amp;quot; description=&amp;quot;The thing to use&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;DEMO_MODULE_LED&amp;quot; value=&amp;quot;LED_X&amp;quot; description=&amp;quot;LED Selection&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/doc&amp;gt;&lt;br /&gt;
  &amp;lt;settings&amp;gt;&lt;br /&gt;
    &amp;lt;dl_settings name=&amp;quot;bla&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;dl_setting min=&amp;quot;0&amp;quot; max=&amp;quot;5&amp;quot; step=&amp;quot;1&amp;quot; var=&amp;quot;bla_bla&amp;quot; shortname=&amp;quot;bb&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/dl_settings&amp;gt;&lt;br /&gt;
  &amp;lt;settings&amp;gt;&lt;br /&gt;
  &amp;lt;depends&amp;gt;foo.xml,bar|baz&amp;lt;/depends&amp;gt;&lt;br /&gt;
  &amp;lt;conficts&amp;gt;boo&amp;lt;/conflicts&amp;gt;&lt;br /&gt;
  &amp;lt;header&amp;gt;&lt;br /&gt;
   &amp;lt;file name=&amp;quot;demo_module.h&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/header&amp;gt;&lt;br /&gt;
  &amp;lt;init fun=&amp;quot;init_demo()&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;periodic fun=&amp;quot;periodic_1Hz_demo()&amp;quot; freq=&amp;quot;1.&amp;quot; start=&amp;quot;start_demo()&amp;quot; stop=&amp;quot;stop_demo()&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;periodic fun=&amp;quot;periodic_10Hz_demo()&amp;quot; period=&amp;quot;0.1&amp;quot; start=&amp;quot;start_demo()&amp;quot; stop=&amp;quot;stop_demo()&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;makefile&amp;gt;&lt;br /&gt;
   &amp;lt;raw&amp;gt;&lt;br /&gt;
    #Raw makefile section&lt;br /&gt;
   &amp;lt;/raw&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;USE_SOMETHING&amp;quot; value=&amp;quot;$(SOMETHING)&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;DEMO_MODULE_LED&amp;quot; value=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;file name=&amp;quot;demo_module.c&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/makefile&amp;gt;&lt;br /&gt;
 &amp;lt;/module&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
* module&lt;br /&gt;
** name : this parameter is the name of the module (mandatory)&lt;br /&gt;
** dir : the name of the directory in '''sw/airborne/modules''' where the source code is located (in the above exemple: sw/airborne/modules/demo_module), if not specified, the name of the module is used as default directory name&lt;br /&gt;
&lt;br /&gt;
* doc&lt;br /&gt;
** description: a description of the module. The content of the first line until the dot is treated as the brief description used as the name in the [http://paparazzi.github.com/docs/latest/onboard_modules.html generated docs] (mandatory).&lt;br /&gt;
** define: describe the possible define flags for this module with default values and a short description (usually called from the [[Airframe_Configuration|airframe firmware section]])&lt;br /&gt;
** configure: describe the possible configuration options for this module with default values and a short description (usually called from the [[Airframe_Configuration|airframe firmware section]])&lt;br /&gt;
** section: describe the parameters that can be added as a section in the [[Airframe_Configuration|airframe configuration file]]&lt;br /&gt;
&lt;br /&gt;
* settings_file (0 or more)&lt;br /&gt;
** file name of a settings xml file&lt;br /&gt;
&lt;br /&gt;
* settings (0 or more): use the same format than systems [[Settings]]&lt;br /&gt;
** target: a list of targets allowed or forbidden for which embedded settings should be used&lt;br /&gt;
** dl_settings node with a tab name&lt;br /&gt;
*** dl_setting: setting description, see [[Settings]] page for details&lt;br /&gt;
&lt;br /&gt;
* depends (0 or 1 'depends' node)&lt;br /&gt;
** comma separated list of required modules&lt;br /&gt;
** allows to specify OR dependencies with pipe (|) similar to Debian depends, ex: &amp;lt;code&amp;gt;foo,bar|baz&amp;lt;/code&amp;gt; would make it depend on foo AND (bar OR baz)&lt;br /&gt;
** the elements can be a xml file (in conf/modules) or a module name (as set in the module xml 'name' node)&lt;br /&gt;
&amp;lt;div class=&amp;quot;toccolours mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:800px&amp;quot;&amp;gt;&lt;br /&gt;
Prior to '''v5.3.0_testing''' we had one &amp;lt;tt&amp;gt;depend&amp;lt;/tt&amp;gt; node instead of &amp;lt;tt&amp;gt;depends&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;conflicts&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible-content&amp;quot;&amp;gt;'depend' node used prior to '''v5.3_devel-438-g8be5c42'''):&lt;br /&gt;
* depend (0 or 1 'depend' node)&lt;br /&gt;
** require : the list of required modules&lt;br /&gt;
** conflict : the list of conflicting modules&lt;br /&gt;
** the elements of a list are separated with a pipe (|), ex: &amp;quot;bla|boo&amp;quot;&lt;br /&gt;
** the elements can be a xml file (in conf/modules) or a module name (in sw/airborne/modules)&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
* conflicts (0 or 1 'conflicts' node)&lt;br /&gt;
** comma separated list of conflicting modules&lt;br /&gt;
** the elements can be a xml file (in conf/modules) or a module name (as set in the module xml 'name' node)&lt;br /&gt;
&lt;br /&gt;
* header (0 or 1 'header' node)&lt;br /&gt;
** file : the name of the header to automatically include in modules.h&lt;br /&gt;
&lt;br /&gt;
* init (0 or more 'init' node)&lt;br /&gt;
** fun : initialization function name, called once at startup&lt;br /&gt;
&lt;br /&gt;
* periodic (0 or more 'periodic' node)&lt;br /&gt;
** fun : periodic function name (mandatory)&lt;br /&gt;
** period : period of the function in seconds, cannot be higher than the main frequency (if not specified, use freq parameter)&lt;br /&gt;
** freq : frequency of the function in Hz, cannot be higher than main frequency (used if period is not defined; if nor period nor freq are defined, the maximum frequency is used by default)&lt;br /&gt;
** delay : integer that can be used to impose a sequence in the periodic functions (use values between 0 and main_freq/function_freq)&lt;br /&gt;
** start : function to be executed before the periodic function starts&lt;br /&gt;
** stop : function to be executed after the periodic function stops (never called if autorun=LOCK)&lt;br /&gt;
** autorun : TRUE to make the periodic function starts automatically after init, FALSE to make it way for a user command to start, LOCK to make it always true (default is LOCK)&lt;br /&gt;
&lt;br /&gt;
* event (0 or more 'event' node)&lt;br /&gt;
** fun : event function name called in each cycle of the main AP loop&lt;br /&gt;
&lt;br /&gt;
* datalink (0 or more 'datalink' node)&lt;br /&gt;
** message : name of the datalink (uplink) message to be parsed&lt;br /&gt;
** fun : name of the function called when a message arrived&lt;br /&gt;
&lt;br /&gt;
* makefile (0 or more 'makefile' node)&lt;br /&gt;
** target : a list of build targets separated with pipes (ex: &amp;lt;makefile target=&amp;quot;tunnel|foo&amp;quot;&amp;gt;) (default is &amp;quot;ap|sim|nps&amp;quot;)&lt;br /&gt;
** define : each define node specifies a CFLAGS for the current targets&lt;br /&gt;
*** name : name of the define (ex: name=&amp;quot;USE_MODULE_LED&amp;quot; -&amp;gt; target.CFLAGS += -DUSE_MODULE_LED) (mandatory)&lt;br /&gt;
*** value : the value to associate (ex: name=&amp;quot;DEMO_MODULE_LED&amp;quot; value=&amp;quot;2&amp;quot; -&amp;gt; target.CFLAGS += -DDEMO_MODULE_LED=2)&lt;br /&gt;
*** type : the type of define, possible values are &amp;quot;define&amp;quot; or &amp;quot;D&amp;quot;, &amp;quot;include&amp;quot; or &amp;quot;I&amp;quot; (ex: name=&amp;quot;$(ARCH_SRC)&amp;quot; type=&amp;quot;include&amp;quot; -&amp;gt; target.CFLAGS += -I$(ARCH_SRC) ) (default is &amp;quot;define&amp;quot;)&lt;br /&gt;
** file&lt;br /&gt;
*** name : the name of the c file (located in &amp;quot;sw/airborne/modules/&amp;lt;dir_name&amp;gt;&amp;quot;) to add in the Makefile (ex: name=&amp;quot;demo_module.c&amp;quot; -&amp;gt; target.srcs += modules/&amp;lt;dir_name&amp;gt;/demo_module.c)&lt;br /&gt;
*** dir : select a directory for this file only (overrides the default directory)&lt;br /&gt;
** file_arch (hardware related code)&lt;br /&gt;
*** name : the name of the c file (located in &amp;quot;sw/airborne/arch/&amp;lt;ARCH&amp;gt;/modules/&amp;lt;dir_name&amp;gt;&amp;quot;) add in the Makefile (ex: name=&amp;quot;demo_module_hw.c&amp;quot; -&amp;gt; target.srcs += arch/&amp;lt;ARCH&amp;gt;/modules/&amp;lt;dir_name&amp;gt;/demo_module_hw.c)&lt;br /&gt;
*** dir : select a directory for this file only (overrides the default directory)&lt;br /&gt;
** raw : allows to define a raw makefile section&lt;br /&gt;
&lt;br /&gt;
If the compilation target is not supported by the module, it will be automatically unloaded. This may require a 'clean_ac' to work.&lt;br /&gt;
&lt;br /&gt;
=== In the airborne code ===&lt;br /&gt;
&lt;br /&gt;
The code corresponding to a module should be placed in the directory &amp;quot;sw/airborne/modules/&amp;lt;dir_name&amp;gt;&amp;quot; where dir_name must match the one in your conf file (attribute &amp;quot;dir&amp;quot; if specified, &amp;quot;name&amp;quot; otherwise). There are also defines generated for the frequency and period of every periodic functions of the module that can be used in the code: &amp;lt;PERIODIC_FUNCTION_NAME&amp;gt;_FREQ and &amp;lt;PERIODIC_FUNCTION_NAME&amp;gt;_PERIOD.&lt;br /&gt;
&lt;br /&gt;
=== Starting / stopping a module ===&lt;br /&gt;
&lt;br /&gt;
If modules are loaded with periodical functions that are not locked, a new tab will automatically appear in the setting page of the GCS that allows you to start and stop them.&lt;br /&gt;
&lt;br /&gt;
An other possibility is that any file that includes the header &amp;quot;modules.h&amp;quot; can start or stop the periodic tasks.&lt;br /&gt;
&lt;br /&gt;
=== Telemetry ===&lt;br /&gt;
&lt;br /&gt;
In the [[telemetry]] file, if a module name is specified in a field '''message''', it will be included in the telemetry messages only if the corresponding module is loaded.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;message name=&amp;quot;SOME_MODULE_MSG&amp;quot; period=&amp;quot;2&amp;quot; module=&amp;quot;module_name&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer_Documentation]] [[Category:Modules]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=20822</id>
		<title>Airframe Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Airframe_Configuration&amp;diff=20822"/>
		<updated>2016-01-15T15:16:25Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: minor spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Airframe_Configuration&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== About ==&lt;br /&gt;
&lt;br /&gt;
The airframe file is the most important configuration file and contains all the hardware and software settings for your airframe. It describes what hardware you have and which firmware, sensors, algorithms, etc. you want to use and also holds your configuration parameters. All gains, trims, and behavior settings are defined with standard XML elements.&lt;br /&gt;
&lt;br /&gt;
The XML airframe configuration file is located in &amp;lt;tt&amp;gt;conf/airframes/&amp;lt;yourairframe&amp;gt;.xml&amp;lt;/tt&amp;gt; and always begins with a &amp;lt;!DOCTYPE airframe SYSTEM &amp;quot;airframe.dtd&amp;quot;&amp;gt; line and should look like this&lt;br /&gt;
{{Box Code|conf/airframes/&amp;lt;yourairframe&amp;gt;.xml|&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE airframe SYSTEM &amp;quot;airframe.dtd&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;airframe name=&amp;quot;yourairframe&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!-- The airframe configuration goes here. --&amp;gt;&lt;br /&gt;
&amp;lt;/airframe&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Also see the wiki pages for [[Fixedwing_Configuration|fixedwing specific configuration]] and [[Rotorcraft_Configuration|rotorcraft specific configuration]].&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating a new Aircraft ==&lt;br /&gt;
&lt;br /&gt;
While the airframe file is where you configure most aspects of your aircraft, a fully specified aircraft needs several XML configuration files:&lt;br /&gt;
* Airframe (what this page is about)&lt;br /&gt;
* [[Flight_Plans|Flight Plan]]&lt;br /&gt;
* [[Settings]]&lt;br /&gt;
* [[Radio_Control|Radio]] (if you use a PPM based R/C system)&lt;br /&gt;
* [[Telemetry]]&lt;br /&gt;
* [[settings_modules]]&lt;br /&gt;
Each aircraft is assigned a name, unique ID and the associated configuration files in [[Conf.xml|&amp;lt;tt&amp;gt;conf/conf.xml&amp;lt;/tt&amp;gt;]]. To create a new Aircraft, click new in the menu A/C in the [[Paparazzi_Center|Paparazzi Center]] and select your new airframe file, etc. (or specify it by hand in [[Conf.xml|&amp;lt;tt&amp;gt;conf/conf.xml&amp;lt;/tt&amp;gt;]]).&lt;br /&gt;
&lt;br /&gt;
== Firmware and Hardware definitions ==&lt;br /&gt;
First you should specify which firmware you want to use, that is if you have a &amp;lt;tt&amp;gt;[[Fixedwing_Configuration|fixedwing]]&amp;lt;/tt&amp;gt; aircraft or a &amp;lt;tt&amp;gt;[[Rotorcraft_Configuration|rotorcraft]]&amp;lt;/tt&amp;gt;:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing or rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Select your Board ===&lt;br /&gt;
&lt;br /&gt;
To specify autopilot hardware you are using and it's low-level settings you have to add a ''target''-tag.&lt;br /&gt;
Each ''target'' has two attributes, which are ''name'' and a corresponding ''board'' attribute.&lt;br /&gt;
The ''name'' attribute is either &amp;quot;ap&amp;quot; (autopilot) or &amp;quot;sim/jsbsim/nps&amp;quot; (simulation).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing or rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;sim&amp;quot; board=&amp;quot;pc&amp;quot;/&amp;gt; &amp;lt;!-- For simulation. --&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot;  board=&amp;quot;lisa_m_1.0&amp;quot;/&amp;gt; &amp;lt;!-- Select your board here --&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== Simulation targets ====&lt;br /&gt;
&lt;br /&gt;
target name=&amp;quot;sim&amp;quot;,&amp;quot;jsbsim&amp;quot;,&amp;quot;nps&amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
board=&amp;quot;pc&amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More Information at [[Simulation]].&lt;br /&gt;
&lt;br /&gt;
==== Board targets ====&lt;br /&gt;
&lt;br /&gt;
target name=&amp;quot;ap&amp;quot;&amp;lt;br/&amp;gt;&lt;br /&gt;
board=&lt;br /&gt;
&amp;quot;apogee_0.99&amp;quot;,&lt;br /&gt;
&amp;quot;apogee_1.0&amp;quot;,&lt;br /&gt;
&amp;quot;ardrone2_raw&amp;quot;,&lt;br /&gt;
&amp;quot;ardrone2_sdk&amp;quot;,&lt;br /&gt;
&amp;quot;booz_1.0&amp;quot;,&lt;br /&gt;
&amp;quot;classix&amp;quot;,&lt;br /&gt;
&amp;quot;hb_1.1&amp;quot;,&lt;br /&gt;
&amp;quot;krooz_sd&amp;quot;,&lt;br /&gt;
&amp;quot;lisa_l_1.0&amp;quot;, &lt;br /&gt;
&amp;quot;lisa_l_1.1&amp;quot;, &lt;br /&gt;
&amp;quot;lisa_m_1.0&amp;quot;, &lt;br /&gt;
&amp;quot;lisa_m_2.0&amp;quot;,&lt;br /&gt;
&amp;quot;lisa_mx_2.0&amp;quot;,&lt;br /&gt;
&amp;quot;lisa_s_0.1&amp;quot;,&lt;br /&gt;
&amp;quot;logom_2.6&amp;quot;,&lt;br /&gt;
&amp;quot;navgo_1.0&amp;quot;, &lt;br /&gt;
&amp;quot;sdlog_1.0&amp;quot;, &lt;br /&gt;
&amp;quot;stm32f4_discovery&amp;quot;,&lt;br /&gt;
&amp;quot;tiny_0.99&amp;quot;, &lt;br /&gt;
&amp;quot;tiny_1.1&amp;quot;, &lt;br /&gt;
&amp;quot;tiny_2.1&amp;quot;, &lt;br /&gt;
&amp;quot;tiny_2.11&amp;quot;, &lt;br /&gt;
&amp;quot;twog_1.0&amp;quot;, &lt;br /&gt;
&amp;quot;umarim_1.0&amp;quot;,&lt;br /&gt;
&amp;quot;umarim_lite_2.0&amp;quot;,&lt;br /&gt;
&amp;quot;yapa_2.0&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
All targets can be found in /conf/boards.&lt;br /&gt;
&lt;br /&gt;
==== Direct Makefile ====&lt;br /&gt;
&lt;br /&gt;
Optionally you can also add a raw [http://en.wikipedia.org/wiki/Makefile Makefile] section. This is only needed in very advanced setups. For example when testing newly developed hardware.&lt;br /&gt;
&lt;br /&gt;
=== LEDs ===&lt;br /&gt;
&lt;br /&gt;
You can configure the LEDs on the autopilot to be used for different status indicators:&lt;br /&gt;
; ''SYS_TIME_LED'': blinks with 1Hz&lt;br /&gt;
; ''AHRS_ALIGNER_LED'': blinks until the AHRS is aligned (gyro bias initialized) and then stays on&lt;br /&gt;
; ''GPS_LED'': blinking if trying to get a fix, on if 3D fix&lt;br /&gt;
; ''RADIO_CONTROL_LED'': on if RC signal is ok&lt;br /&gt;
; ''BARO_LED'' : only on booz and navgo boards: blinks until baro offset is initialized and then stays on&lt;br /&gt;
&lt;br /&gt;
Depending on your board some of the LEDs on it are already assigned to some indicators by default, check the appropriate autopilot board makefile for the defaults.&lt;br /&gt;
&lt;br /&gt;
To reconfigure the default assignment, assign the indicator to an other value. Use ''none'' if indicator should not be assigned to any LED.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing or rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
     &amp;lt;configure name=&amp;quot;SYS_TIME_LED&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;configure name=&amp;quot;RADIO_CONTROL_LED&amp;quot; value=&amp;quot;2&amp;quot;/&amp;gt;&lt;br /&gt;
     &amp;lt;configure name=&amp;quot;GPS_LED&amp;quot; value=&amp;quot;none&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Beware that you can only assign '''one''' indicator to a LED number. So if the LED you want to use is already in use because another indicator is set to that number by default you have to disable that other indicator by setting it to ''none'' or reconfigure it to an other LED.&lt;br /&gt;
&lt;br /&gt;
== Subsystems ==&lt;br /&gt;
&lt;br /&gt;
Each autopilot features certain [[Subsystems|subsystems]] which need to be configured properly.&lt;br /&gt;
The most important ones are described below.&lt;br /&gt;
&lt;br /&gt;
=== IMU ===&lt;br /&gt;
&lt;br /&gt;
Add the [[Subsystem/imu|imu subsystem]] with the type you are using.&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing or rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;imu&amp;quot;       type=&amp;quot;aspirin_v1.5&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See the [[Subsystem/imu|imu subsystem]] page for more details.&lt;br /&gt;
Also see the [[ImuCalibration|IMU calibration]] page.&lt;br /&gt;
&lt;br /&gt;
=== AHRS ===&lt;br /&gt;
&lt;br /&gt;
The [[Subsystem/ahrs|AHRS subsystem]] specifies which attitude estimation filter you are using, e.g. for the complementary filter:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing or rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ahrs&amp;quot; type=&amp;quot;int_cmpl_euler&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
All AHRS algorithms depend on an imu subsystem, except for the ahrs_infrared which depends on the infrared module.&lt;br /&gt;
See the [[Subsystem/ahrs|AHRS subsystem page]] for more details.&lt;br /&gt;
&lt;br /&gt;
If the magnetometer should be used the [[Subsystem/ahrs#Local_Magnetic_Field|local magnetic field section]] must be filled in.&lt;br /&gt;
&lt;br /&gt;
=== Radio Control ===&lt;br /&gt;
&lt;br /&gt;
Supported types are:&lt;br /&gt;
* ''ppm''&lt;br /&gt;
* ''spektrum''&lt;br /&gt;
* ''datalink''&lt;br /&gt;
&lt;br /&gt;
Just specify the appropriate [[Subsystem/radio_control|radio control subsystem]] in your firmware section, e.g.:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing or rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;radio_control&amp;quot;     type=&amp;quot;ppm&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Telemetry (Modem) ===&lt;br /&gt;
&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 your [[Telemetry|telemetry file]], e.g. &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;
The [[Subsystem/telemetry|telemetry subsystem]] supports the following modem protocols:&lt;br /&gt;
* Standard transparent serial (pprz) - this is compatible with all modems and can be used to connect the autopilot directly to a PC for testing without a modem.&lt;br /&gt;
* Maxstream API protocol (xbee) - compatible with all Maxstream modems including the 9XTend and Zigbee.  This protocol enables hardware addressing, allowing multiple aircraft to be managed from a single ground modem.&lt;br /&gt;
&lt;br /&gt;
Just specify the appropriate [[Subsystem/telemetry|telemetry subsystem]] in your firmware section. You can currently choose between the types ''transparent'', ''transparent_usb'' and ''xbee_api''.&lt;br /&gt;
&lt;br /&gt;
'''The default baudrate is 57600 baud, see the [[Subsystem/telemetry|telemetry subsystem]] page for more details and configuration options.'''&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing or rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;telemetry&amp;quot;     type=&amp;quot;transparent&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== GPS ===&lt;br /&gt;
&lt;br /&gt;
The serial port settings must match that of the GPS and are configured here along with the necessary files to interpret the u-blox UBX binary protocol:&lt;br /&gt;
&lt;br /&gt;
Just specify the appropriate [[Subsystem/gps|gps subsystem]] in your firmware section. You can currently choose between the types '''ublox''' and '''ublox_utm''' for the older series 4 modules which still provide a UTM message.&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing or rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;gps&amp;quot;               type=&amp;quot;ublox&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The correct UART is already defined by default according to your board.&lt;br /&gt;
The default GPS baudrate is 38400baud.&lt;br /&gt;
&lt;br /&gt;
If you need to set different baud rates or UART see the [[Subsystem/gps]] page for the options.&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 through the [[tunnel|UART Tunnel]] and [[GPS#GPS_configuration_using_U-Center|Configured with u-center]]&lt;br /&gt;
&lt;br /&gt;
== XML Parameters ==&lt;br /&gt;
&lt;br /&gt;
'''When defining parameters you can use [[Units|automatic unit conversion]] to conveniently set it in e.g. degrees.'''&lt;br /&gt;
&lt;br /&gt;
=== Commands ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;commands&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; lists the abstract commands you need to control the aircraft. In a simple fixed-wing example, we have only three:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&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;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
For rotorcraft, it is usually:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;commands&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;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;YAW&amp;quot;      failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;axis name=&amp;quot;THRUST&amp;quot;   failsafe_value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/commands&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each command is also associated with a failsafe value which will be used if no controller is active, for example during initialization of the autopilot board. The range of these values is [-9600:9600]. For &amp;lt;tt&amp;gt;&amp;quot;THROTTLE&amp;quot;&amp;lt;/tt&amp;gt;, the range is [0, 9600] and in the corresponding &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servo&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; definition the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;neutral&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;min&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; are usually the same for PWM based servos (see below). Note that these commands do not necessarily match the servo actuators. For example, the &amp;lt;tt&amp;gt;&amp;quot;ROLL&amp;quot;&amp;lt;/tt&amp;gt; command is typically linked to two aileron actuators.&lt;br /&gt;
&lt;br /&gt;
=== Servos ===&lt;br /&gt;
&lt;br /&gt;
The above commands get translated to the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; here. In the example below we use two elevons and a motor. ([http://en.wikipedia.org/wiki/Elevon ''Elevons''] are surfaces used for both pitch and roll as on a flying wing.) These servos are listed in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;servos&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;THROTTLE&amp;quot;         no=&amp;quot;0&amp;quot; min=&amp;quot;1000&amp;quot; neutral=&amp;quot;1000&amp;quot; max=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;ELEVON_LEFTSIDE&amp;quot;  no=&amp;quot;1&amp;quot; min=&amp;quot;2000&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;1000&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;servo name=&amp;quot;ELEVON_RIGHTSIDE&amp;quot; no=&amp;quot;2&amp;quot; min=&amp;quot;1000&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;2000&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/servos&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Names are associated to the corresponding '''real physical connector''' to which a servo is connected '''on the autopilot board'''. For example no=&amp;quot;2&amp;quot; means connector two on the board. Also the servo neutral value, total range and direction are defined.  Min/max/neutral values are expressed in microseconds. The direction of travel can be reversed by exchanging min with max (as in &amp;lt;tt&amp;gt;&amp;quot;ELEVON_LEFTSIDE&amp;quot;&amp;lt;/tt&amp;gt;, above).  The ''standard'' travel for a hobby servo is 1000µs - 2000µs with a 1500µs neutral. Trim can be added by changing this neutral value. Absolute servo travel limits can be increased or reduced with the min/max values.  The &amp;lt;tt&amp;gt;&amp;quot;THROTTLE&amp;quot;&amp;lt;/tt&amp;gt; servo typically has the same value for the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;neutral&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;min&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The attribute &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;driver&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; for &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;servos&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; node tells which actuators' driver is associated to the listed servos. After the version '''v4.9_devel-164-gdb0d004''', multiple servos sections can be defined and used together, if the correct [[Subsystem/actuators| actuators subsystems]] are loaded. Some boards are automatically loading a default driver, the one used when no &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;driver&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; attribute is specified.&lt;br /&gt;
&lt;br /&gt;
Note the following important tips:&lt;br /&gt;
* Reverse the servo direction by exchanging min/max&lt;br /&gt;
* Trim should always be adjusted mechanically if possible to avoid asymmetrical travel&lt;br /&gt;
* Any reduction of the total travel range should be done mechanically to maintain precision&lt;br /&gt;
* Many servos will respond well to values slightly outside the normal 1000-2000µs range but experiment carefully as the servo may not operate reliably outside this range and may even suffer permanent damage.&lt;br /&gt;
* Board connector numbering starts with &amp;lt;b&amp;gt;zero (0)&amp;lt;/b&amp;gt; not with one&lt;br /&gt;
* Servos are also known under the synonym &amp;lt;b&amp;gt;actuators&amp;lt;/b&amp;gt;&lt;br /&gt;
* (after version '''v4.9_devel-164-gdb0d004''') For I2C based motor speed control using the [[Rotorcraft_Configuration#Motor_Mixing|motor mixing]]:&lt;br /&gt;
** min: command to stop the motor&lt;br /&gt;
** neutral: motor idle command&lt;br /&gt;
** max: max thrust command&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;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;command_laws&amp;gt;&lt;br /&gt;
  &amp;lt;let var=&amp;quot;aileron&amp;quot;            value=&amp;quot;@ROLL  * 0.3&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;let var=&amp;quot;elevator&amp;quot;           value=&amp;quot;@PITCH * 0.7&amp;quot;/&amp;gt;  &lt;br /&gt;
  &amp;lt;set servo=&amp;quot;THROTTLE&amp;quot;         value=&amp;quot;@THROTTLE&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;set servo=&amp;quot;ELEVON_LEFTSIDE&amp;quot;  value=&amp;quot;$elevator + $aileron&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;set servo=&amp;quot;ELEVON_RIGHTSIDE&amp;quot; value=&amp;quot;$elevator - $aileron&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/command_laws&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:airframe_sign_conventions.jpg|thumb|Sign conventions for flight dynamics]]&lt;br /&gt;
where the third line is the simplest: the throttle servo value equals throttle command value. The other lines define and control the pitch/roll mixing.  Elevon values are computed with a combination of two commands, '''ROLL''' and '''PITCH'''. This ''mixer'' is defined with two intermediate variables '''aileron''' and '''elevator''' introduced with the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;let&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; element.  The '''@''' symbol is used to reference a command value in the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; attribute of the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;set&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;let&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; elements.  In the above example, the servos are limited to +/- 70% of their full travel for pitch and 30% for roll, only in combination can the servos reach 100% deflection.  Note that these numbers ''should add up 100% or more, never less''.  For example, you may want 100% travel available for pitch - this means if a roll is commanded along with maximum pitch only one servo will respond to the roll command as the other has already reached its mechanical limit.  If you find after tuning that these numbers add to less than 100% consider reducing the surface travel mechanically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the signs used in the description follow the standard convention.&lt;br /&gt;
&lt;br /&gt;
After '''v4.9_devel-164-gdb0d004''', the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;command_laws&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; section is mandatory for both fixedwing and rotorcraft firmwares, only for fixedwing otherwise.&lt;br /&gt;
&lt;br /&gt;
=== Battery === &lt;br /&gt;
&lt;br /&gt;
This section gives characteristics for monitoring the main power battery.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MILLIAMP_AT_FULL_THROTTLE&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; represents the actual current (in mA) when full THROTTLE is applied. Note that when flying the current typically is significantly lower than in static tests at home on your workbench. &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MILLIAMP_AT_FULL_THROTTLE&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; is used to compute the &amp;lt;tt&amp;gt;energy&amp;lt;/tt&amp;gt; value of the &amp;lt;tt&amp;gt;BAT&amp;lt;/tt&amp;gt; message when no [[Current_sensor|Current sensor]] is mounted in the airframe. This value can also be used in flight plans. For example, if at full throttle your motor consumes 10 Amps, use a value of 10000. You can &amp;quot;tweak&amp;quot; this number after a few flights to match the capacity of your battery. If upon landing your bat.energy messages says that you used 2500 mAh while the energy recharged into the battery is only 2000 mAh, you could reduce the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MILLIAMP_AT_FULL_THROTTLE&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; value by 20% to match your in-flight current consumption. This tweaking is most precise if you fly full throttle only (respectively no throttle to glide down again).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;CURRENT_ESTIMATION_NONLINEARITY&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; can be added to tweak the energy estimation for non full throttle cruise. As the current consumption is nonlinear, at 50% throttle it is likely to be substantially less than 50%. A superellipse is used to approximate this nonlinearity. The default setting is 1.2 and is used if the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;CURRENT_ESTIMATION_NONLINEARITY&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; is not defined in your airframe file. A value 1 corresponds to linear behaviour, 1.5 corresponds to strong nonlinearity. The tweaking is done same as described above for &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MILLIAMP_AT_FULL_THROTTLE&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;, but only partial throttle (cruise throttle) should be applied in flight.&lt;br /&gt;
&lt;br /&gt;
If both &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MILLIAMP_AT_FULL_THROTTLE&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;CURRENT_ESTIMATION_NONLINEARITY&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; are tweaked well, you get precise energy estimations with less than 5% error independent of your flight pattern without even requiring a [[Current_sensor|current sensor]].&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;CATASTROPHIC_BAT_LEVEL&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; (was previously &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;LOW_BATTERY&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt;) value defines the voltage at which the autopilot will lock the throttle at 0% in autonomous mode (kill_throttle mode). This value is also used by the ground server to issue a '''CATASTROPHIC''' alarm message on the bus (this message will be displayed in the console of the GCS).  &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;CRITIC&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;LOW&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; values will also used as threshold for '''CRITIC''' and '''WARNING''' alarms. They are optional and the respective defaults are 10.0 and 10.5V.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;MAX_BAT_LEVEL&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; may be specified to improve the display of the battery gauge in the strip or in &amp;quot;papgets&amp;quot;. Note that this definition is optional, with a default value of 12.5V.&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ADC_CHANNEL_VSUPPLY&amp;quot; value=&amp;quot;ADC_4&amp;quot; /&amp;gt; &lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;section name=&amp;quot;BAT&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MILLIAMP_AT_FULL_THROTTLE&amp;quot; value=&amp;quot;12000&amp;quot; unit=&amp;quot;mA&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CATASTROPHIC_BAT_LEVEL&amp;quot; value=&amp;quot;6.0&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;CRITIC_BAT_LEVEL&amp;quot; value=&amp;quot;6.5&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;LOW_BAT_LEVEL&amp;quot; value=&amp;quot;7.0&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;MAX_BAT_LEVEL&amp;quot; value=&amp;quot;8.4&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The conversion of ADC measurements to Voltage is already defined for the different autopilot boards, if you need to override these defaults you can use the &amp;lt;b&amp;gt;&amp;lt;tt&amp;gt;VoltageOfAdc(adc)&amp;lt;/tt&amp;gt;&amp;lt;/b&amp;gt; define and also specify offsets or anything else you might need, e.g.:&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;BAT&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;define name=&amp;quot;VOLTAGE_ADC_SCALE&amp;quot; value=&amp;quot;0.0177531&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;VOLTAGE_OFFSET&amp;quot; value=&amp;quot;0.5&amp;quot; unit=&amp;quot;V&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;VoltageOfAdc(adc)&amp;quot; value=&amp;quot;(VOLTAGE_ADC_SCALE * adc + VOLTAGE_OFFSET)&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Calculating '''VOLTAGE_ADC_SCALE''':&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;VOLTAGE\_ADC\_SCALE=\frac{Vref}{ADCresolution-1}\div\frac{R2}{R1+R2}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Vref - Voltage reference for the ADC (will be 3.3V in most cases, can be found in mcu/adc datasheet)&lt;br /&gt;
*ADCresolution - ADC bit depth (e.g. 2^12=4096 for a 12 bit ADC)&lt;br /&gt;
*R1 - Resistor between battery and ADC input pin of MCU&lt;br /&gt;
*R2 - Resistor between ADC input pin of the MCU and GND&lt;br /&gt;
&lt;br /&gt;
It is also a good idea to measure the actual voltage of the battery with a precision voltage meter, compare it with the calculated value from the autopilot (e.g. via [[Paparazzi_Center#Messages]]) and edit the vales for ADC scaling. Since the resistors have a tolerance, this can fine tune the measurement.&lt;br /&gt;
&lt;br /&gt;
=== Modules ===&lt;br /&gt;
&lt;br /&gt;
The [[Modules|modules]] allow to add new code in a flexible way with initialisation, periodic and event functions without modifying the main AP loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;modules main_freq=&amp;quot;60&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;load name=&amp;quot;demo_module.xml&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;/modules&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The main_freq parameter (in Hz) allows to specify the frequency of the main loop. Default is 60 Hz&lt;br /&gt;
&lt;br /&gt;
=== GCS ===&lt;br /&gt;
&lt;br /&gt;
[[Image:ac_icon_multi_uav.png|thumb|Various A/C icons demonstrated on a multi UAV simulation session]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Icons_Theme_Default.png|thumb|Default Theme]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Icons_Theme_Flat.png|thumb|Flat Theme]]&lt;br /&gt;
&lt;br /&gt;
Use this &amp;lt;b&amp;gt;optional&amp;lt;/b&amp;gt; section to help customize parts of the GCS for a specific airframe:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;GCS&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ICONS_THEME&amp;quot; value=&amp;quot;flat_theme&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ALT_SHIFT_PLUS_PLUS&amp;quot; value=&amp;quot;30&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ALT_SHIFT_PLUS&amp;quot; value=&amp;quot;5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ALT_SHIFT_MINUS&amp;quot; value=&amp;quot;-5&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;SPEECH_NAME&amp;quot; value=&amp;quot;Quad&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;AC_ICON&amp;quot; value=&amp;quot;flyingwing&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;ICONS_THEME&amp;lt;/tt&amp;gt; can be used to define an alternate/custom GCS icons theme for a given aircraft The '''flat_theme''' is one example of an alternate set of GCS icons.&lt;br /&gt;
* &amp;lt;tt&amp;gt;ALT_SHIFT_PLUS_PLUS&amp;lt;/tt&amp;gt; sets the number of metres the target altitude will change when the double up arrow button is pressed on the [[GCS#Strips|strip]]&lt;br /&gt;
* &amp;lt;tt&amp;gt;ALT_SHIFT_PLUS&amp;lt;/tt&amp;gt; sets the number of metres the target altitude will change when the up arrow button is pressed on the [[GCS#Strips|strip]]&lt;br /&gt;
* &amp;lt;tt&amp;gt;ALT_SHIFT_MINUS&amp;lt;/tt&amp;gt; sets the number of metres the target altitude will change when the down arrow button is pressed on the [[GCS#Strips|strip]]&lt;br /&gt;
* &amp;lt;tt&amp;gt;SPEECH_NAME&amp;lt;/tt&amp;gt; a string ([a-zA-Z0-9_]) that will be used in place of the aircraft name specified in &amp;lt;tt&amp;gt;conf.xml&amp;lt;/tt&amp;gt; for the [[Speech|speech]] and [[GCS#Alarms|alarms]] functionality. Set this to &amp;quot;_&amp;quot; to prevent the speech function from saying the aircraft name. Useful if your aircraft name takes a long time to say (i.e. &amp;quot;UAV1-A_with_spektrum&amp;quot; can be shortened to &amp;quot;Plane&amp;quot;).&lt;br /&gt;
* &amp;lt;tt&amp;gt;AC_ICON&amp;lt;/tt&amp;gt; can be used to define the vehicle icon (or overwrite the default icon) that shows up on the 2D-map of the GCS. Available values are: &amp;lt;tt&amp;gt;flyingwing&amp;lt;/tt&amp;gt; , &amp;lt;tt&amp;gt;fixedwing&amp;lt;/tt&amp;gt; , &amp;lt;tt&amp;gt;rotorcraft&amp;lt;/tt&amp;gt; , &amp;lt;tt&amp;gt;quadrotor&amp;lt;/tt&amp;gt; , &amp;lt;tt&amp;gt;hexarotor&amp;lt;/tt&amp;gt; , &amp;lt;tt&amp;gt;octorotor&amp;lt;/tt&amp;gt; , &amp;lt;tt&amp;gt;quadrotor_x&amp;lt;/tt&amp;gt; , &amp;lt;tt&amp;gt;hexarotor_x&amp;lt;/tt&amp;gt; , &amp;lt;tt&amp;gt;octorotor_x&amp;lt;/tt&amp;gt; , &amp;lt;tt&amp;gt;home&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Custom Icons Theme Support ====&lt;br /&gt;
&lt;br /&gt;
A custom icons theme is supported through the use of the '''ICONS_THEME''' attribute. Set the '''ICONS_THEME''' attribute ''value'' to the path of your custom icons theme directory and the given aircraft will now display your custom icons. Note that the path is relative to the default GCS icons path root: ''$PAPARAZZI_HOME/data/pictures/gcs_icons''&lt;br /&gt;
&lt;br /&gt;
{{Box Code|code snippet|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;GCS&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;define name=&amp;quot;ICONS_THEME&amp;quot; value=&amp;quot;myawesome_icons&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The directory that contains your custom icons, in this example named ''myawesome_icons'', is located at ''$PAPARAZZI_HOME/data/pictures/gcs_icons''. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:User_Documentation]] [[Category:Airframe_Configuration]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Modems&amp;diff=20725</id>
		<title>Modems</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Modems&amp;diff=20725"/>
		<updated>2016-01-07T16:12:13Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: typos etc&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Paparazzi autopilots generally feature a TTL serial port to interface with any common radio modem.  The bidirectional link provides real-time telemetry and in-flight tuning and navigation commands.  The system is also capable overlaying the appropriate protocols to communicate through non-transparent devices such as the Coronis Wavecard or Maxstream API-enabled products, allowing for hardware addressing for multiple aircraft or future enhancements such as data-relaying, inter-aircraft communication, RSSI signal monitoring and automatic in-flight modem power adjustment.  Below is a list of some of the common modems used with Paparazzi, for details on configuring your modem see the [[Airframe_Configuration#Telemetry_.28Modem.29|Airframe Configuration]] and [[XBee_configuration|XBee Configuration]] pages.&lt;br /&gt;
&lt;br /&gt;
==General comparison==&lt;br /&gt;
'''This is ONLY a comparison between modules on this page'''&lt;br /&gt;
&lt;br /&gt;
All modules listed here work without issue and are generally available.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; &lt;br /&gt;
| align=&amp;quot;center&amp;quot;  style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Feature'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Modems#Digi_XBee_Pro_DigiMesh_.2F_802.15.4_.28.22Series_1.22.29|XBee Series 1]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Modems#Digi_XBee_Pro_DigiMesh_.2F_802.15.4_.28.22Series_1.22.29|XBee Pro Series 1]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Modems#Digi_XBee_Pro_ZB_.2F_ZNet_2.5_.28.22Series_2.22.29|XBee Series 2]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Modems#Digi_XBee_Pro_ZB_.2F_ZNet_2.5_.28.22Series_2.22.29|XBee Pro Series 2]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Modems#Digi_XBee_868LP|XBee 868LP]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Modems#Digi_XBee_Pro_900HP|XBee Pro 900HP]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Modems#Digi_XBee_Pro_XSC_900MHz|XBee Pro XSC 900]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Modems#Digi_9XTend|Digi 9XTend]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Modems#SiLabs_Si1000_SoC_based_modems|SiLabs Si1000]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Modems#AC4790-200|Aerocom AC4790-200]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Modems#AC4790-1000|Aerocom AC4790-1000]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Modems#Laird_RM024|Laird RM024 50mW]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Modems#Laird_RM024|Laird RM024 125mW]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot;  style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Modems#RN-41_Bluetooth_module.28Sparkfun.27s_WRL-08497.29|RN-41 Bluetooth]]'''&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''frequency'''||2,4GHz||2,4GHz||2,4GHz||2,4GHz||868MHz||900MHz||900MHz||900MHz, 2.4GHz||240-960MHz||900MHz||900MHz||2,4GHz||2,4GHz||2,4GHz&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''output power'''||1mW||63mW (US) 10 mW (Int'l)||2mW||63mW||5mW||250mW||250mW||1mW-1W||max 100mW||5-200mW||5-1000mW||2,5-50mW||2,5-125mW||32mW&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''RF speed'''||250kbps||250kbps||250kbps||250kbps||10kbps, 80kbps||10 or 200kbps||10, 20kbps||9.6, 115.2kbps|| ||76.8kbps||76.8kbps||280, 500kbps||280, 500kbps||300kbps&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''antenna'''||chip, wire, rpsma, u.fl||chip, wire, rpsma, u.fl||chip, wire, rpsma, u.fl||chip, wire, rpsma, u.fl||external required||wire, rpsma, u.fl||wire, rpsma, u.fl||rpsma, MMCX||external required||MMCX, internal Antenna||MMCX||u.fl, chip, both||u.fl, chip, both||pcb trace&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''pinout'''||XBee||XBee||XBee||XBee||SMD||XBee||XBee||20 pin 2,54mm/USB||SMD (42 pin LGA)||20 pin mini connector||20 pin mini connector||XBee/SMD||XBee/SMD||SMD&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''price'''||16€||26€||14€||28€||18€||32€||32€||150€||4€||52€||64€||30€||30€||20€&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''for Country'''||Worldwide||Worldwide||Worldwide||Worldwide||Europe||North America, Australia||North America, Australia||Worldwide||Worldwide||North America, Australia||North America, Australia||Europe||North America||Worldwide&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Frequencies ==&lt;br /&gt;
&lt;br /&gt;
Analog and digital signals (video and data/modem) can not be transmitted over the same frequency band since the analog signal will &amp;quot;block&amp;quot; the digital one. (Attention ! the common 2.4 or 5.8GHz frequencies have multiple channels, if the analog and digital transmitter/receiver modules are set up to different channels/frequencies, they should work (even on 2.4GHz)).&lt;br /&gt;
&lt;br /&gt;
You may want to inform yourself about your countries laws ! Different countries allow different frequencies at different power. &amp;lt;br/&amp;gt;&lt;br /&gt;
Sending on a wrong frequency or with too much power may end in a serious lawsuit !&lt;br /&gt;
&lt;br /&gt;
Digi: [http://www.digi.com/technology/rfmodems/agencyapprovals Government Agency Certifications]&lt;br /&gt;
&lt;br /&gt;
== HAM / CEPT Licence ==&lt;br /&gt;
&lt;br /&gt;
If possible, consider making a HAM radio (amateur radio) licence. (e.g. CEPT, depends on your locality)&lt;br /&gt;
&lt;br /&gt;
You will learn about the radio technology, operational technology and legislation.&amp;lt;br/&amp;gt;&lt;br /&gt;
With a HAM radio licence, you can also use other frequencies or transmit on a higher power. (e.g. In some countries, the 5.8GHz video transmission is for non licenced people restricted to 10mW!)&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Licence Pros'''&lt;br /&gt;
* You will be informed well about the (local and international) legislations.&lt;br /&gt;
* You can transmit on a higher power (depends on frequency).&lt;br /&gt;
* You will learn a lot about the techniques and be more than a standard &amp;quot;consumer&amp;quot; of radio electronic products.&lt;br /&gt;
* It will be easier to find faults in your radio systems.&lt;br /&gt;
* You can build (if you want) high gain/focused antennas which can give you a better signal, wider range and won't disturb anyone else. &lt;br /&gt;
* Well educated people respecting the legislation just looks much better in looks to UAV's :)&lt;br /&gt;
&lt;br /&gt;
'''Licence Cons'''&lt;br /&gt;
* You will need to learn for the test (can be compared with a diverce licence).&lt;br /&gt;
* The certificate and books will cost about 70€ (total, can vary !).&lt;br /&gt;
* Maybe some costs (per year) for your call sign.&lt;br /&gt;
&lt;br /&gt;
=== CEPT Licence in Austria ===&lt;br /&gt;
&lt;br /&gt;
A short description about getting the CEPT 1 (not the CEPT Novice !) licence in Austria.&lt;br /&gt;
&lt;br /&gt;
You will need the appropriate books which cost 50€ (70€ if you want them with the ask catalog and answers which can be helpful) and rough 18€ for the exam and certificate. The ÖVSV offers also some courses, but you can also learn everything with the books.&lt;br /&gt;
&lt;br /&gt;
The are (regularly?) HAM licence courses at the https://metalab.at/ in Vienna.&lt;br /&gt;
&lt;br /&gt;
To be continued...&lt;br /&gt;
&lt;br /&gt;
=== Links ===&lt;br /&gt;
&lt;br /&gt;
[http://www.oevsv.at/ Austrian ÖVSV]&amp;lt;br/&amp;gt;&lt;br /&gt;
[http://www.darc.de/ German DARC]&lt;br /&gt;
&lt;br /&gt;
== Digi XBee modules ==&lt;br /&gt;
&lt;br /&gt;
Digi (formerly Maxstream) offers an increasing variety of Zigbee protocol modems well suited for Paparazzi in 2.4 GHz, 900MHz and 868Mhz frequencies.  The &amp;quot;Pro&amp;quot; series are long range, up to 40km!  Standard series are slightly smaller/lighter/lower power consumption and very short range.  All versions are all pin compatible and weigh around 2 grams with wire antennas. All Digi modems can be operated in transparent mode (as a serial line replacement) or in &amp;quot;API mode&amp;quot; with hardware addressing, managed networking, and RSSI (signal strength) data with the Paparazzi &amp;quot;Xbee&amp;quot; option.  &lt;br /&gt;
&lt;br /&gt;
Four antenna options are offered: RP-SMA, U-FL, wire antenna, chip antenna&lt;br /&gt;
&lt;br /&gt;
* XBee (PRO) ZB (the current series)&lt;br /&gt;
* XBee (PRO) ZNet 2.5 (formerly Series 2) (only legacy -&amp;gt; use XBee-PRO ZB)&lt;br /&gt;
The XBee &amp;amp; XBee-PRO ZB share hardware (ember stack) with XBee &amp;amp; XBee-PRO ZNet 2.5. As a result, modules can be &amp;quot;converted&amp;quot; from one platform to another by loading different firmware onto a given module.&lt;br /&gt;
&lt;br /&gt;
These two also share the same hardware and can be converted from one to another by flashing a different firmware:&lt;br /&gt;
* XBee-PRO 802.15.4 (formerly Series 1)&lt;br /&gt;
* XBee-PRO DigiMesh 2.4&lt;br /&gt;
&lt;br /&gt;
'''Note: Modules based on Freescale chipset (formerly Series 1) are not compatible with Ember chipset based modules (Series 2).'''&lt;br /&gt;
&lt;br /&gt;
If only point to point or point to multipoint communication is required 802.15.4 will do the job. These are designed for high data rates and low latency.&amp;lt;br/&amp;gt;&lt;br /&gt;
Modules with Zigbee firmware are needed for mesh functionality(communication between the UAV's)&lt;br /&gt;
&lt;br /&gt;
See the [[XBee_configuration|XBee Configuration]] page. This [http://pixhawk.ethz.ch/tutorials/how_to_configure_xbee tutorial] is also good to configure and get started with XBee Pro.&lt;br /&gt;
&lt;br /&gt;
=== Module Comparison ===&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||'''Module'''||'''Point-to-Multipoint'''||'''ZigBee/Mesh'''||'''Chipset'''|||'''Software stack'''||'''Frequency'''||'''TX Power normal/PRO'''||'''Notes'''&lt;br /&gt;
|-&lt;br /&gt;
|'''XBee ZB'''&lt;br /&gt;
|&lt;br /&gt;
|yes&lt;br /&gt;
|Ember&lt;br /&gt;
|EmberZNet PRO 3.1 (ZigBee 2007)&lt;br /&gt;
|2.4 GHz&lt;br /&gt;
|2mW/50mW&lt;br /&gt;
|coordinator needed&lt;br /&gt;
|-&lt;br /&gt;
|'''XBee ZNet 2.5'''&lt;br /&gt;
|&lt;br /&gt;
|yes&lt;br /&gt;
|Ember&lt;br /&gt;
|EmberZNet 2.5 ZigBee&lt;br /&gt;
|2.4 GHz&lt;br /&gt;
|2mW/50mW&lt;br /&gt;
|(only legacy -&amp;gt; use XBee-PRO ZB) coordinator needed&lt;br /&gt;
|-&lt;br /&gt;
|'''XBee DigiMesh 2.4'''&lt;br /&gt;
|&lt;br /&gt;
|yes&lt;br /&gt;
|Freescale&lt;br /&gt;
|&lt;br /&gt;
|2.4 GHz&lt;br /&gt;
|&lt;br /&gt;
|all nodes equal (no special coordinators/routers/end-devices)&lt;br /&gt;
|-&lt;br /&gt;
|'''XBee 802.15.4'''&lt;br /&gt;
|yes&lt;br /&gt;
|&lt;br /&gt;
|Freescale&lt;br /&gt;
|&lt;br /&gt;
|2.4 GHz&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|'''XBee-PRO 868'''&lt;br /&gt;
|yes&lt;br /&gt;
|&lt;br /&gt;
|?&lt;br /&gt;
|&lt;br /&gt;
|868 MHz&lt;br /&gt;
|500mW&lt;br /&gt;
|Only High Power Frequency allowed in the UK. 2.4GHz limited to 10mW&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Pinout ====&lt;br /&gt;
&lt;br /&gt;
[[Image:Maxstream_Xbee_pinout.jpg|left|thumb|Maxstream XBee pinout]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||''Xbee 20-pin Header''||''Name''||''Notes''||''Suggested Color''||&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
| +3.3v&lt;br /&gt;
| Power&lt;br /&gt;
|Red&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|DOUT&lt;br /&gt;
|Tx output - connect to Autopilot Rx&lt;br /&gt;
|Green&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|DIN&lt;br /&gt;
|Rx input - connect to Autopilot Tx&lt;br /&gt;
|Blue&lt;br /&gt;
|-&lt;br /&gt;
|10&lt;br /&gt;
|GND&lt;br /&gt;
| Ground&lt;br /&gt;
|Black&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The image view is from above, top, thus NOT at the side where the connector pins come out&lt;br /&gt;
&lt;br /&gt;
Note : DTR and RTS need to be wired for upgrading firmware&lt;br /&gt;
&lt;br /&gt;
=== GCS Adaptation ===&lt;br /&gt;
&lt;br /&gt;
There are several vendors of hardware to connect the ground XBee radio modem to the GCS computer.&amp;lt;br/&amp;gt;&lt;br /&gt;
More information about general USB-Serial adapters can be found on the [[Serial_Adapter]] page.&lt;br /&gt;
&lt;br /&gt;
====Adafruit====&lt;br /&gt;
&lt;br /&gt;
[[Image:xbeeadapter_LRG.jpg|thumb|left|Adafruit XBee adapter board]][[Image:xbeeadapterftdi_LRG.jpg|thumb|Adafruit XBee adapter with FTDI cable]]&lt;br /&gt;
[http://www.adafruit.com/index.php?main_page=product_info&amp;amp;cPath=29&amp;amp;products_id=126 Adafruit] offers a great adapter board kit for the Xbee modules that includes a 5-3.3V voltage regulator, power and activity LEDs, and pins to connect directly to your FTDI cable for $10!  Some assembly required.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Droids====&lt;br /&gt;
&lt;br /&gt;
[[Image:XBee_Simple_Board.jpg|thumb|left|XBee Simple Board]]&lt;br /&gt;
&lt;br /&gt;
[[Image:XBee_USB_Board.jpg|thumb|left|XBee USB Board]]&lt;br /&gt;
&lt;br /&gt;
[http://www.droids.it/cmsvb4/content.php?143-990.001-XBee-Simple-Board XBee Simple Board]&lt;br /&gt;
&lt;br /&gt;
Simple breakout board with voltage regulator.&lt;br /&gt;
&lt;br /&gt;
[http://www.droids.it/cmsvb4/content.php?152-990.002-XBee-USB-Board XBee USB Board]&lt;br /&gt;
&lt;br /&gt;
Adapter with FTDI chip for direct USB connection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====PPZUAV====&lt;br /&gt;
&lt;br /&gt;
[[Image:FTDI_Utility_Board.jpg|thumb|left|FTDI Utility Board 1.0‎]]&lt;br /&gt;
&lt;br /&gt;
[https://www.ppzuav.com/osc/product_info.php?products_id=111 ppzuav.com product link]&amp;lt;br/&amp;gt;&lt;br /&gt;
More information at the [[Serial_Adapter#FTDI_utility_Board]] page.&lt;br /&gt;
&lt;br /&gt;
FTDI Utility Board 1.0  with FTDI232RL&amp;lt;br/&amp;gt;&lt;br /&gt;
On board XBEE connector and Molex Picoblade connectors. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Sparkfun====&lt;br /&gt;
&lt;br /&gt;
[[Image:XBee_Explorer_USB.jpg|thumb|left|XBee Explorer USB]]&lt;br /&gt;
&lt;br /&gt;
[http://www.sparkfun.com/products/8687 sparkfun.com]&lt;br /&gt;
&lt;br /&gt;
XBee Explorer USB with FTDI232RL&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Digi XBee Pro DigiMesh / 802.15.4 (&amp;quot;Series 1&amp;quot;) ===&lt;br /&gt;
*Note: Products based on XBee ZNet 2.5 (formerly Series 2) modules do not communicate with products based on XBee DigiMesh / 802.15.4 (formerly Series 1) modules.&lt;br /&gt;
&lt;br /&gt;
These relatively cheap and light modules implement the [http://www.zigbee.org/en/index.asp ZigBee/IEEE 802.15.4] norm. They allow up to 1.6km (1 mile) range (Paparazzi tested to 2.5km (1.5 miles)). The main drawback of using such 2.4Ghz modules for datalink is that it will interfere with the 2.4Ghz analog video transmitters and a inevitable decrease in range when in proximity to any wifi devices. For the plane, get the whip antenna version if you are not planning to build a custom antenna.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|[[Image:Xbee_Pro_USB_RF_Modem.jpg|thumb|left|XBee Pro USB Stand-alone Modem (XBP24-PKC-001-UA)]]&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 2.4GHz&lt;br /&gt;
* Output Power 100mW (Xbee Pro)&lt;br /&gt;
* Sensitivity  -100 dBm &lt;br /&gt;
* RF Data Rate Up to 250 Kbps&lt;br /&gt;
* Interface data rate Up to 115.2 Kbps&lt;br /&gt;
* Power Draw (typical) 214 mA TX / 55 mA RX &lt;br /&gt;
* Supply Voltage 3.3v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 1500m line-of-sight &lt;br /&gt;
* Dimensions 24 x 33mm&lt;br /&gt;
* Weight 4 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Chip antenna, ¼ monopole integrated whip antenna or a U.FL antenna connector (3 versions)&lt;br /&gt;
* Price: 16€, Pro 26€&lt;br /&gt;
|&lt;br /&gt;
[[Image:XBee_pro.jpg|thumb|left|XBee Pro OEM Modem]]&lt;br /&gt;
|}&lt;br /&gt;
Mouser: [http://au.mouser.com/Search/ProductDetail.aspx?qs=sGAEpiMZZMtJacPDJcUJYzVn8vIv7g2fIpf5DCzJqko%3d 888-XBP24-PKC-001-UA]&amp;lt;br&amp;gt;&lt;br /&gt;
NOTE: If you wish to use this unit with another XBee type other than the 802.15.4 (i.e. XBee-PRO ZB) then purchase a modem with the U.fl connector.&lt;br /&gt;
&lt;br /&gt;
==== Documentation ====&lt;br /&gt;
&lt;br /&gt;
* [http://www.maxstream.net/products/xbee/xbee-pro-oem-rf-module-zigbee.php  product page]&lt;br /&gt;
* [http://www.maxstream.net/products/xbee/datasheet_XBee_OEM_RF-Modules.pdf  datasheet]&lt;br /&gt;
* [http://www.maxstream.net/products/xbee/product-manual_XBee_OEM_RF-Modules.pdf  user manual]&lt;br /&gt;
* To program your Xbee you need X-CTU you can download it [http://www.digi.com/support/productdetl.jsp?pid=3352&amp;amp;osvid=57&amp;amp;tp=5&amp;amp;s=316 here]. (only windows)&lt;br /&gt;
* explanation on X-CTU [http://www.ladyada.net/make/xbee/configure.html here].&lt;br /&gt;
* [http://ftp1.digi.com/support/firmware/update/xbee/ Drivers for XB24 and XBP24 modules]&lt;br /&gt;
&lt;br /&gt;
=== Digi XBee Pro ZB / ZNet 2.5 (&amp;quot;Series 2&amp;quot;) ===&lt;br /&gt;
&lt;br /&gt;
The low-power XBee ZB and extended-range XBee-PRO ZB use the ZigBee PRO Feature Set for advanced mesh networking.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|[[Image:XBee_Pro_2SB.jpg|thumb|left|Digi XBee Pro ZB]]&lt;br /&gt;
|&lt;br /&gt;
* Low-cost, low-power mesh networking&lt;br /&gt;
* Interoperability with ZigBee PRO Feature Set devices from other vendors*&lt;br /&gt;
* Support for larger, more dense mesh networks&lt;br /&gt;
* 128-bit AES encryption&lt;br /&gt;
* Frequency agility&lt;br /&gt;
* Over-the-air firmware updates (change firmware remotely)&lt;br /&gt;
* ISM 2.4 GHz operating frequency&lt;br /&gt;
* XBee: 2 mW (+3 dBm) power output (up to 400 ft RF LOS range)&lt;br /&gt;
* XBee-PRO: 50 mW (+17 dBm) power output (up to 1 mile RF LOS range)&lt;br /&gt;
* RPSMA connector, U.FL connector, Chip antenna, or Wired Whip antenna&lt;br /&gt;
* price : 14€, Pro 28€&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
These are available from Mouser:&amp;lt;br&amp;gt;&lt;br /&gt;
[http://au.mouser.com/Search/Refine.aspx?Keyword=888-XBP24-Z7WIT-004 888-XBP24-Z7WIT-004] XBee-PRO ZB with whip antenna&amp;lt;br&amp;gt;&lt;br /&gt;
[http://au.mouser.com/Search/Refine.aspx?Keyword=XBP24-Z7SIT-004 888-XBP24-Z7SIT-004] XBee-PRO ZB with RPSMA&lt;br /&gt;
&lt;br /&gt;
See [[XBee_configuration|XBee Configuration]] for setup.&lt;br /&gt;
&lt;br /&gt;
==== Documentation ====&lt;br /&gt;
* [http://www.digi.com/products/wireless/zigbee-mesh/xbee-zb-module.jsp http://www.digi.com/products/wireless/zigbee-mesh/xbee-zb-module.jsp]&lt;br /&gt;
&lt;br /&gt;
=== Digi XBee Pro 868 ===&lt;br /&gt;
&lt;br /&gt;
'''WARNING - THESE MODEMS HAVE A 10% DUTY CYCLE, AND CURRENTLY HAVE SEVERE ISSUES WITH PAPARAZZI'''&lt;br /&gt;
&lt;br /&gt;
868MHz is a limited band. Please read the [[868MHz Issues]]&lt;br /&gt;
&lt;br /&gt;
XBee-PRO 868 modules are long range embedded RF modules for European applications. Purpose-built for exceptional RF performance, XBee-PRO 868 modules are ideal for applications with challenging RF environments, such as urban deployments, or where devices are several kilometers apart.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|[[Image:xbeeproxsc-rpsma.jpg|thumb|left|Maxstream XBee Pro 868]]&lt;br /&gt;
|&lt;br /&gt;
* 868 MHz short range device (SRD) G3 band for Europe&lt;br /&gt;
* Software selectable Transmit Power&lt;br /&gt;
* 40 km RF LOS w/ dipole antennas&lt;br /&gt;
* 80 km RF LOS w/ high gain antennas (TX Power reduced)&lt;br /&gt;
* Simple to use peer-to-peer/point-to-mulitpoint topology&lt;br /&gt;
* 128-bit AES encryption&lt;br /&gt;
* 500 mW EIRP&lt;br /&gt;
* 24 kbps RF data rate&lt;br /&gt;
* price : ~70 USD&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [[XBee_configuration#XBee_Pro_868_MHZ|XBee Configuration]] for setup.&lt;br /&gt;
&lt;br /&gt;
==== Documentation ====&lt;br /&gt;
* [http://www.digi.com/products/wireless/point-multipoint/xbee-pro-868.jsp http://www.digi.com/products/wireless/point-multipoint/xbee-pro-868.jsp]&lt;br /&gt;
&lt;br /&gt;
=== Digi XBee 868LP ===&lt;br /&gt;
&lt;br /&gt;
XBee 868LP modules are a low-power 868 MHz RF module for use in Europe. The range is shorter than it's brother the XBee PRO-868, but it can use the 868 G4 band with hopping which does not have restrictions on it's duty cycle. This is a big advantage if one want to have a good stream of telemetry data&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|[[Image:868lp.jpg|thumb|left|XBee 868LP]]&lt;br /&gt;
|&lt;br /&gt;
* 868 MHz short range device (SRD) G4 band for Europe&lt;br /&gt;
* 4 km RF LOS w/ u.fl antennas&lt;br /&gt;
* 5 mW EIRP&lt;br /&gt;
* 10 or 80 kbps RF data rate&lt;br /&gt;
* price : 18€&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Documentation ====&lt;br /&gt;
* [http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/zigbee-mesh-module/xbee-868lp#overview http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/zigbee-mesh-module/xbee-868lp#overview]&lt;br /&gt;
&lt;br /&gt;
==== Trial ====&lt;br /&gt;
&lt;br /&gt;
With a quickly crafted and not optimal positioned antenna on the airframe we managed to get the advertised 4000 meter range. Data throughput was not high and the Iridium Telemetry XML configuration document was therefore used. All in all, cheap, easy to setup, pin compatible with regular modules and quite a range and usable in Europe without hassle.&lt;br /&gt;
&lt;br /&gt;
=== Digi XBee Pro 900HP  ===&lt;br /&gt;
* Frequency band 900Mhz&lt;br /&gt;
* RF rate 10 or 200 kbps&lt;br /&gt;
* up to 250mW output power&lt;br /&gt;
* 5 to 8 grams&lt;br /&gt;
* price: 32€&lt;br /&gt;
&lt;br /&gt;
==== Documentation ====&lt;br /&gt;
[http://ftp1.digi.com/support/documentation/90002173_H.pdf http://ftp1.digi.com/support/documentation/90002173_H.pdf]&lt;br /&gt;
&lt;br /&gt;
=== Digi XBee Pro XSC 900MHz ===&lt;br /&gt;
&lt;br /&gt;
Maxstream has recently announced a promising new line of modems combining the small size and low cost of their popular Xbee line with the long range and 2.4 GHz video compatibility of their high end 900 MHz models.  Sounds like the perfect modem for anyone who can use 900 MHz.  Give them a try and post your results here!&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|[[Image:xbeeproxsc-rpsma.jpg|thumb|left|Maxstream XBee Pro XSC]]&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 900 MHz&lt;br /&gt;
* Output Power 100 mW (+20 dBm)&lt;br /&gt;
* Sensitivity  -100 dBm &lt;br /&gt;
* RF Rate: 10 or 20 kbps&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 24km (15 miles) line-of-sight &lt;br /&gt;
* Interface 20-pin mini connector (Xbee compatible pinout)&lt;br /&gt;
* RPSMA, integrated whip antenna or U.FL antenna connector (3 versions)&lt;br /&gt;
* price : 32€&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Documentation ====&lt;br /&gt;
* [http://www.digi.com/products/wireless/point-multipoint/xbee-pro-xsc.jsp http://www.digi.com/products/wireless/point-multipoint/xbee-pro-xsc.jsp]&lt;br /&gt;
&lt;br /&gt;
==== Trials ====&lt;br /&gt;
Tested one today and it worked great. Going to try a multiUAV test with it soon&lt;br /&gt;
--Danstah&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
MultiUAV tests concluded this is probably not the best module to use. Even though it says you can change the baudrate inside x-ctu that is not the case, it is fixed at 9600 bps. This is a great modem however for single UAV's and I do recommend.&lt;br /&gt;
--Danstah&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Why would the European (868 MHz) be good to 24kbps and this only to 9600?  When I was altering my XBees (2.4Ghz Pro's) I had this problem altering baud rates until I read you have to send a &amp;quot;commit and reboot&amp;quot; type command after setting the baud rate. Could this be the case? --GR&lt;br /&gt;
&lt;br /&gt;
=== Digi 9XTend ===&lt;br /&gt;
&lt;br /&gt;
These larger units have been tested on the 900Mhz band, but are also available in 2.4Ghz.  They are a bit on the heavy side, about 20 grams, but give good performance at range. They have adjustable transmit power settings from 100mW to 1W.  Testing has shown range up to 5.6km (3.5 Miles) with XTend set to 100mW with small 3.1dB dipole antenna.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
[[Image:XTend_USB_RF_Modem.jpg|frame|left|9XTend USB Modem]]&lt;br /&gt;
|&lt;br /&gt;
* Frequency Band 900Mhz and 2.4Ghz (2 versions)&lt;br /&gt;
* Output Power 1mW to 1W software selectable&lt;br /&gt;
* Sensitivity  -110 dBm (@ 9600 bps)&lt;br /&gt;
* RF Data Rate 9.6 or 115.2 Kbps&lt;br /&gt;
* Interface data rate up to 230.4 Kbps&lt;br /&gt;
* Power Draw (typical) 730 mA TX / 80 mA RX &lt;br /&gt;
* Supply Voltage 2.8 to 5.5v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 64km line-of-sight &lt;br /&gt;
* Dimensions 36 x 60 x 5mm&lt;br /&gt;
* Weight 18 grams&lt;br /&gt;
* Interface 20-pin mini connector or USB&lt;br /&gt;
* RF connector RPSMA (Reverse-polarity SMA) or MMCX (2 versions)&lt;br /&gt;
* price : 150€&lt;br /&gt;
|&lt;br /&gt;
[[Image:Xtend_module.jpg|frame|left|9XTend OEM Modem]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Pinout ====&lt;br /&gt;
&lt;br /&gt;
[[Image:Maxstream_9XTend_Pinout.gif|thumb|left|Maxstream 9XTend Pinout]]&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||'''''9XTend 20-pin Header'''''||'''''Name'''''||'''''Tiny Serial-1 Header'''''||'''''Notes'''''&lt;br /&gt;
|-&lt;br /&gt;
||1||GND||1 (GND)||Ground &lt;br /&gt;
|-&lt;br /&gt;
||2||VCC||2 (5V)||5V power (150mA - 730mA Supplied from servo bus or other 5V source)&lt;br /&gt;
|-&lt;br /&gt;
||5||RX||8 (TX)||3-5V TTL data input - connect to Tiny TX&lt;br /&gt;
|-&lt;br /&gt;
||6||TX||7 (RX)||5V TTL data output - connect to Tiny RX&lt;br /&gt;
|-&lt;br /&gt;
||7||Shutdown||2||This pin must be connected to the 5V bus for normal operation&lt;br /&gt;
|}&lt;br /&gt;
Notes:&amp;lt;br&amp;gt;&lt;br /&gt;
* 9XTend can run on voltages as low as 2.8V but users are strongly advised against connecting any modem (especially high power models) to the sensitive 3.3V bus supplying the autopilot processor and sensors.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Documentation ====&lt;br /&gt;
&lt;br /&gt;
* [http://www.maxstream.net/products/xtend/oem-rf-module.php product page]&lt;br /&gt;
* [http://www.maxstream.net/products/xtend/datasheet_XTend_OEM_RF-Module.pdf datasheet]&lt;br /&gt;
* [http://www.maxstream.net/products/xtend/product-manual_XTend_OEM_RF-Module.pdf user manual]&lt;br /&gt;
&lt;br /&gt;
==== Configuration ====&lt;br /&gt;
&lt;br /&gt;
These modems need to be carefully configured based on your usage scenario to obtain the best possible range and link quality. In addition, it is always good to make sure the firmware is up to date.&lt;br /&gt;
&lt;br /&gt;
Some typical configurations that may work well, but can still depend your particular situation, are given below. For further details, be sure to consult the XTend users manual. Your application may need a different or modified configuration. The radiomodems do not need identical settings and can in fact be optimized with different settings. A good example is delays and retries: if each radio has the same number of retries and no delay, when a collision occurs each will continuously try to re-transmit, locking up the transmission for some time with no resolution or successful packet delivery. Instead, it is best to set the module whose data should have a lower latency to have no delay and a lower number of retries, while the other module has a delay set (RN &amp;gt; 0) and a greater number of retries. See acknowledged mode example below.&lt;br /&gt;
&lt;br /&gt;
* Acknowledged Polling Mode ('''Recommended'''):&lt;br /&gt;
** This causes one radio to be the base and the other(s) to be the remote(s). It eliminates collisions because remotes do not send data unless requested by the base. It can work in acknowledged mode (RR&amp;gt;0), basic reliable mode (MT&amp;gt;0) or in basic mode (no acknowledgement or multiple packets). It is recommended that the lower latency and/or higher data rate side be configured as the base (i.e. if you are sending lots of telemetry then the air module configured as the base is probably a good idea, but if you are using datalink joystick control, the ground side might be better as the base. It may require some experimentation).&lt;br /&gt;
* Acknowledged Point-to-(Multi)Point Mode:&lt;br /&gt;
** Each radio sends a packet and requests and acknowledgement that the packet was sent from the receiving side. The retries and delays must be set appropriately to ensure packet collisions are dealt with appropriately. It can also work without acknowledgements in basic reliable mode (MT&amp;gt;0) without any acknowledgements (RR=0, MT=0). Some experimentation may be required.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||'''''Setting Name'''''||colspan=&amp;quot;2&amp;quot;|'''''Acknowledged Mode'''''||colspan=&amp;quot;2&amp;quot;|'''''Polling Mode (Acknowledged)'''''||'''''Notes'''''&lt;br /&gt;
|-&lt;br /&gt;
|| ||'''''Airside Module'''''||'''''Groundside Module'''''||'''''Base Module'''''||'''''Remote Module'''''||&lt;br /&gt;
|-&lt;br /&gt;
||BD||6||6||6||6||Adjust to match your configured autopilot and ground station baud rates (default for these is 57600bps)&lt;br /&gt;
|-&lt;br /&gt;
||DT||default||default||0x02||0x01||Can be adjusted if consistency maintained across addressing functionalities (see manual)&lt;br /&gt;
|-&lt;br /&gt;
||MD||default||default||3 (0x03)||4 (0x04)||&lt;br /&gt;
|-&lt;br /&gt;
||MT||0||0||0||0||Use this to enable Basic Reliable transmission, link bandwidth requirement increases (see manual)&lt;br /&gt;
|-&lt;br /&gt;
||MY||default||default||0x01||0x02||Can be adjusted if consistency maintained across addressing functionalities (see manual)&lt;br /&gt;
|-&lt;br /&gt;
||PB||default||default||0x02||default||Can be adjusted if consistency maintained across addressing functionalities (see manual)&lt;br /&gt;
|-&lt;br /&gt;
||PD||default||default||default||default||Can be adjusted to increase polling request rate and DI buffer flush timeout (see manual)&lt;br /&gt;
|-&lt;br /&gt;
||PE||default||default||0x02||default||Can be adjusted if consistency maintained across addressing functionalities (see manual)&lt;br /&gt;
|-&lt;br /&gt;
||PL||default||default||default||default||''Transmit power level should be reduced for lab testing!!''&lt;br /&gt;
|-&lt;br /&gt;
||RN||0 (0x00)||8 (0x08)||default||default||&lt;br /&gt;
|-&lt;br /&gt;
||RR||6 (0x06)||12 (0x0C)||6 (0x06)||12 (0x0C)||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Note:''' All settings are assumed to be default except those listed. Those listed are in decimal unless hex 0x prefix included. Depending on your firmware version, slight modifications may be necessary.&lt;br /&gt;
&lt;br /&gt;
Here is some additional information and alternative instructions to configure the polling mode from the Digi site: [http://www.digi.com/support/kbase/kbaseresultdetl?id=2178 Polling Mode for the 9XTend Radio Modem]&lt;br /&gt;
&lt;br /&gt;
== SiLabs Si1000 SoC based modems ==&lt;br /&gt;
&lt;br /&gt;
The Si1000 radio System on Chip (SOC) produced by  SiLabs is found in a number of radio modules, for example the cheap and widely used HopeRf module. There is [https://github.com/RFDesign/SiK open source firmware] for these radios which makes them suitable for use in MAVs. &lt;br /&gt;
&lt;br /&gt;
The latest SiK firmware supports also mesh topologies.&lt;br /&gt;
&lt;br /&gt;
Online documentation for the Sik firmware shows how to configure it for various jurisdictions. The firmware supports 433 MHz, 470 MHz, 868 MHz and 900 MHz radios. The new RFD868 also orks in the European spectrum licences (868 MHz) &lt;br /&gt;
&lt;br /&gt;
Note: When using a SiK firmware radio with paparazzi, you should set &amp;quot;ATS6=0&amp;quot; (MavLink packing off) and configure paparazzi for transparent serial mode. Better still create a special module to na=make full use of the RFDxxx modem&lt;br /&gt;
&lt;br /&gt;
[http://www.rfdesign.com.au/index.php/rfd900 This module] is well proven and supports antenna diversity. A combination of 6dbi Yagi plus a dipole on the ground station, with a pair of  orthogonality oriented dioples in the airframe, has been extensively tested and proven reliable at &amp;gt;8km range (theoretical range of &amp;gt; ~40km).&lt;br /&gt;
&lt;br /&gt;
Alternatively, for shorter range a pair of cheap generic HopeRF-based modems [http://rctimer.com/index.php?gOo=goods_details.dwt&amp;amp;goodsid=815 such as these]&lt;br /&gt;
&lt;br /&gt;
The RFD900 can be paired with cheap generic (single front-end) modules, if for example you use a small short range airframe with a ground station that's also used for long range operations.&lt;br /&gt;
&lt;br /&gt;
== Laird (ex Aerocom) ==&lt;br /&gt;
Lairds's API mode is already implemented but some system integration is required. Full API more with addressed packets works well and was tested with AC4790-1x1 5mW low power modules. Maximim range achieved with a whip quater-wave antenna was 1Km.&lt;br /&gt;
&lt;br /&gt;
How to use this modem on ground station side? [http://paparazzi.enac.fr/wiki/index.php/User:SilaS#SDK-AC4868-250_ground_modem_part]&lt;br /&gt;
&lt;br /&gt;
See folder paparazzi3 / trunk / sw / aerocomm. It has all the required files to use this modem on the airborne and ground station side. The link.ml file is a direct replacement of the &amp;quot;main&amp;quot; link.ml file of the ground sttaion and will be merged into it in the future.. or you can do it as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
=== AC4790-200 ===&lt;br /&gt;
* Frequency 902-928MHz (North America, Australia, etc).&lt;br /&gt;
* Output Power 5-200mW&lt;br /&gt;
* Sensitivity (@ full RF data rate) -110dB&lt;br /&gt;
* RF Data Rate up to 76.8 Kbps&lt;br /&gt;
* INterface Data Rate Up to Up to 115.2 Kbps &lt;br /&gt;
* Power Draw (typical) 68 mA&lt;br /&gt;
* Supply Voltage 3.3v &amp;amp; 5.5V&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 6.4 kilometers line-of-sight &lt;br /&gt;
* Dimensions 42 x 48 x 5mm &lt;br /&gt;
* Weight &amp;lt; 20 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Antenna MMCX jack Connector or internal&lt;br /&gt;
* price : 52€&lt;br /&gt;
|&lt;br /&gt;
[[Image:ac4868_transceiver.jpg|thumb|left|AC4868 OEM Modem]]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
=== AC4790-1000 ===&lt;br /&gt;
* Frequency 902-928MHz (North America, Australia, etc).&lt;br /&gt;
* Output Power 5-1000mW&lt;br /&gt;
* Sensitivity (@ full RF data rate) -99dB&lt;br /&gt;
* RF Data Rate up to 76.8 Kbps&lt;br /&gt;
* INterface Data Rate Up to Up to 115.2 Kbps &lt;br /&gt;
* Power Draw (typical) 650 mA&lt;br /&gt;
* Supply Voltage 3.3V only&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) Up to 32 kilometers with high-gain antenna&lt;br /&gt;
* Dimensions 42 x 48 x 5mm &lt;br /&gt;
* Weight &amp;lt; 20 grams&lt;br /&gt;
* Interface 20-pin mini connector  &lt;br /&gt;
* Antenna MMCX jack Connector&lt;br /&gt;
* price : 64€&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Pinout ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Aerocomm_AC4868_pinout.jpg|thumb|left|Laird AC4868 modem pinout]]&lt;br /&gt;
[[Image:Aerocomm_AC4490-200_wired.jpg|thumb|left|Laird AC4490 wiring example]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|+ Wiring the Laird AC4868 to the Tiny&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||'''''AC4868 20-pin Header'''''||'''''Name'''''||'''''Color'''''||'''''Tiny v1.1 Serial-1'''''||'''''Tiny v2.11 Serial'''''||'''''Notes'''''&lt;br /&gt;
|-&lt;br /&gt;
||2||Tx||green||7||7||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||3||Rx||blue||8||8||''(Note 1)''&lt;br /&gt;
|-&lt;br /&gt;
||5||GND||black||1||1|| -&lt;br /&gt;
|-&lt;br /&gt;
||10+11||VCC||red||2||3||+3.3v ''(Note 2)''&lt;br /&gt;
|-&lt;br /&gt;
||17||C/D||white||3||?||Low = Command High = Data&lt;br /&gt;
|}&lt;br /&gt;
''Note 1 : names are specified with respect to the AEROCOMM module''&lt;br /&gt;
&lt;br /&gt;
''Note 2 : AC4790-1000 needs pins 10 and 11 jumped to work properly''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Laird RM024 ===&lt;br /&gt;
[[Image:Laird_LT2510_RM024-P125-C-01-side.jpg|thumb|RM024 P125]]&lt;br /&gt;
[[Image:Lt2510_prm123.jpg|thumb|LT2510 Modem]]&lt;br /&gt;
The RM024 replaces the discontinued LT2510 (they are backwards compatible).&lt;br /&gt;
&lt;br /&gt;
General features:&lt;br /&gt;
* Frequency Band 2.4GHz&lt;br /&gt;
* Output Power 2,5mW - 125mW&lt;br /&gt;
* Sensitivity  -98dbm @ 280kbps/-94 dBm @ 500kbps&lt;br /&gt;
* RF Data Rate 280/500 kbps&lt;br /&gt;
* UART up to 460800 baud&lt;br /&gt;
* Power Draw 90mA - 180mA TX / 10mA RX&lt;br /&gt;
* Supply Voltage 3.3v&lt;br /&gt;
* Range up to 4000m&lt;br /&gt;
* Dimensions 26 x 33 x 4mm&lt;br /&gt;
* Weight 4 grams&lt;br /&gt;
* Interface 20-pin mini connector (smd solder pad or XBee compatible pin header)&lt;br /&gt;
* Chip antenna, U.FL antenna connector or both&lt;br /&gt;
* Price: 29-31€ @ mouser (SMD / XBEE header)&lt;br /&gt;
&lt;br /&gt;
Two different mounting/pinuts are available:&amp;lt;br/&amp;gt;&lt;br /&gt;
* smd version: can be soldered on a pcb&amp;lt;br/&amp;gt;&lt;br /&gt;
* pin header: standard XBEE pinout (this is the SMD version mounted on a seperate pcb with male pin headers)&lt;br /&gt;
&lt;br /&gt;
Available in two different output power versions:&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
||''value''||''50mW version''||''125mW version''&lt;br /&gt;
|-&lt;br /&gt;
|output power&lt;br /&gt;
| 2,5 mW - 50 mW&lt;br /&gt;
| 2,5 mW - 125 mW&lt;br /&gt;
|-&lt;br /&gt;
|output power dbm&lt;br /&gt;
|4 dbm - 17 dbm&lt;br /&gt;
|4 dbm - 21 dbm&lt;br /&gt;
|-&lt;br /&gt;
|TX drain&lt;br /&gt;
|90mA&lt;br /&gt;
|&amp;lt;180mA&lt;br /&gt;
|-&lt;br /&gt;
|max range (280kbps with 2 dbi antenna)&lt;br /&gt;
|2400m&lt;br /&gt;
|4000m&lt;br /&gt;
|-&lt;br /&gt;
|approval&lt;br /&gt;
|CE for EU, FCC/IC for USA,&lt;br /&gt;
Canada PRM122/123 also for Japan&lt;br /&gt;
|FCC/IC for USA, Canada &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The RM024 uses frequency hopping (FHSS) which needs a client/server model. That means that one modem (most appropriately the ground station modem) needs to be set to server mode. It will transmit a beacon message and have all client modems synchronize to that in a time and frequency hopping scheme manner. For that all modems need to have the same channel (in fact the hopping scheme) and system-id. Clients can be set to auto-channel and auto-system-id to follow any/the first visible server.&lt;br /&gt;
&lt;br /&gt;
====Documentation====&lt;br /&gt;
[http://www.lairdtech.com/WorkArea/DownloadAsset.aspx?id=2147488576 RM024 User Manual]&amp;lt;br/&amp;gt;&lt;br /&gt;
[http://www.lairdtech.com/WorkArea/linkit.aspx?LinkIdentifier=id&amp;amp;ItemID=4379 LT2510 User Manual]&amp;lt;br/&amp;gt;&lt;br /&gt;
[http://www.lairdtech.com/zips/Developer_Kit.zip Windows configuration tool]&lt;br /&gt;
&lt;br /&gt;
'''Setup'''&lt;br /&gt;
&lt;br /&gt;
Look at the [[Laird_RM024_setup page]]&lt;br /&gt;
&lt;br /&gt;
== Bluetooth ==&lt;br /&gt;
These modems do not give you a great range but Bluetooth can be found in a lot of recent laptops built-in. Maybe not useful for fixed wing aircrafts it might be used for in-the-shop testing or quadcopters. Make sure you get a recent Class 1 EDR 2.0 stick if you buy one for your computer.&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
=== RN-41 Bluetooth module(Sparkfun's WRL-08497) ===&lt;br /&gt;
* Frequency Band 2.4GHz&lt;br /&gt;
* Output Power 32 mW &lt;br /&gt;
* RF Data Rate up to ~300 kbps in SPP&lt;br /&gt;
* Interface Data Rate up to 921 kbps &lt;br /&gt;
* Power Draw (typical) 50 mA TX / 40 mA RX &lt;br /&gt;
* Supply Voltage 3.3v&lt;br /&gt;
* Range (typical, depends on antenna &amp;amp; environment) 100 meters line-of-sight &lt;br /&gt;
* Dimensions 26 x 13 x 2mm &lt;br /&gt;
* Weight ~1.5 grams&lt;br /&gt;
* Interface solder connector  &lt;br /&gt;
* price : 20€&lt;br /&gt;
|&lt;br /&gt;
[[Image:roving_nw_wiring.jpg|thumb|Roving Networks modem wiring]]&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
&lt;br /&gt;
To connect to it, get the MAC address of the bluetooth modem&lt;br /&gt;
&lt;br /&gt;
 me@mybox:~$ hcitool scan&lt;br /&gt;
 Scanning ...&lt;br /&gt;
        00:06:66:00:53:AD       FireFly-53AD&lt;br /&gt;
&lt;br /&gt;
either make a virtual connection to a Bluetooth serial port each time you connect&lt;br /&gt;
&lt;br /&gt;
 sudo rfcomm bind 0 00:06:66:00:53:AD&lt;br /&gt;
&lt;br /&gt;
or configure it once in /etc/bluetooth/rfcomm.conf&lt;br /&gt;
&lt;br /&gt;
 rfcomm0 {&lt;br /&gt;
   bind yes;&lt;br /&gt;
   device 00:06:66:00:53:AD;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
now you can use Bluetooth as '''/dev/rfcomm0''' with the Paparazzi 'link'. You might need to restart 'link' in case you get out of range and it disconnects (tbd). Set the Tiny serial speed to 115200 as the modules come preconfigured to that.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== WiFi ==&lt;br /&gt;
&lt;br /&gt;
== ESP8266 Chip Module ==&lt;br /&gt;
&lt;br /&gt;
[[File:ESP8266.jpg|thumbnail|left|ESP8266 WiFi module]]&lt;br /&gt;
&lt;br /&gt;
To have a simple connection from your GCS to your autopilot, one can use your GCS computer built-in WiFi to establish a dataconnection. THe only thing you need is a WiFimodule connected to your Autopilot dataport and a laptop or other GCS device with Wifi.&lt;br /&gt;
&lt;br /&gt;
Flash the Wifimodule with [https://github.com/beckdac/ESP8266-transparent-bridge transparent bridge firwmware] using [https://github.com/themadinventor/esptool esptool]. When connected through WiFi, you can use telnet to set the baud rate.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 telnet 192.168.4.1&lt;br /&gt;
 +++AT BAUD 57000&lt;br /&gt;
&lt;br /&gt;
To use with paparazzi GCS, the TCP signals need to be tunnelled to a virtual serial device. This was accomplished with the &amp;quot;socat&amp;quot; command&lt;br /&gt;
&lt;br /&gt;
 $ socat -d -d PTY,link=/dev/mywifi TCP:192.168.4.1:23&lt;br /&gt;
&lt;br /&gt;
Satar up Paparazzi Center and make line like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Telemetry via Video Transmitter==&lt;br /&gt;
&lt;br /&gt;
[[Image:video_tx_small.jpg|thumb|2.4GHz Video Transmitter]]&lt;br /&gt;
In order for the UAV to transmit video from an onboard camera, an analog video transmitter can be used.  These vary in power, and thus range, and run normally on 2.4Ghz.  Small UAVs can get about 600m of range from the 50mW version, and extended range can be achieved using units up to 1W.  Weight for these units varies from a couple grams to about 30 for the 1W with shielding.  Please check for your countries regulations on 2.4Ghz transmission, as each is different. &lt;br /&gt;
&lt;br /&gt;
It is possible to use the audio channel to send simple telemetry data to the groundstation. Uploading telemetry not possible via analog audio transmitter only.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Antennas ==&lt;br /&gt;
&lt;br /&gt;
Here are some examples of lightweight and efficient 868MHz antennas developped by the RF laboratory at ENAC.&lt;br /&gt;
[[Image:868mhz_twinstar_antenna_1.jpg|thumb|left|868MHz copper foil antenna attached to the aircraft tail]] &lt;br /&gt;
[[Image:868mhz_twinstar_antenna_2.jpg|thumb|left|868MHz copper foil antenna bottom view]] &lt;br /&gt;
[[Image:868mhz_ground_antenna.jpg|thumb|left|868MHz ground antenna]] &lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This wiki page might give some ideas about antennas: http://en.wikipedia.org/wiki/Dipole_antenna&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Connectors_and_Wiring&amp;diff=20723</id>
		<title>Connectors and Wiring</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Connectors_and_Wiring&amp;diff=20723"/>
		<updated>2016-01-07T15:00:49Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Hirose DF13 series look pretty similar to the Molex Picoblade, although they have a different form factor and may not fit! &amp;lt;br/&amp;gt;&lt;br /&gt;
Check the type of connector before ordering (3D Robotics and HK/Chinese manufacturers may use one of these connector types).&lt;br /&gt;
&lt;br /&gt;
== Molex PicoBlade™ 1.25mm (.049&amp;quot;) Pitch Connector System ==&lt;br /&gt;
&lt;br /&gt;
[[Image:molex_plug.gif|thumb|Molex plug]]&lt;br /&gt;
&lt;br /&gt;
Paparazzi autopilots use [http://www.molex.com/cgi-bin/bv/molex/jsp/family/intro.jsp?BV_SessionID=@@@@1727607529.1210263742@@@@&amp;amp;BV_EngineID=cccdadedmmeeehecflgcehedffgdfmk.0&amp;amp;oid=-10261&amp;amp;channel=Products&amp;amp;familyOID=-10261&amp;amp;frellink=Introduction&amp;amp;chanName=family&amp;amp;pageTitle=PicoBlade&amp;amp;#153;%20|%20Overview 1.25mm Molex PicoBlade™] headers for all connections.  Users must make their own wiring harnesses by either crimping the molex terminal pins onto their wiring or soldering pre-crimped wires to their peripherals.&lt;br /&gt;
* Be sure to order plenty of 1.25mm [[Media:molex-female-510210200_sd.pdf|Molex plugs]] (female)&lt;br /&gt;
* Current: 1.0A&lt;br /&gt;
* Wires are available (post sources) with pins already crimped - simply trim and solder these to your peripherals and assemble them into the Molex plugs. Try [http://www.farnell.com/ Farnell] Part number 112-5276 or 112-5274, RS-Components [http://uk.rs-online.com/web/search/searchBrowseAction.html?method=searchProducts&amp;amp;searchTerm=279-9516&amp;amp;x=0&amp;amp;y=0 279-9516] or [http://uk.rs-online.com/web/search/searchBrowseAction.html?method=searchProducts&amp;amp;searchTerm=279-9544&amp;amp;x=30&amp;amp;y=20 279-9544]. In the US Newark has them. Part number [http://www.newark.com/jsp/search/productdetail.jsp?sku=93K4876 93K4876] ~$10 for 10 300mm wires with a socket on each end.&lt;br /&gt;
&lt;br /&gt;
=== 1.25mm (0.049&amp;quot;) Pitch PicoBlade Receptacle (Female) ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Molex_crimp.jpg|thumb|Inserting a Molex crimp]]&lt;br /&gt;
&lt;br /&gt;
These are the connector housings, used in the wiring harness and not the PCB&lt;br /&gt;
&lt;br /&gt;
* [http://www.mouser.com/search/ProductDetail.aspx?R=51021-0200virtualkey53810000virtualkey538-51021-0200 51021-0200] 1.25mm Molex PicoBlade Receptacle 2pos&lt;br /&gt;
* [http://www.mouser.com/search/ProductDetail.aspx?R=51021-0300virtualkey53810000virtualkey538-51021-0300 51021-0300] 1.25mm Molex PicoBlade Receptacle 3pos&lt;br /&gt;
* [http://www.mouser.com/Search/ProductDetail.aspx?qs=ILqg114nvd6Z%252bmZXFEtu8g%3d%3d 51021-0400] 1.25mm Molex PicoBlade Receptacle 4pos&lt;br /&gt;
* [http://www.mouser.com/search/ProductDetail.aspx?R=51021-0500virtualkey53810000virtualkey538-51021-0500 51021-0500] 1.25mm Molex PicoBlade Receptacle 5pos&lt;br /&gt;
* [http://www.mouser.com/Search/ProductDetail.aspx?qs=hSmm4fxMIuNmj4UzNb1XZA%3d%3d 51021-0700] 1.25mm Molex PicoBlade Receptacle 7pos&lt;br /&gt;
* [http://www.mouser.com/search/ProductDetail.aspx?R=51021-0800virtualkey53810000virtualkey538-51021-0800 51021-0800] 1.25mm Molex PicoBlade Receptacle 8pos&lt;br /&gt;
* [http://www.mouser.com/search/ProductDetail.aspx?R=51021-1000virtualkey53810000virtualkey538-51021-1000 51021-1000] 1.25mm Molex PicoBlade Receptacle 10pos&lt;br /&gt;
&lt;br /&gt;
=== 1.25mm (0.049&amp;quot;) Female Crimp Terminals ===&lt;br /&gt;
&lt;br /&gt;
The 1.25mm terminals are extremely small and ''cannot and should not be soldered, crimped with pliers, or attached by any tool other than the genuine Molex crimper.'' Remember that if a wire comes loose, any wire, the plane will crash!&lt;br /&gt;
&lt;br /&gt;
* [http://www.mouser.com/search/ProductDetail.aspx?R=50058-8000virtualkey53810000virtualkey538-50058-8000 Mouser 50058-8000] 28-32 tape ($0.04-0.07 USD based on qty)&lt;br /&gt;
* [http://www.mouser.com/search/ProductDetail.aspx?R=50079-8000virtualkey53810000virtualkey538-50079-8000 Mouser 50079-8000] 26-28 tape ($0.03-0.07 USD based on qty)&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
* [http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&amp;amp;name=WM1142CT-ND Digi-Key WM1142CT-ND] 26-28 AWG&lt;br /&gt;
* [http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&amp;amp;name=WM1775-ND Digi-Key WM1775-ND] 28-32 AWG&lt;br /&gt;
&lt;br /&gt;
[[Image:molex_pin.gif|thumb|Molex pin]]&lt;br /&gt;
&lt;br /&gt;
=== Crimpers ===&lt;br /&gt;
&lt;br /&gt;
[[Image:molex_crimper.jpg|thumb|Molex Crimper]]&lt;br /&gt;
&lt;br /&gt;
Crimpers are available from Mouser or Digi-Key for approximately $200 USD and will prove worthwhile for most users.  The fact that Wire-to-Wire Plugs are available should make this Crimper an even more worthwhile investment.&lt;br /&gt;
&lt;br /&gt;
* Strip Length should be between 1.40 to 1.90mm&lt;br /&gt;
* Wire Insulation Range should be &amp;lt; 1.0mm with the 28-32AWG Terminals and &amp;lt; 1.04mm with the 26-28AWG Terminals&lt;br /&gt;
&lt;br /&gt;
* [http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&amp;amp;name=WM9984-ND Digi-Key WM9984-ND] for 26-32 AWG wire&lt;br /&gt;
* [http://www.mouser.com/search/refine.aspx?Ntt=63811-0300 P/N# 63811-0300] for 28-26 AWG wire (obsolete)&lt;br /&gt;
* [http://www.mouser.com/search/refine.aspx?Ntt=63811-0200 P/N# 63811-0200] for 32-28 AWG wire (obsolete)&lt;br /&gt;
&lt;br /&gt;
=== 1.25mm (0.049&amp;quot;) Pitch PicoBlade Plug (Male, Wire-to-wire) ===&lt;br /&gt;
&lt;br /&gt;
These Plugs are for Wire-to-Wire connections and they are not required.  Their reference here is for convenience only.&lt;br /&gt;
&lt;br /&gt;
* [http://www.mouser.com/search/ProductDetail.aspx?R=51047-0200virtualkey53810000virtualkey538-51047-0200 51047-0200] 1.25mm Molex PicoBlade Plug 2pos&lt;br /&gt;
* [http://www.mouser.com/search/ProductDetail.aspx?R=51047-0300virtualkey53810000virtualkey538-51047-0300 51047-0300] 1.25mm Molex PicoBlade Plug 3pos&lt;br /&gt;
* [http://www.mouser.com/search/ProductDetail.aspx?R=51047-0400virtualkey53810000virtualkey538-51047-0400 51047-0400] 1.25mm Molex PicoBlade Plug 4pos&lt;br /&gt;
* [http://www.mouser.com/search/ProductDetail.aspx?R=51047-0500virtualkey53810000virtualkey538-51047-0500 51047-0500] 1.25mm Molex PicoBlade Plug 5pos&lt;br /&gt;
* [http://www.mouser.com/search/ProductDetail.aspx?R=51047-0600virtualkey53810000virtualkey538-51047-0600 51047-0600] 1.25mm Molex PicoBlade Plug 6pos&lt;br /&gt;
* [http://www.mouser.com/search/ProductDetail.aspx?R=51047-0700virtualkey53810000virtualkey538-51047-0700 51047-0700] 1.25mm Molex PicoBlade Plug 7pos&lt;br /&gt;
* [http://www.mouser.com/search/ProductDetail.aspx?R=51047-0800virtualkey53810000virtualkey538-51047-0800 51047-0800] 1.25mm Molex PicoBlade Plug 8pos&lt;br /&gt;
* [http://www.mouser.com/search/ProductDetail.aspx?R=51047-0900virtualkey53810000virtualkey538-51047-0900 51047-0900] 1.25mm Molex PicoBlade Plug 9pos&lt;br /&gt;
* [http://www.mouser.com/search/ProductDetail.aspx?R=51047-1000virtualkey53810000virtualkey538-51047-1000 51047-1000] 1.25mm Molex PicoBlade Plug 10pos&lt;br /&gt;
&lt;br /&gt;
=== 1.25mm (0.049&amp;quot;) Male Crimp Terminals ===&lt;br /&gt;
&lt;br /&gt;
These Crimp Terminals are for Wire-to-Wire connections and they are not required.  Their reference here is for convenience only.&lt;br /&gt;
&lt;br /&gt;
* [http://www.mouser.com/search/ProductDetail.aspx?R=50133-8000virtualkey53810000virtualkey538-50133-8000 50133-8000] 28-32 tape &lt;br /&gt;
* [http://www.mouser.com/search/ProductDetail.aspx?R=50125-8000virtualkey53810000virtualkey538-50125-8000 50125-8000] 26-28 tape &lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pre-Crimped Connectors from eBay China (Molex Picoblade) ===&lt;br /&gt;
&lt;br /&gt;
(These are the standard Molex Picoblade connector)&lt;br /&gt;
&lt;br /&gt;
You can find 10pcs female crimp terminals with 10cm wire and and 10 male terminals in a bundle for around 5€&lt;br /&gt;
Search for: &amp;quot;mini/micro jst 10pcs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This is very nice if you do not have a crimp tool and want the cheapest connectors with wires on the market.&lt;br /&gt;
Note: the male terminals in 1.25mm pitch and are trough hole technology&lt;br /&gt;
Be careful, most SMD male terminals are 1mm pitch and can't be used on the [[Lisa/M]] which has 1.25mm pitch.&lt;br /&gt;
&lt;br /&gt;
== Power Supply ==&lt;br /&gt;
For reference, Matthew Currie is assembling his Tiny(s) with WS Deans Micro 2R connectors for power as they are a commonly available R/C connector and are of high quality and durability.  They do not have a positive lock mechanism but insert under a lot of pressure.  They do not require any special crimping tools and withstand up to 15A.&lt;br /&gt;
&lt;br /&gt;
[[Image:Wsdm3007.png]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
Wiring is a critical part of any autonomous vehicle and the importance of high quality reliable wiring cannot be stressed enough.  The Molex connectors work best with 0.4mm (26AWG) wire though can also be used with 0.3mm (29AWG) on extremely lightweight models.  Larger sizes will not fit.  High strand-count wire is strongly advised as it is much less prone to failure from fatigue.  The insulation type is critical: silicone is extremely flexible and heat resistant but easily cut or torn, teflon is extremely heat and abrasion resistant but not very flexible.  Either choice is good though teflon is more durable and readily available.  Standard plastic/vinyl insulated wire does not solder well (insulation melts) and does not crimp well - the vinyl insulation provides little or no strength and wires tend to break at the solder or crimp joints.  Some recommended wire sources are:&lt;br /&gt;
*Alpha 19 strand Teflon insulated 26AWG wire: [http://www.mouser.com/search/refine.aspx?Ntt=2843%2f19 Mouser P/N: 2843/19]&lt;br /&gt;
*[http://www.rdswire.com/ RDS Wire] sells very high strand count (66 strands!) 26AWG and 29AWG silicone wire for around $0.60 to $1 per foot in quantity but they mostly deal with very large production orders and may or may not have small quantities available for a reasonable price.  Call them for details.&lt;br /&gt;
*[http://www.hobby-lobby.com/hobby-wire.htm Hobby-Lobby] has a great selection of larger silicone wire at great prices but this wire is only useful for motors and batteries.  The 0.5mm wire they offer has ''very thick'' silicone insulation and will not fit into the Molex connectors.&lt;br /&gt;
*A convenient female USB mini-B receptacle ( [http://www.mouser.com/search/refine.aspx?Ntt=500075-0517 Mouser P/N: 500075-0517]) permits soldering directly without a PCB&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]] [[Category:User_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Developer_Guide&amp;diff=20722</id>
		<title>Developer Guide</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Developer_Guide&amp;diff=20722"/>
		<updated>2016-01-07T14:54:06Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
By the time you land on this page, you probably want to enhance the Paparazzi project, that is really good for your karma and really appreciated by the Paparazzi community. We welcome contributions and improvements to the documentation.&lt;br /&gt;
[[Image:FixIt.jpg|right|FixIt]]&lt;br /&gt;
&lt;br /&gt;
See also [[Doxygen]] for documentation close to the code.&lt;br /&gt;
&lt;br /&gt;
==[[Contributing|Contributing]]==&lt;br /&gt;
You would like to contribute, but are not sure how, then [[Contributing|this is the page to visit]]&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/CodeEditors|Code Editing]]==&lt;br /&gt;
How to setup your IDE for use with the source code&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/LearningToProgram|Learning to Program]]==&lt;br /&gt;
Improve your Paparazzi code in OCAML,C,C++ and Python&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/AircraftBuildProcess|Aircraft build process and code generation]]==&lt;br /&gt;
Description of the (rather complicated) build system and code generation regarding the airborne firmwares&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/DesignOverview|Design Overview]]==&lt;br /&gt;
Attempt at a longer walk through the airborne code architecture&lt;br /&gt;
&lt;br /&gt;
==[[FirmwareArchitecture|Firmware Architecture]]==&lt;br /&gt;
Attempt at brief overview of the firmware architecture with modules and subsystems&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/Communications|Communications]]==&lt;br /&gt;
How telemetry and datalink is done&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/CommunicationsNew|Communications (Proposed New system)]]==&lt;br /&gt;
How the telemetry and datalink works&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/Server_GCS_com|Server-GCS communications]]==&lt;br /&gt;
How the Server and the Ground Control Station interact with each other&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/Values|Values]]==&lt;br /&gt;
A short walk through the system and how values are handled&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/Settings|Settings]]==&lt;br /&gt;
Settings is the generic mechanism that allows to set and get the value of any variable of the embedded code.&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/Mathlib|Paparazzi Math Library]]==&lt;br /&gt;
The custom Paparazzi math library written in C and how to use it in external programs&lt;br /&gt;
&lt;br /&gt;
==[[Reference/bootloader]]==&lt;br /&gt;
All of the questions and answers about the bootloader, but were afraid to ask&lt;br /&gt;
&lt;br /&gt;
===[[Lpc21iap|LPC USB firmware]]===&lt;br /&gt;
All of the answers to the Paparazzi USB bootloader of question you never dared to ask&lt;br /&gt;
&lt;br /&gt;
====[[Lpc21BootloaderUpload|Upload Bootloader for LPC21xx]]====&lt;br /&gt;
How to [[[[Lpc21BootloaderUpload|upload the Bootloader]] to a LPC2148 processor based Autopilot board like the TWOG&lt;br /&gt;
&lt;br /&gt;
===[[Luftboot|Upload the luftboot bootloader]]===&lt;br /&gt;
How to upload the Bootloader to a STM32 processor based Autopilot board like the [[Elle0]] or [[Lisa/M]]&lt;br /&gt;
&lt;br /&gt;
===[[DFU|Upload with DFU (with native or custom dfu bootloader)]]===&lt;br /&gt;
Using the native (embedded in ROM) or custom (e.g. [[Luftboot]] or [[KroozSD#Bootloader|KroozSD]]==) bootloader to upload Paparazzi code&lt;br /&gt;
&lt;br /&gt;
===[[STLink|Upload with STLink via SWD (without Bootloader)]]===&lt;br /&gt;
General ST-LinkV2 page.&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/GDB_OpenOCD_Debug|GDB OpenOCD Debug]]==&lt;br /&gt;
Using GDB or OpenOCD to directly flash and debug Hardware&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/USB-Serial|USB-Serial]]==&lt;br /&gt;
Using a USB connection instead of UART for use with telemetry&lt;br /&gt;
&lt;br /&gt;
==[[ControlTheory]]==&lt;br /&gt;
All [[ControlTheory|information you are looking for about the harsh reality of Control Theory]] needed to let your aircraft fly&lt;br /&gt;
&lt;br /&gt;
==[[Demystified/Altitude and Height|Altitude and Height]]==&lt;br /&gt;
Altitude and Height demystified&lt;br /&gt;
&lt;br /&gt;
==[[Abi|AirBorne Interface ABI]]==&lt;br /&gt;
Presentation of the airborne communication system&lt;br /&gt;
&lt;br /&gt;
==[[DevGuide/StateInterface]]==&lt;br /&gt;
A stateinterface is a stateinterface is a stateinterface, [[DevGuide/StateInterface|poems aside read more about what the stateinterface entails here]]&lt;br /&gt;
&lt;br /&gt;
==[[RT_Paparazzi]]==&lt;br /&gt;
[[RT_Paparazzi|Real Time Paparazzi]] how-to and guidelines&lt;br /&gt;
&lt;br /&gt;
==[[Builds|Continuous Integration builds]]==&lt;br /&gt;
Info on the [[Builds|Continuous Integration builds]] (CI) server&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Lisa&amp;diff=20721</id>
		<title>Lisa</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Lisa&amp;diff=20721"/>
		<updated>2016-01-07T14:51:45Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Autopilots&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
Lisa ( the Lost Illusions Serendipitous Autopilot) is a range of autopilots based on [http://www.st.com/mcu/inchtml-pages-stm32.html STM32] microcontrollers ( CortexM3@72Mhz ) designed to run Paparazzi.&lt;br /&gt;
There's no such thing as a perfect autopilot, only autopilots adapted to a particular purpose. This is the reason why the Lisa autopilots come in different styles for different uses. &lt;br /&gt;
&lt;br /&gt;
The first members of the family are:&lt;br /&gt;
&lt;br /&gt;
*Lisa/L, a design where the STM32 is associated to a gumstix [http://www.gumstix.net/Setup-and-Programming/cat/Overo-Setup-and-Programming/111.html Overo].&lt;br /&gt;
*Lisa/M, a design focusing on cost and simplicity.&lt;br /&gt;
*Lisa/S, a design focusing on size and weight.&lt;br /&gt;
&lt;br /&gt;
==Lisa/L==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
[[Lisa/L]] is a dual processor board autopilot designed to allow for the possibility of using Linux for Paparazzi airborne code.&lt;br /&gt;
&lt;br /&gt;
[[Image:lisa_l_bloc_diag_simple.png|360px]]&lt;br /&gt;
[[Image:lisa_l_top.png|360px]] [[Image:lisa_l_bot.png|360px]]&lt;br /&gt;
&lt;br /&gt;
=== Documentation ===&lt;br /&gt;
&lt;br /&gt;
The documentation for Lisa/L is broken into several parts due to board complexity and Gumstix [[Overo]] integration.&lt;br /&gt;
* [[Lisa/L|Main Documentation]] - primary hardware documentation and intro to software&lt;br /&gt;
* [[Dev/LisaL|Additional Developer Documentation]] - additional advanced hardware and software documentation and notes&lt;br /&gt;
* [[LisaL_Gallery|Lisa/L Photo Gallery]] - pictures of [[Lisa/L]]&lt;br /&gt;
* [[User/LisaL/Tutorial/Quadrocopter|Unfinished Rotorcraft Tutorial]] - rotorcraft tutorial, needs considerable work&lt;br /&gt;
* [[User/LisaL/Tutorial/FixedWing|Unfinished Fixedwing Tutorial]] - fixedwing tutorial, needs considerable work&lt;br /&gt;
* [[OMAP|Gumstix Integration Intro]] - intro and documentation listing for integrating a Gumstix Overo with [[Lisa/L]], including for USB devices and cameras&lt;br /&gt;
&lt;br /&gt;
== Lisa/M ==&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
[[Lisa/M]] is a great general purpose small-footprint autopilot. There are currently two versions that have been produced. Detailed documentation can be found here:&lt;br /&gt;
* [[Lisa/M_v2.0|Lisa/M v2.0 (current) Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Image:LisaM_V2_0_TopView.JPG|360px|Lisa/M v2.0 Top View]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [[Lisa/M_v1.0|Lisa/M v1.0 Documentation]]&lt;br /&gt;
&lt;br /&gt;
[[Image:lisa_m_top_small.png|360px|Lisa/M v1.0 Top View]]&lt;br /&gt;
&lt;br /&gt;
=== Usage scenarios ===&lt;br /&gt;
&lt;br /&gt;
There are many potential applications for the small, relatively inexpensive and flexible [[Lisa/M]]. For regular Autopilot boards a fully equip [[Lisa/M]] board is needed. For some scenarios just a basic [[Lisa/M]] without an [[Inertial_Measurement_Units|IMU]] and barometric pressure sensor is needed, which reduces the board cost. Here are some ideas (not all have yet to be implemented):&lt;br /&gt;
&lt;br /&gt;
* As a basic Autopilot&lt;br /&gt;
** To use the [[Lisa/M]] as an autopilot, you need to attach a GPS receiver. A nice [[GPS#u-Blox_LEA_Series_Receivers|uBlox LEA-5H]] or newer will perform great.&lt;br /&gt;
* As an advanced Autopilot&lt;br /&gt;
** Additional sensors for measuring airspeed, current, etc. would enhance a fixed-wing airframe.&lt;br /&gt;
* As a servo extender&lt;br /&gt;
** Sometimes being able to control seven actuators is just not enough. Large airframes may require flaps or an airbrake and automatic landing facilities. Maybe special ACL/Nav lights, or four cameras with zoom. By using a coupled second basic [[Lisa/M]] and connecting this to the master Autopilot board we can extend the amount of servos. Large airframes can also benefit from remote and/or redundant servo drivers.&lt;br /&gt;
* As a Safety Pilot Device&lt;br /&gt;
** To provide an extra safety level required in some UAS challenges. A second [[Lisa]] board can make it easy to adhere to the rules for such a challenge.&lt;br /&gt;
* As a Data Logger&lt;br /&gt;
** Maybe you have a need only to log all kinds of data, like temperature, volts, amps, height, airspeed, and not control the aircraft. For this we can setup a [[Lisa/M]] board. Collecting this data can be to a storage medium like on a micro SD card. Sometimes there is no need for real-time data collection through telemetry but just for storing a huge dataset.&lt;br /&gt;
* As a Camera controller&lt;br /&gt;
** On some models that do not require many servos (for example - flying wing with only 3 channels used), spare channels can be used for camera control. In addition, it could be used as an independent pan-tilt unit (PTU) controller.&lt;br /&gt;
* As a Airframe Tracker&lt;br /&gt;
** Tracking an airframe for an antenna or camera on a tripod is one of the many optional uses for a [[Lisa/M]] Board.&lt;br /&gt;
&lt;br /&gt;
== Lia ==&lt;br /&gt;
&lt;br /&gt;
Lia is a lower-cost variant of Lisa/M 2.0. The microcontroller, basic layout, servo outputs, and mounting holes are the same. Major differences:&lt;br /&gt;
* 0.1&amp;quot; through-hole connections for non-servo I/O instead of Molex picoblade&lt;br /&gt;
** PCB size increased slightly to (58x34mm) to accommodate throughholes&lt;br /&gt;
* CAN transceiver removed on initial units; populated on later units (see [http://paparazzi.enac.fr/wiki/Lia documentation])&lt;br /&gt;
* barometer removed&lt;br /&gt;
* I2C level shifter removed&lt;br /&gt;
* 5V voltage regulator removed&lt;br /&gt;
* Added provisions for multiple BEC input balancing on servo connectors&lt;br /&gt;
&lt;br /&gt;
[[Image:Lia_1.1_top.jpg|360px|Lia v1.1 Top View]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Lia|Lia documentation]]&lt;br /&gt;
&lt;br /&gt;
== Lisa/S ==&lt;br /&gt;
&lt;br /&gt;
Lisa/S is very small autopilot board. The focus for this design is size, weight and power consumption. It's an autopilot suited for the smallest airframes.&lt;br /&gt;
&lt;br /&gt;
[[Image:Lisa_S_V0_1_r2_on_finger.jpg|360px]]&lt;br /&gt;
&lt;br /&gt;
* [[Lisa/S|Lisa/S Documentation]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Lisa]] [[Category:User_Documentation]] [[Category:Autopilots]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Lisa/S/Tutorial/Nano_Quadcopter&amp;diff=20532</id>
		<title>Lisa/S/Tutorial/Nano Quadcopter</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Lisa/S/Tutorial/Nano_Quadcopter&amp;diff=20532"/>
		<updated>2015-12-29T15:04:27Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: more spelling errors&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float: right; width: 20%&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So you've received your Lisa/S Nano Quadcopter kit, what do you do next...&lt;br /&gt;
&lt;br /&gt;
The following is an example set of instructions on how to put together your new Lisa/S Nano Quadcopter kit. As with all things open source there's always more than one way to do it. So feel free to deviate from the instructions where you feel the need. Of course if you see errors or improvement please feel free to update them.&lt;br /&gt;
&lt;br /&gt;
{{#ev:youtube|7lLxFDNiywM|400}}&lt;br /&gt;
&lt;br /&gt;
== Step 1 - Check the parts and tools ==&lt;br /&gt;
&lt;br /&gt;
First we need to check that we have everything that we need.&lt;br /&gt;
&lt;br /&gt;
The kit contains:&lt;br /&gt;
* 1 x Lisa/S&lt;br /&gt;
* 1 x Superbit USBRF Dongle&lt;br /&gt;
* 2 x CyRF Modules (one mounted on Lisa/S, and one mounted on USBRF dongle)&lt;br /&gt;
* 2 x 2.4GHz U.FL whip antennas&lt;br /&gt;
* 1 x Cortex JTAG connector to 4 pin SWD connector adapter&lt;br /&gt;
* 1 x TTL level UART adapter&lt;br /&gt;
* 1 x motor connector adapter kit with battery pigtail&lt;br /&gt;
* 2 x 0.05&amp;quot; pitch 10 pin headers&lt;br /&gt;
* 1 x 0.05&amp;quot; pitch 4 pin header&lt;br /&gt;
* 1 x 120mm class quadcopter frame (brushed motors and propellers included)&lt;br /&gt;
* 1 x set of replacement propellers&lt;br /&gt;
* 1 x 1S LiPo 230mAh battery&lt;br /&gt;
* 1 x battery charger with USB cable&lt;br /&gt;
* 1 x 10mm x 10mm GPS patch antenna (optional, only included in the &amp;quot;With GPS Antenna&amp;quot; variant)&lt;br /&gt;
* 1 x Black Magic Probe with JTAG and Serial cables (optional, only included in the &amp;quot;With Black Magic Probe&amp;quot; variant)&lt;br /&gt;
&lt;br /&gt;
Other tools:&lt;br /&gt;
* A small phillips head screw driver&lt;br /&gt;
* A fine tipped soldering iron and solder, flux, etc... (Required if you selected the some soldering required option)&lt;br /&gt;
* A multimeter&lt;br /&gt;
&lt;br /&gt;
Useful tools&lt;br /&gt;
* A desk vice&lt;br /&gt;
* Some 2 mm diameter round toothpicks sanded down to tightly fit the mounting holes of the Lisa/S&lt;br /&gt;
&lt;br /&gt;
== Step 2 - Soldering ==&lt;br /&gt;
&lt;br /&gt;
If you selected the Some Soldering Required option now we need to do that soldering.&lt;br /&gt;
&lt;br /&gt;
* The 4 x 2 pin Molex PicoBlade connectors to the motor adaptor kit PCB&lt;br /&gt;
* The battery pig tale to the motor adaptor kit PCB [[File:Soldering.JPG|thumb|none|Soldering]]&lt;br /&gt;
* Using the multimeter check that there is '''&amp;lt;u&amp;gt;no&amp;lt;/u&amp;gt;''' continuity between the pins of the battery and motor connectors. If there is then you have a solder bridge causing a short which needs to be fixed.&lt;br /&gt;
* Check that there is continuity between the positive (red) lead of the battery and the outside pin of the connectors.&lt;br /&gt;
* Wash off any flux with flux wash&lt;br /&gt;
* Place a tiny amount of solder on the pads on the bottom of the motor adaptor opt PCB where it connects to the Lisa/S. Tip use a solder sucker to suck most of the solder off again. You just want the pads tinned.&lt;br /&gt;
* Solder one of the 0.05&amp;quot; pitch 10 pin headers to the Lisa/S CAN, UART, SWD pads&lt;br /&gt;
* Alight the motor adaptor PCB with the Lisa/S PCB using the 2 mm toothpicks and solder the 6 pads [[File:Solder_Adaptor_to_LisaS.jpg|thumb|none|Soldering the motor adaptor to the Lisa/S]]&lt;br /&gt;
* Wash off any flux with flux wash&lt;br /&gt;
* Inspect the PCB to ensuring that all solder joints are wet and no drops of solder have be been left on the board causing shorts.&lt;br /&gt;
* Dry the PCB thoroughly with your wife/girlfriends hair dryer while she's out. Remember to put it back as you found it so she doesn't suspect a thing.&lt;br /&gt;
&lt;br /&gt;
Now that you've got this far sit back and bask in the glory of soldering the tiny little joint. You might like to ponder as I did on your decision to opt for the pre soldered kit...&lt;br /&gt;
&lt;br /&gt;
== Step 3 - Assemble the aircraft ==&lt;br /&gt;
&lt;br /&gt;
Now that the fiddly bit has been completed, lets put everything together&lt;br /&gt;
&lt;br /&gt;
* Place a small square of double sided tape on the back of the GPS antenna. [[File:Double_sided_tape.JPG|thumb|none|Double sided tape on the back of the GPS antenna]]&lt;br /&gt;
* Attach the GPS antenna to the GPS antenna connector on the Lisa/S&lt;br /&gt;
* Attach the CYRF antenna to the CYRF antenna connector [[File:ConnectAntennas.JPG|thumb|none|Antennas connected]]&lt;br /&gt;
* Stick the GPS antenna to the back of the CYRF radio PCB [[File:GPS_antenna_stuck_to_CYRF_back.JPG|thumb|none|GPS fixed]]&lt;br /&gt;
* Unscrew the 4 screws on the body of the airframe [[File:Airframe_pre-assembly.jpeg|thumb|none|Airframe disassembled]] [[File:LisaS_NanoQ_Assembly_Legend.jpg|thumb|none|Assembly Legend]]&lt;br /&gt;
* Insert the 4 arms with attached motors to the body&lt;br /&gt;
* Place the Lisa/S on the rubber mounts on the body in your desired orientation and secure with the 4 screws [[File:LisaS_mounted.jpeg|thumb|none|Lisa/S mounted]]&lt;br /&gt;
* Connect the 4 motors to the connectors [[File:Motors_connected.jpeg|thumb|none|Motors connected]]&lt;br /&gt;
&lt;br /&gt;
== Step 4 - Install Paparazzi and other tools ==&lt;br /&gt;
&lt;br /&gt;
If you don't already have [http://www.paparazziuav.org/ Paparazzi] installed on a computer now is the time to do so.&lt;br /&gt;
&lt;br /&gt;
Follow the instructions at http://wiki.paparazziuav.org/wiki/Installation.&lt;br /&gt;
&lt;br /&gt;
Tip: If you are installing on Mac OS X we recommend installing using the Source installation method instead of the basic. Some packages in the binary installer might be outdated and cause problems if you decide to use the Basic installation route. With Source installation you guarantee to have the newest packages that are much more likely to work on your version of Mac OS X and XCode.&lt;br /&gt;
&lt;br /&gt;
== Step 5 - Flash the USBRF ==&lt;br /&gt;
&lt;br /&gt;
The superbitrf firmware source code is hosted on Github. Additional information regarding the flashing firmware instructions can be found on the wiki page https://github.com/esden/superbitrf-firmware/wiki.&lt;br /&gt;
The flashing firmware instructions are the following:&lt;br /&gt;
&lt;br /&gt;
1. Open your OS terminal window&lt;br /&gt;
2. Clone the superbitrf-firmware repository by typing in your terminal command&lt;br /&gt;
 &amp;lt;code&amp;gt;git clone https://github.com/esden/superbitrf-firmware.git&amp;lt;/code&amp;gt;&lt;br /&gt;
3. Change directory into the superbitrf-firmware directory via&lt;br /&gt;
 &amp;lt;code&amp;gt;cd superbitrf-firmware&amp;lt;/code&amp;gt; &lt;br /&gt;
4. to make sure you have the latest and greatest of supporting source code of libopencm3 &lt;br /&gt;
 &amp;lt;code&amp;gt;git submodule init &amp;amp;&amp;amp; git submodule update&amp;lt;/code&amp;gt;&lt;br /&gt;
5. Now build this code via&lt;br /&gt;
 &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;&lt;br /&gt;
6. Plug in your Superbit USBRF dongle '''while holding &amp;quot;the button&amp;quot;''' on the Superbit USBRF dongle, into your laptop.&lt;br /&gt;
You will see a red and yellow LED blink in turn, indicating that the module is ready to receive and update to the latest firmware you just build.&lt;br /&gt;
&lt;br /&gt;
7. To start the firmware update  a.k.a. Flashing your firmware type:&lt;br /&gt;
 &amp;lt;code&amp;gt;make flash&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Wait... and your are done with the update&lt;br /&gt;
&lt;br /&gt;
== Step 6 - Build and upload the Lisa/S firmware ==&lt;br /&gt;
&lt;br /&gt;
While we go through the initial process it would be a good idea to charge the flight battery. You can do this with the [[Lisa/S_Nano_Quadcopter_Kit/BatteryCharger|supplied charger]] or your own battery charger.&lt;br /&gt;
&lt;br /&gt;
Now lets get to building the firmware for the Quadcopter.&lt;br /&gt;
&lt;br /&gt;
# Start Paparazzi Centre by running &amp;lt;code&amp;gt;./paparazzi&amp;lt;/code&amp;gt; from a terminal window&lt;br /&gt;
# From the A/C menu select &amp;lt;code&amp;gt;LadyLisa&amp;lt;/code&amp;gt;&lt;br /&gt;
# In the Airframe section check that you have the &amp;lt;code&amp;gt;ladybird_lisa_s.xml&amp;lt;/code&amp;gt; airframe file&lt;br /&gt;
# In the &amp;lt;code&amp;gt;Target&amp;lt;/code&amp;gt; drop down list select &amp;lt;code&amp;gt;ap&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click the &amp;lt;code&amp;gt;Build&amp;lt;/code&amp;gt; button. If everything goes to plan the code will be built and there will not be any errors shown.&lt;br /&gt;
# Plug the &amp;lt;code&amp;gt;Serial Wire Debug&amp;lt;/code&amp;gt; board into the ribbon cable&lt;br /&gt;
# Plug the other end of the ribbon cable into the BlackMagic board&lt;br /&gt;
# Plug the USB cable into the BlackMagic board&lt;br /&gt;
# Plug the &amp;lt;code&amp;gt;Serial Wire Debug&amp;lt;/code&amp;gt; board into the Lisa/S SWD pins&lt;br /&gt;
# Plug the other end of the USB cable into a vacant USB port on the computer. &lt;br /&gt;
# Connect a fully charged battery to the Lisa/S&lt;br /&gt;
# From the &amp;lt;code&amp;gt;Flash mode&amp;lt;/code&amp;gt; drop down list select &amp;lt;code&amp;gt;BlackMagic Probe (SWD)&amp;lt;/code&amp;gt;&lt;br /&gt;
# Click the &amp;lt;code&amp;gt;Upload&amp;lt;/code&amp;gt; button. You should see the LEDs of the Lisa/S go out and only the Power LED remains lit while the upload takes place. Once complete the other LEDs will light.&lt;br /&gt;
&lt;br /&gt;
If using the Black Magic Probe use the [http://1bitsquared.com/collections/all-products/products/jtag-idc-cable &amp;quot;JTAG SWD Cable&amp;quot;] with [http://1bitsquared.com/collections/all-products/products/jtag-swd-adapter &amp;quot;JTAG SWD Adapter] and connect to the 4pin SWD header on the [http://1bitsquared.com/collections/autopilots/products/lisa-s Lisa/S] with the adapter facing away from the Lisa/S. [[File:swd.JPG|thumb|none|Connect the 4pin SWD header with the Lisa/S]]&lt;br /&gt;
&lt;br /&gt;
If you are using Mac OS-X, then you have to create a symbolic link for the BlackMagic to be seen as &amp;lt;code&amp;gt;ttyACM0&amp;lt;/code&amp;gt;. Plug your BlackMagic board into a USB port on the computer and write &amp;quot; ls -l /dev/*usb* /dev/*USB* &amp;quot; command in a terminal window in order to see the device name. Use the first appearing name which should be something like /dev/cu.usbmodemE3BBA8B7. Then create a sym link with &amp;quot;sudo ln -s /dev/cu.usbmodemE3BBA8B7 /dev/ttyACM0 &amp;quot; command. Check the sym link by &amp;quot;ls -l /dev/ttyACM0 &amp;quot; command. Now the flashing should work.&lt;br /&gt;
&lt;br /&gt;
== Step 7 - Binding your transmitter to the Superbit USBRF dongle ==&lt;br /&gt;
&lt;br /&gt;
1) Plug the Superbit USBRF dongle into one of your computers USB ports&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Press &amp;quot;the button&amp;quot; on the Superbit USBRF dongle&lt;br /&gt;
&amp;lt;br&amp;gt;''The orange LED on the dongle should have lit up now...''&lt;br /&gt;
&amp;lt;br&amp;gt;''NOTE: Sometimes the binding is '''not successful''' on the first try, you might need to '''retry to bind''' before the dongle recognizes your transmitter and the orange LED turns off''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3) Put your transmitter into binding mode, on most transmitters turn on your transmitter while holding the bind button.&lt;br /&gt;
&amp;lt;br&amp;gt;''If the binding with your transmitter was successful the orange LED on the USBRF dongle will turn off''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4) Get your transmitter out of bind mode, most of the time just simply release the bind button on your transmitter&lt;br /&gt;
&amp;lt;br&amp;gt;''After few seconds the orange LED will turn off while another LED will light up. This indicates that the transmitter is connected to your dongle and receiving packets from your transmitter''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;sub&amp;gt;''Note: for more information how to turn on your transmitter in bind mode refer to your transmitter documentation. This varies a lot depending on the version and make of the transmitter. Spektrum DX6I and Orange TX transmitters you just hold the Trainer switch while you power it on. Others have a dedicated bind button on the back of the transmitter that you hold while turning on your transmitter. Some have a TX menu item for this.''&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 8 - Binding your transmitter to Lisa/S ==&lt;br /&gt;
&lt;br /&gt;
1) Press the bind button on the Lisa/S board and while '''holding it pressed power on the Lisa/S autopilot board''', difficult but doable if you pre-position your battery connector then connect the battery&lt;br /&gt;
&amp;lt;br&amp;gt;''The Radio LED should be blinking in short blinks once a second, sometimes hard to notice''&lt;br /&gt;
&lt;br /&gt;
2) Put your '''transmitter into binding mode''', for most most transmitters, just turn on your transmitter while holding the bind button of your transmitter&lt;br /&gt;
&amp;lt;br&amp;gt;''The Radio LED on the Lisa/s should stop blinking, this can take even upto 40 seconds, be patient''&lt;br /&gt;
&lt;br /&gt;
[[Category:Lisa]] [[Category:User_Documentation]] [[Category:Tutorial]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Micro_logger&amp;diff=20243</id>
		<title>Micro logger</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Micro_logger&amp;diff=20243"/>
		<updated>2015-08-18T14:50:04Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
The micro logger is simply a memory chip (S25FL128S or S25FL256S) connected to one SPI port of your autopilot.&lt;br /&gt;
&lt;br /&gt;
===Advantages===&lt;br /&gt;
* very light (hard to do lighter)&lt;br /&gt;
* no bad connexions (the memory needs to be soldered)&lt;br /&gt;
&lt;br /&gt;
===Disadvantages===&lt;br /&gt;
* hard to remove&lt;br /&gt;
* slower than other loggers&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Capability===&lt;br /&gt;
This logger is capable of logging the entire IMU (9 axis) on 32 bits values at 512Hz. This is possible when you erase completely the memory at the beginning of the log (ERASE_MEMORY_AT_START set to 1).&lt;br /&gt;
&lt;br /&gt;
In case of buffer overflow, the reading tool is capable of &amp;quot;rebuilding&amp;quot; the missed values. It is going to put zeros where we missed values.&lt;br /&gt;
&lt;br /&gt;
=How to use it=&lt;br /&gt;
==Configuration of the module==&lt;br /&gt;
To configure the messages you want to log, you will need to edit the module c file in : sw/airborne/modules/loggers/high_speed_logger_direct_memory.c. At the top of the file you will have a section containing all the parameters that you can change. Among those you got :&lt;br /&gt;
* ERASE_MEMORY_AT_START : if set to 1 the memory will be erased completly when starting a new log. This will take a little bit less than a minute, but afterwards you will be able to log values at a higher rate than if you didn't do it. If you let it to 0, the module is going to erase the memory block by block of 4K when needed.&lt;br /&gt;
&lt;br /&gt;
* SIZE_OF_LOGGED_VALUES : the number of Bytes that each value logged must be (in memory). You can write a 4 Bytes values in a 2 Bytes slots, you just need to be certain that you don't have any overflows.&lt;br /&gt;
&lt;br /&gt;
* NBR_VALUES_TO_LOG : the number of messages you want to log. This value is equivalent to the size of the values_to_log array.&lt;br /&gt;
&lt;br /&gt;
* SKIP_X_CALLS_BETWEEN_VALUES : you might want to slow down the logger instead of losing values (because of buffer overflows). if that value is set to 0, a new value of every logged messages will be added to the buffer. If set to 2, we will wait two calls to the module, then during the third one we will write the values to the buffer. By default this modules is called at 512Hz.&lt;br /&gt;
&lt;br /&gt;
Then you have two arrays :&lt;br /&gt;
&lt;br /&gt;
* values_to_log : containing the pointer to the values to log.&lt;br /&gt;
* name_of_the_values : the name of the messages logged. This is simply an aesthetic configuration, for you to know which message were logged.&lt;br /&gt;
&lt;br /&gt;
==Logging values==&lt;br /&gt;
To use the micro logger you simply need to load the module &amp;quot;'''high_speed_logger_direct_memory'''&amp;quot; in your airframe file. You might want to be certain of the frequency at which the module is called by loading it like that :&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;modules main_freq=&amp;quot;512&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;load name=&amp;quot;high_speed_logger_direct_memory.xml&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/modules&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then you are going to have to add the GUI to your GCS by adding to your settings the file : &amp;quot;'''settings/modules/high_speed_logger_direct_memory.xml'''&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:GCS mem.png]]&lt;br /&gt;
&lt;br /&gt;
Then in the GCS you can go in the tab settings, then logger. In this tab you will have only one command to change the status of the module.&lt;br /&gt;
&lt;br /&gt;
At the start the module is in idle mode. To start logging you will need to prepare the memory first. To do that simply select the initialize mode and validate. The module will work. To test if the module have completed it's work you can click on the value to the left of the drop down menu. Once completed the status will be back to idle.&lt;br /&gt;
&lt;br /&gt;
Then you can start actually logging values by selecting the &amp;quot;start log&amp;quot; mode and validating.&lt;br /&gt;
&lt;br /&gt;
Once you are done with your log you need to select the &amp;quot;stop log&amp;quot; mode and validate.&lt;br /&gt;
&lt;br /&gt;
==Reading the values back==&lt;br /&gt;
&lt;br /&gt;
[[File:Micro logger.png]]&lt;br /&gt;
&lt;br /&gt;
WARNING !!! : On some boards the UART port is used also by the GPS. The soft behind the GPS might read all the values on the port instead of the logger module. To solve that issue you simply need to use an other UART port for the logger module (configured in : conf/modules/high_speed_logger_direct_memory.xml). The other solution is to move the GPS in you board makefile.&lt;br /&gt;
&lt;br /&gt;
For this operation you will need to get the reader application available [http://karlito139.github.io/lisa_s_logger_reader/ here]. The source code is available [https://github.com/karlito139/lisa_s_logger_reader here].&lt;br /&gt;
&lt;br /&gt;
To read the values back you simply need to connect to your autopilot using a serial connexion. Then start the micro logger application, at the top right of the interface you get a drop down menu containing all the serial ports available on your computer, select the one corresponding to your autopilot. Then simply click on the &amp;quot;Dump memory&amp;quot; button. The application is going to fetch all the values stored in the memory (warning this operation might be slow, up to 40 minutes if you used the entire memory).&lt;br /&gt;
&lt;br /&gt;
Finally you can click on the export button at the bottom of the window to save the values in a csv file.&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Lisa/M_v2.0&amp;diff=20225</id>
		<title>Lisa/M v2.0</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Lisa/M_v2.0&amp;diff=20225"/>
		<updated>2015-08-13T18:37:17Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float: right; width: 15%&amp;quot;&amp;gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Autopilots&amp;lt;/categorytree&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right; width: 45%; overflow: hidden&amp;quot;&amp;gt;[[Image:LisaM_V2_0_TopView.JPG|right|500px|Lisa/M V2.0 top view]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right; width: 40%&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lisa/M is a small, general purpose autopilot designed with flexibility across multiple applications in mind. Small weight and size, with (optional) integrated [[AspirinIMU | Aspirin IMU]] and full size 0.1&amp;quot; servo headers make the Lisa/M suitable for both fixed-wing and rotorcraft vehicles. This autopilot is based on a STM32 processor for extensive peripheral connection and faster processing.&lt;br /&gt;
&lt;br /&gt;
A number of tutorials are being prepared for getting started with Lisa/M:&lt;br /&gt;
* [[Lisa/M/Tutorial/FixedWing|Fixedwing tutorial]]&lt;br /&gt;
* [[Lisa/M/Tutorial/RotorCraft|Rotorcraft tutorial]]&lt;br /&gt;
&lt;br /&gt;
Please join us in our quest to make the getting started information even more, eh... informative, by adjusting those pages with your own improvements.&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
Lisa/M is based on the 64 pins STM32F105RCT6 [http://www.st.com/internet/mcu/product/221023.jsp connectivity line family] processor featuring 64k of RAM and 256k of FLASH. All the pins are exposed, providing access to the complete set of the STM32 peripherals.&lt;br /&gt;
NOTE: This MCU is different from LISA/L. Lisa/L is based on the 64 pins STM32F103RE processor featuring 64k of RAM and 512k of FLASH, which is part of the [http://www.st.com/internet/mcu/product/164485.jsp high-density performance line family].&lt;br /&gt;
&lt;br /&gt;
* STM32 microcontroller [http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00220364.pdf STM32F105RCT6 datasheet] with 256kB flash and 64kB RAM&lt;br /&gt;
* Pressure sensor [http://www.bosch-sensortec.com/content/language1/html/3477.htm BMP085] (optional as of 08/2012)&lt;br /&gt;
* 7 x Analog input channels&lt;br /&gt;
* 3 x Generic digital in-/out-puts&lt;br /&gt;
* 2 x 3.3V TTL UART (5V tolerant)&lt;br /&gt;
* 8 x Servo PPM outputs (only 6 if second I2C (I2C1) bus in use)&lt;br /&gt;
* 1 x CAN bus&lt;br /&gt;
* 1 x [http://en.wikipedia.org/wiki/Serial_Peripheral_Interface SPI] bus&lt;br /&gt;
* 1 x [http://en.wikipedia.org/wiki/I2c I&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;C] bus (2 x when using only the first 6 Servo PPM outputs)&lt;br /&gt;
* 1 x Micro USB&lt;br /&gt;
* 4 x status LEDs with attached test point&lt;br /&gt;
* 10.8 grams (0.4 oz) (with Aspirin IMU mounted)&lt;br /&gt;
* 9.9 grams (0.35 oz) (without Aspirin IMU mounted)&lt;br /&gt;
* ~34mm x ~60mm x ~10mm&lt;br /&gt;
* 4 layers PCB design&lt;br /&gt;
&lt;br /&gt;
With mounted Aspirin IMU has the following additional sensors on board:&lt;br /&gt;
&lt;br /&gt;
* 3 Axis Gyroscope&lt;br /&gt;
* 3 Axis Accelerometer&lt;br /&gt;
* 3 Axis Magnetometer&lt;br /&gt;
* Barometer MS5611 (as of Aspirin v2.1)&lt;br /&gt;
&lt;br /&gt;
NOTE:&lt;br /&gt;
'''Lisa/M has pads for the BMP085 pressure sensor. Lias/M 2 boards made before August 2012 had the BMP085 sensor mounted. Boards made after August 2012 do not have the sensor mounted as they are designed to be used with Aspirin 2.1 which has the new MS5611-01BA03 barometric pressure sensor.'''&lt;br /&gt;
&lt;br /&gt;
So, except for a GPS unit you have all necessary sensors for full attitude and altitude stabilization in an extremely small package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=200px heights=200px&amp;gt;&lt;br /&gt;
Image:LisaM_V2_0_TopView.JPG|Lisa/M V2.0 top view&lt;br /&gt;
Image:LisaM_V2_0_BottomView.JPG|Lisa/M V2.0 bottom view&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pinout ==&lt;br /&gt;
Pins Name and Type are specified with respect to the Autopilot Board.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;float: right; width: 100%&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:LisaM_V2_0_top_labeled.png|900px]]&lt;br /&gt;
[[Image:LisaM_warning_label.png|200px]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''SERVO1/2/3/4/5/6/7/8'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||SERVOx||OUT||Servo signal (PWM)(See Note 1 below)||style=&amp;quot;background:Yellow; color:black&amp;quot;|Yellow&lt;br /&gt;
|-&lt;br /&gt;
|2||SV||PWR||Servo Bus Voltage Rail (conf w/ JP1)||style=&amp;quot;background:red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|3||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''JTAG'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||N/A||N/A||JTAG Debug Header (Pin 1 is +3V3)||style=&amp;quot;background:white; color:black&amp;quot;|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''UART3'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|2||V_IN||PWR||UART Voltage (conf w/ JP6 and JP7)||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|3||TX||OUT||USART3 Serial Output (3.3V level)||style=&amp;quot;background:Yellow; color:black&amp;quot;|Yellow&lt;br /&gt;
|-&lt;br /&gt;
|4||RX||IN||USART3 Serial Input (3.3V level)(Pullup to Pin 2 voltage)(5V tolerant)||style=&amp;quot;background:Orange; color:white&amp;quot;|Orange&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''UART1/5'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|2|| +3V3||PWR||3.3V Rail from autopilot (conf w/ JP8 and JP9)||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|3||RX1||IN||USART1 Serial Input (3.3V level)(Pullup to Pin 2 voltage)(5V tolerant)||style=&amp;quot;background:Orange; color:white&amp;quot;|Orange&lt;br /&gt;
|-&lt;br /&gt;
|4||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|5|| +3V3||PWR||3.3V Rail from autopilot (conf w/ JP8 and JP9)||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|6||RX5||IN||UART5 Serial Input (3.3V level)(Pullup to Pin 5 voltage)(5V tolerant)||style=&amp;quot;background:Orange; color:white&amp;quot;|Orange&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''GPIO'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|2|| +3V3||PWR||3.3V Rail from autopilot||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|4||PC12||I/O||GPIO, connected to PC12 (5V tolerant)||style=&amp;quot;background:#FDC579; color:black&amp;quot;|Dark Tan&lt;br /&gt;
|-&lt;br /&gt;
|5||TRST||I/O||JTAG_TRST (also connected to LED1 cathode)||style=&amp;quot;background:#FED6B1; color:black&amp;quot;|Light Tan&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''ANALOG2'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|2|| +3V3||PWR||3.3V Rail from autopilot||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|3|| +5V||PWR||5V Rail from autopilot||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|4||ADC4||I/O||by default connected to LED_4 cathode (Remove LED/resistor to use as ADC4)||style=&amp;quot;background:magenta; color:white&amp;quot;|Magenta&lt;br /&gt;
|-&lt;br /&gt;
|5||ADC6||I/O||by default connected to LED_3 cathode (Remove LED/resistor to use as ADC6)||style=&amp;quot;background:#FFA1B2; color:black&amp;quot;|Pink&lt;br /&gt;
|-&lt;br /&gt;
|6||BOOT0||I/O||BOOT0||style=&amp;quot;background:grey; color:black&amp;quot;|Grey&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''USB'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||N/A||N/A||USB (The USB connections are also available as 0.05&amp;quot; (1.27mm) through hole pads underneath the GPIO header)||style=&amp;quot;background:white; color:black&amp;quot;|None&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''I2C1 CAN'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|2|| V_BATT||PWR||V_BATT Bus on autopilot, voltage divider for V_BAT_MEAS, (conf w/ JP2 to connect to V_IN)||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|3|| V_IN||PWR||Connected to autopilot voltage regulator inputs (conf w/ JP1, JP2 and JP3)||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|4||CANL||I/O||CANL (5V level)||style=&amp;quot;background:orange; color:white&amp;quot;|Orange&lt;br /&gt;
|-&lt;br /&gt;
|5||CANH||I/O||CANH (5V level)||style=&amp;quot;background:yellow; color:black&amp;quot;|Yellow&lt;br /&gt;
|-&lt;br /&gt;
|6||SCL||I/O||SCL (5V level)(See Note 1 below)||style=&amp;quot;background:green; color:white&amp;quot;|Green&lt;br /&gt;
|-&lt;br /&gt;
|7||SDA||I/O||SDA (5V level)(See Note 1 below)||style=&amp;quot;background:blue; color:white&amp;quot;|Blue&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''SPI1'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|2|| +3V3||PWR||3.3V Rail from autopilot||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|3||MOSI||Out||MOSI||style=&amp;quot;background:orange; color:white&amp;quot;|Orange&lt;br /&gt;
|-&lt;br /&gt;
|4||MISO||In||MISO||style=&amp;quot;background:yellow; color:black&amp;quot;|Yellow&lt;br /&gt;
|-&lt;br /&gt;
|5||SCK||Out||SCK||style=&amp;quot;background:green; color:white&amp;quot;|Green&lt;br /&gt;
|-&lt;br /&gt;
|6||SS||Out||SS||style=&amp;quot;background:blue; color:white&amp;quot;|Blue&lt;br /&gt;
|-&lt;br /&gt;
|7||DRDY||I/O||DRDY||style=&amp;quot;background:#FDC579; color:black&amp;quot;|Dark Tan&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''ANALOG1'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|2|| +3V3||PWR||3.3V Rail from autopilot||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|3|| +5V||PWR||5V Rail from autopilot||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|4||ADC1||In||ADC1 (or LED_6 if populated)||style=&amp;quot;background:green; color:white&amp;quot;|Green&lt;br /&gt;
|-&lt;br /&gt;
|5||ADC2||In||ADC2 (or LED_7 if populated)||style=&amp;quot;background:blue; color:white&amp;quot;|Blue&lt;br /&gt;
|-&lt;br /&gt;
|6||ADC3||In||ADC3 (or LED_8 if populated)||style=&amp;quot;background:#FED6B1; color:black&amp;quot;|Light Tan&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''UART2'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|2|| +3V3||PWR||UART Voltage (conf w/ JP4 and JP5)||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|3||TX||OUT||USART2 Serial Output (3.3V level)||style=&amp;quot;background:Yellow; color:black&amp;quot;|Yellow&lt;br /&gt;
|-&lt;br /&gt;
|4||RX||IN||USART2 Serial Input (3.3V level)('''NOT 5V TOLERANT''')(Pullup to Pin 2 voltage)||style=&amp;quot;background:Orange; color:white&amp;quot;|Orange&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''I2C2'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Pin #''!!width=&amp;quot;10%&amp;quot;|''Name''!!width=&amp;quot;10%&amp;quot;|''Type''!!''Description''!!width=&amp;quot;5%&amp;quot;|''Color''&lt;br /&gt;
|-&lt;br /&gt;
|1||GND||PWR||common ground||style=&amp;quot;background:black; color:white&amp;quot;|Black&lt;br /&gt;
|-&lt;br /&gt;
|2|| +3V3||PWR||3.3V Rail from autopilot||style=&amp;quot;background:Red; color:white&amp;quot;|Red&lt;br /&gt;
|-&lt;br /&gt;
|3||SCL||I/O||SCL (3.3V level)||style=&amp;quot;background:green; color:white&amp;quot;|Green&lt;br /&gt;
|-&lt;br /&gt;
|4||SDA||I/O||SDA (3.3V level)||style=&amp;quot;background:blue; color:white&amp;quot;|Blue&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''NOTE 1''': SERVO7 and SERVO8 are directly connected to I2C1_SCL and I2C1_SDA lines. Therefore one has to choose, either use SERVO7 and SERVO8 '''OR''' have the I2C1 bus available, if that one needs to be used for whatever reason alongside the I2C2 bus. To use the servos 7 and 8 just set the  &amp;lt;define name=&amp;quot;USE_SERVOS_7AND8&amp;quot;/&amp;gt;  in your airframe file and you are good to go. For this to work one must make sure to have the latest Paparazzi sourcecode.&lt;br /&gt;
&lt;br /&gt;
=== LEDs ===&lt;br /&gt;
Lisa/M 2.0 has 5 LEDS (+1 power LED). There are 3 additional LEDs (LED_6, LED_7, LED_8) that are not populated by default (in favor of using ADC1-3 on the ANALOG1 connector).&lt;br /&gt;
By default the LEDs are use for:&lt;br /&gt;
; LED_1, red: ''SYS_TIME_LED'': blinks with 1Hz&lt;br /&gt;
; LED_2, green : ''AHRS_ALIGNER_LED'': blinks until the AHRS is aligned (gyro bias initialized) and then stays on&lt;br /&gt;
; LED_3, green : ''GPS_LED'': blinking if trying to get a fix, on if 3D fix&lt;br /&gt;
; LED_4, red : ''RADIO_CONTROL_LED'': on if RC signal is ok&lt;br /&gt;
; LED_5, green : not set to anything by default&lt;br /&gt;
&lt;br /&gt;
=== Jumper Configuration ===&lt;br /&gt;
There are a number of jumpers on Lisa/M used to configure voltage levels and power input.&lt;br /&gt;
&lt;br /&gt;
The default configuration is UART3 VCC at V_IN, UART1/2/5 VCC at +3V3, with the V_SERVO servo voltage rail NOT connected to the autopilot V_IN rail, allowing one to power the autopilot and servos separately. The +5V regulator is NOT bypassed, allowing a regulated +5V on listed headers and for the CAN transceiver and I2C level shifter. The V_BATT connector is NOT connected to V_IN, so one can attach a battery voltage to the V_BATT pin to measure the battery voltage, if so desired.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=380px heights=205px&amp;gt;&lt;br /&gt;
Image:LisaM_V2_0_top_jumpers_and_leds.png | Lisa/M v2.0 Top Jumpers and LEDs&lt;br /&gt;
Image:LisaM_V2_0_bottom_jumpers.png | Lisa/M v2.0 Bottom Jumpers&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''Power Jumper Configuration'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Jumper''!!width=&amp;quot;20%&amp;quot;|''Bus Connection''!!width=&amp;quot;7%&amp;quot;|''Default''!!''Description''&lt;br /&gt;
|-&lt;br /&gt;
|JP1||SERVO_BUS to V_IN||OPEN||If closed then connects servo header voltage rail SERVO_BUS to autopilot input voltage V_IN rail&lt;br /&gt;
|-&lt;br /&gt;
|JP2||V_BATT to V_IN||OPEN||If closed then connects I2C1/CAN rail V_BATT to autopilot input voltage V_IN rail&lt;br /&gt;
|-&lt;br /&gt;
|JP3||V_IN to +5V||OPEN||If closed then connects autopilot input voltage V_IN rail to autopilot +5V rail, bypassing onboard 5V supply&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''UART3 VCC Configuration'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Jumper''!!width=&amp;quot;20%&amp;quot;|''Bus Connection''!!width=&amp;quot;7%&amp;quot;|''Default''!!''Description''&lt;br /&gt;
|-&lt;br /&gt;
|JP6||UART3_VCC to V_IN||style=&amp;quot;background:black; color:white&amp;quot;|CLOSED||Connects UART3 connector VCC to autopilot input voltage V_IN rail&lt;br /&gt;
|-&lt;br /&gt;
|JP7||UART3_VCC to +3V3||OPEN||If closed then connects UART3 connector VCC to autopilot +3V3 rail&lt;br /&gt;
|}&lt;br /&gt;
'''WARNING: UART3 GPS Connector is connected to V_IN, check your GPS input voltage before connecting!!!'''&lt;br /&gt;
&lt;br /&gt;
'''WARNING: DO NOT CLOSE BOTH JP6 AND JP7 SIMULTANEOUSLY!!!'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''UART2 VCC Configuration'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Jumper''!!width=&amp;quot;20%&amp;quot;|''Bus Connection''!!width=&amp;quot;7%&amp;quot;|''Default''!!''Description''&lt;br /&gt;
|-&lt;br /&gt;
|JP4||UART2_VCC to V_IN||OPEN||If closed then connects UART2 connector VCC to autopilot input voltage V_IN rail '''SEE WARNING BELOW'''&lt;br /&gt;
|-&lt;br /&gt;
|JP5||UART2_VCC to +3V3||style=&amp;quot;background:black; color:white&amp;quot;|CLOSED||If closed then connects UART2 connector VCC to autopilot +3V3 rail&lt;br /&gt;
|}&lt;br /&gt;
'''WARNING: UART2 RX is NOT 5V TOLERANT. Thus, while possible to connect UART2_VCC to V_IN, DO NOT ATTEMPT THIS. Only use JP5 (the default).&lt;br /&gt;
&lt;br /&gt;
'''WARNING: DO NOT CLOSE BOTH JP4 AND JP5 SIMULTANEOUSLY!!!'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;  cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;70%&amp;quot;&lt;br /&gt;
|+'''UART1 and UART5 VCC Configuration'''&lt;br /&gt;
!width=&amp;quot;7%&amp;quot;|''Jumper''!!width=&amp;quot;20%&amp;quot;|''Bus Connection''!!width=&amp;quot;7%&amp;quot;|''Default''!!''Description''&lt;br /&gt;
|-&lt;br /&gt;
|JP8||UART1&amp;amp;5_VCC to V_IN||OPEN||If closed then connects UART1 and UART5 connector VCC to autopilot input voltage V_IN rail&lt;br /&gt;
|-&lt;br /&gt;
|JP9||UART1&amp;amp;5_VCC to +3V3||style=&amp;quot;background:black; color:white&amp;quot;|CLOSED||If closed then connects UART1 and UART5 connector VCC to autopilot +3V3 rail&lt;br /&gt;
|}&lt;br /&gt;
'''WARNING: DO NOT CLOSE BOTH JP8 AND JP9 SIMULTANEOUSLY!!!'''&lt;br /&gt;
&lt;br /&gt;
There are additional jumpers on the board for expert or developer configurations, please see [[Lisa/M_v20#Schematic|schematic]] and [[Lisa/M_v20#Downloads|layout]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Powering the Board ===&lt;br /&gt;
&lt;br /&gt;
[[Image:LisaM_warning_label.png|right|200px]]&lt;br /&gt;
&lt;br /&gt;
The 3.3V regulator on Lisa/M is a [http://www.micrel.com/page.do?page=/product-info/products/mic5209.shtml MIC5209-3.3YM] capable of delivering up to 500mA. While it is possible to power this regulator with up to 16V, '''DO NOT''' do this. By default, the UART3 RX pin is pulled up to the input voltage V_IN. For this reason, 5V is the maximum input voltage. Note that the UART3 GPS Connector is connected to V_IN, check your GPS input voltage before connecting. If one desires to have V_IN at a higher voltage, the jumpers should be adjusted accordingly. As noted, this regulator can handle up to 16V, though experience has shown that this regulator can become very hot in operation with high input voltages, resulting in potential thermal shutdown while in flight. Depending on the expected current draw, it is best to power this regulator with a lower voltage. 5V is the perfect choice. &lt;br /&gt;
&lt;br /&gt;
The onboard 5V regulator on Lisa/M is a [http://www.national.com/pf/LP/LP2992.html LP2992], a low-noise, low-dropout linear regulator capable of delivering up to 250mA. This regulator can be bypassed with JP3, connecting the autopilot V_IN bus directly to the autopilot 5V bus if, for example, one is using an external 5V regulated supply, and a higher current is needed. Unless external use of 5V is required on the ANALOG1 and ANALOG2 headers, the only 5V usage onboard is for the CAN transceiver and the I2C1 level shifter.&lt;br /&gt;
&lt;br /&gt;
When measuring the supply voltage of a battery with the V_BATT pin (could be connected to V_IN through JP2), it is important to note the maximum voltage limit. The voltage divider on the board for measuring with a 3.3V ADC is --'''V_BAT'''--/\/\'''10k'''/\/\--'''V_BAT_MEAS'''--/\/\'''2k2'''/\/\--'''GND'''--. This means that the maximum allowable voltage on V_BATT is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;V\_BAT_{max} = 3.3V*\frac{10k}{2.2k} = 15V&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If a higher voltage measurement is desired, another voltage divider is required off-board. Alternatively, one could modify the existing voltage divider (e.g. change 10k resistor to 22k to get 33V maximum). When checking if voltage exceeds the maximum, make sure to consider maximum battery voltage, not nominal voltage (e.g. 4.22V or so for a single lithium cell, not 3.7V nominal, so the maximum number of cells in series is 3, like a 3S LiPo pack).&lt;br /&gt;
&lt;br /&gt;
== Schematic ==&lt;br /&gt;
&amp;lt;gallery widths=250px heights=168px&amp;gt;&lt;br /&gt;
Image:Lisa_m_v2_0_sheet_1.png | LisaM V2.0 Schematic Sheet 1/3&lt;br /&gt;
Image:Lisa_m_v2_0_sheet_2.png | LisaM V2.0 Schematic Sheet 2/3&lt;br /&gt;
Image:Lisa_m_v2_0_sheet_3.png | LisaM V2.0 Schematic Sheet 3/3&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;gallery widths=250px heights=168px&amp;gt;&lt;br /&gt;
Image:Lisa_m_v2_1_r3_sheet_1.png | Lisa/M V2.1 R3 Schematic Sheet 1/2&lt;br /&gt;
Image:Lisa_m_v2_1_r3_sheet_2.png | Lisa/M V2.1 R3 Schematic Sheet 1/2&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples of Airborne Equipment Electrical Connections ==&lt;br /&gt;
&lt;br /&gt;
=== Quadrocopter, Spektrum Satellite Receivers, PWM Motor Controllers (ESC) and dedicated avionics Battery Elimination Circuit (BEC) ===&lt;br /&gt;
&lt;br /&gt;
[[File:LisaM_V2_0_wiring_quadrocopter_spektrum_bec_pwmesc.png|700px]]&lt;br /&gt;
&lt;br /&gt;
This is a recommended powering configuration. It eliminates the balancing issues of the built in BECs into the ESCs.&lt;br /&gt;
&lt;br /&gt;
The dotted lines from the BEC show the alternative wiring that does not require closing the VS jumper on the Lisa/M. The disadvantage is that you have to wire/crimp the BEC output wires into the picoblade molex connector providing the battery voltage reference. Usually it is easier to just use the existing &amp;quot;servo&amp;quot; connector on the BEC and closing the jumper instead.&lt;br /&gt;
&lt;br /&gt;
=== Quadrocopter, Spektrum Satellite Receivers and PWM Motor Controllers (ESC) ===&lt;br /&gt;
&lt;br /&gt;
[[File:LisaM_v2_0_wiring_quadrocopter_spektrum_pwmesc.png|700px]]&lt;br /&gt;
&lt;br /&gt;
This configuration assumes the ESCs have a battery eliminator circuit (BEC) function and provide 5 volts on their 5V pins. Closing JP1 powers Lisa/M and the attached accessories.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Warning:&amp;lt;/span&amp;gt; The built in BECs on the ESCs are usually linear voltage regulators, they are fairly inefficient compared to dedicated BECs that are usually implemented as switching DC/DC converters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Warning:&amp;lt;/span&amp;gt; Due to manufacturing differences of BECs, connecting more then one BEC in parallel will likely cause one of the BECs to take majority of the load and dissipate most of the drop down voltage. ([https://en.wikipedia.org/wiki/Linear_regulator Read on how linear voltage regulators work.]) As in this example the BECs are part of the ESCs, one of the ESCs will get warmer than the others, which in turn may lead to reliability issues.&lt;br /&gt;
&lt;br /&gt;
[[File:LisaM_V2_0_wiring_quadrocopter_spektrum_pwmesc_shunts.png|700px]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:green&amp;quot;&amp;gt;Tip:&amp;lt;/span&amp;gt; To improve balancing between the ESC built in BECs you can add a 1Ohm resistor in the +5V line coming from the motor controller. This will cause some pre-loading of the voltage regulator and improve the load sharing between the BECs while decreasing the efficiency of the supply.&lt;br /&gt;
&lt;br /&gt;
When using cheap ATMega or SiLabs-based PWM motor controllers consider replacing their firmware with either [https://github.com/sim-/tgy Simon Kirby] or [https://github.com/bitdump/BLHeli BLHeli] firmware respectively to get useful performance of your multicopter! You can find a firmware compatibility list [https://docs.google.com/spreadsheet/ccc?key=0AhR02IDNb7_MdEhfVjk3MkRHVzhKdjU1YzdBQkZZRlE here].&lt;br /&gt;
&lt;br /&gt;
=== Quadrocopter, Spektrum Satellite Receivers and I2C Motor Controllers (ESC) ===&lt;br /&gt;
&lt;br /&gt;
[[File:LisaM_V2_0_quadrocopter_spektrum_i2c_esc_wiring.png|700px]]&lt;br /&gt;
&lt;br /&gt;
This diagram &amp;quot;should&amp;quot; be the same for AscTec as well as Mikrokopter motor controller based airframes.&lt;br /&gt;
&lt;br /&gt;
=== Fixedwing, Spektrum Satellite Receivers and Elevons Only ===&lt;br /&gt;
&lt;br /&gt;
[[File:LisaM_V2_0_wiring_fixedwing_spektrum_elevons.png|700px]]&lt;br /&gt;
&lt;br /&gt;
This configuration assumes the ESC has a BEC and provides 5 volts on its 5V pin. Closing JP1 powers Lisa/M and the attached accessories.&lt;br /&gt;
&lt;br /&gt;
=== Fixedwing, Spektrum Satellite Receivers ===&lt;br /&gt;
&lt;br /&gt;
[[File:LisaM_V2_0_wiring_fixedwing_spektrum.png|700px]]&lt;br /&gt;
&lt;br /&gt;
This configuration assumes the ESC has a BEC and provides 5 volts on its 5V pin. Closing JP1 powers Lisa/M and the attached accessories.&lt;br /&gt;
&lt;br /&gt;
=== Transitioning [http://wiki.thequadshot.com Quadshot] Using Spektrum Receivers ===&lt;br /&gt;
&lt;br /&gt;
[[File:LisaM_V2_0_wiring_quadshot_spektrum.png|700px]]&lt;br /&gt;
&lt;br /&gt;
The ESCs have BECs and provide 5 volts on their 5V pins. Closing JP1 powers Lisa/M and the attached accessories.&lt;br /&gt;
&lt;br /&gt;
Still need: Large Fixed-wing with advanced power system and/or IC engine, PPM example&lt;br /&gt;
&lt;br /&gt;
== R/C Receivers ==&lt;br /&gt;
&lt;br /&gt;
One can use [[Subsystem/radio_control#Spektrum|Spektrum]] DSM2 or compatible receivers as well as traditional PPM receivers.  It is even possible to [[Subsystem/radio_control#Spektrum|connect two Spectrum or compatible satellite receivers]] for better redundancy or to improve RC signal reception. Connecting a RC receiver for flying your aircraft in manual mode during setup and test phase is 99% of the cases a must. Therefore the Paparazzi team made it easy to connect one.&lt;br /&gt;
&lt;br /&gt;
===  Using a Spektrum DSM receiver ===&lt;br /&gt;
&lt;br /&gt;
==== Physically connecting ====&lt;br /&gt;
&lt;br /&gt;
Wiring up a Spektrum or compatible satellite receiver is not all to difficult to do. Note however that it is very important to make absolutely sure the connectors are properly made. Not being precise in this step can mean full RC loss and loss of airframe in the first tuning testflights. &lt;br /&gt;
&lt;br /&gt;
A spektrum satellite receiver should be connected to the UART1 connector on the autopilot board. Make sure the voltage on the AP board UART1 + pin is not to high, or to low for your receiver.&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
# Connect the minus(-) of the receiver to GND of UART1&lt;br /&gt;
# The receiver plus(+) to the UART1 Plus(+) &lt;br /&gt;
# Data out signal of the receiver to the RX pin on the UART1&lt;br /&gt;
&lt;br /&gt;
==== Binding ====&lt;br /&gt;
&lt;br /&gt;
To get a receiver and transmitter to work together you must perform a binding process. &lt;br /&gt;
&lt;br /&gt;
It is important to '''bind''' your Spectrum DSM receiver to your transmitter '''via''' your '''Lisa board''', not in any other way!&lt;br /&gt;
&lt;br /&gt;
The way to bind is by temporary connecting via fiddly small molex pins. &lt;br /&gt;
It is advised to make a small bind plug out of a molex connector for this purpose. &lt;br /&gt;
Before you start make sure you have your airframe configuration already uploaded either via USB or a JTAG cable.&lt;br /&gt;
&lt;br /&gt;
The bind procedure:&lt;br /&gt;
&lt;br /&gt;
# On the connector '''ANALOG1''' have a wire between the GND and ADC1 pin, located in the middle of the board&lt;br /&gt;
# Power up your autopilot board&lt;br /&gt;
# Hold the bind button on your '''transmitter''', while '''keeping it pressed''' switch on your transmitter&lt;br /&gt;
#:Wait...! All lights of the receiver blink and then go steady&lt;br /&gt;
# Let go of your transmitter bind button&lt;br /&gt;
# Power off your Lisa Board&lt;br /&gt;
# Remove the wire connecting the GND and ADC1 pins on the ANALOG1 connector&lt;br /&gt;
# Repower your board, if you have servos connected and wiggle the RC transmitter sticks some servos should move&lt;br /&gt;
&lt;br /&gt;
That is all, you are done. &lt;br /&gt;
The bind procedure only needs to be done '''once''' for your receiver.&lt;br /&gt;
&lt;br /&gt;
===  Using a CPPM receiver ===&lt;br /&gt;
&lt;br /&gt;
Using a CPPM receiver, a so called '''PPM sum stream''' input is possible. [[RC_Receivers_and_Radios#PPM_Based_Systems | To make it work, you need a CPPM a.k.a. PPM sum, stream out capable receiver. Find out more following this link]]  &lt;br /&gt;
&lt;br /&gt;
==== Connecting ====&lt;br /&gt;
&lt;br /&gt;
Connect the CPPM out signal to the RX pin of UART1.&lt;br /&gt;
&lt;br /&gt;
Make sure put this in your airframe file in your AP target section.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing or rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;radio_control&amp;quot; type=&amp;quot;ppm&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;configure name=&amp;quot;RADIO_CONTROL_PPM_PIN&amp;quot; value=&amp;quot;UART1_RX&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/subsystem&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Alternative =====&lt;br /&gt;
&lt;br /&gt;
However if in the case you want to use the UART1 port for something else, there is an option to connect the receiver to a servo pin. Yes, that's right, a servo connector is used for receiving a CPPM stream '''input'''.  If you want to walk that path, the default pin number to capture the CPPM datastream is via servo connector SERVO6&lt;br /&gt;
&lt;br /&gt;
If you connect the CPPM out capable receiver that way make sure to put this in your airframe file in your AP target section:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing or rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;radio_control&amp;quot; type=&amp;quot;ppm&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;configure name=&amp;quot;RADIO_CONTROL_PPM_PIN&amp;quot; value=&amp;quot;SERVO6&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/subsystem&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you do not have or cannot modify a receiver to a ''CPPM out'' able receiver, a [[PPM_Encoder | PPM encoder board]] can be used to avoid opening your receiver for PPM out modification. However with the very low prices of Spectrum DSMX CPPM out, lat time we looked you could have one starting from EUR 10,-&lt;br /&gt;
&lt;br /&gt;
===Using a S-Bus receiver===&lt;br /&gt;
&lt;br /&gt;
There is a third option, connect a receiver with S-Bus signal output. For this with regular Futaba receiver an inverter my be needed.&lt;br /&gt;
&lt;br /&gt;
== Extras ==&lt;br /&gt;
&lt;br /&gt;
=== UART I/O ===&lt;br /&gt;
&lt;br /&gt;
UART pins can also be used as general purpose I/O, this might come in handy in case all other inputs or your AP board are in use.&lt;br /&gt;
&lt;br /&gt;
===  USB as UART1TX + hardware flow control===&lt;br /&gt;
&lt;br /&gt;
[[File:Lisam-usb-uart1.jpg]]&lt;br /&gt;
&lt;br /&gt;
The USB_VBUS on the Lisa/M 2.0 can be used as UART1 TX. To do this, a diode has to be removed. Make sure to include a series resistor of 100-3000 Ohm to protect the microcontroller from overcurrents. The 2nd and 3th pin of the USB pads are CTS and RTS respectively. It is recommended to include a series resistor in the RTS line, as this is an outgoing line. &lt;br /&gt;
&lt;br /&gt;
If you want to enable flow control in the software, but don't want to use flow control when no cable is connected to the CTS/RTS, a pulldown resistor of 10 kOhm has to be added between the CTS and the GND. If you do this, take care when connecting UART devices that have a large series resistor in their RTS line. The combination of the pulldown resistor and the series resistor might cause the high-level voltage to drop under the high-level threshold of the microcontroller, causing strange behaviour.&lt;br /&gt;
&lt;br /&gt;
For Example the RTS , mostly a purple wire, is the '''pin 10''' on the Xtend module when set in the module with Hardware flow control (use X-CTU)&lt;br /&gt;
CTS, most blue, on pin 9 of the Xtend&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery widths=380px heights=205px&amp;gt;&lt;br /&gt;
Image:Lisam-diode.JPG | Remove this diode. After removing this diode you can not power the board via USB anymore.&lt;br /&gt;
Image:Lisam-gpio-usb.JPG | Take care of the small distance between the GPIO pins and the USB pads.&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== PCB ==&lt;br /&gt;
&lt;br /&gt;
=== Gerber &amp;amp; Drill Files  ===&lt;br /&gt;
&lt;br /&gt;
'''''Download  Lisa/M v2.0 gerber &amp;amp; drill files (zip)''''' ''[[Lisa/M_v2.0#Get the design|Get the design]]''&lt;br /&gt;
&lt;br /&gt;
== Assembly ==&lt;br /&gt;
&lt;br /&gt;
To create and assemble a board oneself is possible. It takes some skills however. &lt;br /&gt;
&lt;br /&gt;
For the Lisa/m v2.0 without the Aspirin sensor board a good soldering iron is enough.(smallest components are 0402) For the Aspirin Sensor board you need a hot air soldering station.&lt;br /&gt;
&lt;br /&gt;
In case you wan to follow that path you need the design. You came to the right place here is the info to get the needed files;&lt;br /&gt;
&lt;br /&gt;
===Components Layout===&lt;br /&gt;
&lt;br /&gt;
''[[Lisa/M_v2.0#Get the design|Get the design]]''&lt;br /&gt;
&lt;br /&gt;
Need some top and bottom of board images and line drawings here.&lt;br /&gt;
&lt;br /&gt;
=== Bill Of Material ===&lt;br /&gt;
&lt;br /&gt;
'''''Download  Lisa/M v2.0 Bill Of Material (zipped .xls file)''''' ''[[Lisa/M_v2.0#Get the design|Get the design]]''&lt;br /&gt;
&lt;br /&gt;
Open .sch File in Eagle, execute UPL --&amp;gt; bom.ulp , save as .txt&lt;br /&gt;
&lt;br /&gt;
== PCB and assembled boards suppliers ==&lt;br /&gt;
&lt;br /&gt;
To difficult to create your own AP board, understandable, thus pre made board available via [[Get_Hardware|Get Hardware]] page... hopefully :)&lt;br /&gt;
&lt;br /&gt;
== Mechanical Dimensions ==&lt;br /&gt;
&lt;br /&gt;
[[Image:LisaM_V2_0_top_mechanical.png|500px|Lisa/M v2.0 Mechanical Dimensions]]&lt;br /&gt;
&lt;br /&gt;
The overall height of the board including the servo connectors is 10mm. Note that the overall length includes the USB connector. The mounting holes are nominal 2mm diameter (with a bit of clearance).&lt;br /&gt;
Beware that in version 2.1 of the Lisa/MX the mounting holes are for m3 screws.&lt;br /&gt;
&lt;br /&gt;
== Get the design ==&lt;br /&gt;
&lt;br /&gt;
'''Source files'''&lt;br /&gt;
:*download available on GitHub: ''[https://github.com/paparazzi/paparazzi-hardware/tree/master/controller/lisa_m/v2.0 Lisa/M v2.0 Cadsoft Eagle 6 Design]''&lt;br /&gt;
'''Gerber &amp;amp; Drill files'''&lt;br /&gt;
:*download ''NOT YET AVAILABLE'' Need generated gerbers and drill files&lt;br /&gt;
'''Assembly files'''&lt;br /&gt;
:*download ''NOT YET AVAILABLE'' Need Lisa/M v2.0 Components layouts (pdf)&lt;br /&gt;
:*download ''NOT YET AVAILABLE'' Need Lisa/M v2.0 Bill Of Material&lt;br /&gt;
&lt;br /&gt;
== Uploading new software ==&lt;br /&gt;
New onboard software for the Lisa/M v2.0 can uploaded by connecting your PC via a micro-USB port to the autopilot board. For this the board need to contain the [[Luftboot]] bootloader. All Lisa/M 2.0 from Transition Robotics Inc. come with luftboot already in the board.&lt;br /&gt;
&lt;br /&gt;
An alternative to get your firmware in the board is by using a JTAG connector connected via the 10-pin Samtec connector that is available on the board.&lt;br /&gt;
&lt;br /&gt;
See the [[FirmwareFlashing]] page for an overview of different methods to upload new software to your autopilot.&lt;br /&gt;
&lt;br /&gt;
=== Using luftboot ===&lt;br /&gt;
'''This is the default FLASH_MODE for Lisa/M v2.0''', it could be explicitly selected by adding&lt;br /&gt;
:&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;configure name=&amp;quot;FLASH_MODE&amp;quot; value=&amp;quot;DFU&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
to the firmware section of your airframe file. Make sure to set Lisa/M 2.0 as it's target board.&lt;br /&gt;
&lt;br /&gt;
Once USB is plugged in, the board automatically goes to bootloader mode and the status LEDs cycle up and down:&lt;br /&gt;
&lt;br /&gt;
[[File:Luftboot.gif|320px]]&lt;br /&gt;
&lt;br /&gt;
If you have trouble entering the bootloader mode or want to upload/update the bootloader itself, see the [[Luftboot]] page.&lt;br /&gt;
&lt;br /&gt;
=== Using JTAG ===&lt;br /&gt;
You still can use a [[JTAG|JTAG adapter]] for [[FirmwareFlashing#JTAG|flashing]] and [[DevGuide/JTAG-Debug|debugging]] your paparazzi firmware. To use [[FirmwareFlashing#JTAG|JTAG flashing]] configure the ''FLASH_MODE'' in your firmware section:&lt;br /&gt;
:&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;configure name=&amp;quot;FLASH_MODE&amp;quot; value=&amp;quot;JTAG&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is possible to use an advanced adapter called Black Magic Probe. See more details [[here|JTAG#Black_Magic_Probe]]&lt;br /&gt;
&lt;br /&gt;
Using JTAG will not overwrite the bootloader by default. To overwrite the luftboot bootloader configure&lt;br /&gt;
:&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;configure name=&amp;quot;NO_LUFTBOOT&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then press upload as normal...&lt;br /&gt;
&lt;br /&gt;
=== Serial Firmware Upload ===&lt;br /&gt;
Firmware upload using the factory integrated bootloader can be useful e.g. if you have overwritten [[Luftboot]] accidentally and don´t have access to [[JTAG]].&amp;lt;br/&amp;gt;&lt;br /&gt;
Either set the flash mode in the target section of the airframe configuration:&lt;br /&gt;
:&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;configure name=&amp;quot;FLASH_MODE&amp;quot; value=&amp;quot;SERIAL&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
or add it to the commandline invocation:&lt;br /&gt;
 make AIRCRAFT=&amp;lt;aircraftname&amp;gt; ap.upload FLASH_MODE=SERIAL&lt;br /&gt;
&lt;br /&gt;
Due to hardware constraints, the board has to be modified to make use of the bootloader, which is only accessible on UART1:&lt;br /&gt;
# Diode D3 has to be removed (the bigger black brick next to the USB connector). Attention, no more powering via USB after that.&lt;br /&gt;
# BOOT1 has to be set to GND by connecting ACC_DRDY(unused) to GND at the Aspirin pads&lt;br /&gt;
&lt;br /&gt;
Now a boot sequence works as follows:&lt;br /&gt;
#BOOT1 has to be set to 3.3V by use of a jumper cable&lt;br /&gt;
#Connect a 3,3V serial cable (FTDI, MAX232...) to UART1, the TX pin is USB_VBUS&lt;br /&gt;
#Power the board and activate the bootloader program&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Prevent board from going into bootloader mode ===&lt;br /&gt;
&lt;br /&gt;
Normally, if you power up the board with the USB cable connected to a PC it will automatically go into bootloader mode. If you want the board to power up normally with the cable connected you can ground the ADC2 in the ANALOG1 connector.&lt;br /&gt;
&lt;br /&gt;
== Detailed Hardware Revision History ==&lt;br /&gt;
&lt;br /&gt;
=== Changes Between LISA v1.1 and v2.0 ===&lt;br /&gt;
&lt;br /&gt;
* Lots of silkscreen improvements&lt;br /&gt;
* Added attributes to all parts to make the usage of bom-ex ulp possible.&lt;br /&gt;
* Improved routing to allow teardropping&lt;br /&gt;
* Fixed stm32f1, f2 and f4 compatibility circuit. (has to jump to ground not to 3v3)&lt;br /&gt;
* Connected existing UART RX pullups to the respective connector power pins instead of 3v3. To prevent connecting 5V over IO pin to the 3v3 power rail.&lt;br /&gt;
* Added pullups on all UART RX lines to prevent undesired floatation.&lt;br /&gt;
* LED's are connected to 3v3 now. To make sure we don't have an issue with voltage tolerance on the gpio pins.&lt;br /&gt;
* ...&lt;br /&gt;
&lt;br /&gt;
== Hardware Change Requests ==&lt;br /&gt;
&lt;br /&gt;
If you have a Lisa/M 2.0 and in the process of using it you come up with something you find annoying, dangerous, or restricting, add your hardware update requests here. Better still, modify the Lisa schematics yourself and show your new improvements if you are skilled enough to do this.&lt;br /&gt;
&lt;br /&gt;
* REQ: Replace BMP085 with MS5611 (the MS5611 seems to be better in performance then the BMP but it is more expensive and seems to be more difficult to obtain. &lt;br /&gt;
** A: Using a MS5611 is possible through using a Aspirin v2.1 board&lt;br /&gt;
&lt;br /&gt;
* REQ: Replace 7 Pin CAN with molex with something less risky to be inserted in 7 Pin SPI in relation to powering the board via CAN molex.&lt;br /&gt;
&lt;br /&gt;
* REQ: Separate spot for external power if powered via separate battery. Realizing we can via Servo ports by Bridge J1 but still like to measure board voltage then and have a way to add power without mistakenly insert I2CCAN Molex conector into SPI Molex on board connector. Thus a separate CAN and Power plug. Power on regular four pin molex with GND, V+5, , V_BATT, V_I (Current sense). Option to have thicker wire to be soldered to the board, for power hungry setups and other issues connectors for power are not a good idea.&lt;br /&gt;
&lt;br /&gt;
* REQ: Replace Aspirin IMU board with InvenSense MPU-9150 and bring the MS5611 back onto the Lisa/M board to reduce footprint, mass, and manufacturing cost once the 9150 becomes readily available(if at al with SPI) and is tested to perform well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Lisa/Lia F4 ==&lt;br /&gt;
Lisa/Lia autopilot can be easily converted to a much more powerful controller, based on STM32F405RGT6 chip [http://www.st.com/web/catalog/mmc/FM141/SC1169/SS1577/LN1035/PF252144]. The chip has the same dimensions (LQFP64 10x10mm package) with the exact same pinout as the original STM32F105RCT6 chip. The main advantage of the f4 chip is:&lt;br /&gt;
&lt;br /&gt;
* 168MHz CPU speed, 1MB flash and 192kb RAM&lt;br /&gt;
* FPU (fast floating point computations)&lt;br /&gt;
* configurable DMA streams (more peripherals can use DMA)&lt;br /&gt;
* multiplexed IO pins (peripherals can be mapped to various IO pins)&lt;br /&gt;
* CPU usage only about 5% with standard rotorcraft flight configuration&lt;br /&gt;
&lt;br /&gt;
STM32F405RGT6 chip can be ordered for example [http://cz.mouser.com/ProductDetail/STMicroelectronics/STM32F405RGT6/?qs=Z8%252beY1k3TIKgj7QWsYGpQw== here]. To replace the chip a good soldering station with microscope and enough light is recommended. After replacing the chip, jumpers CMP1 and CMP2 have to be opened. &lt;br /&gt;
&amp;lt;gallery widths=300px heights=200px&amp;gt;&lt;br /&gt;
 [[File:F4_digikey.jpg]]&lt;br /&gt;
Image:F4_digikey.jpg|DigiKey part number for F4 chip&lt;br /&gt;
Image:F4_on_board.jpg|Lia F4 with the new chip&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Programming ===&lt;br /&gt;
The STM32F4 can be flashed via SWD/JTAG (e.g. with the BlackMagicProbe) or via [[DFU#Native_DFU_bootloader_.28embedded_in_ROM.29|DFU-UTIL]].&lt;br /&gt;
[[Luftboot|Luftboot]] currently supports only F1xx chips.&lt;br /&gt;
&lt;br /&gt;
'''To program via DFU-UTIL:'''&lt;br /&gt;
&lt;br /&gt;
[[File:LisaMX v2_0_DFU.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
[[DFU#Native_DFU_bootloader_.28embedded_in_ROM.29|First, install DFU-UTIL as shown here.]]&amp;lt;br&amp;gt;&lt;br /&gt;
The two pairs of pins circled in red should be shorted (VERY CAREFULLY), eg with tweezers, as shown, i.e.:&amp;lt;br&amp;gt;&lt;br /&gt;
1) The Boot0 and VDD pins on the STM32F4 should be shorted together.&amp;lt;br&amp;gt;&lt;br /&gt;
2) The ACC_DRDY (Boot1) and GND pins should be shorted together on the Aspirin mounting pads. (This can be done even if an aspirin IMU is mounted).&amp;lt;br&amp;gt;&lt;br /&gt;
The USB connector should then be plugged in. This action also powers the board. Do not connect any additional source of power.&amp;lt;br&amp;gt;&lt;br /&gt;
Remove the shorts. The board should now be in bootloader mode. Only one green LED should be lit.&amp;lt;br&amp;gt;&lt;br /&gt;
The board can then be flashed using DFU-UTIL.&amp;lt;br&amp;gt;&lt;br /&gt;
Tested functional on a [http://transition-robotics.com/products/lisa-m-f4-with-10dom-aspirin-imu TRI Lisa/MX v2.0] using Paparazzi Master branch on 18 Nov 2014.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''A guide how to flash the F4 chip from Eclipse can be found in [[RT_Paparazzi|RT_Paparazzi]].'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Lisa]] [[Category:User_Documentation]] [[Category:Autopilots]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Tuning&amp;diff=20224</id>
		<title>Tuning</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Tuning&amp;diff=20224"/>
		<updated>2015-08-13T18:27:25Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Intro ==&lt;br /&gt;
&lt;br /&gt;
This page provides guidelines for tuning a new aircraft and additional practical tips. Be sure to familiarize yourself with the theory of [[Theory_of_Operation#PID|PID Controllers]] before you begin tuning your airframe. Use of the [[RTPlotter|real time plotter]] may help to visualize and understand the behavior of the control loops. Review [http://paparazzi.enac.fr/w/images/Users_manual.pdf User Manual] as well. Also reading [http://www.av8n.com/how/ See How It Flies, by John S. Denker] is very beneficial to get your airframe tuned well.&lt;br /&gt;
&lt;br /&gt;
==Energy Control==&lt;br /&gt;
&lt;br /&gt;
If you came to this page and want to learn about how to perform your [[Tuning_energy_control_loops | Energy control tuning]], this is '''not''' the page to read, go to [[Tuning_energy_control_loops | tuning energy control loops]].&lt;br /&gt;
&lt;br /&gt;
==Quickstart==&lt;br /&gt;
&lt;br /&gt;
'''Here is the sub-minimal ultra-quick-start guide: note that point 1 and 3 should ALWAYS be performed every time you reflash your plane!!!'''&lt;br /&gt;
&lt;br /&gt;
# Before take-off [[Tuning#Directions|check]] (beware: do not skip a test as it is not because 2 are good that the third will also be good)&lt;br /&gt;
## RC-left is aileron-left and up is up in [[AutopilotModes|MANUAL]].&lt;br /&gt;
## RC-left is aileron-left and up is up in [[AutopilotModes|AUTO1]].&lt;br /&gt;
## [[Tuning#Directions|turning the plane-left is aileron-right]] and nose-up is elevator-down with RC in neutral in [[AutopilotModes|AUTO1]]. (to check the [[GCS#PFD|Artificial horizon]] in the [[GCS|GCS]]: use the words: right wing sees the ground to not mess up left and right if uncertain.)&lt;br /&gt;
# Fly manual&lt;br /&gt;
## [[Tuning#Neutrals|trim your plane]]&lt;br /&gt;
## check [[Fixedwing_Configuration#Servos|servo deflections]] are good (sufficient but not aerobatic)&lt;br /&gt;
## remember the cruise throttle. (and max/min throttle if you will use aggressive-climb)&lt;br /&gt;
# On the ground, after trimming: &lt;br /&gt;
## Check with plane flat/cruise attitude on the ground that the ailerons/elevator do not move when you switch from MANUAL to AUTO1. This checks your IMU/Thermopiles are properly aligned and that [[Tuning#Trim|your trim values are in the airframe file and not the RC-transmitter]] &lt;br /&gt;
# Test [[Tuning#Auto_1|try AUTO1]]&lt;br /&gt;
## When entering AUTO1, make sure you try to turn before your plane is too far away since [[Fixedwing_Configuration#Auto1|AUTO1 circles are usually much larger than manual circles]].&lt;br /&gt;
## Make a [[RTPlotter|graph]] on the groundstation of DESIRED-&amp;gt;phi/theta and ATTITUDE-phi/theta to see if they match. &lt;br /&gt;
## When flying with IMU pay special attention here if after several left turns the plane still turns right too. Plot the IMU_ACC-&amp;gt;ax,ay,az to see the average vibration in your plane. If the vibration level is lower than half of gravity (5m/s2) than usually you are OK. If it is much more, you should dampen your IMU more. (in foam, or mounted on your heavy battery, ...)&lt;br /&gt;
# Only when AUTO1 works fine you can [[Tuning#Auto_1|go to AUTO2]]&lt;br /&gt;
## check that your throttle is not killed (RED) in the groundstation&lt;br /&gt;
## check that your cruise throttle is correct if you have a powerful motor &lt;br /&gt;
## if tuning the altitude loop seems difficult try the [[Tuning#Sample.2FSimple_Altitude_and_Throttle_Loop|simple 3 gain auto_throttle_loop]]&lt;br /&gt;
&lt;br /&gt;
== Sensors ==&lt;br /&gt;
&lt;br /&gt;
=== IMU / Sensors ===&lt;br /&gt;
You may want to look at the [[ImuCalibration]]. &amp;lt;br/&amp;gt;&lt;br /&gt;
While some Sensors can be operated with factory calibration (MPU6050 or 6000) other, for example Magnetometers require a calibration to the earth magnetic field and UAV radiated magnetic field to work satisfactory.&lt;br /&gt;
&lt;br /&gt;
=== Directions ===&lt;br /&gt;
* Reverse any servos and make sure no mechanical binding occurs at the limits of travel in Manual mode.&lt;br /&gt;
* Take the plane outside and engage AUTO1.  Bank and pitch the plane and verify that the controls respond in the correct direction AND that the PFD in the notebook responds correctly.  Note that your body will have a tremendous impact on the measured angles if using IR sensors. If using an IMU, there is no need to be outside. See note.&lt;br /&gt;
* Verify that AUTO1 stick movements respond in the correct direction - important! See note.&lt;br /&gt;
* Move the plane rapidly to ensure the gyro response resists motion - increase the gain if needed for better visualization.&lt;br /&gt;
NOTE: If the PFD responds in the wrong direction to the motion, you should adjust parameters in the INFRARED or IMU parts of the airframe file. If the control surfaces respond in the wrong direction to counteract motion (stabilize the aircraft, bring it back to neutral), reverse the servos in the airframe file. If the manual input from R/C causes the control surfaces to respond in the wrong direction (want them to force motion, not counteract motion), then you must reverse the channel on the R/C transmitter. Be sure to recheck surface neutrals and endpoints after doing such modifications. Also double check the gain signs, make sure none are positive that should be negative.&lt;br /&gt;
&lt;br /&gt;
== R/C, Modem, and GPS ==&lt;br /&gt;
* Make sure the GPS signal is strong (outdoors) - you should have a 3-D fix in less than 1 minute and at least some satellite signals above 40dB. The plane should not drift on the map by more than 10 meters.&lt;br /&gt;
* Perform a range test of R/C and modem signals.&lt;br /&gt;
* Ensure that two way communications are in place. Check that the motor starts up when launch is commanded or move a waypoint and check that it's updated in the autopilot.&lt;br /&gt;
&lt;br /&gt;
== Trim ==&lt;br /&gt;
&amp;lt;b&amp;gt;Important: You must never keep any trim, mixers, or rates in your R/C transmitter.&amp;lt;/b&amp;gt;  R/C trim can be applied in flight but must be corrected and removed on the ground before attempting autonomous flight.  Exponential can be useful and will not adversely affect AUTO1 flight but if &amp;quot;low rates&amp;quot; are needed they should be programmed on the same transmitter switch with AUTO1 so that you always have full travel in AUTO1.&lt;br /&gt;
* Fly the plane at what you feel is a suitable &amp;quot;cruise&amp;quot; throttle setting and set the trims.  Note that setting in the GCS and try to return to that exact setting in subsequent tests.  Enter that throttle setting in your airframe file.&lt;br /&gt;
* Check maximum pitch and roll response and adjust the mixer parameters or mechanical linkages after landing.&lt;br /&gt;
* Land and adjust the linkages.  If necessary, the PPM values can be read from the GCS and servo neutrals adjusted electronically, but manual adjustment will produce far better results.&lt;br /&gt;
* Fly again to verify trim and control response.  If satisfactory, check for any significant throttle-dependent roll.  Again, this is best to correct mechanically but can be addressed with the ''AILERON_OF_THROTTLE'' mixer in the autopilot.  Check also for any odd behavior at full throttle.&lt;br /&gt;
* Make sure that GPS and modem data is reliable during these test flights. Note particularly any tendency for the aircraft to appear to fly sideways on the map - this is an indication of weak GPS signals.&lt;br /&gt;
&lt;br /&gt;
== Auto 1 ==&lt;br /&gt;
* Engage Auto1 and ''immediately'' make sure you can turn both left and right!&lt;br /&gt;
* Fly at your &amp;quot;cruise&amp;quot; throttle and adjust the ''ROLL_PGAIN'' until the plane doesn't quite oscillate&lt;br /&gt;
* Adjust the IR roll neutral as needed&lt;br /&gt;
* Verify adequate pitch response and adjust PITCH_PGAIN as needed&lt;br /&gt;
* Experiment with different throttle settings and tune P and D gains as needed&lt;br /&gt;
&lt;br /&gt;
If you are alone in the field while tuning, setting values via your RC transmitter may come in handy, see [[Telemetry#R.2FC_Transmitter_Data_Uplink|RC receiver data uplink]]&lt;br /&gt;
&lt;br /&gt;
== Auto 2 ==&lt;br /&gt;
* Engage [[AutopilotModes|AUTO2]] and you're done! Make sure you keep a finger on the Mode switch to take over just in case.&lt;br /&gt;
&lt;br /&gt;
==Alternate Tuning Procedure==&lt;br /&gt;
Danstah wrote up a tuning procedure on this website http://www.engr.usu.edu/wiki/index.php/OSAMtuning&lt;br /&gt;
&lt;br /&gt;
==Sample/Simple Altitude and Throttle Loop==&lt;br /&gt;
&lt;br /&gt;
The dash button changes the NOMINAL_CRUISE_THROTTLE to the MAX_CRUISE_THROTTLE while the loiter button changes it to MIN_CRUISE_THROTTLE. &lt;br /&gt;
&lt;br /&gt;
This makes it easy to suddenly make the UAV fly a bit slower or a bit faster. However, when changing the throttle, you also need to change the elevator trim in order not to climb/descend too much. This it what AUTO_THROTTLE_LOITER_TRIM and AUTO_THROTTLE_DASH_TRIM are for. (I think the unit is MAX_PPRZ = 9600 = full deflection?) &lt;br /&gt;
&lt;br /&gt;
The auto-throttle loop is actually the most difficult loop to tune as it has both the speed and altitude that are correlated. Controlling both speed and altitude with high performance is very hard. It is way easier to control 1 entity (e.g. altitude) with higher performance and let the speed change a bit, or have an airspeed controller but then do the altitude slowly... &lt;br /&gt;
&lt;br /&gt;
Sample altitude controller:&lt;br /&gt;
---------------------&lt;br /&gt;
&lt;br /&gt;
Step1: outerloop: if altitude is not good -&amp;gt; compute a climb/descend rate. (including ALTITUDE_MAX_CLIMB)&lt;br /&gt;
&lt;br /&gt;
  climb_command = altitude_error x alt_pgain&lt;br /&gt;
&lt;br /&gt;
e.g. 10 m too low x 0.1 alt gain = climb_command at 1 m/s&lt;br /&gt;
e.g. 50 m too low x 0.1 alt gain = climb at 5 m/s &amp;gt; ALTITUDE_MAX_CLIMB(2) -&amp;gt; climb_command = 2m/s&lt;br /&gt;
&lt;br /&gt;
---------------------&lt;br /&gt;
&lt;br /&gt;
Step2: innerloop: [many many options here, but since you ask for simple I'll only give one robust and simple:]&lt;br /&gt;
&lt;br /&gt;
too low -&amp;gt; pitch up and extra throttle (if you only apply throttle, airspeed will increase and might even start to dive with full throttle if the nose is a bit heavy, if you only apply pitch airspeed will decrease and could lead to stall, with proper tuning you can get a pretty constant speed even while climbing and descending) &lt;br /&gt;
&lt;br /&gt;
  pitch_command = climb_command x pitch_of_vz&lt;br /&gt;
  throttle_command = nominal_cruise_trim_throttle + climb_command x throttle_climb_increment&lt;br /&gt;
&lt;br /&gt;
e.g. climb_command at 1 m/s x pitch_of_vz 0.15 = 0.15 radians pitch = 9 degrees pitch up&lt;br /&gt;
&lt;br /&gt;
e.g. climb_command at 1 m/s x throttle_climb_increment 0.25 with nominal_cruise_trim_throttle 0.5 = 75% throttle&lt;br /&gt;
&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
If you use AGRESSIVE_CLIMB then if the altitude error is larger than the chosen threshold a precomputed pitch and throttle will be applied. &lt;br /&gt;
&lt;br /&gt;
AUTO_PITCH is for constant throttle and control height with elevator only&lt;br /&gt;
&lt;br /&gt;
auto_throttle_p/i/d_gains are to regulate the climb rate more precisely&lt;br /&gt;
&lt;br /&gt;
==Other Misc things before flying==&lt;br /&gt;
&lt;br /&gt;
It's very important to address the issue of low voltage cut-off before flying (LVC). &lt;br /&gt;
There's a good chance that the LVC will kick in on the brushless ESC before the Paparazzi detects it. &lt;br /&gt;
If this happens, the ESC cut's off throttle, and there's no way the autopilot knows this, the plane keeps loosing altitude, &lt;br /&gt;
the autopilot tries to increase throttle, but the ESC does not respond, almost always leading to a mishap. &lt;br /&gt;
To avoid this, either turn off the LVC on the ESC, OR, make sure the autopilot kills throttle first, &lt;br /&gt;
by programming the CATASTROPHIC_BAT_LEVEL to something higher than the ESC LVC. &lt;br /&gt;
For example, set CATASTROPHIC_BAT_LEVEL to 9.5V, and the ESC LVC at 9V. &lt;br /&gt;
Don't ask how we know, it was a safe landing into a small tree :) No damage. BUT you cant get lucky always!&lt;br /&gt;
&lt;br /&gt;
Have a look at the [[Failsafe|failsafe]] and [[Airframe_Configuration#Battery|battery configuration]] for more details.&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:User_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=FAQ&amp;diff=20223</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=FAQ&amp;diff=20223"/>
		<updated>2015-08-13T18:13:18Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: come on guys, at least get the spelling of the project name right (misc. typos)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Is it possible to do XYZ?==&lt;br /&gt;
:Yes, sure! The beauty Paparazzi is that it is fully opensource'ed - '''Any''' feature or function you want '''can be added''' to the software and even the hardware.&lt;br /&gt;
&lt;br /&gt;
==How can I contribute?==&lt;br /&gt;
:See the [[Contributing| how to contribute]] wiki page.&lt;br /&gt;
&lt;br /&gt;
==How do I check which Paparazzi Version I'm using==&lt;br /&gt;
: Run ./paparazzi_version from you paparazzi directory.&lt;br /&gt;
: This simple script will run ''git describe'' to find the next reachable tag and print something like ''v5.1.1_testing-43-ge060371''.&lt;br /&gt;
: The output contains the most recent reachable tag, number of commits since then, SHA1 of that commit and whether the working directory was dirty.&lt;br /&gt;
: If you have an older version of Paparazzi that does not contain that script you can just run &amp;lt;tt&amp;gt;git describe --match &amp;quot;v[0-9].[0-9]*&amp;quot; --dirty --always --long&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==What equipment and components are suggested==&lt;br /&gt;
# Linux (Debian or Ubuntu) compatible or Apple Macintosh notebook computer, preferably with a very bright screen for outdoor use.&lt;br /&gt;
# Most any airframe that will accommodate a Paparazzi Autopilot and some extra weight and wiring - ''brushless motors are strongly suggested.''  See the [[Gallery|User's Gallery]] for some airframe examples.&lt;br /&gt;
# One of the [[Autopilots]] from one of the [[Get_Hardware|Paparazzi vendors]] or build your own from the downloadable plans/gerbers&lt;br /&gt;
# If it is not already included with the AP a external [[IMU]]&lt;br /&gt;
# A 2.4 GHz R/C Transmitter and Receiver with a 3-position switch and PPM output for selecting Manual/Stabilized/Auto.&lt;br /&gt;
# A pair of [[Modems]] along with any enclosures and antennas&lt;br /&gt;
# A [[Serial_Adapter|USB &amp;lt;-&amp;gt; UART]] adapter  for connecting the modem to your USB port and/or for serial flashing of bootloader code or tunnel access to the GPS receiver&lt;br /&gt;
# A standard Mini-B and Micro-B USB cable&lt;br /&gt;
# Lots of [[Other_Hardware#Wiring|very durable wire, crimpers, and molex pins or pre-crimped wire.]]&lt;br /&gt;
&lt;br /&gt;
==Are internal combustion engines supported?==&lt;br /&gt;
:Yes, not relying solely on inertial measurement, the Paparazzi system is very well suited for aircraft with high vibration levels.  Care must be taken to prevent oily exhaust residue buildup on the IR sensors and a simple variable must be added to properly address the special idle/kill needs of an IC engine.&lt;br /&gt;
&lt;br /&gt;
==Can Paparazzi fly a glider?==&lt;br /&gt;
:Sure.  Paparazzi uses throttle and pitch to control climb rate by default. You can fit an airspeed sensor and adjust your airframe configuration to maintain airspeed instead.&lt;br /&gt;
&lt;br /&gt;
==Will the autopilot provide enough 5V power for many/large/digital servos as well as a modem, video TX, etc.?==&lt;br /&gt;
:Depends on the Autopilot, compare the maximum output of the AP and the needed power&lt;br /&gt;
:The [[Tiny]] includes a high capacity and high efficiency switching voltage regulator intended to power servos, modems, video systems and other payloads. This regulator should be preferred to power the servos rather than a linear regulator.  While linear regulators may be rated for several amps, they require a great deal of cooling and can easily overheat with only a few hundred milliamps of continuous current without cooling.  By comparison, the switching regulator included on the Tiny can work continuously at 2A with little or no cooling. Be careful using high power or digital servos consuming a lot of current. If you use four or more of them on your airframe it is recommended to supply them separately. It is important to realize that the servos in any stabilized aircraft will operate continuously. Therefore a power supply that powers the servos reliably in manual flight may easily overheat or produce critical voltage drops in autonomous flight.&lt;br /&gt;
&lt;br /&gt;
==Do I need a separate battery or regulator to isolate the autopilot, servos, video, modem, etc. from one another?==&lt;br /&gt;
:The autopilot processor and sensors are powered by a 3.3V regulator and therefore are rather isolated from voltage fluctuations on the battery or 5V bus.&lt;br /&gt;
&lt;br /&gt;
==Can I use a Sirf, Trimble, etc. instead of the u-Blox GPS receiver?==&lt;br /&gt;
:Yes, but it would require a tremendous amount of work as some of the navigation code is dependent on some of the UBX messages.  NMEA does not provide messages in the desired form and substantial calculation would be required for conversion.  Any of the other proprietary protocols would work but you would need to write your own protocol handler. u-Blox (Hobbyking's costs &amp;lt;14€) offers great performance, size, and speed as well as the ability to easily configure the internal Kalman filter parameters to expect significant acceleration in 3-D space - a very important feature.&lt;br /&gt;
&lt;br /&gt;
==Does Paparazzi use DGPS, WAAS, EGNOS, or MSAS?==&lt;br /&gt;
:Most modern GPS receivers have the ability to process serial data sent from an external DGPS receiver, but the advent of WAAS/EGNOS has made the early ground-based DGPS transmitters nearly obsolete.  The u-Blox GPS receiver supports all common SBAS systems (WAAS, EGNOS, and MSAS), as well as any standard form of external DGPS.  It's important to understand that DGPS merely improves the ''accuracy'' of the position estimate by subtracting any static error.  The only way to improve the ''precision'' of the GPS is by improving the antenna or the GPS module itself.  See [http://en.wikipedia.org/wiki/Accuracy_and_precision Wikipedia:Accuracy and Precsion] for a detailed explanation of these terms.&lt;br /&gt;
&lt;br /&gt;
==How does the R/C receiver interface with the autopilot?==&lt;br /&gt;
:Standard hobby R/C transmitters multiplex up to 9 channels of PWM servo data into a single PPM signal which is encoded onto an FM wave for transmission, this signal is then decoded by the RF section of the R/C receiver back into the original PPM signal containing 9 servo position PWM values.  This signal is normally then sent to a demultiplexer (i.e. 4017) where it is separated into 9 individual servo signals on 9 individual pins.  The Paparazzi autopilot intercepts the signal between the RF section and the demultiplexer and does its own demultiplexing, filtering, and processing before multiplexing the manual or autonomous servo commands back into a single signal and passing them to the 4017 to be distributed to the servos.&lt;br /&gt;
&lt;br /&gt;
==Why does Paparazzi tap directly into the R/C receiver instead of using individual servo signals?==&lt;br /&gt;
:By connecting directly to the RF section of the R/C receiver we are able to obtain up to 9 channels of R/C servo data from a small, lightweight inexpensive 4 channel receiver with only 3 wires needed to connect the components.  Furthermore, the autopilot then has direct access to the raw R/C signal where it can be filtered, evaluated, and assessed for quality.  The autopilot can then alert the user of any loss of R/C signal as well as perform any pre-configured autonomous commands in response to a loss of signal.&lt;br /&gt;
&lt;br /&gt;
==Are PCM or 2.4GHz R/C systems compatible with Paparazzi?==&lt;br /&gt;
:Yes. Most good 2.4Ghz receivers can directly output a PPM signal on one servo pin. A general rule of thumb is that if you see any type of demultiplexer on your R/C receiver, you can look up the data sheet for it and likely tap into the input pin with success. Some information on compatible R/C receivers and how to find the PPM signal of your own receiver is given in the [[Other_Hardware#R.2FC_Receiver|RC receiver]] section.&lt;br /&gt;
&lt;br /&gt;
:If that's not possible, you can use the available PPM encoder board, to re-multiplex the servo channels into one PPM signal. This seems to be a common solution.&lt;br /&gt;
&lt;br /&gt;
==What R/C transmitters are compatible?==&lt;br /&gt;
:No mixing or programming is done in the transmitter so even the simplest models will suffice but one important requirement is a 3-position switch to select among the three autopilot modes: manual, stabilized only, and fully autonomous.  Those handy with electronics can replace a dial with a switch and resistor if needed.  The transmitter's PPM values need to be recorded and the channel used to control the autopilot mode must be stated.  Some commonly used transmitter configuration files are provided in the [http://cvs.savannah.gnu.org/viewvc/paparazzi/paparazzi3/conf/radios/ conf/radios] folder and the syntax of these files is easy to follow for those using other brands or models.&lt;br /&gt;
&lt;br /&gt;
==Can a gamepad/joystick be used to control the aircraft through the modem?==&lt;br /&gt;
:Yes, the code to do this was written some time ago though it was not tested in flight due to latency concerns with the primitive [[Modems#Coronis_WaveCard|Coronis]] modems used at the time.  Any of the [[modems]] currently recommended should work well in this manner but the theoretical reliability is still questionable due to the fact that no interrupt or prioritization structure exists for the telemetry data so any manual control inputs would be lumped in with the rest of the data to be lost or delayed as needed.&lt;br /&gt;
&lt;br /&gt;
==What do MANUAL/AUTO1/AUTO2 stand for?==&lt;br /&gt;
&lt;br /&gt;
:Those are the three modes that Paparazzi can operate in. Confer to [[AutopilotModes]] for more information.&lt;br /&gt;
&lt;br /&gt;
==What Electronic Speed Controllers (ESC) are compatible?==&lt;br /&gt;
:Any controller can be used, the exact PWM value that is sent to the controller for 0-100% throttle is completely configurable in the airframe file so all controllers are compatible and any controller will arm properly with or without the use of an R/C transmitter.  Upon each boot, the autopilot immediately sends whatever you have defined as 0% throttle (typically around 1200μs) and maintains that signal until a manual or autonomous command is given.  Most modern controllers are &amp;quot;auto calibrating&amp;quot; which is an undesirable feature for R/C pilots and even more so for autonomous systems but can be dealt with.  The calibration is done by defining the PWM value at boot to be 0% power and then defining some initial arbitrary mid-range value such as 1500μs to be 100% until a higher value is seen.  The net result of this behavior is that the motor is given full power at any command above 50% throttle until 100% throttle has actually been commanded at least once.  This is not an issue for planes that routinely take off at 100% throttle but can disrupt the throttle tuning and altitude control on any flights where 100% throttle has never been commanded. [http://www.castlecreations.com/products/products_fly.html Castle Creations Electronic Speed Controllers] can be configured for &amp;quot;fixed endpoints&amp;quot; so the ESC does not need to &amp;quot;learn&amp;quot; the endpoints at first takeoff this providing a consistent and predictable throttle response. By default this range 1250-1850μs but can be set at different values where needed.&lt;br /&gt;
&lt;br /&gt;
: For quadrocopters a ESc with a very low latency is highly recommended. That can be a cheap standard ESC with a upgraded firmware (which uses I2C as input) or a high quality esc (mocrocopter ESC)&lt;br /&gt;
&lt;br /&gt;
==Can traditional throttle stick programming be done on the ESC once connected to the autopilot?==&lt;br /&gt;
:Yes.  If the transmitter is on with the throttle at full or whatever is required for your ESC when the autopilot is first booted, the autopilot will immediately see the manual control signal and the throttle position and pass that along to the ESC as the first value, triggering the programming mode.&lt;br /&gt;
&lt;br /&gt;
==Does Paparazzi support digital servos?==&lt;br /&gt;
:Of course.  Digital servos use exactly the same electrical interface as their analog counterparts, the only difference being in the way they control the motor.  Analog servos use a '''P'''roportional feedback loop, meaning the voltage sent to the motor is proportional to the difference between the measured and intended position of the arm.  Digital servos use a '''P'''roportional + '''D'''erivative ('''PD''') feedback loop.  The derivative term considers the current speed and direction of the servo as well as the speed and direction of the pilot's stick command.  The derivative term will increase power to the motor if the servo is moving the wrong direction (providing faster direction changes) and will reduce/reverse power if the servo is near it's desired position but moving too fast (reducing overshoot).  The net effect of this is that a digital servo can use a much stronger '''P''' term without risk of oscillation and overshoot because the '''D''' term is there to intelligently dampen it as needed and boost it whenever it can.&lt;br /&gt;
:How does the inclusion of a '''D''' term make an analog servo become digital?  Analog servos use a simple opamp to linearly relate the motor voltage to the difference between the potentiometer reading and PWM signal, whereas digital servos use a microprocessor to analyze the potentiometer position and velocity as well as the current and recent PWM signals to calculate the optimum voltage to send to the motor.  &lt;br /&gt;
:'''Important:''' Please be aware that autonomous flight involves ''continuous'' movement of all servos.  Make sure your power supply is capable of handling this and that your servos are capable of continuous operation without overheating - especially if you use digital servos.&lt;br /&gt;
&lt;br /&gt;
==Can I solder wires directly to the autopilot instead of using the molex connectors?==&lt;br /&gt;
:Sure, only for some board it is easier to do than for others. Tiny: All of the molex headers are thru-hole and you can easily solder small gauge wire directly to the pins that protrude from these headers on the back of the board.  It's important to note that '''standard servo wire cannot be soldered reliably''' in this fashion - you must use only high-grade wire intended for soldering (no vinyl insulation!).  Direct soldering is not recommended, but it is possible ofcourse.  See the [[Other_Hardware#Wiring|Wiring]] section for suggested wire types and sources. If you want to go the direct soldering path, be sure to you have '''excellent soldering skills''' and use high quality wiring.&lt;br /&gt;
&lt;br /&gt;
==What are the paparazzi failsafe features and how do I configure them?==&lt;br /&gt;
The basic autopilot already has several built-in failsafe features ranging from lowlevel to highlevel and from implied to optional. For more details take a look on the [[Failsafe]] page.&lt;br /&gt;
&lt;br /&gt;
==Why do I only get a blank (black) GCS==&lt;br /&gt;
:The GCS stays blank until you get telemetry messages (either from the real aircraft or simulated) with the correct MD5 checksum meaning the autopilot has the correct and up to date flightplan/airframe/... programmed in it (in case of an MD5 problem you constantly get a lot of warnings in paparazzi center). &lt;br /&gt;
:'''Solution''': Probably your telemetry is not set up correctly, this is most likely a [[XBee configuration]] issue.[[Subsystem/telemetry#Configure_Options|Configure the baudrate for your XBee connected to the autopilot]] and [[Subsystem/telemetry#Set_GCS_baud_rate|set the baudrate for the link to the one the ground XBee uses]] (They don't need to be the same). Also make sure your xbee cable is correct, transmit (tx) of xbee goes to receive (rx) on the autopilot and vice versa.&lt;br /&gt;
&lt;br /&gt;
==Why do I get a Failure(&amp;quot;#of_world:no georef&amp;quot;) when trying to load map tiles==&lt;br /&gt;
:You get the georef error because the location is not initialized (probably GCS still blank and no aircraft are present). You can't get map tiles for nowhere...&lt;br /&gt;
:'''Solution''': Set up your telemetry properly so you get messages from the aircraft OR start a simulation with the appropriate coordinates then load the map tiles.&lt;br /&gt;
&lt;br /&gt;
==How do I check if my telemetry is working?==&lt;br /&gt;
:'''Solution''': Launch the link and messages tools in the Paparazzi Center. You should see the the messages coming in (blinking green) in the messages window.&lt;br /&gt;
: If you get an the error ''Failure(&amp;quot;Error opening modem serial device : fd &amp;lt; 0 (/dev/ttyUSB0)&amp;quot;)'' from ''link'', your modem is either not connected at all, or just available under a different device name. Check if you set the [[Installation#Setting_access_rights_for_USB_download|udev rules]] and if your modem becomes available under the device you set.&lt;br /&gt;
: You might need to adjust the device and baud-rate of the link according to your setup, e.g. &amp;lt;tt&amp;gt;link -d /dev/ttyUSB0 -s 57600&amp;lt;/tt&amp;gt;&lt;br /&gt;
: If you're stuck you can make ''link'' very verbose by setting the ''PPRZ_DEBUG'' environment variable to '' '*' ''&lt;br /&gt;
&lt;br /&gt;
==Why don't I get a GPS position?==&lt;br /&gt;
:'''Problem''': Your GPS seems to be working, but you cannot get a valid position fix. Speed and course are displayed correctly, though. Possibly you also see Invalid_argument(&amp;quot;Latlong.of_utm&amp;quot;) errors on the GCS log.&lt;br /&gt;
&lt;br /&gt;
This may happen if you have configured the wrong GPS subsystem for your Tiny board.&lt;br /&gt;
If you have the LEA-5H module on your Tiny board, but have configured&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;subsystem name=&amp;quot;gps&amp;quot; type=&amp;quot;ublox_utm&amp;quot;/&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
in your airframe file, this will occur because the 5H module does not support UTM position.&lt;br /&gt;
&lt;br /&gt;
:'''Solution''': Make sure your GPS is [[GPS#GPS_configuration_using_U-Center|configured]] correctly and change the gps type to &amp;quot;&amp;lt;tt&amp;gt;ublox&amp;lt;/tt&amp;gt;&amp;quot; if applicable.&lt;br /&gt;
&lt;br /&gt;
==Why do I get a CRITICAL **: murrine_style_draw_box: assertion `width &amp;gt;= -1' failed error message on starting the GCS==&lt;br /&gt;
:'''Solution''': This error is not critical at all and can be safely ignored.  &lt;br /&gt;
It is triggered by a bug in the Murrine GTK engine in combination with the default theme which Ubuntu uses, as detailed here:&lt;br /&gt;
https://bugs.launchpad.net/ubuntu/+source/light-themes/+bug/538499&lt;br /&gt;
&lt;br /&gt;
==Do Paparazzi autopilots support onboard datalogging with an uSD or SD card?==&lt;br /&gt;
:Currently, writing to an SD card takes a considerable amount of processor resources, enough to significantly impact critical timings and autopilot performance. For this reason, no onboard datalogging is supported on current autopilots. If logging is needed on the aircraft (say for use without a datalink) then a second board that &amp;quot;sniffs&amp;quot; the datalink telemetry is needed. Support for this is available in Paparazzi. For information, see [[Data Logger]].&lt;br /&gt;
&lt;br /&gt;
==Telemetry not working==&lt;br /&gt;
:If you are receiving the error &amp;quot;Failure(&amp;quot;Error opening modem serial device : fd &amp;lt; 0 (/dev/ttyUSB0)&amp;quot;)&amp;quot; &lt;br /&gt;
:'''Solution''': You might need to add your user to the modems group (dialout), then log out and in again.&lt;br /&gt;
:write in terminal:$ sudo adduser &amp;lt;user&amp;gt; dialout&lt;br /&gt;
:it will be effective after your next login or simply write:&lt;br /&gt;
:$newgrp dialout&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:User_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Reference/bootloader&amp;diff=20144</id>
		<title>Reference/bootloader</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Reference/bootloader&amp;diff=20144"/>
		<updated>2015-07-14T20:02:18Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: typos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| align=right&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Firmware Flashing&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Adding a bootloader==&lt;br /&gt;
&lt;br /&gt;
[[Lpc21BootloaderUpload|If you just want to know how to add a bootloader to the LPC]]&lt;br /&gt;
&lt;br /&gt;
==Hardware boot sector==&lt;br /&gt;
&lt;br /&gt;
Each board can be programmed with a serial number and additional board&lt;br /&gt;
information (board type, board version, hw options like the type of GPS&lt;br /&gt;
receiver used, manufacturer, mfd date, ...) in a flash sector. This&lt;br /&gt;
hardware sector is written once when the board is programmed for the&lt;br /&gt;
first time and will not be changed (or only if hardware changes are&lt;br /&gt;
done, e.g. GPS changed). The bootloader and the autopilot software can&lt;br /&gt;
read the hw sector.&lt;br /&gt;
&lt;br /&gt;
==Software boot sector==&lt;br /&gt;
&lt;br /&gt;
The software boot sector is rewritten each time a new autopilot software&lt;br /&gt;
is flashed to the device. It contains the hash value for the build,&lt;br /&gt;
build date, the aircraft (ID and name) it was built for and other&lt;br /&gt;
useful configuration information.&lt;br /&gt;
&lt;br /&gt;
It can contain various ways to protect the software from running on an&lt;br /&gt;
incompatible hardware. The simplest way is to give a hardcoded value&lt;br /&gt;
for the serial number. The bootloader will at least report a warning if&lt;br /&gt;
someone tries to flash a software into a hardware that contains the&lt;br /&gt;
wrong serial number. The sw boot sector could contain a specific&lt;br /&gt;
hardware type, version and sub information that the software is built&lt;br /&gt;
for. The bootloader will refuse to flash if this does not fit.&lt;br /&gt;
&lt;br /&gt;
Another way would be to configure the autopilot software &amp;quot;on the fly&amp;quot; if&lt;br /&gt;
possible. Example: The hw sector contains the type, speed and the serial&lt;br /&gt;
port (0/1) that the GPS is connected to. The ap software reads this&lt;br /&gt;
information and configures itself. That way one software elf image&lt;br /&gt;
could run on almost all hardwares of a type, e.g. Tiny. There are still&lt;br /&gt;
some hard-to-see limitations, for example if a modem is connected to a&lt;br /&gt;
serial LPC port that does not have handshake lines but the software&lt;br /&gt;
requires that. Long and buggy lists would be the result...&lt;br /&gt;
&lt;br /&gt;
==Make==&lt;br /&gt;
&lt;br /&gt;
The board serial number can be mentioned in the makefile for the&lt;br /&gt;
aircraft to make sure that it only runs on that board. The board and&lt;br /&gt;
board version could be in there. It would be a lot of work and an&lt;br /&gt;
additional build system to mention the necessary hardware in each .c&lt;br /&gt;
file, maybe not useful.&lt;br /&gt;
&lt;br /&gt;
I think it would be cool to not have any '#ifdef' switches any more. The&lt;br /&gt;
software can read the configuration and react to that. If there are&lt;br /&gt;
limitations there could be a a minimum board version (e.g. &amp;gt; V1.1)&lt;br /&gt;
could be given. If future versions get &amp;quot;too&amp;quot; incompatible, a new board&lt;br /&gt;
type or board major version is issued.&lt;br /&gt;
&lt;br /&gt;
==Sectors==&lt;br /&gt;
&lt;br /&gt;
The sectors are &amp;quot;C&amp;quot; structures. All entries are n * 32bit/4bytes long.&lt;br /&gt;
They start with the ASCII word for &amp;quot;PPRZ&amp;quot; followed by the 32bit value&lt;br /&gt;
for the maximum overall length. The third value points to the last&lt;br /&gt;
valid entry in the sector. This value increases each time the structure&lt;br /&gt;
is enhanced. Entries can be added but must be downwards compatible - it&lt;br /&gt;
is not allowed to remove values. The last valid word of the sector is a&lt;br /&gt;
32bit CRC. The meaning of values is defined through a &amp;quot;C&amp;quot; header or XML&lt;br /&gt;
file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==On board software==&lt;br /&gt;
&lt;br /&gt;
The bootloader should make sure that a valid hw sector exists when&lt;br /&gt;
flashing new ap software. Nevertheless is could happen that the ap&lt;br /&gt;
software realizes it could not start due to a crc fail, non valid&lt;br /&gt;
values or similar. We need a safety procedure what to do then.&lt;br /&gt;
&lt;br /&gt;
[[Category:Firmware Flashing]] [[Category:Developer_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Subsystem/ins&amp;diff=20096</id>
		<title>Subsystem/ins</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Subsystem/ins&amp;diff=20096"/>
		<updated>2015-07-13T15:23:41Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages hideprefix=always&amp;gt;Subsystems&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
== INS subsystem ==&lt;br /&gt;
The INS (Inertial Navigation System) subsystem specifies which position and velocity estimation algorithm you are using.&lt;br /&gt;
&lt;br /&gt;
Most of the INS filters are only providing position and speed, and they need to be used together with an [[Subsystem/ahrs|AHRS (Attitude and Heading Reference System) filter]] for attitude. Currently, only the experimental invariant filter is a full INS.&lt;br /&gt;
&lt;br /&gt;
Currently possible INS subsystem types are:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
! Type !! Point Type !! Firmwares !! Notes&lt;br /&gt;
|-&lt;br /&gt;
|'''[[Subsystem/ins#alt_float|alt_float]]''' || floating || fixedwing || &lt;br /&gt;
|-&lt;br /&gt;
|'''[[Subsystem/ins#GPS passthrough (gps_passthrough)|gps_passthrough]]''' ||  || all ||&lt;br /&gt;
|-&lt;br /&gt;
|'''[[Subsystem/ins#xsens|xsens]]''' ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|'''[[Subsystem/ins#xsens700|xsens700]]'''  ||  ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|'''[[Subsystem/ins#no_type|no_type]]''' ||  || all || &lt;br /&gt;
|-&lt;br /&gt;
|'''[[Subsystem/ins#Horizontal Filter Float (hff)|Horizontal Filter Float (hff)]]''' || floating ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|'''[[Subsystem/ins#extended|extended]]''' || floating? || all ||&lt;br /&gt;
|-&lt;br /&gt;
|'''[[Subsystem/ins#ardrone2|ardrone2]]''' || floating ||  ||&lt;br /&gt;
|-&lt;br /&gt;
|'''[[Subsystem/ins#float_invariant|float_invariant]]''' || floating || fixedwing ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
e.g. for the extended filter:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing or rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ins&amp;quot; type=&amp;quot;extended&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Implementations ==&lt;br /&gt;
&lt;br /&gt;
=== alt_float ===&lt;br /&gt;
Filters altitude and climb rate for fixedwings.&lt;br /&gt;
&lt;br /&gt;
A 2-state Kalman filter that estimates vertical position and vertical velocity from GPS and barometric data.&lt;br /&gt;
&lt;br /&gt;
When ''USE_BAROMETER'' is defined to ''TRUE'':&lt;br /&gt;
* GPS horizontal position and horizontal velocity is directly passed through&lt;br /&gt;
* GPS vertical position sets the altitude for the barometric reference pressure (QFE)&lt;br /&gt;
* Vertical position and velocity is a filtered based on barometric pressure with respect to the reference pressure and GPS vertical velocity readings.&lt;br /&gt;
&lt;br /&gt;
When ''USE_BAROMETER'' is not defined, ''FALSE'' or ''0'':&lt;br /&gt;
* GPS velocity is directly passed through to the vehicle's state.&lt;br /&gt;
* GPS horizontal position is directly passed through.&lt;br /&gt;
* Altitude is filtered based on GPS height and vertical velocity data.&lt;br /&gt;
&lt;br /&gt;
'''Parameters'''&lt;br /&gt;
&lt;br /&gt;
USE_BAROMETER - Enables the use of barometric data&lt;br /&gt;
&lt;br /&gt;
DEBUG_ALT_KALMAN - Enables debug messages from the subsystem (Default: not defined)&lt;br /&gt;
&lt;br /&gt;
e.g. to use with barometer:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ins&amp;quot; type=&amp;quot;alt_float&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;define name=&amp;quot;USE_BAROMETER&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== GPS passthrough (gps_passthrough) ===&lt;br /&gt;
&amp;quot;dummy&amp;quot; INS that does no filtering whatsoever. It directly passes GPS position and velocity through.&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing or rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ins&amp;quot; type=&amp;quot;gps_passthrough&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== xsens ===&lt;br /&gt;
XSens Mti-G&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ins&amp;quot; type=&amp;quot;xsens&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;configure name=&amp;quot;XSENS_UART_NR&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;configure name=&amp;quot;XSENS_UART_BAUD&amp;quot; value=&amp;quot;B115200&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/subsystem&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== xsens700 ===&lt;br /&gt;
XSens Mti-G&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;load name=&amp;quot;ins_xsens_MTiG_fixedwing.xml&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;configure name=&amp;quot;XSENS_UART_NR&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/load&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== no_type ===&lt;br /&gt;
Vertical filter (in float) estimating altitude, vertical velocity and accelerometer bias.&lt;br /&gt;
&lt;br /&gt;
If USE_GPS, horizontal position and velocity is set directly by GPS.&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;subsystem name=&amp;quot;ins&amp;quot;/&amp;gt; &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Horizontal Filter Float (hff) ===&lt;br /&gt;
simple with float vertical and horizontal filters for INS&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing or rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ins&amp;quot; type=&amp;quot;hff&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== extended ===&lt;br /&gt;
Extended vertical filter (in float).&lt;br /&gt;
&lt;br /&gt;
A 4-state Kalman filter that estimates:&lt;br /&gt;
* vertical position&lt;br /&gt;
* vertical speed&lt;br /&gt;
* accelerometer bias&lt;br /&gt;
* barometric offset&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing or rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;ins&amp;quot; type=&amp;quot;extended&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
'''Parameters'''&lt;br /&gt;
&lt;br /&gt;
INS_PROPAGATE_FREQUENCY - Defines the frequency (Hz) of the propagation model (Default: PERIODIC_FREQUENCY)&lt;br /&gt;
&lt;br /&gt;
=== ardrone2 ===&lt;br /&gt;
simple INS with float vertical filter for use with ardrone2_sdk&lt;br /&gt;
&lt;br /&gt;
=== float_invariant ===&lt;br /&gt;
attitude and speed estimation for fixedwings via invariant filter&lt;br /&gt;
&lt;br /&gt;
[[Category:User_Documentation]] [[Category:Subsystems]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&amp;diff=20056</id>
		<title>Flight Plans</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Flight_Plans&amp;diff=20056"/>
		<updated>2015-07-10T14:36:41Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A '''flight plan''' is a XML document which one can create and store aboard an autopilot. The flight plan will describe how you want your aircraft to travel if released into into the wild blue yonder.&lt;br /&gt;
&lt;br /&gt;
== DTD and Structure ==&lt;br /&gt;
&lt;br /&gt;
The formal description of the flight plan file is given in the [http://en.wikipedia.org/wiki/Document_Type_Definition '''DTD'''] (located in &amp;lt;tt&amp;gt;conf/flight_plans/flight_plan.dtd&amp;lt;/tt&amp;gt;). This&lt;br /&gt;
DTD must be referenced in the header of your flight plan XML document using the following line:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;!DOCTYPE flight_plan SYSTEM &amp;quot;flight_plan.dtd&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The flight plans are stored in the &amp;lt;tt&amp;gt;conf/flight_plans&amp;lt;/tt&amp;gt; directory. The [[Flight_Plan_Editor|flight plan editor]] can be used to create basic flight plans via the GUI.&lt;br /&gt;
&lt;br /&gt;
Extract from the [http://en.wikipedia.org/wiki/Document_Type_Definition DTD]:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;!ELEMENT flight_plan (header?,waypoints,sectors?,include*,exceptions?,blocks)&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''A flight plan is composed of two mandatory elements: [[#waypoints|waypoints]] and [[#blocks|blocks]]'''&lt;br /&gt;
&lt;br /&gt;
The root &amp;lt;tt&amp;gt;flight_plan&amp;lt;/tt&amp;gt; element is specified with several attributes:&lt;br /&gt;
 &amp;lt;tt&amp;gt;'''&amp;lt;flight_plan name lat0 lon0 ground_alt security_height home_mode_height qfu alt max_dist_from_home&amp;gt;'''&amp;lt;/tt&amp;gt;&lt;br /&gt;
; &amp;lt;tt&amp;gt;'''name'''&amp;lt;/tt&amp;gt;: The name of the mission (a text string)&lt;br /&gt;
; &amp;lt;tt&amp;gt;'''lat0, lon0'''&amp;lt;/tt&amp;gt;: Defines the latitude and longitude coordinates of the reference point {0,0} in WGS84 degree coordinates&lt;br /&gt;
; &amp;lt;tt&amp;gt;'''ground_alt'''&amp;lt;/tt&amp;gt;: The ground altitude (in meters), Above Sea Level where you are flying. It defines the &amp;lt;tt&amp;gt;GROUND_ALT&amp;lt;/tt&amp;gt; constant value which can be used in combination with a waypoint &amp;lt;height&amp;gt; parameter to define a waypoint height&lt;br /&gt;
; &amp;lt;tt&amp;gt;'''security_height'''&amp;lt;/tt&amp;gt;:  The height (over &amp;lt;tt&amp;gt;'''ground_alt'''&amp;lt;/tt&amp;gt;) used by the circle-home failsafe procedure and in other flight procedures such as formation flight and anti-collision avoidance. Warnings are produced if you place a waypoint lower than &amp;lt;tt&amp;gt;'''security_height'''&amp;lt;/tt&amp;gt; (usually the case for the landing point)&lt;br /&gt;
; &amp;lt;tt&amp;gt;'''home_mode_height'''&amp;lt;/tt&amp;gt; (optional): This optional attribute available since v4.2 allows to override &amp;lt;tt&amp;gt;'''security_height'''&amp;lt;/tt&amp;gt; as failsafe height in home mode. If &amp;lt;tt&amp;gt;'''home_mode_height'''&amp;lt;/tt&amp;gt; Is set lower than &amp;lt;tt&amp;gt;'''security_height'''&amp;lt;/tt&amp;gt;, the later is used. This attribute is useful if you need to return home at a high altitude rather than a low altitude.&lt;br /&gt;
; &amp;lt;tt&amp;gt;'''qfu'''&amp;lt;/tt&amp;gt; (optional): defines the global constant &amp;lt;tt&amp;gt;QFU&amp;lt;/tt&amp;gt;. It usually is the magnetic heading in degrees (north=0, east=90) of the runway, the opposite of wind direction. This constant may be used in the mission description. It is also used by the simulator as the original course of the aircraft. So if you want to take off and climb to the West you would use qfu=270. &lt;br /&gt;
; &amp;lt;tt&amp;gt;'''alt'''&amp;lt;/tt&amp;gt;: The default altitude of waypoints ([[Altitude_definitions|Above Sea Level]]). So if your ground altitude is 400 then alt needs to be a value greater than ground altitude and above any obstructions in the flight plan. &lt;br /&gt;
; &amp;lt;tt&amp;gt;'''max_dist_from_home'''&amp;lt;/tt&amp;gt;: A radius representing the maximum allowed distance (in meters) from the HOME waypoint. Exceeding this value (ie flying outside the circle with this radius) will trigger an exception. It is up to you to define the block to be executed (ie what to do) for the exception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''Here is an '''example''' of such a line in the top of a flight plan:''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;flight_plan alt=&amp;quot;250&amp;quot; ground_alt=&amp;quot;185&amp;quot; lat0=&amp;quot;43.46223&amp;quot; lon0=&amp;quot;1.27289&amp;quot; name=&amp;quot;Example Muret&amp;quot; max_dist_from_home=&amp;quot;300&amp;quot; qfu=&amp;quot;270&amp;quot; security_height=&amp;quot;25&amp;quot; &amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that a flight plan could also contain optional &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt;'s and &amp;lt;tt&amp;gt;exceptions&amp;lt;/tt&amp;gt; cases.&lt;br /&gt;
&lt;br /&gt;
In English the above flight plan says the name is Example Muret. The reference coordinates for the 0,0 point is: 43.46223 (lat) and 1.27289 (long). The flying site 0,0 location is 185m above sea level. The security height is 25m above 0,0 point or 210m above sea level. The default (ie if not defined in a waypoint this alt is used) altitude is 250m (above sea level). The home mode block altitude is defined to be 150m above sea level. Also, for security, a circle is defined with a radius that's 300m from 0,0 position. This is the max_dist_from_home value. Fly 301m from 0,0 and an exception is triggered. A useful block is to trigger/go to the home mode block and return to home when the aircraft flies outside the safety circle. Example flight plans are helpful for study before you build your own from scratch.&lt;br /&gt;
&lt;br /&gt;
== Waypoints ==&lt;br /&gt;
&lt;br /&gt;
The waypoints are the geographic locations used to specify the trajectories. A waypoint is specified by it's name and coordinates:&lt;br /&gt;
 &amp;lt;tt&amp;gt;''' &amp;lt;waypoint name wpx wpy [alt] [height]/&amp;gt; '''&amp;lt;/tt&amp;gt;&lt;br /&gt;
where wpx and wpy are real positional coordinates ( &amp;lt;tt&amp;gt;'''lat/lon'''&amp;lt;/tt&amp;gt; )  '''or''' UTM coordinates ( &amp;lt;tt&amp;gt;'''utm_x0/utm_y0'''&amp;lt;/tt&amp;gt; ) '''or''' relative coordinates ( &amp;lt;tt&amp;gt;'''x/y'''&amp;lt;/tt&amp;gt; ) in meters from your reference point {0,0} .  &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; is an optional parameter and can be used to assign an altitude to a particular waypoint that is different from the globally defined &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; parameter of the flightplan. The &amp;lt;tt&amp;gt;height&amp;lt;/tt&amp;gt; attribute can be used to set the waypoint height relative to the [[Altitude_definitions|ground altitude]] (&amp;lt;tt&amp;gt;ground_alt&amp;lt;/tt&amp;gt;) of the flight plan for this waypoint.&lt;br /&gt;
&lt;br /&gt;
An example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;waypoints&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;HOME&amp;quot; x=&amp;quot;0.0&amp;quot; y=&amp;quot;30.0&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;BRIDGEOVERRIVER&amp;quot; x=&amp;quot;-100.0&amp;quot; y=&amp;quot;60.0&amp;quot; alt=&amp;quot;270.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;MyBarn&amp;quot; x=&amp;quot;-130.0&amp;quot; y=&amp;quot;217.5&amp;quot; alt=&amp;quot;3000.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;3&amp;quot; x=&amp;quot;-30.0&amp;quot; y=&amp;quot;50&amp;quot; height=&amp;quot;50.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;4&amp;quot; x=&amp;quot;-30.0&amp;quot; y=&amp;quot;50.&amp;quot; alt=&amp;quot;ground_alt + 50&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;_MYHELPERSPOT&amp;quot; x=&amp;quot;-30.0&amp;quot; y=&amp;quot;60&amp;quot; height=&amp;quot;50.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;_MYOTHERHELPERSPOT&amp;quot; x=&amp;quot;-70.0&amp;quot; y=&amp;quot;90&amp;quot; height=&amp;quot;70.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;TOWER&amp;quot; lat=&amp;quot;48.858249&amp;quot; lon=&amp;quot;2.294494&amp;quot; height=&amp;quot;324.&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;waypoint name=&amp;quot;MountainCAFE&amp;quot; utm_x0=&amp;quot;360284.8&amp;quot; utm_y0=&amp;quot;4813595.5&amp;quot; alt=&amp;quot;1965.&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Tips'''&lt;br /&gt;
* Waypoints are easily adjusted with the [[Flight_Plan_Editor|flight plan editor]].&lt;br /&gt;
* If a waypoint name starts with an underscore ( _ ), the waypoint is '''not displayed''' in the GCS, except in editor mode.&lt;br /&gt;
* The maximum number of waypoints is 254.&lt;br /&gt;
* A waypoint named &amp;lt;tt&amp;gt;HOME&amp;lt;/tt&amp;gt; is required if the failsafe HOME mode procedure is used.&lt;br /&gt;
* A waypoints index/reference pointer is derived by prefixing the waypoint name with &amp;quot;WP_&amp;quot;. Useful when a [[#Call |call function]] uses the waypoints reference index vs. it's name.&lt;br /&gt;
&lt;br /&gt;
== Sectors ==&lt;br /&gt;
&lt;br /&gt;
=== Static sectors (default) ===&lt;br /&gt;
&lt;br /&gt;
Flat ''Sectors'' can be described as an area defined by list of waypoint corners. Such an area will be displayed in the Ground Control Station (GCS) by colored lines connecting the cornerpoints.&lt;br /&gt;
A function is generated to check if a point, usually the aircraft itself, is ''inside'' this sector. Currently, this feature requires that the polygon is &amp;lt;b&amp;gt;convex&amp;lt;/b&amp;gt; and described in a &amp;lt;b&amp;gt;clockwise&amp;lt;/b&amp;gt; order. For a sector named &amp;lt;tt&amp;gt;MyBigGarden&amp;lt;/tt&amp;gt; the generated function for the example here would be &amp;lt;tt&amp;gt;bool_t InsideMyBigGarden(float x, float y);&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;y&amp;lt;/tt&amp;gt; are east and north coordinated, in meters, relative to the geographic reference of the flight plan. If the flight plan is dynamically relocated, such a sector will be relocated but the display is currently not updated on the GCS. It would be great if one would help improving that part of the source code. Note that sector names are not allowed to contain spaces.&lt;br /&gt;
&lt;br /&gt;
For example, with the following element in a flight plan.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;sectors&amp;gt;&lt;br /&gt;
    &amp;lt;sector name=&amp;quot;MyBigGarden&amp;quot; color=&amp;quot;red&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;_1&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;_2&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;_3&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;_4&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/sector&amp;gt;&lt;br /&gt;
  &amp;lt;/sectors&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is then possible to add an exception clause to your flightplan. For example if the aircraft for some reason flies outside this, defined by us, sector the airframe will fly to a standby waypoint. The exclamation mark (!) means the boolean operator &amp;lt;tt&amp;gt;NOT&amp;lt;/tt&amp;gt; in this example. In regular language one would describe &amp;quot;If my airframe is NOT inside the MyBigGarden sector anymore then deroute it to the standby waypoint. In Flightplan &amp;quot;Speak&amp;quot; this is written like: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;exception cond=&amp;quot;! InsideMyBigGarden(GetPosX(), GetPosY())&amp;quot; deroute=&amp;quot;standby&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NOTE: editing of the waypoints of the sector during the flight will not dynamically update the inside function. It will always check if the position is inside the original sector.&lt;br /&gt;
&lt;br /&gt;
'''Tips'''&lt;br /&gt;
* A nice option in the corner notation is that one can add an underscore ( _ ) in front of the name; a corner or waypoint name that starts with an underscore is not displayed in the GCS. Only in editor mode it is visible. It is visible in editor mode, because if you the could not see it, it also would be not possible to edit or drag the corner or waypoint to another position.&lt;br /&gt;
* The color indicating the sector borders is not fixed but can be defined by oneself if wished for via the color attribute.&lt;br /&gt;
&lt;br /&gt;
=== Dynamic sectors ===&lt;br /&gt;
&lt;br /&gt;
With the latest version (v5.5-devel-628), it is possible to create dynamic sectors. The procedure to create the sector is the same than for the static version with an extra attribute '''type=&amp;quot;dynamic&amp;quot;''':&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;sectors&amp;gt;&lt;br /&gt;
    &amp;lt;sector name=&amp;quot;MyBigGarden&amp;quot; color=&amp;quot;red&amp;quot; type=&amp;quot;dynamic&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;C1&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;C2&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;C3&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;corner name=&amp;quot;C4&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/sector&amp;gt;&lt;br /&gt;
  &amp;lt;/sectors&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also recommended to avoid using hidden waypoints (no _ prefix), so you can move the corner of your sector from the GCS. The polygon is updated on the 2D map to reflect the new waypoints positions.&lt;br /&gt;
Beside the possibility to change the shape of the area in flight, one of the main benefit is that the algorithm behind allows concave hulls. The only restriction is that the edges of the polygon should not cross each other.&lt;br /&gt;
&lt;br /&gt;
The generated function is the same than the static version and can be used the same way.&lt;br /&gt;
&lt;br /&gt;
== Includes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; is used to add some flight plan elements defined in an external procedure. It’s useful to include pre-written procedures with only few arguments and then clarify the flight plan.&lt;br /&gt;
Here is the structure:&lt;br /&gt;
 &amp;lt;tt&amp;gt;&amp;lt;include name procedure&amp;gt; [&amp;lt;arg name value /&amp;gt;]*[&amp;lt;with from to /&amp;gt;]*&amp;lt;/include&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;name&amp;lt;/tt&amp;gt; attribute of the include element will be used in this flight plan to prefix the blocks of the &amp;lt;tt&amp;gt;procedure&amp;lt;/tt&amp;gt;, the XML referenced file.&lt;br /&gt;
Named arguments may be given with their value in the &amp;lt;tt&amp;gt;arg&amp;lt;/tt&amp;gt; elements. The &amp;lt;tt&amp;gt;with&amp;lt;/tt&amp;gt; tag allows to link labels (e.g. attribute of a deroute instruction or of an exception) from the procedure to blocks of the main flight plan.&lt;br /&gt;
Then, each block of the procedure is like any block of the flight plan and is designated with a dotted identifier: block &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; of a procedure named &amp;lt;tt&amp;gt;p&amp;lt;/tt&amp;gt; is named &amp;lt;tt&amp;gt;b.p&amp;lt;/tt&amp;gt; .&lt;br /&gt;
&lt;br /&gt;
Here is an example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;includes&amp;gt;&lt;br /&gt;
    &amp;lt;include name=&amp;quot;landing&amp;quot; procedure=&amp;quot;landing.xml&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/includes&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Blocks ==&lt;br /&gt;
&lt;br /&gt;
Block elements are the main part of a flight plan: they describe each unit of the mission.&lt;br /&gt;
They are made of various primitives, called stages and exceptions, you can put one after the other. When a&lt;br /&gt;
stage (or a block) is finished, the autopilot goes to the next one. The behaviour after the last stage of the last block is undefined. &lt;br /&gt;
&lt;br /&gt;
As described in the DTD, the &amp;lt;tt&amp;gt;blocks&amp;lt;/tt&amp;gt; element is composed of &amp;lt;tt&amp;gt;block&amp;lt;/tt&amp;gt; elements which are sequence of ''stages'':&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;!ELEMENT blocks (block+)&amp;gt;&lt;br /&gt;
  &amp;lt;!ELEMENT block  (exception|while|heading|attitude|go|xyz|set|call|circle|deroute|stay|follow|survey_rectangle|for|return|eight|oval|home|path)*&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;block name=&amp;quot;circlehome&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;circle radius=&amp;quot;75&amp;quot; wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can add a button in the [[GCS#Strips|strip of the aircraft]] with the attribute &amp;lt;tt&amp;gt;strip_button&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;block name=&amp;quot;descent&amp;quot; strip_button=&amp;quot;Descent&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;circle wp=&amp;quot;HOME&amp;quot; throttle=&amp;quot;0.0&amp;quot; pitch=&amp;quot;-15&amp;quot; vmode=&amp;quot;throttle&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This button will activate the block. If the attribute &amp;lt;tt&amp;gt;group&amp;lt;/tt&amp;gt; is specified, all strip buttons of the same group will be placed vertically on top of each other.&lt;br /&gt;
&lt;br /&gt;
In the same way, a key shortcut can be specified:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;block key=&amp;quot;D&amp;quot; name=&amp;quot;descent&amp;quot; strip_button=&amp;quot;Descent&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;circle wp=&amp;quot;HOME&amp;quot; throttle=&amp;quot;0.0&amp;quot; pitch=&amp;quot;-15&amp;quot; vmode=&amp;quot;throttle&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Modifiers are allowed, using the syntax of [http://library.gnome.org/devel/gtk/2.15/gtk-Keyboard-Accelerators.html#gtk-accelerator-parse GTK accelerators].&lt;br /&gt;
&lt;br /&gt;
An icon can be specified to display the button. The &amp;lt;tt&amp;gt;strip_button&amp;lt;/tt&amp;gt; label then is a tooltip for the icon. The icon must be an image file available in the directory &amp;lt;tt&amp;gt;data/pictures/gcs_icons&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;block name=&amp;quot;Takeoff&amp;quot; strip_icon=&amp;quot;takeoff.png&amp;quot; strip_button=&amp;quot;Takeoff&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can call functions before or after each execution of the block:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;block name=&amp;quot;circlehome&amp;quot; pre_call=&amp;quot;function_to_call_before_circle()&amp;quot; post_call=&amp;quot;function_to_call_after_circle()&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;circle wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Expressions ====&lt;br /&gt;
&lt;br /&gt;
Most of the numeric attributes in stages are analyzed as C expressions. The syntax of this C expression is restricted to &lt;br /&gt;
* numeric constants&lt;br /&gt;
* some internal autopilot variables (not fully documented, see examples)&lt;br /&gt;
* Some binary operators: &amp;lt;, &amp;gt;, &amp;lt;=, &amp;gt;=, &amp;lt;&amp;gt;, ==, +, -, /, *&lt;br /&gt;
* Some utility functions&lt;br /&gt;
&lt;br /&gt;
Some examples of usable expressions are given in the next sections.&lt;br /&gt;
=== Initialization  Blocks ===&lt;br /&gt;
Most flight plans will have three blocks of flight plan initialization blocks. It is good practice to follow this example below if you first start learing to create flightplans&lt;br /&gt;
&lt;br /&gt;
The first block waits until the GPS fix has been established, as shown below.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;blocks&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Wait GPS&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;set value=&amp;quot;1&amp;quot; var=&amp;quot;kill_throttle&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;while cond=&amp;quot;!GpsFixValid()&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The second block updates the local waypoints with respect to the UAV.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Geo init&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;while cond=&amp;quot;LessThan(NavBlockTime(), 10)&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;call fun=&amp;quot;NavSetGroundReferenceHere()&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This next block prevents the UAV from starting the engine and taking off. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;block name=&amp;quot;Holding point&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;!--set var=&amp;quot;nav_mode&amp;quot; value=&amp;quot;NAV_MODE_ROLL&amp;quot;/--&amp;gt;&lt;br /&gt;
      &amp;lt;set value=&amp;quot;1&amp;quot; var=&amp;quot;kill_throttle&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;attitude roll=&amp;quot;0&amp;quot; throttle=&amp;quot;0&amp;quot; vmode=&amp;quot;throttle&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Exceptions ===&lt;br /&gt;
&lt;br /&gt;
The flight manager can handle exceptions. They consist in conditions checked periodically (at the same pace as the navigation control), allowing the control to jump to a given block. Here is the syntax of exceptions:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;exception cond=&amp;quot;...&amp;quot; deroute=&amp;quot;...&amp;quot;&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;cond&amp;lt;/tt&amp;gt; is an expression and &amp;lt;tt&amp;gt;deroute&amp;lt;/tt&amp;gt; is the name of the block we want to switch to as soon as the condition is true.&lt;br /&gt;
&lt;br /&gt;
Here are some example of exceptions:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;exception cond=&amp;quot;10 &amp;gt; PowerVoltage()&amp;quot; deroute=&amp;quot;go_down&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;exception cond=&amp;quot;(ground_alt+10 &amp;gt; GetPosAlt())&amp;quot; deroute=&amp;quot;go_up&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;exception cond=&amp;quot;(autopilot_flight_time &amp;gt; 840)&amp;quot; deroute=&amp;quot;quick_land&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Exceptions can be local to a block or global to the flight plan, in the &amp;lt;tt&amp;gt;&amp;lt;exceptions&amp;gt;&amp;lt;/tt&amp;gt; element. In the following example, time since last reception of a message from the ground station is monitored and the navigation is switched to the &amp;lt;tt&amp;gt;Standby&amp;lt;/tt&amp;gt; block if no message have been received for 22s. This exception is valid for '''all''' the blocks.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;flight_plan ...&amp;gt;&lt;br /&gt;
    &amp;lt;waypoints&amp;gt; ... &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
    &amp;lt;exceptions&amp;gt;&lt;br /&gt;
      &amp;lt;exception cond=&amp;quot;datalink_time &amp;gt; 22&amp;quot; deroute=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/exceptions&amp;gt;&lt;br /&gt;
  &amp;lt;blocks&amp;gt; ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Deroute ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;deroute&amp;lt;/tt&amp;gt; is the ''goto'' directive of the flight plan; it switches the navigation to the given block:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;deroute block=&amp;quot;landing&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this primitive should not be used to execute loops which are provided by the following elements.&lt;br /&gt;
&lt;br /&gt;
=== Return ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;return&amp;lt;/tt&amp;gt; is also a ''goto'' directive that brings you back to the last block (and last stage). It has no argument.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;return/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Loops ===&lt;br /&gt;
&lt;br /&gt;
Unbounded loops are written with &amp;lt;tt&amp;gt;while&amp;lt;/tt&amp;gt; elements whose &amp;lt;tt&amp;gt;cond&amp;lt;/tt&amp;gt; attribute is a boolean expression.&lt;br /&gt;
Children  of &amp;lt;tt&amp;gt;while&amp;lt;/tt&amp;gt; are stages:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;while cond=&amp;quot;TRUE&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;go wp=&amp;quot;A&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;go wp=&amp;quot;B&amp;quot;/&amp;gt; &lt;br /&gt;
    &amp;lt;go wp=&amp;quot;C&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;while cond=&amp;quot;5 &amp;gt; stage_time&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/while&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In this example, we run an infinite loop, lettin the aircraft try to go via waypoints &amp;lt;tt&amp;gt;A&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;B&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;C&amp;lt;/tt&amp;gt; and waiting for 5 seconds before repeating.&lt;br /&gt;
&lt;br /&gt;
Bounded loops are written with the &amp;lt;tt&amp;gt;for&amp;lt;/tt&amp;gt; tag:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;0&amp;quot; to=&amp;quot;3&amp;quot;&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
  &amp;lt;/for&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where the body of the loop will be run four times.&lt;br /&gt;
&lt;br /&gt;
The variable of a &amp;lt;tt&amp;gt;for&amp;lt;/tt&amp;gt; loop can be used inside expressions appearing as attributes of the stages:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;1&amp;quot; to=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot; alt=&amp;quot;ground_alt+50*$i&amp;quot; until=&amp;quot;stage_time&amp;gt;10&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/for&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, the aircraft will circle around waypoint '''HOME''' for 10 seconds at and altitude above ground of 50m, 10 seconds at altitude 100 meter (50+50), ... until 250m (5x +50).&lt;br /&gt;
&lt;br /&gt;
Note: Two bounded loops using the same control variable are not allowed in the same block.&lt;br /&gt;
&lt;br /&gt;
=== Navigation modes ===&lt;br /&gt;
&lt;br /&gt;
Navigation modes give the description of the desired trajectory in 3D. While the horizontal mode is specified through&lt;br /&gt;
''stages'', the vertical control is specified with various attributes of these stages. The current available navigation stages are&lt;br /&gt;
* attitude : just keep a fixed attitude;&lt;br /&gt;
* heading : keep a given course;&lt;br /&gt;
* go : go to a given waypoint;&lt;br /&gt;
* path : list of waypoints linked by ''go''&lt;br /&gt;
* circle : circle around a waypoint;&lt;br /&gt;
* oval : two half circles with a straight between two nav points&lt;br /&gt;
* eight : fly a figure of eight through a waypoint and around another&lt;br /&gt;
* stay : hold the position (hard to realize for a fixed-wing aircraft);&lt;br /&gt;
* follow : follow another aircraft;&lt;br /&gt;
* xyz : circle around a point moveable with the RC transmitter stick (obsolete with the datalink).&lt;br /&gt;
&lt;br /&gt;
The vertical control is achieved using the &amp;lt;tt&amp;gt;vmode&amp;lt;/tt&amp;gt; attribute of these stages. The possible values are &lt;br /&gt;
* '''alt''' (the default) : the autopilot keeps the desired altitude which is the altitude of the waypoint (if any) or the altitude specified with the &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; attribute;&lt;br /&gt;
* '''climb''' : the autopilot keeps the desired vertical speed specified with the &amp;lt;tt&amp;gt;climb&amp;lt;/tt&amp;gt; attribute (in m/s);&lt;br /&gt;
* '''throttle''' : the autopilots sets the desired throttle specified with the &amp;lt;tt&amp;gt;throttle&amp;lt;/tt&amp;gt; attribute (between 0 and 1);&lt;br /&gt;
* '''glide''' : the autopilot keeps the desired slope between two waypoints&lt;br /&gt;
&lt;br /&gt;
The default control is done with the throttle. However, setting the &amp;lt;tt&amp;gt;pitch&amp;lt;/tt&amp;gt; attribute to '''auto''' and the &amp;lt;tt&amp;gt;throttle&amp;lt;/tt&amp;gt; attribute to a constant allows a vertical control only by controlling the attitude of the A/C.&lt;br /&gt;
The &amp;lt;tt&amp;gt;pitch&amp;lt;/tt&amp;gt; attribute also can be set to any value (in degrees) while the throttle control is in use: it usually affects the airspeed of the aircraft.  &lt;br /&gt;
&lt;br /&gt;
The different navigation modes are detailed in the next sections.&lt;br /&gt;
&lt;br /&gt;
=== Attitude ===&lt;br /&gt;
&lt;br /&gt;
Element &amp;lt;tt&amp;gt;attitude&amp;lt;/tt&amp;gt; is the navigation mode which corresponds to the current lowest control loop for horizontal mode.&lt;br /&gt;
The autopilot then keeps a constant attitude. The &amp;lt;tt&amp;gt;roll&amp;lt;/tt&amp;gt; attribute is required (in degrees, positive to put right wing low).&lt;br /&gt;
&lt;br /&gt;
To fly away, at constant airspeed:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;attitude roll=&amp;quot;0&amp;quot; vmode=&amp;quot;throttle&amp;quot;, throttle=&amp;quot;0.5&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To fly around, holding a given altitude:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;attitude roll=&amp;quot;30&amp;quot; alt=&amp;quot;ground_alt+50&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that it is not a ''safe'' navigation mode since the geographic position of the plane is not controlled. However, this mode is useful to tune the roll attitude control loop.&lt;br /&gt;
&lt;br /&gt;
=== Heading ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;heading&amp;lt;/tt&amp;gt; primitive is relative to the second level loop for horizontal mode in the autopilot which will keep the given &amp;lt;tt&amp;gt;course&amp;lt;/tt&amp;gt;, a required attribute (in degrees, clockwise, north=0, east=90).&lt;br /&gt;
&lt;br /&gt;
One example to takeoff, following the QFU, 80% throttle, nose up (15 degrees) until height of 30m is reached:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;heading course=&amp;quot;QFU&amp;quot; vmode=&amp;quot;throttle&amp;quot; throttle=&amp;quot;0.8&amp;quot; pitch=&amp;quot;15&amp;quot; until=&amp;quot;(GetPosAlt() &amp;gt; ground_alt+30)&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Go ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;go&amp;lt;/tt&amp;gt; primitive is probably the most useful one. Basically, the autopilot will try to join a given waypoint (&amp;lt;tt&amp;gt;wp&amp;lt;/tt&amp;gt;, the only required attribute). So the simplest thing you can ask for is&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;go wp=&amp;quot;HOME&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
which will set the '''HOME''' waypoint as the desired target position. Note than since &amp;lt;tt&amp;gt;vmode=&amp;quot;alt&amp;quot;&amp;lt;/tt&amp;gt; is the default, the altitude of the target waypoint is also taken into account. The navigation will switch to the next stage as soon as the target is reached.&lt;br /&gt;
&lt;br /&gt;
It is usually not a good idea to try to join a waypoint without asking for a precise trajectory, i.e. a given line.&lt;br /&gt;
Setting the &amp;lt;tt&amp;gt;hmode&amp;lt;/tt&amp;gt; attribute to '''route''', the navigation will go over a segment joining two waypoints:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The target altitude is the altitude of the target waypoint; it can also be set with the &amp;lt;tt&amp;gt;alt&amp;lt;/tt&amp;gt; attribute. The following example keeps an altitude with fixed throttle:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;go from=&amp;quot;wp2&amp;quot; wp=&amp;quot;wp3&amp;quot; hmode=&amp;quot;route&amp;quot; pitch=&amp;quot;auto&amp;quot; throttle=&amp;quot;0.75&amp;quot; alt=&amp;quot;ground_alt+100&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The attributes related to the vertical control can also be set to replace the default altitude mode:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot; vmode=&amp;quot;climb&amp;quot; climb=&amp;quot;1.5&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, the &amp;lt;tt&amp;gt;approaching_time&amp;lt;/tt&amp;gt; (in seconds) attribute helps to decide when the target is ''reached''. It can be set&lt;br /&gt;
to '''0''' to go over the target waypoint (default value is the '''CARROT''' time, set in the airframe configuration file).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;go from=&amp;quot;wp1&amp;quot; wp=&amp;quot;wp2&amp;quot; hmode=&amp;quot;route&amp;quot; approaching_time=&amp;quot;1&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Path ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;path&amp;lt;/tt&amp;gt; primitive is just a shorthand expression for a set of &amp;lt;tt&amp;gt;go&amp;lt;/tt&amp;gt; primitives. A list of waypoints defined with the &amp;lt;tt&amp;gt;wpts&amp;lt;/tt&amp;gt; attribute is pre-processed into a set of &amp;lt;tt&amp;gt;go&amp;lt;/tt&amp;gt; primitives with the &amp;lt;tt&amp;gt;hmode&amp;lt;/tt&amp;gt; attribute. For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;path wpts=&amp;quot;wp1, wp2, wp3&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Other attributes are optional:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;path wpts=&amp;quot;wp3, wp1, wp2&amp;quot; approaching_time=&amp;quot;1&amp;quot; pitch=&amp;quot;auto&amp;quot; throttle=&amp;quot;0.5&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Circle ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;circle&amp;lt;/tt&amp;gt; primitive is the second main navigation mode: the trajectory is defined as a circle around a given waypoint with a given radius:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
A positive radius makes the UAS move clockwise, a negative counter-clockwise.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;until&amp;lt;/tt&amp;gt; attribute may be used to control the end of the stage. The following example defines an ascending trajectory at constant throttle, nose up (15 degrees), over growing circles, until the battery level is low:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;circle wp=&amp;quot;wp1&amp;quot; radius=&amp;quot;50+(GetPosAlt()-ground_alt)/2&amp;quot; vmode=&amp;quot;throttle&amp;quot; throttle=&amp;quot;0.75&amp;quot; pitch=&amp;quot;15&amp;quot; until=&amp;quot;10&amp;gt;PowerVoltage()&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Oval ===&lt;br /&gt;
The oval consists of two half circles that are connected with two straight lines. This flight path is usefull when a IMU is used because the straights allow for level flight. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt; &amp;lt;oval p1=&amp;quot;1&amp;quot; p2=&amp;quot;2&amp;quot; radius=&amp;quot;nav_radius&amp;quot;/&amp;gt; &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Eight ===&lt;br /&gt;
Fly a figure of eight that consists of two straight legs that pass though the center and the center of the half circle at the end of the two legs is in the turn around  waypoint. The altitude of the center waypoint is used for the entire figure. The turn around waypoint is moved to match radius given. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;  &amp;lt;eight center=&amp;quot;1&amp;quot; radius=&amp;quot;nav_radius&amp;quot; turn_around=&amp;quot;2&amp;quot;/&amp;gt; &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Survey rectangle ===&lt;br /&gt;
Fly a survey rectangle defined by two waypoints. The distance between the legs of the grid (in meter) and the orientation of the grid (NS or WE) can be set by the operator. The plane will turn outside of the border of the rectangle before starting a new leg.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;  &amp;lt;survey_rectangle wp1=&amp;quot;1&amp;quot; wp2=&amp;quot;2&amp;quot; grid=&amp;quot;200&amp;quot; orientation=&amp;quot;NS&amp;quot;/&amp;gt; &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Follow ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;follow&amp;lt;/tt&amp;gt; is a special primitive which makes the UAS follow another UAS (real or simulated, named with its &amp;lt;tt&amp;gt;ac_id&amp;lt;/tt&amp;gt;) at a given &amp;lt;tt&amp;gt;distance&amp;lt;/tt&amp;gt; (in meters) behind and at a given &amp;lt;tt&amp;gt;height&amp;lt;/tt&amp;gt; (in meters) above.&lt;br /&gt;
&lt;br /&gt;
In this example, the autopilot will try to follow A/C number '''4''', staying '''50'''m behind and '''20'''m above.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;follow ac_id=&amp;quot;4&amp;quot; distance=&amp;quot;50&amp;quot; height=&amp;quot;20&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Stay ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;stay&amp;lt;/tt&amp;gt; is a mode for UAS's able to hover:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;stay wp=&amp;quot;HOME&amp;quot; alt=&amp;quot;10&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XYZ ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;xyz&amp;lt;/tt&amp;gt; is a special mode where the UAS circles around a user moveable waypoint. This waypoint is moved with the RC sticks:&lt;br /&gt;
* YAW channel controls the point over the west-east axis;&lt;br /&gt;
* PITCH channel controls the point over the south-north axis;&lt;br /&gt;
* ROLL channel controls the altitude.&lt;br /&gt;
&lt;br /&gt;
Example (default radius is '''100'''):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;xyz radius=&amp;quot;40&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Set ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;set&amp;lt;/tt&amp;gt; element is a dangerous one which should be used only by expert users: it is used to directly set an internal variable of the autopilot. For example, you can change the value of the default ground altitude, a variable used by the home mode failsafe procedure (and maybe by your own flight plan):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;set var=&amp;quot;ground_alt&amp;quot; value=&amp;quot;ground_alt+50&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
This directive is extremely powerful and has great potential for error - use with caution.&lt;br /&gt;
&lt;br /&gt;
=== Call ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;call&amp;lt;/tt&amp;gt; allows the user to define its own navigation procedures in C. The &amp;lt;tt&amp;gt;value&amp;lt;/tt&amp;gt; must be a call to a boolean function which must return TRUE as long as the stage is not completed (a function which should be called only once would then return immediately FALSE).&lt;br /&gt;
This feature is illustrated with the '''line''' pattern:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;call fun=&amp;quot;nav_line_setup()&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;call fun=&amp;quot;nav_line_run(WP_1, WP_2, nav_radius)&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where &amp;lt;tt&amp;gt;nav_line_setup()&amp;lt;/tt&amp;gt; returns FALSE and &amp;lt;tt&amp;gt;nav_line_run()&amp;lt;/tt&amp;gt; always returns TRUE (this stage never ends). '''Note''' that a waypoints index is derived/denoted by prefixing the waypoint name with &amp;lt;tt&amp;gt;WP_&amp;lt;/tt&amp;gt;(i.e.: 1 --&amp;gt; WP_1, 2 --&amp;gt; WP_2)&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To call ''any'' function exactly once regardless of the return value (e.g. call a void function), add &amp;lt;tt&amp;gt;loop=&amp;quot;FALSE&amp;quot;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;call fun=&amp;quot;viewvideo_take_shot(TRUE)&amp;quot; loop=&amp;quot;FALSE&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Such extra navigation functions are usually written as a [[Modules|Module]] and the header files are included automatically.&lt;br /&gt;
&lt;br /&gt;
If you want to call functions that are not part of a module, you need to include the header file which contains the function declaration:or supplementary C file which must be specified in the &lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;header&amp;gt;&lt;br /&gt;
#include &amp;quot;path/to/header.h&amp;quot;&lt;br /&gt;
  &amp;lt;/header&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where the path is relative to the &amp;lt;tt&amp;gt;sw/airborne&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
You can also call functions before or after each execution of the block (this means continuously on each iteration of each stage of the block, not just when entering o exiting the block).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;block name=&amp;quot;circlehome&amp;quot; pre_call=&amp;quot;function_to_call_before_circle()&amp;quot; post_call=&amp;quot;function_to_call_after_circle()&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;circle wp=&amp;quot;HOME&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/block&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pre Call ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;block name=&amp;quot;Standby&amp;quot; strip_button=&amp;quot;Standby&amp;quot; strip_icon=&amp;quot;home.png&amp;quot; pre_call=&amp;quot;if(!InsideKill(GetPosX(), GetPosY())) NavKillThrottle();&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Post Call ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;block name=&amp;quot;traj&amp;quot; pre_call=&amp;quot;formation_pre_call()&amp;quot; post_call=&amp;quot;formation_flight()&amp;quot;&amp;gt; &amp;lt;!-- formation flight is call after all other navigation tasks --&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Procedures ==&lt;br /&gt;
&lt;br /&gt;
Procedures are libraries which can be included in flight plans. They are composed of waypoints, sectors and blocks. The header of a procedure may contain some parameters which are replaced by arguments when the procedure is included.&lt;br /&gt;
&lt;br /&gt;
Extract of the DTD: a procedure is a sequence of parameters, waypoints, ...:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;!ELEMENT procedure (param*,header?,waypoints?,sectors?,exceptions?,blocks?)&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;tt&amp;gt;param&amp;lt;/tt&amp;gt;eter is just a name. A parameter is optional if it is declared with a default value.&lt;br /&gt;
An example with a required and an optional parameter:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;param name=&amp;quot;alt&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;param name=&amp;quot;radius&amp;quot; default_value=&amp;quot;75&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Procedures are called with the &amp;lt;tt&amp;gt;include&amp;lt;/tt&amp;gt; element in a flight plan. A procedure cannot be included twice or by another procedure. A procedure call requires:&lt;br /&gt;
&lt;br /&gt;
* the name of the procedure file, the name given to this inclusion; &lt;br /&gt;
* values for the parameters;&lt;br /&gt;
* backlinks for block name exits of the procedure.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;include name=&amp;quot;landing&amp;quot; procedure=&amp;quot;landing.xml&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is the corresponding procedure '''landing.xml''':&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE procedure SYSTEM &amp;quot;flight_plan.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;procedure&amp;gt;&lt;br /&gt;
    &amp;lt;waypoints&amp;gt;&lt;br /&gt;
      &amp;lt;waypoint name=&amp;quot;AF&amp;quot; x=&amp;quot;177.4&amp;quot; y=&amp;quot;45.1&amp;quot; alt=&amp;quot;30&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;waypoint name=&amp;quot;TD&amp;quot; x=&amp;quot;28.8&amp;quot; y=&amp;quot;57.0&amp;quot; alt=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;waypoint name=&amp;quot;_BASELEG&amp;quot; x=&amp;quot;168.8&amp;quot; y=&amp;quot;-13.8&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/waypoints&amp;gt;&lt;br /&gt;
    &amp;lt;blocks&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
      &amp;lt;block name=&amp;quot;land&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;call fun=&amp;quot;nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;circle radius=&amp;quot;nav_radius&amp;quot; until=&amp;quot;NavCircleCount() &amp;gt; 0.5&amp;quot; wp=&amp;quot;_BASELEG&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;circle radius=&amp;quot;nav_radius&amp;quot; until=&amp;quot;And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10), 10 &amp;gt; fabs(GetPosAlt()- WaypointAlt(WP__BASELEG)))&amp;quot; wp=&amp;quot;_BASELEG&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;/block&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/blocks&amp;gt;&lt;br /&gt;
  &amp;lt;/procedure&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the name of procedure '''land''' block will be renamed into '''landing.land''':&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;deroute block=&amp;quot;landing.land&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
will jump to this procedure block.&lt;br /&gt;
&lt;br /&gt;
Suppose you have a go-around condition in your landing procedure. You would write it&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;exception cond=&amp;quot;...&amp;quot; deroute=&amp;quot;go-around&amp;quot;/&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
then you must link this block exit with one of your block (e.g. &amp;lt;tt&amp;gt;Standby&amp;lt;/tt&amp;gt;). So you would include the procedure as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;include name=&amp;quot;landing&amp;quot; procedure=&amp;quot;landing.xml&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;with from=&amp;quot;go-around&amp;quot; to=&amp;quot;Standby&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/include&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Advanced Examples ==&lt;br /&gt;
&lt;br /&gt;
Parameters used in a flight plan can be computed expressions. In this example, the plane is asked to perform 5 circles at progressively increasing altitudes for exactly one minute at each altitude:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;for var=&amp;quot;i&amp;quot; from=&amp;quot;1&amp;quot; to=&amp;quot;5&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;circle wp=&amp;quot;HOME&amp;quot; radius=&amp;quot;75&amp;quot;&lt;br /&gt;
          alt=&amp;quot;ground_alt + 50*$i&amp;quot;&lt;br /&gt;
          until=&amp;quot;stage_time &amp;gt; 60&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/for&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Below you find some random examples of the posibilities. This is only the tip of the iceberg, use your imagination and go wild with new creative ideas for your flightplan&lt;br /&gt;
&lt;br /&gt;
=== Gains on the fly ===&lt;br /&gt;
&lt;br /&gt;
It is very well possible to set specific gain for an airframe if it reaches e.g a certain block.&lt;br /&gt;
&lt;br /&gt;
=== Dynacmically adjustable maximum speed ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Immobilize Actuators === &lt;br /&gt;
&lt;br /&gt;
h_ctl setpoints variable are set by the h_ctl_attitude_loop() (from fw_h_ctl.c) loop) which can be disabled with the h_ctl_disabled flag:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;set var=&amp;quot;h_ctl_disabled&amp;quot; value=&amp;quot;TRUE&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;set var=&amp;quot;h_ctl_aileron_setpoint&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
 &amp;lt;set var=&amp;quot;h_ctl_elevator_setpoint&amp;quot; value=&amp;quot;MAX_PPRZ/2&amp;quot;/&amp;gt;&lt;br /&gt;
 .... waiting for a condition ...&lt;br /&gt;
 &amp;lt;set var=&amp;quot;h_ctl_disabled&amp;quot; value=&amp;quot;FALSE&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips and Tricks ==&lt;br /&gt;
&lt;br /&gt;
There are many ways to skin a cat just as there are many ways to craft your flight plan. Following the best practices tips can save you from a lot of frustration and mishap.&lt;br /&gt;
&lt;br /&gt;
* Simulate your flight plan before taking it to the sky. Flight plans should always be carefully tested prior to flight, take a look at the [[Simulation|simulation]] page for details on how to simulate your plan.&lt;br /&gt;
* Make an subdirectory in the Flight_plan directory with your own name and add your flight plans there. Make sure that the location of the DTD is correct, e.g by using relative directory double dots as in &amp;lt;tt&amp;gt;&amp;lt;!DOCTYPE flight_plan SYSTEM &amp;quot;../flight_plan.dtd&amp;quot;&amp;gt;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Take a good look at other flight plans included with Paparazzi. To learn from example flight plans please visit the [[Flight_Plan_Examples|flight plan examples]] page&lt;br /&gt;
* There are several option to build failsafe features into you flightplan, [[Failsafe|for some examples visit the Failsafe page]].&lt;br /&gt;
* Some flight plan examples define waypoint locations using relative coordinates. These are relative positions from the fixed lat and lon in the header of the flight plan. When simulating your flight plan the aircraft always use the lat/lon as defined in the flight plan since a regular simulation has no notion of you current position of you local PC where you simulate on. This is something to keep in mind if you test your flight plan in real flights.&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:User_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Category:Autopilots&amp;diff=19968</id>
		<title>Category:Autopilots</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Category:Autopilots&amp;diff=19968"/>
		<updated>2015-07-02T16:28:40Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Autopilots_Chinese|Chinese 中文]]&lt;br /&gt;
__NOTOC__&lt;br /&gt;
__NOEDITSECTION__&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;border-spacing:8px;margin:0px -8px&amp;quot; class=&amp;quot;MainPageBG&amp;quot; style=&amp;quot;width:100%;border:1px solid #9999bf;background-color:#f5fffa;vertical-align:top;color:#000; text-align: left;&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;h3 style=&amp;quot;-moz-border-radius-topright: 0.7em;&lt;br /&gt;
background:#cedff2;margin:-2px;padding:4px;&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:favicon32.png|32px]] Autopilots&lt;br /&gt;
&amp;lt;/h3&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding:6px;&amp;quot;&amp;gt;&lt;br /&gt;
{{Autopilots}}&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;!-- Start of right-column --&amp;gt;&lt;br /&gt;
| class=&amp;quot;MainPageBG&amp;quot; style=&amp;quot;width:70%;border:1px solid #cedff2;background-color:#f5fffa;vertical-align:top&amp;quot;|&lt;br /&gt;
{|width=&amp;quot;100%&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;5&amp;quot; style=&amp;quot;vertical-align:top;background-color:#f5fffa&amp;quot;&lt;br /&gt;
|-valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| &amp;lt;h2 style=&amp;quot;margin:0;background-color:#cef2e0;font-size:120%;font-weight:bold;border:1px solid #a3bfb1;text-align:left;color:#000;padding:0.2em 0.4em;&amp;quot;&amp;gt;Paparazzi Autopilots&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|Hardware support for Autopilot versions currently in use. &lt;br /&gt;
|-&lt;br /&gt;
|[[Image:tiny13_family_top_sm.jpg|center|400px|Tiny 1.1 autopilots on the &amp;quot;assembly line&amp;quot;]]&lt;br /&gt;
|-&lt;br /&gt;
|One of the great advantages of Paparazzi is support for multiple hardware designs. The old Paparazzi board where based around ATMega MCUs. The current autopilots are designed around two primary processors:&lt;br /&gt;
*STM32 series microcontrollers &lt;br /&gt;
*LPC21xx series microcontrollers&lt;br /&gt;
There are active and current autopilots designs using both architectures. Not all autopilots have the same capabilities, peripherals or features, but each has advantages in different applications.&lt;br /&gt;
&lt;br /&gt;
Currently, boards are designed around the STM32F1 series, but there is future upgrade path capabilities to the F2 and F4 series, giving way to feature rich processors with a variety of peripherals and speeds. Architecture-dependent firmware code is supported in part by [http://www.libopencm3.org libopencm3]. The [[Lisa]] , [[Krooz]] and [[LinAM]] autopilots use the STM32.&lt;br /&gt;
&lt;br /&gt;
The LPC21xx based boards use the LPC2148 and have been flying fixed wing and multi-rotors for many years. This architecture is more mature but at the expense of speed and extra ports available on the newer STM32 series processors. The [[Tiny]] series, [[Booz]], [[TWOG/v1.0 | TWOG]], [[YAPA]], [[Umarim_Lite_v2 | Umarim]] and [[NavGo_v3 | NavGo]] autopilots all use the LPC2148.&lt;br /&gt;
&lt;br /&gt;
Some autopilots have also been designed for close integration with small single-board computers, particularly those based on [[OMAP]] processors such as the [http://www.gumstix.com/ Gumstix] [https://www.gumstix.com/store/index.php?cPath=33 Overo] series. The [[Lisa/L]] and [[Classix]] boards are designed with this in mind, though other autopilots can be easily interfaced. Further information can be found [[OMAP|here]].&lt;br /&gt;
&lt;br /&gt;
A basic feature comparison table is presented to help in the autopilot hardware selection process. Stable tried tested LPC or more cutting edge STM32.&lt;br /&gt;
&lt;br /&gt;
For information regarding architecture and firmware compatibility of various subsystems and modules, please see the appropriate [[Subsystems]] overview and [[Modules_list|Modules List]] pages.&lt;br /&gt;
&lt;br /&gt;
NOTE: The accuracy of this table '''may not be 100% correct''', the best resource is always hardware and software source files and individual autopilot pages.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;text-align:center&amp;quot; cellpadding=&amp;quot;2%&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|+'''Autopilot&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; Feature Matrix'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;16%&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Feature'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;7%&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Lisa/L|Lisa/L v1.1]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;7%&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Lisa/M_v20|Lisa/M v2.0]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;7%&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Lisa/S]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;7%&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[LinAM V4]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;7%&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[NavStik|NavStik]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;7%&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[KroozSD|KroozSD]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;7%&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Apogee/v1.00|Apogee v1.00]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;7%&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Umarim_v10|Umarim v1.0]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;7%&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Umarim_Lite_v2|Umarim Lite v2]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;7%&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[NavGo_v3|NavGo v3]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;7%&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[Tiny/v2.11|Tiny v2.11]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;7%&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[TWOG/v1.0|TWOG v1.0]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;7%&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[YAPA/v2.0|YAPA v2.0]]'''&lt;br /&gt;
| align=&amp;quot;center&amp;quot; width=&amp;quot;7%&amp;quot; style=&amp;quot;background:#f0f0f0;&amp;quot;|'''[[HBmini/v2.0]]'''&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#f0f0f0;&amp;quot;| || align=&amp;quot;center&amp;quot; colspan=&amp;quot;13&amp;quot;|'''MCU'''&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Part'''||&amp;lt;small&amp;gt;STM32F103RE&amp;lt;/small&amp;gt;||&amp;lt;small&amp;gt;STM32F105RCT6&amp;lt;/small&amp;gt;||&amp;lt;small&amp;gt;STM32F103REY6&amp;lt;/small&amp;gt;||&amp;lt;small&amp;gt;STM32F405RGT6&amp;lt;/small&amp;gt;||&amp;lt;small&amp;gt;STM32F415RG&amp;lt;/small&amp;gt;||&amp;lt;small&amp;gt;STM32F405RGT6&amp;lt;/small&amp;gt;||&amp;lt;small&amp;gt;STM32F405RGT6&amp;lt;/small&amp;gt;||LPC2148||LPC2148||LPC2148||LPC2148||LPC2148||LPC2148||LPC2148&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Clock'''||72MHz||72MHz||72MHz||168MHz||168MHz||168MHz||168MHz||60MHz||60MHz||60MHz||60MHz||60MHz||60MHz||60MHz&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Flash'''||512kB||256kB||512kB||1024kB||1024kB||1024kB||1024kB||512kB||512kB||512kB||512kB||512kB||512kB||512kB&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''RAM&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;'''||64kB||64kB||64kB||192kB||192kB|||128 &amp;amp; 64kB||128 &amp;amp; 64kB||32kB &amp;amp; 8kB||32kB &amp;amp; 8kB||32kB &amp;amp; 8kB||32kB &amp;amp; 8kB||32kB &amp;amp; 8kB||32kB &amp;amp; 8kB||32kB &amp;amp; 8kB&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#f0f0f0;&amp;quot;| || align=&amp;quot;center&amp;quot; colspan=&amp;quot;13&amp;quot;|'''Onboard Sensors&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt;'''&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''MEMS IMU'''||no||aspirin||yes||yes||yes||krooz/ext||yes||yes||yes||yes||no||no||no||yes&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Magnetometer'''|| || ||yes||yes||yes||yes||yes||no||no||yes||no||no||no||yes&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Barometer'''||yes||yes||yes||yes||yes||yes||yes||yes||no||yes||no||no||no||yes&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Diff Pressure'''||yes||no||no||yes||optional||no||no||no||no||no||no||no||no||no&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''GPS'''||no||no||yes||yes||optional||no||no||no||no||no||yes||no||no||no&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#f0f0f0;&amp;quot;| || align=&amp;quot;center&amp;quot; colspan=&amp;quot;13&amp;quot;|'''Input/Output&amp;lt;sup&amp;gt;4&amp;lt;/sup&amp;gt; &amp;amp; Communication Interfaces'''&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''UART'''||3 &amp;amp; 1RX||2 &amp;amp; 2RX||1 &amp;amp; 1RX||1 &amp;amp; 2RX||4&amp;lt;sup&amp;gt;9&amp;lt;/sup&amp;gt;||3||3 &amp;amp; 1Rx||2||2||2||1||2||2||2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''I2C'''||2||1 + 1&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;||1&amp;lt;sup&amp;gt;8&amp;lt;/sup&amp;gt;||1||2&amp;lt;sup&amp;gt;9&amp;lt;/sup&amp;gt;||2||2||2||1||2||1||1||1||2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''SPI'''||2||1||0||0||1&amp;lt;sup&amp;gt;9&amp;lt;/sup&amp;gt;||1||1||1||1||1||1||1||1||1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''ADC'''||3 (12bit)||3 + 2 (12bit)&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;||0||3 (12bit)||2&amp;lt;sup&amp;gt;9&amp;lt;/sup&amp;gt;||4 + 1 (12bit)&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;||0 + 3 (12bit)||0 + 4 (10bit)||8&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;||0 + 4 (10bit)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;||0 + 1 (10bit)&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;||8 (10bit)||6 (10bit)||8 (10bit)(16bit)&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''PWM'''||6||6 + 2&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;||6||8||6&amp;lt;sup&amp;gt;9&amp;lt;/sup&amp;gt;||10 + 1&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;||6 + 1||6||6||0 + 1&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;||8||8||10||10&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''PPM Output'''||no||no||no||no||no||no||no||no||no||no||1||1||no|| &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''PPM Capture'''||1||0 + 1&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;||1||6&amp;lt;sup&amp;gt;9&amp;lt;/sup&amp;gt;||1||1||1 + 1&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;||1 + 1&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;||1 + 1&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;||1||1||1||1&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''R/C serial'''|| ||2||1||1&amp;lt;sup&amp;gt;9&amp;lt;/sup&amp;gt;||1|| ||1 (standard &amp;amp; S.BUS)|| || || || || || || &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''GPIO&amp;lt;sup&amp;gt;7&amp;lt;/sup&amp;gt;'''||?||1||0||4||?||2 + 1&amp;lt;sup&amp;gt;5&amp;lt;/sup&amp;gt;||0 + 4||0 + 4&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;||0 + 4&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;||0 + 2&amp;lt;sup&amp;gt;6&amp;lt;/sup&amp;gt;||2||2||1||11&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Onboard LEDs'''||8||5||4||5||3||3||4||2||2||4||3||3||3||2&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''USB Peripheral'''||Onboard USB JTAG + UART||bootloader||no||DFU bootloader||DFU bootloader||bootloader||DFU bootloader + USB storage||bootloader||bootloader||bootloader||bootloader||bootloader||bootloader||bootlader &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''CAN'''||1||1||1||1||no||no||no||no||no||no||no||no||no||&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''MODEM connector'''||no||no||no||no|| ||Xbee||no||no||no||no||no||no||Xbee||&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#f0f0f0;&amp;quot;| || align=&amp;quot;center&amp;quot; colspan=&amp;quot;13&amp;quot;|'''Onboard Peripherals'''&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''SD card/interface'''||no||no||no||no||yes/SPI||yes/SPI||yes/SDIO + USB storage||no||no||no||no||no|| || &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''RTC'''||no||no||no||no||no||no||yes + backup cap.||no||no||no||no||no|| || &lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Others'''||Overo w/ I/O incl. USB Host||Aspirin footprint, JTAG header|| || ||Overo, 16Mb SPI Flash, HDMI with JTAG+2xUART||On-board micro-USB B header||On-board mini-USB B header|| ||On-board mini-USB B header|| || || ||RS232 options||Buzzer&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#f0f0f0;&amp;quot;| || align=&amp;quot;center&amp;quot; colspan=&amp;quot;13&amp;quot;|'''Program &amp;amp; Debug Interface'''&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|''' '''||USB (luftboot)+ JTAG + UART||USB (luftboot)+ JTAG + UART|| SWD + UART|| SWD + USB || USB + JTAG(HDMI) + UART || ||USB(DFU) + SWD||USB (pprz bootloader)||USB (pprz bootloader)||USB (pprz bootloader)||USB (pprz bootloader)||USB (pprz bootloader)||USB (pprz bootloader)||JTAG&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#f0f0f0;&amp;quot;| || align=&amp;quot;center&amp;quot; colspan=&amp;quot;13&amp;quot;|'''Power Management'''&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Supply Input'''||6.1V - 18V||5V - 16V||2.3V - 5.5V||7V - 32V||3.5V - 14V&amp;lt;sup&amp;gt;9&amp;lt;/sup&amp;gt;||7V - 32V||5.5V - 17V||5.5V - 17V||5.5V - 17V||5.5V - 16V||6.1V - 18V||6.1V - 18V||6.1V - 18V||6.1-18V&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Supply Output'''||2.25@5V, 2.25A@3.3V, Other||500mA@3.3V, 250mA@5V||1A@3.3V||1A@5V||3.3V ?||1.5A@3.3V, 5A@5V||1A@3.3V, 1.5A@5V||1A@3.3V, 1.5A@5V||1A@3.3V, 1.5A@5V||1A@3.3V, 1.5A@5V||1A@3.3V, 2.25A@5V||1A@3.3V, 2.25A@5V||2x 1A@3.3V, 2.25A@5V||1A@3.3V, 2.25A@5V&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Software Switch'''||2||no||1||1 (5V)||4||no||1 (5V)||no||no||no||1||1||1||4&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#f0f0f0;&amp;quot;| || align=&amp;quot;center&amp;quot; colspan=&amp;quot;13&amp;quot;|'''Mechanical'''&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Size'''||~100mm x ~50mm||34mm x 60mm x 10mm||20mm x 20mm x 5mm||65mm x 45mm x 10mm||?&amp;lt;sup&amp;gt;9&amp;lt;/sup&amp;gt;||50mm x 60mm x 10mm||53 x 25 x 9mm (shares the same external dimensions as UmarimLite)||56mm x 25mm||53mm x 25mm||35mm x 35mm||70.8mm x 40mm||40.2mm x 30.5mm||80.0mm x 40.0mm?||57x30mm&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Weight'''||?||9.9g - 10.8g||2g||20g||?&amp;lt;sup&amp;gt;9&amp;lt;/sup&amp;gt;||20g - 40g||10g||9g||8g||?||24g||8g||23g w/ XBee?||30&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Connector Style'''||Picoblade||Picoblade &amp;amp; 0.1&amp;quot; Servo||0.05&amp;quot; header||0.1&amp;quot; Servo||?&amp;lt;sup&amp;gt;9&amp;lt;/sup&amp;gt;||Picoblade &amp;amp; 0.1&amp;quot; Servo||Picoblade||Picoblade||Picoblade||Picoblade||Picoblade||Picoblade||0.1&amp;quot; Headers||Picoblade &amp;amp; 0.1&amp;quot; Servo&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''PCB Style'''||4-layer||4-layer||6-layer||6-layer||?||2-layer||4-layer||4-layer||4-layer||4-layer||2-layer||2-layer||2-layer||4-layer&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Mounting Holes'''||4x M3||4x 2mm||no||4x M2||4x ?||4x M3||4x 2mm (shares the same mounting points as UmarimLite)||4x 2mm||4x 2mm||4x 2mm||no||no||4x M3||4xM2&lt;br /&gt;
|-&lt;br /&gt;
|style=&amp;quot;background:#f0f0f0;&amp;quot;| || align=&amp;quot;center&amp;quot; colspan=&amp;quot;12&amp;quot;|'''Comments'''&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Comments'''||IMU and Overo Mount Location, Many Features|| || ||Cortex™-M4 168MHz processor with FPU unit,onboard IMU,GPS,Baro,Airspeed ||Overo can be mount, Cortex™-M4 168MHz processor with FPU unit, onboard IMU, microSD card slot, 16Mb SPI Flash, onboard GPS, onboard speed sensor||High speed Cortex™-M4 168MHz processor with FPU unit, IMU, microSD card slot, OSD, onboard XBee connector||Cortex-M4 MCU, 9DOF IMU + Baro, Hi-speed microSD logging + USB storage mode, S.BUS compatible, small and lightweight ||Small Dimensions, narrow fuselage form factor, IMU||Smallest Dimensions, IMU, basic version of Umarim||Small Dimensions, IMU, magnetometer &amp;amp; high sensitivity Barometer; designed for small rotorcraft||Onboard u-blox GPS, designed for easy DIY assembly (same as TWOG)||Basic, no onboard sensors (all external for expandability)||Specially designed to work with rs232 sensors such as XSens Mit-G/Crossbow NAV420/ig500/3DM-GX3/DMS-SGP02/MGL-sp-5. Onboard XBee connector|| can use mpu6050 or mpu6000&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Typical Usage'''||Advanced payload and controls development using Gumstix; fixed-wing or rotorcraft||Small, general purpose w/ IMU; fixed-wing or rotorcraft|| ||High integrated and performance, rotorcraft or fixed-wing||  ||High integrated, high productivity board w/ IMU, microSD card, OSD and XBee; rotorcraft or fixed-wing||Small and powerful general purpose ;fixed-wing||Small, general purpose w/ IMU; fixed-wing||Small, general purpose w/ IMU; fixed-wing||Small, general purpose w/ IMU; rotorcraft||Small, general purpose w/ GPS; fixed-wing with external IR or IMU||Small, general purpose; fixed wing with all external sensors||0.1&amp;quot; headers means easier wiring, at the cost of weight||For all kind of aircraft&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Date Introduced'''||Summer 2010||Winter 2012||Summer 2013||Summer 2015||Summer 2013||Spring 2013||Summer 2013||Fall 2011||Summer 2012||Summer 2012||Fall 2007||Spring 2008||Spring 2011||Winter 2012&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;background:#f0f0f0;&amp;quot;|'''Previous Versions'''||[[Lisa/L]] v1.0||[[Lisa/M_v10|Lisa/M v1.0]]|| ||[[LinAM]] v3 ||[[Krooz|Krooz]]|| || || || ||[[Tiny/v1.1|Tiny v1.1]],  [[Tiny/v0.99|Tiny v0.99]]|| ||[[YAPA/v1.0|YAPA v1.0]]|| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
'''Notes:'''&lt;br /&gt;
&lt;br /&gt;
'''1.''' Only the newest revisions of the more commonly used autopilots are listed&lt;br /&gt;
&lt;br /&gt;
'''2.''' The extra 8kB of RAM on the LPC2148 shared with the USB DMA&lt;br /&gt;
&lt;br /&gt;
'''3.''' The onboard sensors are almost always supplemented with external sensors. For example, TWOG can use an external IMU or IR sensors, and also needs an external GPS.&lt;br /&gt;
&lt;br /&gt;
'''4.''' Input/Outputs listed are generally those easily accessible on regular autopilot connectors, customization/hacks can modify available I/O, for example free an extra I2C on Tiny and TWOG&lt;br /&gt;
&lt;br /&gt;
'''5., 6.''' Some features use shared resources - denoted by X + Y where Y is shared - and cannot be used simultaneously&lt;br /&gt;
&lt;br /&gt;
'''5.''' Lisa/M v2.0 shared resources include: one I2C is shared with 2 PWM outputs, two ADCs are shared with LEDs, one RX only UART is shared with the PPM capture&lt;br /&gt;
&lt;br /&gt;
'''6.''' Umarim v1.0 shared resources include: 4 ADCs are shared with 4 GPIOs&lt;br /&gt;
&lt;br /&gt;
'''7.''' Usually other unused pins can be used for additional GPIO with some code modifications&lt;br /&gt;
&lt;br /&gt;
'''8.''' Many of the pins have multiple purposes. Servo 5&amp;amp;6 can be used for i2c even though there is no dedicated connector.&lt;br /&gt;
&lt;br /&gt;
'''9.''' Depending on the breakout board on the autopilot which outputs/inputs are made available.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h2&amp;gt;Schematics, CAD files, Gerber files, BOM release strategy&amp;lt;/h2&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;h3&amp;gt;About the hardware development and release process.&amp;lt;/h3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://github.com/paparazzi/paparazzi-hardware Files needed to create the hardware can be found here]. It is always good to remind oneself of the email Antoine once wrote in the mailing list before you want to start producing your own PCB's.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;P&amp;gt;8 June 2011 13:25:47 Antoine Drouin wrote on the mailing list:&amp;lt;/P&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I've started this project together with Pascal 8 years ago and since then I have dedicated my time to try and make it successful. I'm utterly convinced of the benefits of open source, but observing how Paparazzi grew over time, I came to the conclusion that hardware is a bit different than software... &amp;quot;gcc tiny.brd&amp;quot; is not going to make a board magically appear on your desktop. &lt;br /&gt;
&lt;br /&gt;
I'll list here some of my arguments in favor of releasing CAD files after the board is mature.&lt;br /&gt;
&lt;br /&gt;
# Unlike software, where an unskilled user can type make and get a piece of complex software to successfully build, assembling hardware requires tools and skills. Providing gerbers and BOM have lured a bunch of new users into believing otherwise and has created tons of frustration. I've myself fixed a number of badly assembled boards and I even recall that while helping debugging a board (so after assembly), discovering that the person had manufactured two layers PCBs instead of four layers. As the technology of the autopilot increases, this problem becomes more and more important.&lt;br /&gt;
# The success of the project depends on the availability of affordable hardware. The price of hardware is directly and exponentially dependent on the number of manufactured units. If ten persons manufacture 10 boards each, the cost will be much higher than if one person manufactures 100.&lt;br /&gt;
# Last and not least, the quality of assembly also depends very much on the number of manufactured units. Good quality can only be achieved through the use of automated placing and soldering, and those processes can only be used if the number of units reach a certain amount.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]] [[Category:User_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Get_Hardware&amp;diff=19960</id>
		<title>Get Hardware</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Get_Hardware&amp;diff=19960"/>
		<updated>2015-07-02T14:30:39Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: spelling (Firefox can spell check the edit box, this is awesome)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As an open-source project, all source code and hardware plans are [https://github.com/paparazzi/paparazzi-hardware freely available on GitHub] for anyone to produce, use, modify, and redistribute in accordance with the [http://www.gnu.org/licenses/gpl.txt GPL License Agreement] which requires only that the open-source nature of the project be maintained by all who redistribute it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Autopilots=&lt;br /&gt;
&lt;br /&gt;
== [[File:1bitsquared_logo.png|100px|link=http://1bitsquared.com]] 1 BIT SQUARED ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Paparazzi UAV, development, production and consulting company. Manufacturers and distributors of [[Lisa/S]] nano autopilot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [[File:Ppzuav.jpg|100px|link=https://www.ppzuav.com/osc]] PPZUAV ==&lt;br /&gt;
[[Image:ApogeeV1_img01sm.JPG|thumb|100px|ApogeeV1]]&lt;br /&gt;
&amp;lt;p&amp;gt;Assembling hardware for Paparazzi based projects since 2007.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;We are a USA based company that makes the Open Sourced Paparazzi Hardware available around the World. If you need fully assembled or just PCBs we can help.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;If you do not see what you need please do not hesitate to contact us via eMail to: sales@ppzuav.com for details.&lt;br /&gt;
Visit the [https://www.ppzuav.com/osc Web Store] to see the latest offerings.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
NOTE: PPZUAV will be closed for vacation Sept 2014 to Jan 2015. &lt;br /&gt;
&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== [http://transition-robotics.com [[Image:Transition_Robotics_Logo.png|100px]] Transition Robotics Inc.] [[Image:LisaM_V2_0_TopView.JPG|thumb|Lisa/M V2.0 top view]][[Image:LisaM_V2_0_BottomView.JPG|thumb|Lisa/M V2.0 bottom view]] ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Transition Robotics Inc. is a young company developing new solutions for and with the Paparazzi UAV platform. Their core product is the [[Image:Quadshot_Logo.jpg|100px|link=http://thequadshot.com|Quadshot]], a VTOL transitioning aircraft.&lt;br /&gt;
&lt;br /&gt;
Beside the Quadshot itself they develop and provide hardware and software that is especially optimized for Paparazzi, such as the Lisa Autopilots, Aspirin IMUs and associated accessories.&lt;br /&gt;
&lt;br /&gt;
They have a shop on their [http://transition-robotics.com Quadshot product page].&lt;br /&gt;
&lt;br /&gt;
As of February 2012, Transition Robotics, Inc. has acquired all IP and Paparazzi related inventory from Joby Robotics. We are thankful to Joby Robotics for their important and faithful support of Paparazzi related hardware projects, and hope to carry on this tradition. Hardware formerly supplied by Joby Robotics may now be purchased at the [http://transition-robotics.com/collections/all Transition Robotics/Quadshot webstore.]&lt;br /&gt;
&lt;br /&gt;
The [http://transition-robotics.com/collections/all TRI/Quadshot Webstore] also stocks pre-crimped Molex Picoblade wires and connector housings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
== [[File:Luftfotos24.jpg|250px|link=http://www.luftfotos24.de/de/]] Luftfotos24 ==&lt;br /&gt;
&amp;lt;p&amp;gt;We produce ready-to-fly paparazzi systems for everyone.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;We are a company based in germany and deliver around the world. We create our own hardware and a groundstation that includes the rc transmitter and video rx. Complete paparazzi systems are available at: [http://shop.luftfotos24.de Shop Luftfotos24]&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Other =&lt;br /&gt;
&lt;br /&gt;
==[http://www.sparkfun.com Sparkfun]==&lt;br /&gt;
Sparkfun is a great source of miscellaneous electronics like:&lt;br /&gt;
* Development boards&lt;br /&gt;
* GPS&lt;br /&gt;
* Gyros&lt;br /&gt;
* Accelerometers&lt;br /&gt;
* Pressure sensors&lt;br /&gt;
* Ultrasonic distance sensors&lt;br /&gt;
* Temperature/humidity sensors&lt;br /&gt;
* USB to Serial converters (XBEE adapter)&lt;br /&gt;
* LEDs&lt;br /&gt;
* Etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Sparkfun distributors in Europe'''&lt;br /&gt;
&lt;br /&gt;
Incomplete list.&lt;br /&gt;
*http://www.lipoly.de/index.php?main_page=index&amp;amp;cPath=880_883&amp;amp;language=en&lt;br /&gt;
*http://www.watterott.com/en/SparkFun&lt;br /&gt;
&lt;br /&gt;
==Mouser==&lt;br /&gt;
&lt;br /&gt;
Electronic distributor, sells all kinds of electronic parts or modules.&lt;br /&gt;
Free shipping as of 60€.&lt;br /&gt;
&lt;br /&gt;
== [https://store.diydrones.com/ DIYDrones] ==&lt;br /&gt;
Mainly focused on ArduPilot hardware. But carries Paparazzi compatible Telemetry and sensor boards.&lt;br /&gt;
&lt;br /&gt;
'''DIYDrones distributors in Europe'''&lt;br /&gt;
*http://www.lipoly.de/index.php?main_page=index&amp;amp;cPath=880_1912 [DE]&lt;br /&gt;
*http://www.unmannedtechshop.co.uk/ [UK]&lt;br /&gt;
*http://www.buildyourowndrone.co.uk/ [UK]&lt;br /&gt;
&lt;br /&gt;
==u-Blox GPS receivers==&lt;br /&gt;
&lt;br /&gt;
* [http://www.navilock.de/produkte/gruppen/13/Boards_und_Module navilock.de] (also available on [http://www.amazon.de Amazon.de])&lt;br /&gt;
* [http://www.rfdesign.co.za/pages/5645456/Products/GPS-Products/Antaris-4-Modules.asp rfdesign.co.za] (Also [http://www.rfdesign.co.za/pages/5645456/Products/GPS-Products/u-blox-5-Modules.asp u-blox 5] and [http://www.rfdesign.co.za/pages/5645456/Products/GPS-Products/u-blox-6-Modules.asp u-blox 6] modules avialable)&lt;br /&gt;
* [http://www.expedienttech.com/ expedittech.com]&lt;br /&gt;
* [http://www.csgshop.com/category.php?id_category=16 csgshop.com US UBLOX MAX-6Q] ( Lithuania )&lt;br /&gt;
* [https://www.ppzuav.com/osc/product_info.php?cPath=13&amp;amp;products_id=75 ppzuav.com GPS13] (USA)&lt;br /&gt;
* [http://www.hobbyking.com/hobbyking/store/__31135__neo_6m_gps_module.html hobbyking.com NEO-6M] 18$ / 14€&lt;br /&gt;
&lt;br /&gt;
==Airspeed Sensors==&lt;br /&gt;
&lt;br /&gt;
Eagle Tree Systems makes a small standalone airspeed sensor that can be connected via i2c. They also sell pitot tubes standalone for other differential pressure sensors.&lt;br /&gt;
*[http://www.eagletreesystems.com/Standalone/standalone.htm Eagle Tree Systems] (Also available from a number of distributors)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DIGI XBee telemetry modules ==&lt;br /&gt;
For detailed shopping guide see [Modems]&lt;br /&gt;
*http://www.watterott.com/en/Digi (DE EU)&lt;br /&gt;
*https://store.diydrones.com/ (US See above for local distributors)&lt;br /&gt;
*http://unmannedtechshop.co.uk/UAV-Components/UAV-telemetry (UK)&lt;br /&gt;
*http://mouser.com/ (AU and other regions)&lt;br /&gt;
&lt;br /&gt;
=PCB=&lt;br /&gt;
==[https://www.ppzuav.com/osc/index.php?cPath=1 PPZUAV]==&lt;br /&gt;
Paparazzi specific bare and already assembled PCB's.&lt;br /&gt;
&lt;br /&gt;
==[http://www.seeedstudio.com/service/index.php?r=site/pcbService Seeedstudio Fusion PCB]==&lt;br /&gt;
Very cheap 1, 2 and 4 layer boards from china. (perfect for bigger volumes and a low price)&amp;lt;br/&amp;gt;&lt;br /&gt;
Shipping from china takes some time. Minimum order is 5 pcs.&lt;br /&gt;
&lt;br /&gt;
==[http://oshpark.com/ OSH Park]==&lt;br /&gt;
Fast high quality 2 and 4 layer boards.(perfect for high requirements, but they're not the cheapest)&amp;lt;br/&amp;gt;&lt;br /&gt;
Free worldwide shipping. Minimum order is 3 pcs.&lt;br /&gt;
&lt;br /&gt;
==[http://PCBShopper.com/ PCBShopper]==&lt;br /&gt;
A hobbyist-created site for finding the cheapest PCB manufacturer. Enter the size, layers, and quantity of the board you designed, and PCBShopper will give you prices and delivery time from several different manufacturers.&lt;br /&gt;
&lt;br /&gt;
= Old vendors =&lt;br /&gt;
&lt;br /&gt;
Here is a list of former paparazzi hardware vendors for reference. They were providing a great service to the Paparazzi community.&lt;br /&gt;
&lt;br /&gt;
* [http://chebuzz.com/paparazzi Chebuzz Pprz] had to move back to US and close his store, [http://aerofu.com/ AeroFu] is carrying on his business.&lt;br /&gt;
* [http://jobyrobotics.com Joby Robotics] stock and IP was bought by [http://transition-robotics.com Transition Robotics] that is carrying on their business.&lt;br /&gt;
&lt;br /&gt;
[[Category:Hardware]] [[Category:User_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Sensors/Airspeed&amp;diff=19959</id>
		<title>Sensors/Airspeed</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Sensors/Airspeed&amp;diff=19959"/>
		<updated>2015-07-02T14:25:45Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: pesky spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Sensors&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
== Introduction ==&lt;br /&gt;
By default, in the airborne code, airspeed is estimated by measuring the GPS ground speed. The related control loops are described [[Control_Loops|here]]. This gives reasonable results particularly in calm weather conditions. Adding an airspeed sensor measures actual airspeed resulting in better throttle control and aircraft performance especially in windy conditions. It is possible to build your own airspeed sensor by using pressure sensors. To start with adding airspeed sensors it is easier to buy pre-build calibrated airspeeds sensors. This page is currently mainly about how to do just that.&lt;br /&gt;
&lt;br /&gt;
== How does it work internally ==&lt;br /&gt;
&lt;br /&gt;
The altitude and airspeed loops are separated as shown in the diagram below. Basically the throttle and pitch are controlled independently and are not coupled in the control loops. Of course one affects the other but the control loops are independent. Please see the [[Control_Loops#Control_loops_using_Airspeed_Sensor|control loops]] for a more detailed block diagram. The airspeed is controlled by two cascaded Proportional–Integral (PI) loops. The first loop is used to regulate the ground speed and the second the airspeed. This is done just to ensure that if the ground speed drops below a certain value the airspeed will be increased to compensate in order to maintain a valid GPS heading. If you happen to have a 3axis magnetometer build in your airframe for getting the heading values, maintaining a certain GPS speed for getting a heading is not needed.&lt;br /&gt;
&lt;br /&gt;
[[Image:Airspeed.png|left|800px]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
The following plot is from an actual test flight after spending some time setting the loop gains  Here the possibility to perform real-time tuning through the GCS is a real time saver. In the test, the an airplane was flying circles at a constant altitude, except in the end of the flight. The wind was about 5 m/s, judging from the ground speed variations. In the middle there is an example of what happens when the ground speed falls below the setpoint. Finally the altitude setpoint was changed to verify that the airspeed will be maintained while climbing.&lt;br /&gt;
[[Image:PlotAS2.png|left|600px]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
The benefits of the airspeed hold are obvious in this example. The throttle adjusts to keep the airspeed close to the setpoint. &lt;br /&gt;
[[Image:09_10_04__17_50_27_as1.png|left|600px]]&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Measuring ==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is very helpful for tuning your aircraft that you only measure the airspeed without controlling you aircraft behavior. This can be accomplished in the following way:&lt;br /&gt;
 &lt;br /&gt;
Replace the '''USE_AIRSPEED''' define with '''MEASURE_AIRSPEED'''.&lt;br /&gt;
If you want to get sensor information as it is acquired without delay through the PERIODIC_SEND_ telemetry mechanism, please set '''SENSOR_SYNC_SEND''' instead. Note that defining MEASURE_AIRSPEED and not USE_AIRSPEED results in the normal AIRSPEED message containing rather useless information (it is simply four copies of estimator_airspeed, which is not updated by the airspeed sensor, though appears to be updated a very low rate '''FIX THIS?'''). Since the airspeed control loops are not active, one can vary the frequency of the raw measurements by adjusting the rate at which the airspeed_ets module is called in conf/modules/airspeed_ets.xml in the periodic function frequency.&lt;br /&gt;
&lt;br /&gt;
= Airspeed sensors =&lt;br /&gt;
&lt;br /&gt;
== EagleTree Airspeed Sensor ==&lt;br /&gt;
&lt;br /&gt;
=== Connecting an EagleTree Airspeed Sensor ===&lt;br /&gt;
&lt;br /&gt;
The [http://www.eagletreesystems.com/Standalone/standalone.htm EagleTree Airspeed Sensor] is a low cost module and comes with a very good pitot tube (Prandtl style, pitot-static tube) that includes static and dynamic ports, it's resolution is 0.45 m/s and it's max speed is 156 m/s. It has an [http://en.wikipedia.org/wiki/I²C I²C] interface that connects directly to the Autopilot I²C port. The paparazzi autopilot code is able to regulate the throttle in order to keep the airspeed constant (and a minimum ground speed). &lt;br /&gt;
&lt;br /&gt;
When you buy the airspeed sensor it is set to operate in the default mode. Make sure you did not set it somehow to 3rd party mode.&lt;br /&gt;
&lt;br /&gt;
First, connect the sensor directly to the TWOG, Tiny or Lisa/M autopilot board via the I²C connector. The connector is J6 on the TWOG and Tiny and I2C on Lisa board. The wires coming from the sensor module have the following layout:&lt;br /&gt;
&lt;br /&gt;
 Red wire: 5V&lt;br /&gt;
 White wire: Ground&lt;br /&gt;
 Yellow wire: SDA&lt;br /&gt;
 Brown wire: SCL&lt;br /&gt;
&lt;br /&gt;
'''See the [[Module/Airspeed_ETS|airspeed_ets module]] page for configuration.'''&lt;br /&gt;
&lt;br /&gt;
=== EagleTree sensor in 3rd party mode ===&lt;br /&gt;
&lt;br /&gt;
While it is possible to use the sensors in a mode where values are the real values measured a.k.a. 3rd party mode, for regular use with the autopilot it has no specific advantage. Since the paparazzi already contain code to convert values to real speed values. Using the default setting is even a simpler if you have an eagletree logger and inbetween do some measurement with it, you do not need to reprogram the sensors if you connect them to the Autopilot board again. &lt;br /&gt;
&lt;br /&gt;
==== Direct mode ====&lt;br /&gt;
&lt;br /&gt;
Optionally if you have a special requirement and want to use the ''direct mode'', it is possible. For this at the moment one needs to use the Eagletree software under Windows. [[Image:SetSensorFor3rPartyModeRealValues.jpg|240px]]&lt;br /&gt;
&lt;br /&gt;
Regardless that his software runs fine under Linux Wine, using is not possible since the USB port is used in HID mode and as of Wine v1.2 using the USB bus under wind this way is not possible yet. There is however work done and on its way that USB ports do work under Wine for HID device.&lt;br /&gt;
&lt;br /&gt;
== Sensortechnics Airspeed Sensor ==&lt;br /&gt;
&lt;br /&gt;
[http://www.sensortechnics.com Sensortechnics] provides a lot of solution for pressure measurements, absolute or differential, using analog or digital (i2c) outputs.&lt;br /&gt;
&lt;br /&gt;
For airspeed measurements on low speed MAVs, a good choice is the [http://www.sensortechnics.com/en/products/pressure-sensors-and-transmitters/amplified-pressure-sensors/lba/ LBA series], especially the [http://www.sensortechnics.com/cms/upload/appnotes/AN_LBA_E_11162.pdf LBAS500UF6S].&lt;br /&gt;
&lt;br /&gt;
This sensor can be used with the generic [http://paparazzi.github.com/docs/latest/module__airspeed_adc.html '''airspeed_adc''' module]. Note that it may be necessary to use a divisor bridge to adapt the 5V output of the sensor to the 3.3V ADC input of the autopilot.&lt;br /&gt;
&lt;br /&gt;
== MS45xx ==&lt;br /&gt;
&lt;br /&gt;
[[Image:MS4525DO.jpg|200px]]&lt;br /&gt;
&lt;br /&gt;
A  MS4525DO based sensor use could benefit from build in temperature compensation. &lt;br /&gt;
&lt;br /&gt;
Application notes to accompany this product:&lt;br /&gt;
 &lt;br /&gt;
# [http://www.meas-spec.com/downloads/MS45xx_Series_Application_Note.pdf MS45xx Series Application Notes] &lt;br /&gt;
# [http://www.meas-spec.com/downloads/Interfacing_to_MEAS_Digital_Pressure_Modules.pdf Interfacing to MEAS Digital Pressure Modules] &lt;br /&gt;
# [http://www.meas-spec.com/downloads/Configuration,_POR_and_Power_Consumption.pdf Configuration, POR and Power Consumption.] &lt;br /&gt;
&lt;br /&gt;
[http://www.digikey.com/catalog/en/partgroup/ms4525do/29060 One can buy one here at digikey]&lt;br /&gt;
&lt;br /&gt;
To use MS4525 you can load the [http://docs.paparazziuav.org/latest/module__airspeed_ms45xx_i2c.html airspeed_ms45xx_i2c.xml module], e.g. put these lines in the modules section of your airframe file:&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;modules&amp;gt;&lt;br /&gt;
    &amp;lt;load name=&amp;quot;airspeed_ms45xx_i2c.xml&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;define name=&amp;quot;MS45XX_I2C_DEV&amp;quot; value=&amp;quot;i2c1&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;define name=&amp;quot;MS45XX_PRESSURE_RANGE&amp;quot; value=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;define name=&amp;quot;MS45XX_OUTPUT_TYPE&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
      &amp;lt;define name=&amp;quot;MS45XX_PRESSURE_OFFSET&amp;quot; value=&amp;quot;8549.0&amp;quot;/&amp;gt;  &amp;lt;!-- 8542.0--&amp;gt;&lt;br /&gt;
    &amp;lt;/load&amp;gt;&lt;br /&gt;
  &amp;lt;/modules&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Duo MS5611 ==&lt;br /&gt;
&lt;br /&gt;
Two MS5611 working in cooperation. see http://blueflyvario.blogspot.de/2013/06/air-speed-from-two-ms5611.html&lt;br /&gt;
&lt;br /&gt;
== [[Sensors/AMSYS|AMS 5812-0003 / AMS 5812-0001]]==&lt;br /&gt;
&lt;br /&gt;
[http://www.amsys.info/drucksensor/differenzdrucksensor.htm EU distributor]&lt;br /&gt;
[http://www.servoflo.com/product-guide-downloads/low-pressure-guide/download/398/847/17.html US Distributor]&lt;br /&gt;
&lt;br /&gt;
The biggest advantage of the -0001 is its resolution, at a loiter airspeed of 8.5 m/s, the resolution of the -0001 is about 0,0038 m/s whereas the resolution of the MS4525 would be 0,082 m/s (using the data provided by 3DR).&lt;br /&gt;
This advantage gets smaller, the faster the aircraft travels. At 25 m/s the resolution is about 0,0013m/s and 0,028 m/s. Both resolutions should be more then enough at that speed.&lt;br /&gt;
&lt;br /&gt;
Maximum speed for the -0001 is about 41 m/s, for the -0003 about 58 m/s&lt;br /&gt;
&lt;br /&gt;
= Future =&lt;br /&gt;
&lt;br /&gt;
Just as with everything in the UAS world, lots of improvements are still possible.&lt;br /&gt;
&lt;br /&gt;
'''What could be improved:'''&lt;br /&gt;
&lt;br /&gt;
# Maybe revert to GPS measurements only if the airspeed sensor fails.&lt;br /&gt;
# Detect Swap of static/dynamic port at pre-flight test&lt;br /&gt;
&lt;br /&gt;
[[Category:Software]] [[Category:Sensors]] [[Category:User_Documentation]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
	<entry>
		<id>http://wiki.paparazziuav.org/w/index.php?title=Subsystem/actuators&amp;diff=19936</id>
		<title>Subsystem/actuators</title>
		<link rel="alternate" type="text/html" href="http://wiki.paparazziuav.org/w/index.php?title=Subsystem/actuators&amp;diff=19936"/>
		<updated>2015-06-26T13:48:53Z</updated>

		<summary type="html">&lt;p&gt;IHaveADrone: anchor tag links and spelling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;categorytree style=&amp;quot;float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;&amp;quot; mode=pages&amp;gt;Subsystems&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
This subsystem only needs be explicitly specified for rotorcrafts where there are several different actuators implementations and you have to add the correct one depending on the ESCs you use.&lt;br /&gt;
&lt;br /&gt;
Currently possible actuators subsystems are&lt;br /&gt;
* ''[[Subsystem/actuators#MKK|mkk]]''&lt;br /&gt;
* ''[[Subsystem/actuators#MKK_v2|mkk_v2]]''&lt;br /&gt;
* ''[[Subsystem/actuators#Asctec_v1|asctec]]''&lt;br /&gt;
* ''[[Subsystem/actuators#Asctec_v2|asctec_v2]]''&lt;br /&gt;
* ''[[Subsystem/actuators#PWM|pwm]]''&lt;br /&gt;
* ''[[Subsystem/actuators#Dual_PWM|dualpwm]]''&lt;br /&gt;
* ''skiron''&lt;br /&gt;
* ''heli''&lt;br /&gt;
* ''ardrone2''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MKK ==&lt;br /&gt;
Mikrokopter ESCs&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
   &amp;lt;subsystem name=&amp;quot;actuators&amp;quot;     type=&amp;quot;mkk&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;configure name=&amp;quot;MKK_I2C_SCL_TIME&amp;quot; value=&amp;quot;50&amp;quot;/&amp;gt; &amp;lt;!-- only LPC21xx, optional, 150 is default, use 50 for 8 motors--&amp;gt;&lt;br /&gt;
     &amp;lt;configure name=&amp;quot;ACTUATORS_MKK_I2C_DEV&amp;quot; value=&amp;quot;i2c1&amp;quot;/&amp;gt;&lt;br /&gt;
   &amp;lt;/subsystem&amp;gt;&lt;br /&gt;
   &amp;lt;define name=&amp;quot;I2C_TRANSACTION_QUEUE_LEN&amp;quot; value=&amp;quot;10&amp;quot;/&amp;gt; &amp;lt;!-- default is 8, increase to 10 or more for 8 motors--&amp;gt;&lt;br /&gt;
 &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
* ''MKK_I2C_SCL_TIME'' is specific to LPC21x based boards (e.g. booz) and has no effect for STM32 based boards (e.g. Lisa/M/L)&lt;br /&gt;
&lt;br /&gt;
=== XML configuration ===&lt;br /&gt;
 &lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;section name=&amp;quot;ACTUATORS_MKK&amp;quot; prefix=&amp;quot;ACTUATORS_MKK_&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;NB&amp;quot; value=&amp;quot;4&amp;quot;/&amp;gt;&amp;lt;!-- number of motors --&amp;gt;&lt;br /&gt;
    &amp;lt;define name=&amp;quot;ADDR&amp;quot; value=&amp;quot;{ 0x52, 0x54, 0x56, 0x58 }&amp;quot;/&amp;gt;&amp;lt;!-- the I2C addresses of your motors --&amp;gt;&lt;br /&gt;
  &amp;lt;/section&amp;gt;&lt;br /&gt;
  &amp;lt;servos driver=&amp;quot;mkk&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;servo name=&amp;quot;FRONT&amp;quot;  no=&amp;quot;0&amp;quot;    min=&amp;quot;0&amp;quot; neutral=&amp;quot;2&amp;quot; max=&amp;quot;200&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;servo name=&amp;quot;RIGHT&amp;quot;  no=&amp;quot;1&amp;quot;    min=&amp;quot;0&amp;quot; neutral=&amp;quot;2&amp;quot; max=&amp;quot;200&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;servo name=&amp;quot;BACK&amp;quot;   no=&amp;quot;2&amp;quot;    min=&amp;quot;0&amp;quot; neutral=&amp;quot;2&amp;quot; max=&amp;quot;200&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;servo name=&amp;quot;LEFT&amp;quot;   no=&amp;quot;3&amp;quot;    min=&amp;quot;0&amp;quot; neutral=&amp;quot;2&amp;quot; max=&amp;quot;200&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/servos&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The order of addresses in the list defines the numbering of motors! Warn on this during motor mixing!&lt;br /&gt;
&lt;br /&gt;
You also need the matching [[Rotorcraft_Configuration#Motor_Mixing|Motor Mixing section]].&lt;br /&gt;
For Paparazzi versions  older than 5.0 MKK specific values for SUPERVISION defines:&lt;br /&gt;
* ''STOP_MOTOR'' : 0, optional, as the default is already 0&lt;br /&gt;
* ''MIN_MOTOR'' : 3&lt;br /&gt;
* ''MAX_MOTOR'' : 200&lt;br /&gt;
The ''STOP|MIN|MAX_MOTOR'' define are not needed in version 5.0 and above.&lt;br /&gt;
&lt;br /&gt;
== MKK v2 ==&lt;br /&gt;
&lt;br /&gt;
Similar to the above, this is version 2 of the MKK ESCs. The configuration is the same as above, just change mkk to mkk_v2 and MKK to MKK_V2.&lt;br /&gt;
&lt;br /&gt;
This also works with ESCs that have the SimonK firmware and that have I2C support. Very limited documentation is available at [https://github.com/sim-/tgy/ the github page]. It should be noted that you will need to compile and load the firmware for each motor as you will need to change the I2C address for each one to match the ADDR define. If you have success with this please post some more info here.&lt;br /&gt;
&lt;br /&gt;
== Asctec v1 ==&lt;br /&gt;
These controllers already to the mixing themselves, so the [[Rotorcraft_Configuration#Motor_Mixing|Motor Mixing section]] section is not needed.&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;actuators&amp;quot; type=&amp;quot;asctec&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Asctec v2 ==&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;actuators&amp;quot; type=&amp;quot;asctec_v2&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
=== XML configuration ===&lt;br /&gt;
You need the matching [[Rotorcraft_Configuration#Motor_Mixing|Motor Mixing section]].&lt;br /&gt;
&lt;br /&gt;
== PWM ==&lt;br /&gt;
Only for stm32 based autopilot boards (eg. Lisa/M, Lisa/L)&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;rotorcraft&amp;quot;&amp;gt;&lt;br /&gt;
     ...&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;actuators&amp;quot; type=&amp;quot;pwm&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;define name=&amp;quot;SERVO_HZ&amp;quot; value=&amp;quot;400&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/subsystem&amp;gt;&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The define ''SERVO_HZ'' sets a higher update frequency for the pwm controllers which is needed for good response times on some ESCs. Some newer ESCs are said to work better with lower frequencies. More information should be added here.&lt;br /&gt;
=== XML configuration ===&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;servos min=&amp;quot;0&amp;quot; neutral=&amp;quot;0&amp;quot; max=&amp;quot;0xff&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;servo name=&amp;quot;FRONT&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;BACK&amp;quot; no=&amp;quot;1&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;LEFT&amp;quot; no=&amp;quot;2&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;RIGHT&amp;quot; no=&amp;quot;3&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;/servos&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
You also need the matching [[Rotorcraft_Configuration#Motor_Mixing|Motor Mixing section]].&lt;br /&gt;
&lt;br /&gt;
== Dual PWM ==&lt;br /&gt;
This driver allows you to generate dual pulses to control for example double servos like those :&lt;br /&gt;
&lt;br /&gt;
[[File:Dual linear servos.jpg]]&lt;br /&gt;
&lt;br /&gt;
The signal we want to generate look like that :&lt;br /&gt;
&lt;br /&gt;
[[File:Dual_pulse.png]]&lt;br /&gt;
&lt;br /&gt;
During the time of a regular pwm pulse (20ms) we got two parts :&lt;br /&gt;
* the first 1 with a total period of 4ms. During that part we generate the first pulse that is going to control for example the first servo.&lt;br /&gt;
* the first 2 with a total period of 16ms. During that part we generate the second pulse that is going to control for example the second servo.&lt;br /&gt;
&lt;br /&gt;
=== How to use the driver ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;'''CAUTION!'''&amp;lt;/span&amp;gt; &amp;lt;b&amp;gt;This module is only implemented on the lisa M and lisa S boards at the time of writing this documentation (28 mars 2014)&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First of all you are going to need to add the subsystem that is going to generate those pulses :&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;firmware name=&amp;quot;fixedwing&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;target name=&amp;quot;ap&amp;quot;   board=&amp;quot;lisa_s_0.1&amp;quot;&amp;gt;&lt;br /&gt;
      ...&lt;br /&gt;
    &amp;lt;/target&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    ...&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;subsystem name=&amp;quot;actuators&amp;quot; type=&amp;quot;dualpwm&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;define name=&amp;quot;DUAL_PWM_ON&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/subsystem&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;/firmware&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== XML configuration ===&lt;br /&gt;
Then we will be able to add a servo block into the airframe file (in the same way we would for regular servos). But we have to specify the driver that we are using for those servos :&lt;br /&gt;
&lt;br /&gt;
{{Box Code|conf/airframes/myplane.xml|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
  &amp;lt;servos driver=&amp;quot;DualPwm&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;servo name=&amp;quot;SWITCH&amp;quot;  no=&amp;quot;3&amp;quot; min=&amp;quot;1100&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;1900&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;servo name=&amp;quot;pitchator&amp;quot;  no=&amp;quot;2&amp;quot; min=&amp;quot;1100&amp;quot; neutral=&amp;quot;1500&amp;quot; max=&amp;quot;1900&amp;quot;/&amp;gt;&lt;br /&gt;
  &amp;lt;/servos&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#FF0000&amp;quot;&amp;gt;'''CAUTION!'''&amp;lt;/span&amp;gt; &amp;lt;b&amp;gt;The tricky part about this module is that it requires the use of the full timer (that was previously shared between multiple regular pwm). In order to reduce the wast of pins we can only put that type of servos on specifics pins :&lt;br /&gt;
* lisa S (version 0.1) : on the servos 2 and 3 (as shown above). The dual PWM will then but outputted on the 5th pin (yes that is not logical).&lt;br /&gt;
* lisa M (version 2.0) : on the servos 4 and 5. The dual PWM will be outputted on the 4th pin.&lt;br /&gt;
&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:User_Documentation]] [[Category:Subsystems]]&lt;/div&gt;</summary>
		<author><name>IHaveADrone</name></author>
	</entry>
</feed>