# UAVCAN Gps+Mag+Baro node

This board has 3 types of sensors:

  1. GNSS module: u-blox 8 (opens new window)
  2. Barometer: BMP280 (opens new window)
  3. Magnetometers: RM3100 (opens new window) and/or HMC5883L (opens new window)


# 1. UAVCAN interface

This node interacts with the following messages:

type message
1 publisher uavcan.equipment.gnss.Fix (opens new window)
2 publisher uavcan.equipment.air_data.StaticPressure (opens new window)
3 publisher uavcan.equipment.air_data.StaticTemperature (opens new window)
4 publisher uavcan.equipment.ahrs.MagneticFieldStrength (opens new window)
5 publisher uavcan.equipment.power.CircuitStatus (opens new window)

Besides required and highly recommended functions such as NodeStatus and GetNodeInfo this node also supports the following application-level functions:

type message
1 RPC-service uavcan.protocol.param (opens new window)
2 RPC-service uavcan.protocol.RestartNode (opens new window)
3 RPC-service uavcan.protocol.GetTransportStats (opens new window)

# 2. Hardware specification

(in progress)

UAVCAN-PWM mini scheme:


# 3. Wire

This board has 3 connectors which are described in the table below.

Connector Description
1 UCANPHY Micro (JST-GH 4) Devices that deliver power to the bus are required to provide 4.9–5.5 V on the bus power line, 5.0 V nominal. Devices that are powered from the bus should expect 4.0–5.5 V on the bus power line. The current shall not exceed 1 A per connector.
2 6-pin Molex (502585-0670 (opens new window), 502578-0600 (opens new window)) Contacts support up to 100 V, 2 A per contact. But the board may work only with 2S-6S.
3 SWD STM32 firmware updating using programmer-sniffer.

# 4. Main function description

This node primary has 3 features: GPS, magnetometer, and barometer. You may enable or disable any of them using the following UAVCAN parameters gps_enable, mag_enable and baro_enable.

Below you can see an illustration of how it may work in uavcan_gui_tool.


# 4.1. GNSS module

The node uses u-blox 8 (opens new window) GNSS module. It can work either with NMEA or ublox (opens new window) protocol. You may choose desired protocol using UAVCAN parameter gnss_type.

Note 1: nmea protocol is not tested well yet. Use ubx protocol instead.

Note 2: During ubx protocol mode, it parses only UbxNavPvt message because it has all necessary information to fill it into Fix message. Turn off all other package.

Note 3: At this moment you need to manually set up the ublox module before usage.

How to setup U-Blox NEO-M8N-0 bu UART

  • Download (opens new window) and install u-center (not u-center 2).
  • Connect to the module by UART at 9600 by default.
  • Open View->Configuration view. Go to MSG (Messages), enable "01-07 NAV-PVT" at UART1, disable all other messages. Push "send" at hte bottom of the window to send command. Check that only NAV-PVT goes from the module by opening View->Messages View.
  • Again go to Configuration view to PRT (Ports), change the Baudrate to 115200, "send" at the bottom.
  • Reconnect to the device at the new baud rate.
  • Go to Configuration view to RATE (Rates), set Measurement Period to 60 ms, "send" at the bottom.
  • If everything ok, go to Configuration view to CFG (Configuration), select "Save current configuration", "send" at the bottom.

About workflow

It communicates with the GNSS module via UART and publishes uavcan.equipment.gnss.Fix (opens new window). You may either set the default publish rate (the same as receiving) by setting gps_frequency to 0 or set any other fixed rate.

Below you can see an example of the Fix message.



The raw GNSS-module needs 8.7 ms to send a UbxNavPvt package via uart (the baud rate is 115200, a package length is 100 bytes).

This board as a wrapper under GNSS-module needs ~12 ms to get this package via UART, process it and send to CAN-bus.

It means that the time overhead compared to raw module is only ~4ms.

# 4.2. Barometer

The node uses BMP280 (opens new window) barometer. Communication with the sensor is carried out using I2C. It publishes 2 messages:

Control measurement settings:

  • pressure oversampling is 8: high resolution, 19 bit / 0.33 Pa
  • temperature oversampling is 8: 19 bit / 0.0006 °C
  • the data rate is up to 50 Hz if standby time is less then 0.5 ms
  • normal mode



# 4.3. Magnetometer

The node supports 2 types of magnetometers: RM3100 (opens new window) and HMC5883L (opens new window). You may choose the one you need at runtime using UAVCAN parameters.

Before the first measurement, this node performs initialization for the chosen magnetometer. Configuration settings are predefined in firmware and shown in the table below.

  1. HMC5883L (opens new window):
  • i2c bus,
  • Continuous-Measurement Mode with Normal measurement configuration,
  • the measurement rate is 30 Hz (15 Hz is the default),
  • adjustable publish rate up to 30 Hz using UAVCAN parameter,
  • number of samples is 2 (1 is the default),
  • the sensor field range is ± 1.3 Ga (by default), so digital resolution is 0.92 mG/LSb.
  1. RM3100 (opens new window)
  • SPI bus
  • Continuous Measurement Mode,
  • the measurement rate is 75 Hz (37 Hz is the default),
  • adjustable publish rate up to 75 Hz using UAVCAN parameter,
  • cycle count is 200 (by default), so the gain is 75 LSB/µT, sensitivity is 13 nT,
  • field Measurement Range is from -800 to +800 uT.

Both magnetometers publish uavcan.equipment.ahrs.MagneticFieldStrength (opens new window).

Below you may see an example of HMC5883L magnetometer raw data.



# 5. Auxiliary functions description

(in progress)

Also, it has external LEDs. They show the system state at this moment.

# 6. Parameters

The list of parameters is shown in the table below:

Idx Name Type Default Min Max Description
0 ID integer 71 0 100 Node identifier
1 gps_enable integer 1 0 1 0 means disable, 1 means enable gps
2 gps_type integer 0 0 2 0 means ublox, 1 means nmea (not supported yet), 2 means ublox emulation (debug only)
3 gps_pub_period integer 0 0 2000 0 means publish which receiving rate, 1-2000 means fixed rate in milliseconds
4 mag_enable integer 1 0 1 0 means disable, 1 means enable magnetometer
5 mag_type integer 0 0 1 0 means RM3100, 1 means HMC5883L
6 mag_pub_frequency integer 75 1 75 Publish rate. Note that this value is actually limited be the sensor type (mag_type)
7 baro_enable integer 1 0 1 0 means disable, 1 means enable barometer
8 baro_pub_frequency integer 50 1 50 Publish rate
9 enable_5v_check integer 1 0 1 Set ERROR status if 5V voltage is out of range 4.5 - 5.5 V
10 enable_vin_check integer 0 0 1 Set ERROR status if Vin voltage is less than 4.5 V
11 name integer 0 0 100 Custom name of the node. Might be implemented by request.

# 7. Led indication

This board has an internal led that may allow you to understand possible problems. It blinks from 1 to 10 times within 4 seconds. By counting the number of blinks you can define the code of current status.

Number of blinks Uavcan health Description
1 OK Everything is ok.
2 OK There is no RawCommand at least for the last 0.5 seconds, PWM state is reset to the default state.
3 WARNING This node can't see any other nodes in the UAVCAN network, check your cables.
4 ERROR There is a problem with circuit voltage, look at the circuit status message to get details. It may happen when you power it from SWD, otherwise be careful with the power supply.
5 CRITICAL There is a problem with the periphery initialization level. Probably you load the wrong firmware.

# 8. Usage example on a table

(in progress)

# 9. UAV usage example

(in progress)