Subsystem/telemetry

From PaparazziUAV
(Redirected from Subsystems/telemetry)
Jump to navigation Jump to search

Telemetry (Modem)

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 file, e.g. conf/telemetry/default.xml. Those wishing to experiment with "alternative" modems can reduce the number and period of each telemetry message to fit within most any bandwidth constraint.

Paparazzi supports the following modem protocols:

  • 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.
  • 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.

Just specify the appropriate subsystem in your firmware section. You can currently choose between the types transparent, transparent_usb and xbee_api.

File: conf/airframes/myplane.xml
  <firmware name="fixedwing or rotorcraft">
     ...
    <subsystem name="telemetry"     type="transparent"/>
  </firmware>

The correct UART is already defined by default according to your board. The default modem baudrate is 57600baud.

Configure Options

If a configure option is not specified the default is used.

  • MODEM_PORT: UART0, UART1, etc.
    • default: The correct UART is already defined according to your board.
  • MODEM_BAUD: B4800, B9600, B38400, B57600, B115200
    • default: B57600

If you use different baud rate or Uart set the according parameters, e.g.

File: conf/airframes/myplane.xml
  <firmware name="fixedwing or rotorcraft">
     ...
    <subsystem name="telemetry"     type="transparent">
      <configure name="MODEM_BAUD"  value="B9600"/>
      <configure name="MODEM_PORT"  value="UART1"/>
    </subsystem>
  </firmware>

Telemetry over USB serial

Simply choose the transparent_usb telemetry type in your airframe file:

File: conf/airframes/myplane.xml
  <firmware name="fixedwing or rotorcraft">
     ...
    <subsystem name="telemetry"     type="transparent_usb"/>
  </firmware>

There are no further options for this type.

On your host computer the usb connection to your autopilot will usually show up as /dev/ttyACM0 or /dev/paparazzi/stm32-usb-serial for the STM32 based boards.

Configuring The Serial Protocol

New users are advised to start with the standard serial protocol before attempting to setup an addressed API link. There are no real reasons for the novice user to use the xbee protocol over the standard PPRZTransport. Even if you are using a Maxstream modem you should still start out with the standard. Lastly it should be pointed out that using a single UAS there is no disadvantage and that the OSAM Paparazzi Team at UAS 2008 took second place using the STANDARD protocol. The serial protocol works with virtually any modem as well as direct cable connections. The baud rates of the airborne modem, autopilot, ground modem, and PC must be configured correctly. The PC and autopilot serial ports do not need to be set to the same baud rate, i.e. when running multiple aircraft from a single ground modem, the ground modem may require a higher baud rate than any of the airborne modems in order to stream the data from multiple simultaneous sources (Warning, this may not be correct for all modems, especially Radiotronix modems that require to have the same baudrate on both side).

Configuring The Maxstream API Protocol

The optional API protocol enables hardware addressing so that multiple aircraft can be managed from a single ground modem, or multiple aircraft and multiple ground stations can work simultaneously without interference from one another. API mode is enabled by sending an escape sequence (+++) followed by AT commands, this can be done automatically at each boot or can be permanently configured with the "ATWR" command for greater reliability.


File: conf/airframes/myplane.xml
 <section name="MISC">
    ...
    <define name="XBEE_INIT" value="\"ATPL2\rATRN1\rATTT80\r\ATBD6\rATWR\r\""/>
    ...
 </section>

The above example will program the Maxstream to API mode, 100mW power (ATPL2), 57600 baud (ATBD6), and permanently store the changes (ATWR). After flashing allow 30 seconds for the modem to store the changes, then disable the init string by adding the line <define name="NO_XBEE_API_INIT" value="TRUE"/> (the parameter "value" has no effect), update the baud rate as needed, and re-flash the autopilot. The modem and autopilot serial port baud rates must match each other at all times.
Notes:

  • Maxtream modems are factory configured for 9600 baud, in order to change baud rates, first configure the autopilot serial port to match the modem (DUART0_BAUD=B9600), boot the system so that the baud rate change command is sent to the modem (ATBD6) and permanently saved (ATWR), allow 30 seconds for the modem configuration to complete, then reprogram the autopilot with the new baud rate (DUART0_BAUD=B57600) and disabled modem configuration string <define name="NO_XBEE_API_INIT" value="TRUE"/> .
  • The ac_id defined in conf/conf.xml is permanently programmed into the modem so this procedure would need to be re-run if the modem is moved to another plane.
  • For temporary boot-time API configuration remove any baud rate changes, remove ATWR\r from the end of the string.
  • Upgrade your Maxstream firmware to the latest version before attempting API mode operation.

Alternate Method

This is the way it is done in funjet1.xml and has been tested to work by Danstah

File: conf/airframes/funjet1.xml
  <section name="MISC">
    ...
    <define name="XBEE_INIT" value="\"ATPL2\rATRN1\rATTT80\r\""/>
<!--    <define name="NO_XBEE_API_INIT" value="TRUE"/> -->
    ...
  </section>

Keep in mind that the ground modem baud rate and aircraft modem baud rate do not have to match. What does need to match however is the baud rate of your modem build into the aircraft and the rate defined in the airframe file. For example if this aircraft modem is set to 9600Baud, this modem can connect with a ground modem configured set to 57600Baud. Also for multiple UAS, a good way to configure them is to use 9600Baud for the Autopilot board and use a ground modem configured to 57600Baud. After your aircrafts are working well, set your configuration to use minimal telemetry.

Set GCS baud rate

Set can set the baudrate for the link in the GCS by specifying -s 57600 as a parameter to link. Then just save your session so you won't have to change it again next time.

You can also manually write a session:

File: conf/control_panel.xml
 <session name="USB">
   <program name="link">
     <arg flag="-d" constant="/dev/ttyUSB0"/>
     <!--<arg flag="-transport" constant="xbee"/>--><!-- uncomment this line for XBee API mode -->
     <arg flag="-s" constant="57600"/>
   </program>
   ...
 </session>

Use this constant /dev/paparazzi/ttyUSB0 when using either the ftdi cable or a Maxstream USB ground modem.. Otherwise use /dev/ttyUSB0 (the ttyUSB0 being the device that you are using. Note: it might not always be ttyUSB0). This paparazzi directory in the dev folder is created when setting the udev rules. Setting Udev rules