ArduPilot · configuration
TFmini Plus 接入 ArduPilot UART / CAN / I²C · Pixhawk 1:接入与配置指南
TFmini Plus 接入 ArduPilot 的准备、连接、配置与代码要点。原始文件可在资料下载区获取。涉及接口:UART、CAN、I²C。
适用范围
TFmini Plus · ArduPilot · UART、CAN、I²C · Pixhawk 1
原始英文技术说明
Configuring TFmini-Plus with UART Interface on Ardupilot Flight Stack using PixHawk1 Flight Controller
TFmini-Plus can directly be connected with the serial port of PixHawk1. TFmini-Plus can be interfaced with flight controller for the purpose of Altitude Holding or Obstacle Avoidance. At the time of writing the guide the controller used was PixHawk1 flashed with ArduCopter V4.0.4. But the guide can be used with other flight controllers running with different ArduCopter firmware versions with slight modification in parameter names and choosing the right port on flight controller.
Example for connecting to PixHawk1:
Figure 1 Schematic Diagram of Connecting TFmini-Plus with TELEM 2 Interface (Serial Port 2) of PixHawk1
Note: Standard output mode of LiDAR should be used instead of PIX mode in the latest firmwares. PIX mode was only required for the firmware versions older than Arducopter V3.6.2.
a) Mission Planner configuration description of TFmini-Plus for the purpose of altitude hold
Connect the flight control board to Mission Planar. Attention: the installation height should be larger than non-detection/blind zone of LiDAR. Select [CONFIG/TUNING] and then click on [Full Parameter List] in the left from the below bar. Find and modify the following parameters:
Page2
SERIAL2_PROTOCOL = 9 [Rangefinder option]
SERIAL2_BAUD = 115 [Choose the current LiDAR baud rate, if haven’t been changed, the default
baud rate 115200 should be selected, that is 115]
RNGFND1_TYPE = 20 [TFmini-Plus UART option]
RNGFND1_MIN_CM = 30 [It could be changed according to real application requirement and should
be greater LiDAR than non-detection zone, unit is cm]
RNGFND1_MAX_CM = 300 [It could be changed according to real application requirement and
should be smaller than effective measure range of LiDAR, unit is cm]
RNGFND1_GNDCLEAR = 15 [expressed in cm, depending upon mounting height of the module and
should be greater LiDAR than non-detection zone]
RNGFND1_ORIENT=25 [facing down]
PRX_TYPE=0Upon setting of these parameters, click [Write Params] on the right of mission planner to finish. After writing the parameters you need to power off the controller and then turn it on to apply the setting changes.
If the error message “Bad LiDAR Health” appears, please check if the connection is correct, the power supply is normal and have you restarted the controller? Also check it whether you have changed the
Page3
mode from Standard mode to Pix mode while the firmware is 3.6.2 or higher if yes then the same error will encounter.
How to see the altitude value from LiDAR sensor: double click the area of the Mission Planner, look at the following picture:
Select option sonarrange, see following picture:
Page4
The altitude distance from the LiDAR will be displayed in Sonar Range (meters), see the following picture:
B) Mission Planner configuration description of TFmini-Plus for the purpose of Obstacle Avoidance
Connect the flight control board to MP. Attention: distance between UAV margin and LiDAR should be larger than LiDAR non-detection zone. Select [Full Parameter List] in the left from the below bar- [CONFIG/TUNING]. Find and modify the following parameters:
AVOID_MARGIN=2 [Unit: m, set obstacle avoidance distance as required]
SERIAL2_PROTOCOL = 9 [Rangefinder option]
SERIAL2_BAUD = 115 [Choose the current LiDAR baud rate, if haven’t been changed, the default
baud rate 115200 should be selected, that is 115]
RNGFND1_TYPE = 20 [TFmini-Plus UART option]
RNGFND1_MIN_CM = 30 [It could be changed according to real application requirement and
should be greater LiDAR than non-detection zone, unit is cm]
RNGFND1_MAX_CM = 300 [It could be changed according to real application requirement and should
be smaller than effective measure range of LiDAR, unit is cm]
RNGFND1_ORIENT = 0 [It depends on the LiDAR’s real installation direction, 0~7, 24=Up and
25=Down (total ten) are supported up till now, see detail in MP]Page5
PRX_TYPE=4 [Rangefinder should be selected for proximity sensor in obstacle avoidance mode]
AVOID_ENABLE= 3 [if 3 = UseFence and UseProximitySensor doesn’t work in IIC then choose 2 =
UseProximitySensor]Upon setting of these parameters, click [Write Params] on the right of the software to finish. After writing the parameters you need to power off the controller and then turn it on to apply the settings.
If the error message “PreArm: check the proximity sensor” appears, please check if the connection is correct, the power supply is normal and have you restarted the controller. Also check it whether you have changed the mode from Standard mode to Pix mode while the firmware is 3.6.2 or higher if yes then the same error will encounter.
How to see the target distance measured by the LiDAR: (distance from LiDAR in obstacle avoidance can’t be displayed in sonarrange option) press Ctrl+F button in keyboard, the following window will pop out:
Page6
Click button Proximity, the following window will appear:
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. The mission planner version at the time of writing this tutorial was v1.3.69.
Page7
Attach: If TELEM 2 port has been used, SERIAL4/5 interface can be used, the other setting are same
Figure 2: Schematic Diagram of Connecting TFmini-Plus with SERIAL4/5 Interface of PixHawk1
Configuration Descriptions on Mission Planner:
Connect flight control board to MP, Select [Full Parameter List] in the left from the below bar [CONFIG/TUNING]. Find and modify following parameters:
SERIAL4_PROTOCOL = 9 (LiDAR)
SERIAL4_BAUD = 115Upon setting of these parameters, the other parameters are same as Mission Planner configuration description of TFmini-Plus for the purpose of Obstacle Avoidance or Altitude Holding, then click [Write Params] on the right of the software to finish.
Page8
使用说明
按原始资料可读取的技术内容编排;具体的产品硬件版本、飞控/软件版本和现场安全边界仍应以原始资料及目标平台当前文档为准。
资料与下载
- Configuring TFmini-Plus with UART · 英文原文(PDF)填写信息后下载
