ArduPilot · configuration
TF series LiDAR with ArduPilot UAVCAN / UART / TTL / CAN: UAVCAN configuration guide
Setup, connection, configuration and code guidance for TF series LiDAR with ArduPilot. The original files are available in Materials and downloads. Documented interface: UAVCAN, UART / TTL, CAN.
Applicable setup
TF series LiDAR · ArduPilot · UAVCAN, UART / TTL, CAN
Technical instructions and steps
Configuring TF series sensor using TTL to UAVCAN Converter using Pixhawk (Ardupilot Firmware)
Introduction
the guide provides first-time testers with instructions on how to test the UAVCAN converter using Pixhawk Flight Controller on Ardupilot.
Applicable product model of the guide :TFLuna\TFmini-S\TFmini-Plus\TF02-Pro\TF03
Applicable communication interface : TTL
The products covered by the test : TFmini-S
Test Preparation
----------------------------------- ----------------------------------- Preparing Tools Number
PC with windows system 1
4pin dubond wires 1
TFmini-S-TTL 1Pixhawk(APM ) 1
TTL to UAVCAN Converter 1
Mission Planner
Ardupilot Flight Stack apm_fmvu3.px4 ----------------------------------- -----------------------------------
Ardupilot Firmware Burning
Use the Mission Planner to upgrade the Ardupilot Flight Stack
Go to ①Initial setting→② Install firmware Legacy→③Load the custom firmware,Load the firmware and write the firmware as prompted.
The message "success" will be displayed when the firmware is successfully burned.
The firmware uses apm_fmvu3.px4, click "Connect" in the upper right corner after loading successfully.
[1666834231215]
Hardware Configuration
The Pixhawk Flight Controller is connected to the TTL to UAVCAN converter board, LiDAR and computer, as shown in the figure below:
(schematic diagram)
[531b1a0d3c66dc619704635156dac0c]
(Connection Example - for reference only)
Parameters Settings
5.1 Altitude Hold
Parameters configuration
Go to Mission Planner Page→Configure/debug→All parameter trees ,Search and modify the following parameters:
CAN_P1_DRIVER=1【CAN1 is used here, and if CAN2 is used, CAN_P2_DRIVER=2 is selected.】
RNGFND1_TYPE = 24【Indicates the UAVCAN interface】
RNGFND1_ADDR=16【16 indicates the default address of the TTL to UAVCAN Converter.】
RNGFND1_MIN_CM =10【The minimum effective reading distance of LiDAR, unit is cm. It could be adjusted according to the actual demand. This value should be larger than LiDAR non-detection zone.】
RNGFND1_MAX_CM = 700 【The maximum effective reading range of the LiDAR, unit is cm. It could be adjusted according to the actual demand, but should be smaller than the maximum effective range of the LiDAR.】
RNGFND1_GNDCLEAR = 15 【The distance shown by the LiDAR after the UAV lands, unit is cm. It depends on the installation height of the module, and this value should be greater than the LiDAR blind area.】
RNGFND1_ORIENT=25【Install the LiDAR facing down】
PRX1_TYPE=0Upon setting of these parameters, click [Write Params] on the right of mission planner to finish the setup.If you get a "Bad LiDAR Health" error, check that the connection is correct and the power is available.
Press ctrl+F in keyboard to bring up the temp screen, select reboot pixhawk, and then reconnected. []
Data test
How to see the range display of LiDAR fixed height: double click Mission Planner in the flight data interface "fast", double click a numerical column, change to “rangefinder1”, you can see the range value.
Select the rangefinder1 option, as shown below:
The main panel will display the specific distance of the LiDAR height, at rangefinder1, as shown below:
5.2 Obstacle avoidance mode
(1)Parameters configuration
Go to Mission Planner Page→Configure/debug→All parameter trees,Search and modify the following parameters:
AVOID_BEHAVE=1【Obstacle action, 0 detour, 1 stop】
AVOID_MARGIN=3【Collision avoidance distance in GPS positioning mode, unit: m, obstacle avoidance distance is set as needed.】
AVOID_DIST_MAX=3【Collision avoidance distance without GPS mode, unit: m, obstacle avoidance distance is set as needed】
AVOID_ENABLE=2【Obstacle avoidance is enabled and only the Proximity Sensor is used as obstacle avoidance detection.】
CAN_P1_DRIVER=1【CAN1 is used here, and if CAN2 is used, CAN_P2_DRIVER=2 is selected.】
RNGFND1_TYPE = 24【24 represents the UAVCAN interface and this parameter is set to expand RNGFND1】
RNGFND1_ADDR=16【16 indicates the default address of the TTL to UAVCAN Converter.】
RNGFND1_MIN_CM =10【The minimum effective reading distance of LiDAR, unit is cm. It could be adjusted according to the actual demand. This value should be larger than LiDAR non-detection zone.】
RNGFND1_MAX_CM = 700 【The maximum effective reading range of the LiDAR, unit is cm. It could be adjusted according to the actual demand, but should be smaller than the maximum effective range of the LiDAR.】
RNGFND1_GNDCLEAR = 15 【The distance shown by the LiDAR after the UAV lands, unit is cm. It depends on the installation height of the module, and this value should be greater than the LiDAR blind area.】
RNGFND1_ORIENT=0【Install the LiDAR facing forward】
PRX1_TYPE=4【RangeFinder is used as obstacle avoidance detection】Upon setting of these parameters, click [Write Params] on the right of mission planner to finish the setup.If you get a "Bad LiDAR Health" error, check that the connection is correct and the power is available.
Press ctrl+F in keyboard to bring up the temp screen, select reboot pixhawk, and then reconnected. []
(2)Data test
Press ctrl+F in keyboard to bring up the temp screen, select Proximity to open the Proximity UI window.
The sensor data are as follows: is advanced obstacle avoidance
The number in green color means the distance from LiDAR in obstacle avoidance mode(it doesn’t mean the real time distance from LiDAR and will not be influenced in Mission Planner).
Use and verification
The technical content follows the readable source material. Confirm the product hardware revision, flight-stack or software version, and field safety boundary against the original material and current platform documentation.
Materials and downloads
- Configuring TF series sensor using TTL to UAVCAN Converter using Pixhawk (Ardupilot Firmware) · English source (DOCX)Complete inquiry to download
- TF系列TTL转UAVCAN接口在开源飞控Pixhawk(APM)固件上的应用 · Chinese source (DOCX)Complete inquiry to download
