Benewake TF mini Setup

I received a Benewake TF mini from 3DXR in the UK week and thought I would document some of the problems getting it working.

Software Update

After some research I discovered a post on DIY Drone (http://diydrones.com/group/apmusergroup/forum/topics/how-to-install-benewake-tf-series-on-pixhawk-take-tf01-for?commentId=705844%3AComment%3A2418173&groupId=705844%3AGroup%3A394667) that mentioned a software update. This involved making up a cable the link a sparkfun 3.3v breakout board to the TF mini and running the firmware update utility that can be found on the Benewake website.

Custom Cable

In my case I will be connecting the TF mini to Pixhawk 2.1 and the only port that’s free is GPS2 as a result I needed to make a custom cable

Mission Planner Configeration

SERIAL4_PROTOCOL = 9 (Lidar)
SERIAL4_BAUD = 115
RNGFND_TYPE = 8 (LightWareSerial)
RNGFND_SCALING = 1
RNGFND_MIN_CM = 5
RNGFND_MAX_CM = 1200
RNGFND_GNDCLEAR = 5 unit cm, or you can use more specific value, it depends on the height TF SERIES installed.
AVOID_ENABLE = 7
AVOID_MARGIN = 4
RNGFND_ORIENT = 0 Forward Facing

Testing

Bench testing went well and the Lidar gave valid readings however when I took the quad outside for the test flight a problem showed up in the form of the GPS module and lights not working after a bit of investigation it turns out that the TF Mini can draw a lot of power between 40mA at close range up to 800mA at long range. According to the Pixhawk 2.1 manual it has a 1A for all peripherals except Telem 1 which has its own 1.5A supply. The solution was to make another custom cable that will take a feed of the 5v servo rail.




Hope this helps someone with their setup.
David Ardis

3 Likes

Hi David,
Thanks for the post. It is very helpful.
Can you please share the link to firmware update utility?
Lenny

@ardisd thanks again.

Hi Daviv,
One more question. Did you use the firmware as is, or you modified the LightWare driver as described in the other post?
Lenny

Lenny

I used the firmware as is and programmed with a 3.3v sparkfun FTDI

David Ardis

David, I have it working now. Thanks again for the help
Lenny

Hi, did you notice that when something is closer than 30cm from the sensor the distance reading starts going back up?
This will be an issue if you want to use it for altitude measurement, I have 2 units with firmware from 3dxr link and both show it.
This is also mentioned here:

Havn’t test it at short range but the datasheet does say the blind range is below 300mm

David Ardis

Yes this problem is still there unfortunately.
I just received latest models and they show the same pattern.
But it does not really affect the flight , unless you want a steady hover at less than 30cm
So best is to adjust RNGFND_MIN_CM = 30 and enjoy !!

Here a video of TFMINI flying indoor with opticalflow 9PX4Flow):

1 Like

As you can see , we do not have to modify driver’s code now :wink:

Dear all. You could find Benewake TFmini’s latest information pack including SPEC/GUI/display program/Pix & Arduino related at below google drive link:
https://drive.google.com/open?id=1wQbZxrUi41zxgvnI7oB3tV55sTZGlK9L

And @Gregsky ,when you need to use TFmini within 30cm range. I think it’s better that you set and ensure you get the reliable data. Pls check below instructions:

Users eliminate unreliable data tips:
Put TFmini against the white wall (diffuse reflection wall, should not be too smooth) about 30cm away, record the LiDAR strength value, assumed to be X. When use TFmini, firstly determine whether the distance value is available according to the strength value. If the strength value is bigger than X, then set the distance value to 30cm (determine the distance value is not reliable). If the strength value is less than X, then you need to further examine the distance value, if the distance value is bigger than 30cm, that is credible, if the distance value is less than 30cm, that is not credible, then also set the distance value to 30cm.

@ardisd, Hi, David. The TFmini Firmware update.rar which you got from 3DXR is a wrong one/useless one, if you use this firmware to upgrade your TFmini, it will caused damage of your TFmini, could you pls delete this link, so that other users may not download it and use it?

*** Dear All, pls contact Benewake for TFmini firmware change and get confirmation before you want to upgrade it. Thank you all. ***

Greetings from Siya of Benewake : )

This firmware will make New TFmini not work properly.PLEASE CHECK the version of YOUR TFmini.Most of them can be adapted to pixhawk by modifying the command code.The command of standard output is 42 57 02 00 00 00 01 06
The command of pix format output is 42 57 02 00 00 00 04 06

Siya

As requested I have removed the post. Can you tell me where I can get the correct firmware.

Sorry for the misunderstanding

David Ardis

So what happens when it is set up for altitude measurement and the drone is landing?
The readings will go down to 30cm and than up again doesn’t this confuse the flight control?
I understand that i can put a minimum distance at 30cm in the parameter but the problem is that when you get lower than 30 the readings go up again.
Am I missing something here?

@Gregsky , as you can see on the video, I make the quad ‘‘jump’’ to about 1 meter = out of the error zone.
On landing, the logic stops using the rangefinder at about 30 cm.

Yes but if the sensor is for example at 15cm from the ground and sends a value of 35 than the FC will still think it is at 35cm

I think the sensor has to trimm the readings to 30cm so below 30 it should just send 30.

@Gregsky
Please take note that I am working on a true TFMINI driver (not a LightWareSerial emulation) that will filter out most of it. I will update you guys of my progress.

1 Like

So you are going to have the sensor in it’s native protocol sending more data?

1 Like