# UAVCAN 介绍

UAVCAN Logo UAVCAN (opens new window) is an onboard network which allows the autopilot to connect to avionics/peripherals. It uses rugged, differential signalling, and supports firmware upgrades over the bus and status feedback from peripherals.

The videos section contains additional information and guides.

注解

PX4 requires an SD card for UAVCAN node allocation and firmware upgrade. It is not used during flight by UAVCAN.

# 初始设置

It supports hardware like:

注解

PX4 does not support UAVCAN servos (at time of writing).

# 升级节点固件

All UAVCAN components share the same connection architecture/are wired the same way. Connect all on-board UAVCAN devices into a chain and make sure the bus is terminated at the end nodes (the order in which the nodes are connected/chained does not matter).

The following diagram shows this for a flight controller connected to UAVCAN motor controllers (ESCs) and a UAVCAN GNSS.

UAVCAN Wiring

The diagram does not show any power wiring. Refer to your manufacturer instructions to confirm whether components require separate power or can be powered from the CAN bus itself.

For more information about proper bus connections see UAVCAN Device Interconnection (opens new window) (Zubax KB).

注解

  • While the connections are the same, the connectors may differ across devices.
  • An second/redundant" CAN interface may be used, as shown above (CAN2). This is optional, but can increase the robustness of the connection.

# 枚举和配置电机控制器

In order to use UAVCAN components with PX4 you will first need to enable the UAVCAN driver:

  1. Power the vehicle using the battery (you must power the whole vehicle, not just the flight controller) and connect QGroundControl.

  2. Navigate to the Vehicle Setup > Parameters screen.

  3. UAVCAN_ENABLE must be set to one of the non-zero values.

    The values are:

    • 0: UAVCAN driver disabled.
    • 1: Sensors Manual Config.
    • 2: Sensors Automatic Config.
    • 3: Sensors and Actuators (ESCs) Automatic Config

    Use 1 if none of the connected UAVCAN devices support automatic configuration (check the manual!), 2 or 3 if some of them support automatic configuration, and 3 if you're using UAVCAN ESCs (this assigns motor controls to the UAVCAN bus rather than PWM).

注解

You will need to manually allocate static ids for any nodes that don't support automatic configuration. When using dynamic configuration, any manually allocated ids should be given a value greater than the number of UAVCAN devices (to avoid clashes).

Most UAVCAN sensors require no further setup (they are plug'n'play, unless specifically noted in their documentation).

UAVCAN motor controllers (ESCs) additionally require the motor order be set, and may require a few other parameters be set. Whether this can be done using the simple QGroundControl setup UI depends on the type of ESC (see link for information).

# 相关链接

# 布线

PX4 requires an SD card for UAVCAN node allocation and during firmware update (which happen during boot). Check that there is a (working) SD card present and reboot.

# 固件设置

If the PX4 Firmware arms but the motors do not start to rotate, check that parameter UAVCAN_ENABLE=3 to use UAVCAN ESCs. If the motors do not start spinning before thrust is increased, check UAVCAN_ESC_IDLT=1.

# Videos

Intro to UAVCAN and Practical Example with Setup in QGroundControl!


UAVCAN for drones — PX4 Developer Summit Virtual 2020


Getting started using UAVCAN v1 with PX4 on the NXP UAVCAN Board — PX4 Developer Summit Virtual 2020


UAVCAN: a highly dependable publish-subscribe protocol for hard real-time intravehicular networking — PX4 Developer Summit Virtual 2019

# Developer Information

  • UAVCAN Development: Topics related to development and integration of new UAVCAN hardware into PX4.