# UAVCAN Rangefinder node
This board has few drivers for communication with such rangefinder as LW20/C (opens new window) and TF-Luna (opens new window) via i2c/uart. After reading measurements it sends data through UAVCAN network.
Fig. Prototype based on lightware LW20
# 1. UAVCAN interface
This node interracts with following messages:
|1||publisher||uavcan.equipment.range_sensor.Measurement (opens new window)|
|2||publisher||uavcan.equipment.power.CircuitStatus (opens new window)|
Besides required and highly recommended functions such as
GetNodeInfo this node also supports the following application-level functions:
|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
# 3. Wire
This board has 3 connectors which are described in the table below.
|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 measures and publishes range with adjustable rates (10 Hz by default for both). Publication and measurement rates might be configured using node parameters, but it is recommended to use default values.
# 5. Auxiliary functions description
It also sends uavcan.equipment.power.CircuitStatus (opens new window) messages with measured
# 6. Parameters
The list of parameters is shown in the table below:
|1||log_level||integer||3||0||4||Minimal log level message which might be sended by this device. 0 - debug, 1 - info, 2 - warn, 3 - error, 4 - disable|
|2||rng_measurement_period||integer||100||10||2000||Period of measurement and publishing|
|3||rng_type||integer||0||0||2||Defines which sensor to use. See the table below.|
|4||rng_id||integer||0||0||255||Id of the sensor in the message.|
|5||enable_5v_check||integer||1||0||1||Set ERROR status if 5V voltage is out of range 4.5 - 5.5 V|
|6||enable_vin_check||integer||0||0||1||Set ERROR status if Vin voltage is less than 4.5 V|
|7||name||integer||0||0||100||Custom name of the node. Might be implemented by request.|
Using parameters you may specify type of sensor (now it supports only LW20/C)
|rng_type value||corresponded sensor type|
|2||Garmin lite v3 (i2c)|
# 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 (it's not a problem for this board, just in case).|
|3||WARNING||This node can't see any other nodes in UAVCAN network, check your cables, or there is no incoming data from the sensor.|
|4||ERROR||There is a problem with circuit voltage, look at circuit status message to get details. It may happen when you power it from SWD, otherwise, be careful with the power supply. This check might be turned off using params.|
|5||CRITICAL||There is a problem with the periphery initialization level. Probably you load the wrong firmware.|
# 8. Usage example on a table
It is recommended to debug it with uavcan_gui_tool (opens new window). You can check the message sent by this node.
Example of the message shown below.
# 9. UAV usage example