Difference between revisions of "Subsystem/radio control"

From PaparazziUAV
Jump to: navigation, search
m (minor spelling)
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages hideprefix=always>Subsystems</categorytree>
 
== Radio Control subsystem ==
 
== Radio Control subsystem ==
 +
Currently possible Radio Control subsystems are:
 +
 +
{| class="wikitable" style="text-align:center" border="1"
 +
! Type !! Firmwares !! Radio file !! Notes
 +
|-
 +
|'''[[Subsystem/radio_control#PPM|ppm]]''' || all || yes ||
 +
|-
 +
|'''[[Subsystem/radio_control#Spektrum|spektrum]]''' || all || no ||
 +
|-
 +
|'''[[Subsystem/radio_control#SBus|sbus and sbus_dual]]''' || all ||  ||
 +
|-
 +
|'''[[Subsystem/radio_control#Datalink|datalink]]'''  || all ||  ||
 +
|-
 +
|'''[[Subsystem/radio_control#SuperbitRF|superbitrf_rc]]''' || rotorcraft only? || No ||
 +
|}
 +
 +
=== Configure Options ===
 +
If a configure option is not specified the default is used.
 +
 +
* '''RADIO_CONTROL_LED''': ''1'', ''2'', ''3'', ''none''
 +
** default: Already defined according to your board (e.g. ''none'' for tiny/twog, ''1'' for booz and navgo, ''2'' lisa_m_1.0, ''4'' lisa_m_2.0).
 +
 +
E.g. if you want to use LED3 to indicate if RC is ok on yapa:
 +
{{Box Code|conf/airframes/myplane.xml|
 +
<source lang="xml">
 +
  <firmware name="fixedwing or rotorcraft">
 +
    ...
 +
    <subsystem name="radio_control"      type="ppm">
 +
      <configure name="RADIO_CONTROL_LED" value="3"/>
 +
    </subsystem>
 +
  </firmware>
 +
</source>
 +
}}
  
 
== Implementations ==
 
== Implementations ==
  
 
=== PPM ===  
 
=== PPM ===  
The Paparazzi autopilot can interface directly with the PWM signal from any standard hobby R/C receiver.  Signal decoding configuration settings for this are stored in the [[Radio_Control|Radio Control]] file.
+
The Paparazzi autopilot can interface directly with the PWM signal from any standard hobby R/C receiver.  Signal decoding configuration settings for this are stored in the [[Radio_Control|Radio Control XML file]].
  
Just specify the appropriate subsystem in your firmware section:
+
Just specify the appropriate subsystem in your firmware section. On some boards, you can also configure the capture pin to use for ppm sum input. Refer to your hardware page for more information.
 
{{Box Code|conf/airframes/myplane.xml|
 
{{Box Code|conf/airframes/myplane.xml|
<pre>
+
<source lang="xml">
 
   <firmware name="fixedwing or rotorcraft">
 
   <firmware name="fixedwing or rotorcraft">
 
     ...
 
     ...
 
     <subsystem name="radio_control"    type="ppm"/>
 
     <subsystem name="radio_control"    type="ppm"/>
 
   </firmware>
 
   </firmware>
</pre>
+
</source>
 
}}
 
}}
 +
  
 
=== Spektrum ===
 
=== Spektrum ===
 +
The Spektrum parser does '''NOT''' use the [[Radio_Control|Radio Control xml]] file. Proper Spektrum support is only provided for the ''STM32'' based autopilots.
 +
 +
You need to define which 3-way switch you want to use as mode switch (most commonly the AUX1 switch)
 +
{{Box Code|conf/airframes/myplane.xml|
 +
<source lang="xml">
 +
  <firmware name="fixedwing or rotorcraft">
 +
    ...
 +
    <subsystem name="radio_control"    type="spektrum">
 +
      <define name="RADIO_MODE" value="RADIO_AUX1"/>
 +
    </subsystem>
 +
  </firmware>
 +
</source>
 +
}}
 +
 +
If you want to use a second Spektrum satellite:
 +
{{Box Code|conf/airframes/myplane.xml|
 +
<source lang="xml">
 +
  <firmware name="fixedwing or rotorcraft">
 +
    ...
 +
    <subsystem name="radio_control"    type="spektrum">
 +
      <define name="RADIO_MODE" value="RADIO_AUX1"/>
 +
      <configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" value="1"/>
 +
    </subsystem>
 +
  </firmware>
 +
</source>
 +
}}
 +
The correct UART for the second receiver is already defined as default for your board. If you want to use a different one you can configure it via:
 +
<source lang="xml"><configure name="RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value="UART5"/></source>
 +
 +
 +
=== SBus ===
 +
'''SBUS uses an inverted signal. To use it on a normal input you need an inverter. The [[Apogee/v1.00|Apogee autopilot board]] already has one built in.'''
 +
 +
You can use the type '''sbus''' for a single SBus reciever or '''sbus_dual''' for two receivers.
 +
{{Box Code|conf/airframes/myplane.xml|
 +
<source lang="xml">
 +
  <firmware name="fixedwing or rotorcraft">
 +
    ...
 +
    <subsystem name="radio_control"    type="sbus">
 +
      <configure name="SBUS_PORT" value="UART2"/>
 +
    </subsystem>
 +
  </firmware>
 +
</source>
 +
}}
 +
or the dual setup:
 +
{{Box Code|conf/airframes/myplane.xml|
 +
<source lang="xml">
 +
  <firmware name="fixedwing or rotorcraft">
 +
    ...
 +
    <subsystem name="radio_control"    type="sbus_dual">
 +
      <configure name="SBUS1_PORT" value="UART1"/>
 +
      <configure name="SBUS2_PORT" value="UART2"/>
 +
    </subsystem>
 +
  </firmware>
 +
</source>
 +
}}
  
 
=== Datalink ===
 
=== Datalink ===
 +
{{Box Code|conf/airframes/myplane.xml|
 +
<source lang="xml">
 +
  <firmware name="fixedwing or rotorcraft">
 +
    ...
 +
    <subsystem name="radio_control"    type="datalink"/>
 +
  </firmware>
 +
</source>
 +
}}
 +
You can additionally configure a '''RADIO_CONTROL_DATALINK_LED''' which is toggled each time a RC command message is received via datalink:
 +
<source lang="xml"><configure name="RADIO_CONTROL_DATALINK_LED" value="3"/></source>
 +
 +
 +
=== SuperbitRF ===
 +
The [[SuperbitRF]] parser does '''NOT''' use the [[Radio_Control|Radio Control xml]] file. Proper SuperbitRF support is only provided for the ''STM32'' based autopilots. SuperbitRF uses the same configuration values as the Spektrum radio control subsystem.
 +
 +
Because the SuperbitRF can't save the bound transmitter in flash, you can define it in your airframe file. You can get the information you need out of the SuperbitRF data packet after binding. An example is shown below:
 +
{{Box Code|conf/airframes/myplane.xml|
 +
<source lang="xml">
 +
  <firmware name="fixedwing or rotorcraft">
 +
    ...
 +
    <subsystem name="radio_control"    type="superbitrf_rc">
 +
      <define name="RADIO_TRANSMITTER_ID" value="2008496626"/>
 +
      <define name="RADIO_TRANSMITTER_CHAN" value="6"/>
 +
      <define name="RADIO_TRANSMITTER_PROTOCOL" value="0x01"/>
 +
      <define name="RADIO_KILL_SWITCH" value="RADIO_FLAP"/>
 +
    </subsystem>
 +
  </firmware>
 +
</source>
 +
}}
 +
  
 
=== Obsolete Classix Autopilot ===
 
=== Obsolete Classix Autopilot ===
Line 40: Line 161:
 
PWM1 and PWM6 should be safe. PWM4 and PWM5 should be OK if you're not using UART1 on the FBW processor - same for PWM2 and PWM3 if you're not using UART0 (disable FBW telemetry for that ).
 
PWM1 and PWM6 should be safe. PWM4 and PWM5 should be OK if you're not using UART1 on the FBW processor - same for PWM2 and PWM3 if you're not using UART0 (disable FBW telemetry for that ).
  
[[Category:Software]] [[Category:User_Documentation]] [[Category:Subsystems]]
+
[[Category:User_Documentation]] [[Category:Subsystems]]

Latest revision as of 07:26, 29 December 2015

Radio Control subsystem

Currently possible Radio Control subsystems are:

Type Firmwares Radio file Notes
ppm all yes
spektrum all no
sbus and sbus_dual all
datalink all
superbitrf_rc rotorcraft only? No

Configure Options

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

  • RADIO_CONTROL_LED: 1, 2, 3, none
    • default: Already defined according to your board (e.g. none for tiny/twog, 1 for booz and navgo, 2 lisa_m_1.0, 4 lisa_m_2.0).

E.g. if you want to use LED3 to indicate if RC is ok on yapa:

File: conf/airframes/myplane.xml
  <firmware name="fixedwing or rotorcraft">
     ...
    <subsystem name="radio_control"       type="ppm">
      <configure name="RADIO_CONTROL_LED" value="3"/>
    </subsystem>
  </firmware>

Implementations

PPM

The Paparazzi autopilot can interface directly with the PWM signal from any standard hobby R/C receiver. Signal decoding configuration settings for this are stored in the Radio Control XML file.

Just specify the appropriate subsystem in your firmware section. On some boards, you can also configure the capture pin to use for ppm sum input. Refer to your hardware page for more information.

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


Spektrum

The Spektrum parser does NOT use the Radio Control xml file. Proper Spektrum support is only provided for the STM32 based autopilots.

You need to define which 3-way switch you want to use as mode switch (most commonly the AUX1 switch)

File: conf/airframes/myplane.xml
  <firmware name="fixedwing or rotorcraft">
     ...
    <subsystem name="radio_control"     type="spektrum">
      <define name="RADIO_MODE" value="RADIO_AUX1"/>
    </subsystem>
  </firmware>

If you want to use a second Spektrum satellite:

File: conf/airframes/myplane.xml
  <firmware name="fixedwing or rotorcraft">
     ...
    <subsystem name="radio_control"     type="spektrum">
      <define name="RADIO_MODE" value="RADIO_AUX1"/>
      <configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" value="1"/>
    </subsystem>
  </firmware>

The correct UART for the second receiver is already defined as default for your board. If you want to use a different one you can configure it via:

<configure name="RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value="UART5"/>


SBus

SBUS uses an inverted signal. To use it on a normal input you need an inverter. The Apogee autopilot board already has one built in.

You can use the type sbus for a single SBus reciever or sbus_dual for two receivers.

File: conf/airframes/myplane.xml
  <firmware name="fixedwing or rotorcraft">
     ...
    <subsystem name="radio_control"     type="sbus">
      <configure name="SBUS_PORT" value="UART2"/>
    </subsystem>
  </firmware>

or the dual setup:

File: conf/airframes/myplane.xml
  <firmware name="fixedwing or rotorcraft">
     ...
    <subsystem name="radio_control"     type="sbus_dual">
      <configure name="SBUS1_PORT" value="UART1"/>
      <configure name="SBUS2_PORT" value="UART2"/>
    </subsystem>
  </firmware>

Datalink

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

You can additionally configure a RADIO_CONTROL_DATALINK_LED which is toggled each time a RC command message is received via datalink:

<configure name="RADIO_CONTROL_DATALINK_LED" value="3"/>


SuperbitRF

The SuperbitRF parser does NOT use the Radio Control xml file. Proper SuperbitRF support is only provided for the STM32 based autopilots. SuperbitRF uses the same configuration values as the Spektrum radio control subsystem.

Because the SuperbitRF can't save the bound transmitter in flash, you can define it in your airframe file. You can get the information you need out of the SuperbitRF data packet after binding. An example is shown below:

File: conf/airframes/myplane.xml
  <firmware name="fixedwing or rotorcraft">
     ...
    <subsystem name="radio_control"     type="superbitrf_rc">
      <define name="RADIO_TRANSMITTER_ID" value="2008496626"/>
      <define name="RADIO_TRANSMITTER_CHAN" value="6"/>
      <define name="RADIO_TRANSMITTER_PROTOCOL" value="0x01"/>
      <define name="RADIO_KILL_SWITCH" value="RADIO_FLAP"/>
    </subsystem>
  </firmware>


Obsolete Classix Autopilot

If you have a Classix Autopilot:

File: conf/airframes/myplane.xml
 ap.CFLAGS += -DRADIO_CONTROL
 ap.EXTRA_SRCS += radio_control.c $(SRC_ARCH)/ppm_hw.c
 ap.CFLAGS += -DACTUATORS=\"servos_direct_hw.h\"
 ap.EXTRA_SRCS += $(SRC_ARCH)/servos_direct_hw.c

For the Classix, you must specify which pins to use for PWM by adding "-DPWM_SERVO_0, etc." to the line fbw.CFLAGS. This activate the PWM channel.

 wiring on classix PWM connector
 connector   LPC   shared         port 
 PWM1        PWM5  AD1_6  CAP1_3  P0.21
 PWM2        PWM3  RXD0   EINT0   P0.1
 PWM3        PWM1  TXD0           P0.0
 PWM4        PWM6  RXD1   EINT3   P0.9
 PWM5        PWM4  TXD1   AD1_1   P0.8
 PWM6        PWM2  SSEL0  EINT2   P0.7

PWM1 and PWM6 should be safe. PWM4 and PWM5 should be OK if you're not using UART1 on the FBW processor - same for PWM2 and PWM3 if you're not using UART0 (disable FBW telemetry for that ).