#aerialrobotics (1)

31040484070?profile=RESIZE_584x

The configuring procedure 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 this procedure the controller used was Cube Orange flashed with ArduCopter V4.0.7. But this procedure 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:

31040485479?profile=RESIZE_710x

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

 

The same procedure can be followed for other serial ports like TELEM1/GPS1/UART4 by looking at the pin out details given below:

31040485677?profile=RESIZE_710x

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. 

31040485701?profile=RESIZE_710x

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=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 youhave restarted the controller. Also check 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:

31040486491?profile=RESIZE_710x

Select option sonarrange as shown in the following picture:

31040486294?profile=RESIZE_710x

The altitude distance from the LiDAR will be displayed in Sonar Range (meters), see the following picture:

31040486874?profile=RESIZE_710x

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 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.

31040486890?profile=RESIZE_584x

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:

31040486695?profile=RESIZE_710x

Click button Proximity, the following window will appear:

31040487455?profile=RESIZE_710x

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

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.

For more information about Benewake LiDAR products and how they can help you, please visit https://en.benewake.com/.

Read more…