ArduPilot · configuration
TF03 with ArduPilot UART / CAN · Cube Orange: integration and configuration guide
Setup, connection, configuration and code guidance for TF03 with ArduPilot. The original files are available in Materials and downloads. Documented interface: UART, CAN.
Applicable setup
TF03 · ArduPilot · UART, CAN · Cube Orange, Pixhawk Cube
Technical instructions and steps
Configuring TF03 with UART Interface on Ardupilot Flight Stack using Cube Orange Flight Controller
Note: the guide is applicable to Cube Orange and Cube Black flight controllers. The interfaces available that can be used to connect TF03 are the same on both flight controllers.
TF03-100, TF03-180 and TF350 can be interfaced with the one of the serial ports of Cube Orange flight controller. There are four serial ports which can be used to interface devices having UART port. The following port mapping shows hardware (left) and software (right) serial port mapping:
TELEM1 > SERIAL1
TELEM2 > SERIAL2 (used in this tutorial)
GPS1 Port > SERIAL3
GPS2/UART4 > SERIAL4
TF03 can be interfaced with flight controller for the purpose of Altitude Hold or Obstacle Avoidance. At the time of writing the guide the controller used was Cube Orange flashed with ArduCopter V4.0.7. 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. For choosing right port, please refer to the hardware and software serial port mapping of flight controller.
Example for connecting TF03 to Cube Orange:
Figure 1 Schematic Diagram of Connecting TF03 with TELEM 2 Interface (Serial Port 2) of Cube
Page2
The same procedure can be followed for other serial ports like TELEM1/GPS1/UART4 by looking at the pin out details given below:
Figure 2 Pinout description of available serial ports on Cube
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 TF03 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.
Page3
Select [CONFIG/TUNING] and then click on [Full Parameter List] in the left from the below bar. Find and modify the following parameters:
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 = 27 [TF03 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 = 500 [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 mode from Standard mode to Pix mode while the firmware is 3.6.2 or higher if yes then the same error will encounter. Switch it back to Standard mode by sending command from the manual of LiDAR.
How to see the altitude value from LiDAR sensor: double click the area of the Mission Planner, look at the following picture:
Page4
Select option sonarrange, see following picture:
Page5
The altitude distance from the LiDAR will be displayed in Sonar Range (meters), see the following picture:
B)Mission Planner configuration description of TF03 for the purpose of Obstacle Avoidance
Although TF03 is long range sensor and in most cases it is used for Altitude Hold but there are some cases where obstacle avoidance is required at long range especially for high speed drone. So in such cases TF03 can be used for obstacle avoidance. Connect the flight control board to MP. Attention: distance between UAV margin and LiDAR should be larger than LiDAR blind zone. Go to [CONFIG/TUNING] tab and select [Full Parameter List] on the left side. Find and modify the following parameters:
AVOID_MARGIN = 5 [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 = 27 [TF03 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 = 700 [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 andPage6
25=Down (total ten) are supported up till now, see details in MP]
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, could choose 2 =
UseProximitySensor]Upon setting of these parameters, click [Write Params] on the right side of the software to finish configuration. 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 you have restarted the controller.
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:
Page7
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.76.
Attach: If TELEM2 port has been used, GPS2/UART4 and TELEM1/SERIAL1 interfaces can also be used, the other settings are same
Configuration Descriptions on Mission Planner:
Connect flight control board to MP, Select [Full Parameter List] in [CONFIG/TUNING] tab. Find and modify following parameters:
For GPS2/UART4:
SERIAL4_PROTOCOL = 9 (LiDAR)
SERIAL4_BAUD = 115For TELEM1:
SERIAL1_PROTOCOL = 9 (LiDAR)
SERIAL1_BAUD = 115Page8
Upon setting of these parameters, the other parameters are same as Mission Planner configuration description of TF03 for the purpose of Obstacle Avoidance or Altitude Holding, then click [Write Params] on the right of the software to finish.
Important Note: If you have configured protocol type (SERIALX_PROTCOL: X can be 1, 2, 3, 4 etc.) for more than one UART ports as 9: Rangefinder but you have connected LiDAR to only single UART port then it will give Bad LiDAR Health error. So you need to configure only those UART ports as 9: Rangefinder to which you will connect LiDAR. In other words we can say that if the number of serial ports configured as 9: Rangefinder is less than the number of connected LiDARs then Bad LiDAR Health will occur.
Page9
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 TF03 with UART Interface on · English source (PDF)Complete inquiry to download
