Skip to main content
← Back to resources

Configuring TF03 on Ardupilot using Cub Orange (UART)

Configuring TF03 on Ardupilot using Cub Orange (UART), including the parameters, figures and instructions in the original document.

Configuring TF03 on Ardupilot using Cub Orange (UART) — source page 1, figure 1
Configuring TF03 with UART Interface on

Ardupilot Flight Stack using Cube Orange

Flight Controller

Configuring TF03 on Ardupilot using Cub Orange (UART) — source page 1, figure 2
Configuring TF03 on Ardupilot using Cub Orange (UART) — source page 1, figure 3

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 this document the controller used was Cube Orange flashed with ArduCopter V4.0.7.

But this document 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:

Configuring TF03 on Ardupilot using Cub Orange (UART) — source page 2, figure 1

Figure 1 Schematic Diagram of Connecting TF03 with TELEM 2 Interface (Serial Port 2) of Cube

pin out details given below:

Configuring TF03 on Ardupilot using Cub Orange (UART) — source page 3, figure 1

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.

Configuring TF03 on Ardupilot using Cub Orange (UART) — source page 3, figure 2

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=0 Upon 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:

Configuring TF03 on Ardupilot using Cub Orange (UART) — source page 5, figure 1

Select option sonarrange, see following picture:

Configuring TF03 on Ardupilot using Cub Orange (UART) — source page 5, figure 2

picture:

Configuring TF03 on Ardupilot using Cub Orange (UART) — source page 6, figure 1

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 and

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.

Configuring TF03 on Ardupilot using Cub Orange (UART) — source page 7, figure 1

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:

Configuring TF03 on Ardupilot using Cub Orange (UART) — source page 7, figure 2
Configuring TF03 on Ardupilot using Cub Orange (UART) — source page 8, figure 1

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 = 115 For TELEM1: SERIAL1_PROTOCOL = 9 (LiDAR) SERIAL1_BAUD = 115

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.

Product inquiry

Talk to a product specialist

Tell us what you need and our team will get back to you.

Product inquiry

Inquiry sent

Your inquiry has been received. We will be in touch soon.