Skip to content

Commit

Permalink
Common: benewake tfmini I2C clarified
Browse files Browse the repository at this point in the history
  • Loading branch information
rmackay9 authored and Hwurzburg committed Jan 31, 2025
1 parent aa4a3e9 commit bc115f7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions common/source/docs/common-benewake-tfmini-lidar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,49 @@ Benewake TFmini / TFmini Plus lidar

The `TFmini <https://en.benewake.com/TFminiS/index.html>`__ and `TFmini Plus <https://en.benewake.com/TFminiPlus/index.html>`__ lidars have an indoor range of 12m, an outdoor range of 7m and weigh 5g and 11g respectively.

Both UART and I2C versions are available. UART has the advantage of allowing easier firmware updates.

More details on both these lidar can be found in the `benewake.com's downloads area <https://en.benewake.com/DataDownload/>`__

.. image:: ../../../images/benewake-tfmini-topimage.jpg
:width: 450px

Where to Buy
------------

- `Benewake.com Distributors <https://en.benewake.com/Agent/index.html>`__
- `Benewake's store on Alibaba.com <https://beixingguangzi.en.alibaba.com/>`__
- `Benewake.com Distributors <https://en.benewake.com/Agent/index.html>`__

Connecting to the Autopilot
-----------------------------------
Connecting using Serial
-----------------------

For a serial connection you can use any spare Serial/UART port. The diagram below shows how to connect to SERIAL4.
For a serial connection you can use any spare Serial/UART port. The diagram below shows how to connect to the autopilot's SERIAL4 port.

.. image:: ../../../images/benewake-tfmini-pixhawk.png
:width: 450px

If the SERIAL4 port on an autopilot is being used then the following parameters should be set for the first rangefinder:

- :ref:`SERIAL4_PROTOCOL <SERIAL4_PROTOCOL>` = 9 (Lidar)
- :ref:`SERIAL4_BAUD <SERIAL4_BAUD>` = 115 (115200 baud)
- :ref:`RNGFND1_TYPE <RNGFND1_TYPE>` = 20 (Benewake-Serial)
- :ref:`SERIAL4_PROTOCOL <SERIAL4_PROTOCOL>` = 9 (Lidar)
- :ref:`SERIAL4_BAUD <SERIAL4_BAUD>` = 115 (115200 baud)
- :ref:`RNGFND1_TYPE <RNGFND1_TYPE>` = 20 (Benewake-Serial)
- :ref:`RNGFND1_MIN <RNGFND1_MIN>` = 30 for TFmini, 10 for TFminiPlus
- :ref:`RNGFND1_MAX <RNGFND1_MAX>` = **1000** for indoor use OR **600** for outdoors. *This is the distance in centimeters that the rangefinder can reliably read.*
- :ref:`RNGFND1_GNDCLR <RNGFND1_GNDCLR>` = 10 *or more accurately the distance in centimetres from the range finder to the ground when the vehicle is landed. This value depends on how you have mounted the rangefinder.*

.. note:: :ref:`RNGFND1_TYPE <RNGFND1_TYPE>` = 20 works for TFminiPlus or TFmini, via its UART connection. If TFminiPlus is connected via I2C to the autopilot, use :ref:`RNGFND1_TYPE <RNGFND1_TYPE>` = 25 (Benewake TFminiPlus-I2C) and also set :ref:`RNGFND1_ADDR<RNGFND1_ADDR>` = 16 (I2C Address of lidar in decimal). *The sensor’s default I2C address is 0x10 hexadecimal which is 16 in decimal.*
Connecting using I2C
--------------------

- :ref:`RNGFND1_MIN <RNGFND1_MIN>` = 30 for TFmini, =10 for TFminiPlus
- :ref:`RNGFND1_MAX <RNGFND1_MAX>` = **1000** for indoor use OR **600** for outdoors. *This is the distance in centimeters that the rangefinder can reliably read.*
- :ref:`RNGFND1_GNDCLR <RNGFND1_GNDCLR>` = 10 *or more accurately the distance in centimetres from the range finder to the ground when the vehicle is landed. This value depends on how you have mounted the rangefinder.*
The diagram below shows how to connect to the autopilot's I2C port.

If instead the Telem2 port was used then the serial parameters listed above should instead be:
.. image:: ../../../images/benewake-tfmini-autopilot-i2c.png
:width: 450px

- :ref:`SERIAL2_PROTOCOL <SERIAL2_PROTOCOL>` = 9
- :ref:`SERIAL2_BAUD <SERIAL2_BAUD>` = 115
- :ref:`RNGFND1_TYPE <RNGFND1_TYPE>` = 25 (Benewake TFminiPlus-I2C)
- :ref:`RNGFND1_ADDR<RNGFND1_ADDR>` = 16 (I2C address of lidar in decimal, equivalent to 0x10 hexadecimal)
- :ref:`RNGFND1_MIN <RNGFND1_MIN>` = 30 for TFmini, 10 for TFminiPlus
- :ref:`RNGFND1_MAX <RNGFND1_MAX>` = **1000** for indoor use OR **600** for outdoors. *This is the distance in centimeters that the rangefinder can reliably read.*
- :ref:`RNGFND1_GNDCLR <RNGFND1_GNDCLR>` = 10 *or more accurately the distance in centimetres from the range finder to the ground when the vehicle is landed. This value depends on how you have mounted the rangefinder.*

Testing the sensor
==================
Expand Down
Binary file added images/benewake-tfmini-autopilot-i2c.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/benewake-tfmini-topimage.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bc115f7

Please sign in to comment.